From ee1fa101db1c44281e522c98ce2c47abca831ab3 Mon Sep 17 00:00:00 2001 From: Forrest Beckwith <100245109+tuvaforrest@users.noreply.github.com> Date: Wed, 13 Dec 2023 21:27:19 -0500 Subject: [PATCH] Yaml terminology updates (#313) * added terminology note meta tags, fixed terminology links * fixed column name mismatch in readmissions yaml, produced full docs --- docs/catalog.json | 2 +- docs/manifest.json | 2 +- .../docs_generate/models/_models.yml | 361 ++++++++++++------ models/ccsr/ccsr_models.yml | 6 + .../cms_chronic_conditions_models.yml | 6 +- .../tuva_chronic_conditions_models.yml | 4 +- .../claims_preprocessing_models.yml | 28 +- models/cms_hcc/cms_hcc_models.yml | 4 + models/core/core_models.yml | 163 +++++--- .../ed_classification_models.yml | 2 +- .../quality_measures_models.yml | 12 + models/readmissions/readmissions_models.yml | 35 +- 12 files changed, 411 insertions(+), 214 deletions(-) diff --git a/docs/catalog.json b/docs/catalog.json index 019bc2e33..99728e6fc 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.3.1", "generated_at": "2023-11-29T23:37:27.815456Z", "invocation_id": "cf40dcc0-22e2-4514-acc7-ce8619372c6b", "env": {}}, "nodes": {"model.input_layer.observation": {"metadata": {"type": "VIEW", "schema": "INPUT_LAYER", "name": "OBSERVATION", "database": "TUVA", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"OBSERVATION_ID": {"type": "TEXT", "index": 1, "name": "OBSERVATION_ID", "comment": null}, "PATIENT_ID": {"type": "TEXT", "index": 2, "name": "PATIENT_ID", "comment": null}, "ENCOUNTER_ID": {"type": "TEXT", "index": 3, "name": "ENCOUNTER_ID", "comment": null}, "PANEL_ID": {"type": "TEXT", "index": 4, "name": "PANEL_ID", "comment": null}, "OBSERVATION_DATE": {"type": "DATE", "index": 5, "name": "OBSERVATION_DATE", "comment": null}, "OBSERVATION_TYPE": {"type": "TEXT", "index": 6, "name": "OBSERVATION_TYPE", "comment": null}, "SOURCE_CODE_TYPE": {"type": "TEXT", "index": 7, "name": "SOURCE_CODE_TYPE", "comment": null}, "SOURCE_CODE": {"type": "TEXT", "index": 8, "name": "SOURCE_CODE", "comment": null}, "SOURCE_DESCRIPTION": {"type": "TEXT", "index": 9, "name": "SOURCE_DESCRIPTION", "comment": null}, "NORMALIZED_CODE_TYPE": {"type": "TEXT", "index": 10, "name": "NORMALIZED_CODE_TYPE", "comment": null}, "NORMALIZED_CODE": {"type": "TEXT", "index": 11, "name": "NORMALIZED_CODE", "comment": null}, "NORMALIZED_DESCRIPTION": {"type": "TEXT", "index": 12, "name": "NORMALIZED_DESCRIPTION", "comment": null}, "RESULT": {"type": "TEXT", "index": 13, "name": "RESULT", "comment": null}, "SOURCE_UNITS": {"type": "TEXT", "index": 14, "name": "SOURCE_UNITS", "comment": null}, "NORMALIZED_UNITS": {"type": "TEXT", "index": 15, "name": "NORMALIZED_UNITS", "comment": null}, "SOURCE_REFERENCE_RANGE_LOW": {"type": "TEXT", "index": 16, "name": "SOURCE_REFERENCE_RANGE_LOW", "comment": null}, "SOURCE_REFERENCE_RANGE_HIGH": {"type": "TEXT", "index": 17, "name": "SOURCE_REFERENCE_RANGE_HIGH", "comment": null}, "NORMALIZED_REFERENCE_RANGE_LOW": {"type": "TEXT", "index": 18, "name": "NORMALIZED_REFERENCE_RANGE_LOW", "comment": null}, "NORMALIZED_REFERENCE_RANGE_HIGH": {"type": "TEXT", "index": 19, "name": "NORMALIZED_REFERENCE_RANGE_HIGH", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 20, "name": "DATA_SOURCE", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.input_layer.observation"}, "model.input_layer.patient": {"metadata": {"type": "VIEW", "schema": "INPUT_LAYER", "name": "PATIENT", "database": "TUVA", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"PATIENT_ID": {"type": "TEXT", "index": 1, "name": "PATIENT_ID", "comment": null}, "FIRST_NAME": {"type": "TEXT", "index": 2, "name": "FIRST_NAME", "comment": null}, "LAST_NAME": {"type": "TEXT", "index": 3, "name": "LAST_NAME", "comment": null}, "SEX": {"type": "TEXT", "index": 4, "name": "SEX", "comment": null}, "RACE": {"type": "TEXT", "index": 5, "name": "RACE", "comment": null}, "BIRTH_DATE": {"type": "DATE", "index": 6, "name": "BIRTH_DATE", "comment": null}, "DEATH_DATE": {"type": "DATE", "index": 7, "name": "DEATH_DATE", "comment": null}, "DEATH_FLAG": {"type": "NUMBER", "index": 8, "name": "DEATH_FLAG", "comment": null}, "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}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.input_layer.patient"}, "model.input_layer.medication": {"metadata": {"type": "VIEW", "schema": "INPUT_LAYER", "name": "MEDICATION", "database": "TUVA", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"MEDICATION_ID": {"type": "TEXT", "index": 1, "name": "MEDICATION_ID", "comment": null}, "PATIENT_ID": {"type": "TEXT", "index": 2, "name": "PATIENT_ID", "comment": null}, "ENCOUNTER_ID": {"type": "TEXT", "index": 3, "name": "ENCOUNTER_ID", "comment": null}, "DISPENSING_DATE": {"type": "DATE", "index": 4, "name": "DISPENSING_DATE", "comment": null}, "PRESCRIBING_DATE": {"type": "DATE", "index": 5, "name": "PRESCRIBING_DATE", "comment": null}, "SOURCE_CODE_TYPE": {"type": "TEXT", "index": 6, "name": "SOURCE_CODE_TYPE", "comment": null}, "SOURCE_CODE": {"type": "TEXT", "index": 7, "name": "SOURCE_CODE", "comment": null}, "SOURCE_DESCRIPTION": {"type": "TEXT", "index": 8, "name": "SOURCE_DESCRIPTION", "comment": null}, "NDC_CODE": {"type": "TEXT", "index": 9, "name": "NDC_CODE", "comment": null}, "NDC_DESCRIPTION": {"type": "TEXT", "index": 10, "name": "NDC_DESCRIPTION", "comment": null}, "RXNORM_CODE": {"type": "TEXT", "index": 11, "name": "RXNORM_CODE", "comment": null}, "RXNORM_DESCRIPTION": {"type": "TEXT", "index": 12, "name": "RXNORM_DESCRIPTION", "comment": null}, "ATC_CODE": {"type": "TEXT", "index": 13, "name": "ATC_CODE", "comment": null}, "ATC_DESCRIPTION": {"type": "TEXT", "index": 14, "name": "ATC_DESCRIPTION", "comment": null}, "ROUTE": {"type": "TEXT", "index": 15, "name": "ROUTE", "comment": null}, "STRENGTH": {"type": "TEXT", "index": 16, "name": "STRENGTH", "comment": null}, "QUANTITY": {"type": "NUMBER", "index": 17, "name": "QUANTITY", "comment": null}, "QUANTITY_UNIT": {"type": "TEXT", "index": 18, "name": "QUANTITY_UNIT", "comment": null}, "DAYS_SUPPLY": {"type": "NUMBER", "index": 19, "name": "DAYS_SUPPLY", "comment": null}, "PRACTITIONER_ID": {"type": "TEXT", "index": 20, "name": "PRACTITIONER_ID", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 21, "name": "DATA_SOURCE", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.input_layer.medication"}, "model.input_layer.eligibility": {"metadata": {"type": "VIEW", "schema": "INPUT_LAYER", "name": "ELIGIBILITY", "database": "TUVA", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"PATIENT_ID": {"type": "TEXT", "index": 1, "name": "PATIENT_ID", "comment": null}, "MEMBER_ID": {"type": "TEXT", "index": 2, "name": "MEMBER_ID", "comment": null}, "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}, "PLAN": {"type": "TEXT", "index": 12, "name": "PLAN", "comment": null}, "ORIGINAL_REASON_ENTITLEMENT_CODE": {"type": "TEXT", "index": 13, "name": "ORIGINAL_REASON_ENTITLEMENT_CODE", "comment": null}, "DUAL_STATUS_CODE": {"type": "TEXT", "index": 14, "name": "DUAL_STATUS_CODE", "comment": null}, "MEDICARE_STATUS_CODE": {"type": "TEXT", "index": 15, "name": "MEDICARE_STATUS_CODE", "comment": null}, "FIRST_NAME": {"type": "TEXT", "index": 16, "name": "FIRST_NAME", "comment": null}, "LAST_NAME": {"type": "TEXT", "index": 17, "name": "LAST_NAME", "comment": null}, "ADDRESS": {"type": "TEXT", "index": 18, "name": "ADDRESS", "comment": null}, "CITY": {"type": "TEXT", "index": 19, "name": "CITY", "comment": null}, "STATE": {"type": "TEXT", "index": 20, "name": "STATE", "comment": null}, "ZIP_CODE": {"type": "TEXT", "index": 21, "name": "ZIP_CODE", "comment": null}, "PHONE": {"type": "TEXT", "index": 22, "name": "PHONE", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 23, "name": "DATA_SOURCE", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.input_layer.eligibility"}, "model.input_layer.condition": {"metadata": {"type": "VIEW", "schema": "INPUT_LAYER", "name": "CONDITION", "database": "TUVA", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"CONDITION_ID": {"type": "TEXT", "index": 1, "name": "CONDITION_ID", "comment": null}, "PATIENT_ID": {"type": "TEXT", "index": 2, "name": "PATIENT_ID", "comment": null}, "ENCOUNTER_ID": {"type": "TEXT", "index": 3, "name": "ENCOUNTER_ID", "comment": null}, "CLAIM_ID": {"type": "TEXT", "index": 4, "name": "CLAIM_ID", "comment": null}, "RECORDED_DATE": {"type": "DATE", "index": 5, "name": "RECORDED_DATE", "comment": null}, "ONSET_DATE": {"type": "DATE", "index": 6, "name": "ONSET_DATE", "comment": null}, "RESOLVED_DATE": {"type": "DATE", "index": 7, "name": "RESOLVED_DATE", "comment": null}, "STATUS": {"type": "TEXT", "index": 8, "name": "STATUS", "comment": null}, "CONDITION_TYPE": {"type": "TEXT", "index": 9, "name": "CONDITION_TYPE", "comment": null}, "SOURCE_CODE_TYPE": {"type": "TEXT", "index": 10, "name": "SOURCE_CODE_TYPE", "comment": null}, "SOURCE_CODE": {"type": "TEXT", "index": 11, "name": "SOURCE_CODE", "comment": null}, "SOURCE_DESCRIPTION": {"type": "TEXT", "index": 12, "name": "SOURCE_DESCRIPTION", "comment": null}, "NORMALIZED_CODE_TYPE": {"type": "TEXT", "index": 13, "name": "NORMALIZED_CODE_TYPE", "comment": null}, "NORMALIZED_CODE": {"type": "TEXT", "index": 14, "name": "NORMALIZED_CODE", "comment": null}, "NORMALIZED_DESCRIPTION": {"type": "TEXT", "index": 15, "name": "NORMALIZED_DESCRIPTION", "comment": null}, "CONDITION_RANK": {"type": "NUMBER", "index": 16, "name": "CONDITION_RANK", "comment": null}, "PRESENT_ON_ADMIT_CODE": {"type": "TEXT", "index": 17, "name": "PRESENT_ON_ADMIT_CODE", "comment": null}, "PRESENT_ON_ADMIT_DESCRIPTION": {"type": "TEXT", "index": 18, "name": "PRESENT_ON_ADMIT_DESCRIPTION", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 19, "name": "DATA_SOURCE", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.input_layer.condition"}, "model.input_layer.procedure": {"metadata": {"type": "VIEW", "schema": "INPUT_LAYER", "name": "PROCEDURE", "database": "TUVA", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"PROCEDURE_ID": {"type": "TEXT", "index": 1, "name": "PROCEDURE_ID", "comment": null}, "PATIENT_ID": {"type": "TEXT", "index": 2, "name": "PATIENT_ID", "comment": null}, "ENCOUNTER_ID": {"type": "TEXT", "index": 3, "name": "ENCOUNTER_ID", "comment": null}, "CLAIM_ID": {"type": "TEXT", "index": 4, "name": "CLAIM_ID", "comment": null}, "PROCEDURE_DATE": {"type": "DATE", "index": 5, "name": "PROCEDURE_DATE", "comment": null}, "SOURCE_CODE_TYPE": {"type": "TEXT", "index": 6, "name": "SOURCE_CODE_TYPE", "comment": null}, "SOURCE_CODE": {"type": "TEXT", "index": 7, "name": "SOURCE_CODE", "comment": null}, "SOURCE_DESCRIPTION": {"type": "TEXT", "index": 8, "name": "SOURCE_DESCRIPTION", "comment": null}, "NORMALIZED_CODE_TYPE": {"type": "TEXT", "index": 9, "name": "NORMALIZED_CODE_TYPE", "comment": null}, "NORMALIZED_CODE": {"type": "TEXT", "index": 10, "name": "NORMALIZED_CODE", "comment": null}, "NORMALIZED_DESCRIPTION": {"type": "TEXT", "index": 11, "name": "NORMALIZED_DESCRIPTION", "comment": null}, "MODIFIER_1": {"type": "TEXT", "index": 12, "name": "MODIFIER_1", "comment": null}, "MODIFIER_2": {"type": "TEXT", "index": 13, "name": "MODIFIER_2", "comment": null}, "MODIFIER_3": {"type": "TEXT", "index": 14, "name": "MODIFIER_3", "comment": null}, "MODIFIER_4": {"type": "TEXT", "index": 15, "name": "MODIFIER_4", "comment": null}, "MODIFIER_5": {"type": "TEXT", "index": 16, "name": "MODIFIER_5", "comment": null}, "PRACTITIONER_ID": {"type": "TEXT", "index": 17, "name": "PRACTITIONER_ID", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 18, "name": "DATA_SOURCE", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.input_layer.procedure"}, "model.input_layer.lab_result": {"metadata": {"type": "VIEW", "schema": "INPUT_LAYER", "name": "LAB_RESULT", "database": "TUVA", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"LAB_RESULT_ID": {"type": "TEXT", "index": 1, "name": "LAB_RESULT_ID", "comment": null}, "PATIENT_ID": {"type": "TEXT", "index": 2, "name": "PATIENT_ID", "comment": null}, "ENCOUNTER_ID": {"type": "TEXT", "index": 3, "name": "ENCOUNTER_ID", "comment": null}, "ACCESSION_NUMBER": {"type": "TEXT", "index": 4, "name": "ACCESSION_NUMBER", "comment": null}, "SOURCE_CODE_TYPE": {"type": "TEXT", "index": 5, "name": "SOURCE_CODE_TYPE", "comment": null}, "SOURCE_CODE": {"type": "TEXT", "index": 6, "name": "SOURCE_CODE", "comment": null}, "SOURCE_DESCRIPTION": {"type": "TEXT", "index": 7, "name": "SOURCE_DESCRIPTION", "comment": null}, "SOURCE_COMPONENT": {"type": "TEXT", "index": 8, "name": "SOURCE_COMPONENT", "comment": null}, "NORMALIZED_CODE_TYPE": {"type": "TEXT", "index": 9, "name": "NORMALIZED_CODE_TYPE", "comment": null}, "NORMALIZED_CODE": {"type": "TEXT", "index": 10, "name": "NORMALIZED_CODE", "comment": null}, "NORMALIZED_DESCRIPTION": {"type": "TEXT", "index": 11, "name": "NORMALIZED_DESCRIPTION", "comment": null}, "NORMALIZED_COMPONENT": {"type": "TEXT", "index": 12, "name": "NORMALIZED_COMPONENT", "comment": null}, "STATUS": {"type": "TEXT", "index": 13, "name": "STATUS", "comment": null}, "RESULT": {"type": "TEXT", "index": 14, "name": "RESULT", "comment": null}, "RESULT_DATE": {"type": "DATE", "index": 15, "name": "RESULT_DATE", "comment": null}, "COLLECTION_DATE": {"type": "DATE", "index": 16, "name": "COLLECTION_DATE", "comment": null}, "SOURCE_UNITS": {"type": "TEXT", "index": 17, "name": "SOURCE_UNITS", "comment": null}, "NORMALIZED_UNITS": {"type": "TEXT", "index": 18, "name": "NORMALIZED_UNITS", "comment": null}, "SOURCE_REFERENCE_RANGE_LOW": {"type": "TEXT", "index": 19, "name": "SOURCE_REFERENCE_RANGE_LOW", "comment": null}, "SOURCE_REFERENCE_RANGE_HIGH": {"type": "TEXT", "index": 20, "name": "SOURCE_REFERENCE_RANGE_HIGH", "comment": null}, "NORMALIZED_REFERENCE_RANGE_LOW": {"type": "TEXT", "index": 21, "name": "NORMALIZED_REFERENCE_RANGE_LOW", "comment": null}, "NORMALIZED_REFERENCE_RANGE_HIGH": {"type": "TEXT", "index": 22, "name": "NORMALIZED_REFERENCE_RANGE_HIGH", "comment": null}, "SOURCE_ABNORMAL_FLAG": {"type": "NUMBER", "index": 23, "name": "SOURCE_ABNORMAL_FLAG", "comment": null}, "NORMALIZED_ABNORMAL_FLAG": {"type": "NUMBER", "index": 24, "name": "NORMALIZED_ABNORMAL_FLAG", "comment": null}, "SPECIMEN": {"type": "TEXT", "index": 25, "name": "SPECIMEN", "comment": null}, "ORDERING_PRACTITIONER_ID": {"type": "TEXT", "index": 26, "name": "ORDERING_PRACTITIONER_ID", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 27, "name": "DATA_SOURCE", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.input_layer.lab_result"}, "model.input_layer.medical_claim": {"metadata": {"type": "VIEW", "schema": "INPUT_LAYER", "name": "MEDICAL_CLAIM", "database": "TUVA", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"CLAIM_ID": {"type": "TEXT", "index": 1, "name": "CLAIM_ID", "comment": null}, "CLAIM_LINE_NUMBER": {"type": "NUMBER", "index": 2, "name": "CLAIM_LINE_NUMBER", "comment": null}, "CLAIM_TYPE": {"type": "TEXT", "index": 3, "name": "CLAIM_TYPE", "comment": null}, "PATIENT_ID": {"type": "TEXT", "index": 4, "name": "PATIENT_ID", "comment": null}, "MEMBER_ID": {"type": "TEXT", "index": 5, "name": "MEMBER_ID", "comment": null}, "PAYER": {"type": "TEXT", "index": 6, "name": "PAYER", "comment": null}, "PLAN": {"type": "TEXT", "index": 7, "name": "PLAN", "comment": null}, "CLAIM_START_DATE": {"type": "DATE", "index": 8, "name": "CLAIM_START_DATE", "comment": null}, "CLAIM_END_DATE": {"type": "DATE", "index": 9, "name": "CLAIM_END_DATE", "comment": null}, "CLAIM_LINE_START_DATE": {"type": "DATE", "index": 10, "name": "CLAIM_LINE_START_DATE", "comment": null}, "CLAIM_LINE_END_DATE": {"type": "DATE", "index": 11, "name": "CLAIM_LINE_END_DATE", "comment": null}, "ADMISSION_DATE": {"type": "DATE", "index": 12, "name": "ADMISSION_DATE", "comment": null}, "DISCHARGE_DATE": {"type": "DATE", "index": 13, "name": "DISCHARGE_DATE", "comment": null}, "ADMIT_SOURCE_CODE": {"type": "TEXT", "index": 14, "name": "ADMIT_SOURCE_CODE", "comment": null}, "ADMIT_TYPE_CODE": {"type": "TEXT", "index": 15, "name": "ADMIT_TYPE_CODE", "comment": null}, "DISCHARGE_DISPOSITION_CODE": {"type": "TEXT", "index": 16, "name": "DISCHARGE_DISPOSITION_CODE", "comment": null}, "PLACE_OF_SERVICE_CODE": {"type": "TEXT", "index": 17, "name": "PLACE_OF_SERVICE_CODE", "comment": null}, "BILL_TYPE_CODE": {"type": "TEXT", "index": 18, "name": "BILL_TYPE_CODE", "comment": null}, "MS_DRG_CODE": {"type": "TEXT", "index": 19, "name": "MS_DRG_CODE", "comment": null}, "APR_DRG_CODE": {"type": "TEXT", "index": 20, "name": "APR_DRG_CODE", "comment": null}, "REVENUE_CENTER_CODE": {"type": "TEXT", "index": 21, "name": "REVENUE_CENTER_CODE", "comment": null}, "SERVICE_UNIT_QUANTITY": {"type": "NUMBER", "index": 22, "name": "SERVICE_UNIT_QUANTITY", "comment": null}, "HCPCS_CODE": {"type": "TEXT", "index": 23, "name": "HCPCS_CODE", "comment": null}, "HCPCS_MODIFIER_1": {"type": "TEXT", "index": 24, "name": "HCPCS_MODIFIER_1", "comment": null}, "HCPCS_MODIFIER_2": {"type": "TEXT", "index": 25, "name": "HCPCS_MODIFIER_2", "comment": null}, "HCPCS_MODIFIER_3": {"type": "TEXT", "index": 26, "name": "HCPCS_MODIFIER_3", "comment": null}, "HCPCS_MODIFIER_4": {"type": "TEXT", "index": 27, "name": "HCPCS_MODIFIER_4", "comment": null}, "HCPCS_MODIFIER_5": {"type": "TEXT", "index": 28, "name": "HCPCS_MODIFIER_5", "comment": null}, "RENDERING_NPI": {"type": "TEXT", "index": 29, "name": "RENDERING_NPI", "comment": null}, "BILLING_NPI": {"type": "TEXT", "index": 30, "name": "BILLING_NPI", "comment": null}, "FACILITY_NPI": {"type": "TEXT", "index": 31, "name": "FACILITY_NPI", "comment": null}, "PAID_DATE": {"type": "DATE", "index": 32, "name": "PAID_DATE", "comment": null}, "PAID_AMOUNT": {"type": "FLOAT", "index": 33, "name": "PAID_AMOUNT", "comment": null}, "ALLOWED_AMOUNT": {"type": "FLOAT", "index": 34, "name": "ALLOWED_AMOUNT", "comment": null}, "CHARGE_AMOUNT": {"type": "FLOAT", "index": 35, "name": "CHARGE_AMOUNT", "comment": null}, "COINSURANCE_AMOUNT": {"type": "FLOAT", "index": 36, "name": "COINSURANCE_AMOUNT", "comment": null}, "COPAYMENT_AMOUNT": {"type": "FLOAT", "index": 37, "name": "COPAYMENT_AMOUNT", "comment": null}, "DEDUCTIBLE_AMOUNT": {"type": "FLOAT", "index": 38, "name": "DEDUCTIBLE_AMOUNT", "comment": null}, "TOTAL_COST_AMOUNT": {"type": "FLOAT", "index": 39, "name": "TOTAL_COST_AMOUNT", "comment": null}, "DIAGNOSIS_CODE_TYPE": {"type": "TEXT", "index": 40, "name": "DIAGNOSIS_CODE_TYPE", "comment": null}, "DIAGNOSIS_CODE_1": {"type": "TEXT", "index": 41, "name": "DIAGNOSIS_CODE_1", "comment": null}, "DIAGNOSIS_CODE_2": {"type": "TEXT", "index": 42, "name": "DIAGNOSIS_CODE_2", "comment": null}, "DIAGNOSIS_CODE_3": {"type": "TEXT", "index": 43, "name": "DIAGNOSIS_CODE_3", "comment": null}, "DIAGNOSIS_CODE_4": {"type": "TEXT", "index": 44, "name": "DIAGNOSIS_CODE_4", "comment": null}, "DIAGNOSIS_CODE_5": {"type": "TEXT", "index": 45, "name": "DIAGNOSIS_CODE_5", "comment": null}, "DIAGNOSIS_CODE_6": {"type": "TEXT", "index": 46, "name": "DIAGNOSIS_CODE_6", "comment": null}, "DIAGNOSIS_CODE_7": {"type": "TEXT", "index": 47, "name": "DIAGNOSIS_CODE_7", "comment": null}, "DIAGNOSIS_CODE_8": {"type": "TEXT", "index": 48, "name": "DIAGNOSIS_CODE_8", "comment": null}, "DIAGNOSIS_CODE_9": {"type": "TEXT", "index": 49, "name": "DIAGNOSIS_CODE_9", "comment": null}, "DIAGNOSIS_CODE_10": {"type": "TEXT", "index": 50, "name": "DIAGNOSIS_CODE_10", "comment": null}, "DIAGNOSIS_CODE_11": {"type": "TEXT", "index": 51, "name": "DIAGNOSIS_CODE_11", "comment": null}, "DIAGNOSIS_CODE_12": {"type": "TEXT", "index": 52, "name": "DIAGNOSIS_CODE_12", "comment": null}, "DIAGNOSIS_CODE_13": {"type": "TEXT", "index": 53, "name": "DIAGNOSIS_CODE_13", "comment": null}, "DIAGNOSIS_CODE_14": {"type": "TEXT", "index": 54, "name": "DIAGNOSIS_CODE_14", "comment": null}, "DIAGNOSIS_CODE_15": {"type": "TEXT", "index": 55, "name": "DIAGNOSIS_CODE_15", "comment": null}, "DIAGNOSIS_CODE_16": {"type": "TEXT", "index": 56, "name": "DIAGNOSIS_CODE_16", "comment": null}, "DIAGNOSIS_CODE_17": {"type": "TEXT", "index": 57, "name": "DIAGNOSIS_CODE_17", "comment": null}, "DIAGNOSIS_CODE_18": {"type": "TEXT", "index": 58, "name": "DIAGNOSIS_CODE_18", "comment": null}, "DIAGNOSIS_CODE_19": {"type": "TEXT", "index": 59, "name": "DIAGNOSIS_CODE_19", "comment": null}, "DIAGNOSIS_CODE_20": {"type": "TEXT", "index": 60, "name": "DIAGNOSIS_CODE_20", "comment": null}, "DIAGNOSIS_CODE_21": {"type": "TEXT", "index": 61, "name": "DIAGNOSIS_CODE_21", "comment": null}, "DIAGNOSIS_CODE_22": {"type": "TEXT", "index": 62, "name": "DIAGNOSIS_CODE_22", "comment": null}, "DIAGNOSIS_CODE_23": {"type": "TEXT", "index": 63, "name": "DIAGNOSIS_CODE_23", "comment": null}, "DIAGNOSIS_CODE_24": {"type": "TEXT", "index": 64, "name": "DIAGNOSIS_CODE_24", "comment": null}, "DIAGNOSIS_CODE_25": {"type": "TEXT", "index": 65, "name": "DIAGNOSIS_CODE_25", "comment": null}, "DIAGNOSIS_POA_1": {"type": "TEXT", "index": 66, "name": "DIAGNOSIS_POA_1", "comment": null}, "DIAGNOSIS_POA_2": {"type": "TEXT", "index": 67, "name": "DIAGNOSIS_POA_2", "comment": null}, "DIAGNOSIS_POA_3": {"type": "TEXT", "index": 68, "name": "DIAGNOSIS_POA_3", "comment": null}, "DIAGNOSIS_POA_4": {"type": "TEXT", "index": 69, "name": "DIAGNOSIS_POA_4", "comment": null}, "DIAGNOSIS_POA_5": {"type": "TEXT", "index": 70, "name": "DIAGNOSIS_POA_5", "comment": null}, "DIAGNOSIS_POA_6": {"type": "TEXT", "index": 71, "name": "DIAGNOSIS_POA_6", "comment": null}, "DIAGNOSIS_POA_7": {"type": "TEXT", "index": 72, "name": "DIAGNOSIS_POA_7", "comment": null}, "DIAGNOSIS_POA_8": {"type": "TEXT", "index": 73, "name": "DIAGNOSIS_POA_8", "comment": null}, "DIAGNOSIS_POA_9": {"type": "TEXT", "index": 74, "name": "DIAGNOSIS_POA_9", "comment": null}, "DIAGNOSIS_POA_10": {"type": "TEXT", "index": 75, "name": "DIAGNOSIS_POA_10", "comment": null}, "DIAGNOSIS_POA_11": {"type": "TEXT", "index": 76, "name": "DIAGNOSIS_POA_11", "comment": null}, "DIAGNOSIS_POA_12": {"type": "TEXT", "index": 77, "name": "DIAGNOSIS_POA_12", "comment": null}, "DIAGNOSIS_POA_13": {"type": "TEXT", "index": 78, "name": "DIAGNOSIS_POA_13", "comment": null}, "DIAGNOSIS_POA_14": {"type": "TEXT", "index": 79, "name": "DIAGNOSIS_POA_14", "comment": null}, "DIAGNOSIS_POA_15": {"type": "TEXT", "index": 80, "name": "DIAGNOSIS_POA_15", "comment": null}, "DIAGNOSIS_POA_16": {"type": "TEXT", "index": 81, "name": "DIAGNOSIS_POA_16", "comment": null}, "DIAGNOSIS_POA_17": {"type": "TEXT", "index": 82, "name": "DIAGNOSIS_POA_17", "comment": null}, "DIAGNOSIS_POA_18": {"type": "TEXT", "index": 83, "name": "DIAGNOSIS_POA_18", "comment": null}, "DIAGNOSIS_POA_19": {"type": "TEXT", "index": 84, "name": "DIAGNOSIS_POA_19", "comment": null}, "DIAGNOSIS_POA_20": {"type": "TEXT", "index": 85, "name": "DIAGNOSIS_POA_20", "comment": null}, "DIAGNOSIS_POA_21": {"type": "TEXT", "index": 86, "name": "DIAGNOSIS_POA_21", "comment": null}, "DIAGNOSIS_POA_22": {"type": "TEXT", "index": 87, "name": "DIAGNOSIS_POA_22", "comment": null}, "DIAGNOSIS_POA_23": {"type": "TEXT", "index": 88, "name": "DIAGNOSIS_POA_23", "comment": null}, "DIAGNOSIS_POA_24": {"type": "TEXT", "index": 89, "name": "DIAGNOSIS_POA_24", "comment": null}, "DIAGNOSIS_POA_25": {"type": "TEXT", "index": 90, "name": "DIAGNOSIS_POA_25", "comment": null}, "PROCEDURE_CODE_TYPE": {"type": "TEXT", "index": 91, "name": "PROCEDURE_CODE_TYPE", "comment": null}, "PROCEDURE_CODE_1": {"type": "TEXT", "index": 92, "name": "PROCEDURE_CODE_1", "comment": null}, "PROCEDURE_CODE_2": {"type": "TEXT", "index": 93, "name": "PROCEDURE_CODE_2", "comment": null}, "PROCEDURE_CODE_3": {"type": "TEXT", "index": 94, "name": "PROCEDURE_CODE_3", "comment": null}, "PROCEDURE_CODE_4": {"type": "TEXT", "index": 95, "name": "PROCEDURE_CODE_4", "comment": null}, "PROCEDURE_CODE_5": {"type": "TEXT", "index": 96, "name": "PROCEDURE_CODE_5", "comment": null}, "PROCEDURE_CODE_6": {"type": "TEXT", "index": 97, "name": "PROCEDURE_CODE_6", "comment": null}, "PROCEDURE_CODE_7": {"type": "TEXT", "index": 98, "name": "PROCEDURE_CODE_7", "comment": null}, "PROCEDURE_CODE_8": {"type": "TEXT", "index": 99, "name": "PROCEDURE_CODE_8", "comment": null}, "PROCEDURE_CODE_9": {"type": "TEXT", "index": 100, "name": "PROCEDURE_CODE_9", "comment": null}, "PROCEDURE_CODE_10": {"type": "TEXT", "index": 101, "name": "PROCEDURE_CODE_10", "comment": null}, "PROCEDURE_CODE_11": {"type": "TEXT", "index": 102, "name": "PROCEDURE_CODE_11", "comment": null}, "PROCEDURE_CODE_12": {"type": "TEXT", "index": 103, "name": "PROCEDURE_CODE_12", "comment": null}, "PROCEDURE_CODE_13": {"type": "TEXT", "index": 104, "name": "PROCEDURE_CODE_13", "comment": null}, "PROCEDURE_CODE_14": {"type": "TEXT", "index": 105, "name": "PROCEDURE_CODE_14", "comment": null}, "PROCEDURE_CODE_15": {"type": "TEXT", "index": 106, "name": "PROCEDURE_CODE_15", "comment": null}, "PROCEDURE_CODE_16": {"type": "TEXT", "index": 107, "name": "PROCEDURE_CODE_16", "comment": null}, "PROCEDURE_CODE_17": {"type": "TEXT", "index": 108, "name": "PROCEDURE_CODE_17", "comment": null}, "PROCEDURE_CODE_18": {"type": "TEXT", "index": 109, "name": "PROCEDURE_CODE_18", "comment": null}, "PROCEDURE_CODE_19": {"type": "TEXT", "index": 110, "name": "PROCEDURE_CODE_19", "comment": null}, "PROCEDURE_CODE_20": {"type": "TEXT", "index": 111, "name": "PROCEDURE_CODE_20", "comment": null}, "PROCEDURE_CODE_21": {"type": "TEXT", "index": 112, "name": "PROCEDURE_CODE_21", "comment": null}, "PROCEDURE_CODE_22": {"type": "TEXT", "index": 113, "name": "PROCEDURE_CODE_22", "comment": null}, "PROCEDURE_CODE_23": {"type": "TEXT", "index": 114, "name": "PROCEDURE_CODE_23", "comment": null}, "PROCEDURE_CODE_24": {"type": "TEXT", "index": 115, "name": "PROCEDURE_CODE_24", "comment": null}, "PROCEDURE_CODE_25": {"type": "TEXT", "index": 116, "name": "PROCEDURE_CODE_25", "comment": null}, "PROCEDURE_DATE_1": {"type": "DATE", "index": 117, "name": "PROCEDURE_DATE_1", "comment": null}, "PROCEDURE_DATE_2": {"type": "DATE", "index": 118, "name": "PROCEDURE_DATE_2", "comment": null}, "PROCEDURE_DATE_3": {"type": "DATE", "index": 119, "name": "PROCEDURE_DATE_3", "comment": null}, "PROCEDURE_DATE_4": {"type": "DATE", "index": 120, "name": "PROCEDURE_DATE_4", "comment": null}, "PROCEDURE_DATE_5": {"type": "DATE", "index": 121, "name": "PROCEDURE_DATE_5", "comment": null}, "PROCEDURE_DATE_6": {"type": "DATE", "index": 122, "name": "PROCEDURE_DATE_6", "comment": null}, "PROCEDURE_DATE_7": {"type": "DATE", "index": 123, "name": "PROCEDURE_DATE_7", "comment": null}, "PROCEDURE_DATE_8": {"type": "DATE", "index": 124, "name": "PROCEDURE_DATE_8", "comment": null}, "PROCEDURE_DATE_9": {"type": "DATE", "index": 125, "name": "PROCEDURE_DATE_9", "comment": null}, "PROCEDURE_DATE_10": {"type": "DATE", "index": 126, "name": "PROCEDURE_DATE_10", "comment": null}, "PROCEDURE_DATE_11": {"type": "DATE", "index": 127, "name": "PROCEDURE_DATE_11", "comment": null}, "PROCEDURE_DATE_12": {"type": "DATE", "index": 128, "name": "PROCEDURE_DATE_12", "comment": null}, "PROCEDURE_DATE_13": {"type": "DATE", "index": 129, "name": "PROCEDURE_DATE_13", "comment": null}, "PROCEDURE_DATE_14": {"type": "DATE", "index": 130, "name": "PROCEDURE_DATE_14", "comment": null}, "PROCEDURE_DATE_15": {"type": "DATE", "index": 131, "name": "PROCEDURE_DATE_15", "comment": null}, "PROCEDURE_DATE_16": {"type": "DATE", "index": 132, "name": "PROCEDURE_DATE_16", "comment": null}, "PROCEDURE_DATE_17": {"type": "DATE", "index": 133, "name": "PROCEDURE_DATE_17", "comment": null}, "PROCEDURE_DATE_18": {"type": "DATE", "index": 134, "name": "PROCEDURE_DATE_18", "comment": null}, "PROCEDURE_DATE_19": {"type": "DATE", "index": 135, "name": "PROCEDURE_DATE_19", "comment": null}, "PROCEDURE_DATE_20": {"type": "DATE", "index": 136, "name": "PROCEDURE_DATE_20", "comment": null}, "PROCEDURE_DATE_21": {"type": "DATE", "index": 137, "name": "PROCEDURE_DATE_21", "comment": null}, "PROCEDURE_DATE_22": {"type": "DATE", "index": 138, "name": "PROCEDURE_DATE_22", "comment": null}, "PROCEDURE_DATE_23": {"type": "DATE", "index": 139, "name": "PROCEDURE_DATE_23", "comment": null}, "PROCEDURE_DATE_24": {"type": "DATE", "index": 140, "name": "PROCEDURE_DATE_24", "comment": null}, "PROCEDURE_DATE_25": {"type": "DATE", "index": 141, "name": "PROCEDURE_DATE_25", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 142, "name": "DATA_SOURCE", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.input_layer.medical_claim"}, "model.input_layer.pharmacy_claim": {"metadata": {"type": "VIEW", "schema": "INPUT_LAYER", "name": "PHARMACY_CLAIM", "database": "TUVA", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"CLAIM_ID": {"type": "TEXT", "index": 1, "name": "CLAIM_ID", "comment": null}, "CLAIM_LINE_NUMBER": {"type": "NUMBER", "index": 2, "name": "CLAIM_LINE_NUMBER", "comment": null}, "PATIENT_ID": {"type": "TEXT", "index": 3, "name": "PATIENT_ID", "comment": null}, "MEMBER_ID": {"type": "TEXT", "index": 4, "name": "MEMBER_ID", "comment": null}, "PAYER": {"type": "TEXT", "index": 5, "name": "PAYER", "comment": null}, "PLAN": {"type": "TEXT", "index": 6, "name": "PLAN", "comment": null}, "PRESCRIBING_PROVIDER_NPI": {"type": "TEXT", "index": 7, "name": "PRESCRIBING_PROVIDER_NPI", "comment": null}, "DISPENSING_PROVIDER_NPI": {"type": "TEXT", "index": 8, "name": "DISPENSING_PROVIDER_NPI", "comment": null}, "DISPENSING_DATE": {"type": "DATE", "index": 9, "name": "DISPENSING_DATE", "comment": null}, "NDC_CODE": {"type": "TEXT", "index": 10, "name": "NDC_CODE", "comment": null}, "QUANTITY": {"type": "NUMBER", "index": 11, "name": "QUANTITY", "comment": null}, "DAYS_SUPPLY": {"type": "NUMBER", "index": 12, "name": "DAYS_SUPPLY", "comment": null}, "REFILLS": {"type": "NUMBER", "index": 13, "name": "REFILLS", "comment": null}, "PAID_DATE": {"type": "DATE", "index": 14, "name": "PAID_DATE", "comment": null}, "PAID_AMOUNT": {"type": "FLOAT", "index": 15, "name": "PAID_AMOUNT", "comment": null}, "ALLOWED_AMOUNT": {"type": "FLOAT", "index": 16, "name": "ALLOWED_AMOUNT", "comment": null}, "COINSURANCE_AMOUNT": {"type": "NUMBER", "index": 17, "name": "COINSURANCE_AMOUNT", "comment": null}, "COPAYMENT_AMOUNT": {"type": "NUMBER", "index": 18, "name": "COPAYMENT_AMOUNT", "comment": null}, "DEDUCTIBLE_AMOUNT": {"type": "NUMBER", "index": 19, "name": "DEDUCTIBLE_AMOUNT", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 20, "name": "DATA_SOURCE", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.input_layer.pharmacy_claim"}, "model.input_layer.practitioner": {"metadata": {"type": "VIEW", "schema": "INPUT_LAYER", "name": "PRACTITIONER", "database": "TUVA", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"PRACTITIONER_ID": {"type": "TEXT", "index": 1, "name": "PRACTITIONER_ID", "comment": null}, "NPI": {"type": "TEXT", "index": 2, "name": "NPI", "comment": null}, "FIRST_NAME": {"type": "TEXT", "index": 3, "name": "FIRST_NAME", "comment": null}, "LAST_NAME": {"type": "TEXT", "index": 4, "name": "LAST_NAME", "comment": null}, "PRACTICE_AFFILIATION": {"type": "TEXT", "index": 5, "name": "PRACTICE_AFFILIATION", "comment": null}, "SPECIALTY": {"type": "TEXT", "index": 6, "name": "SPECIALTY", "comment": null}, "SUB_SPECIALTY": {"type": "TEXT", "index": 7, "name": "SUB_SPECIALTY", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 8, "name": "DATA_SOURCE", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.input_layer.practitioner"}, "model.input_layer.encounter": {"metadata": {"type": "VIEW", "schema": "INPUT_LAYER", "name": "ENCOUNTER", "database": "TUVA", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"ENCOUNTER_ID": {"type": "TEXT", "index": 1, "name": "ENCOUNTER_ID", "comment": null}, "PATIENT_ID": {"type": "TEXT", "index": 2, "name": "PATIENT_ID", "comment": null}, "ENCOUNTER_TYPE": {"type": "TEXT", "index": 3, "name": "ENCOUNTER_TYPE", "comment": null}, "ENCOUNTER_START_DATE": {"type": "DATE", "index": 4, "name": "ENCOUNTER_START_DATE", "comment": null}, "ENCOUNTER_END_DATE": {"type": "DATE", "index": 5, "name": "ENCOUNTER_END_DATE", "comment": null}, "LENGTH_OF_STAY": {"type": "NUMBER", "index": 6, "name": "LENGTH_OF_STAY", "comment": null}, "ADMIT_SOURCE_CODE": {"type": "TEXT", "index": 7, "name": "ADMIT_SOURCE_CODE", "comment": null}, "ADMIT_SOURCE_DESCRIPTION": {"type": "TEXT", "index": 8, "name": "ADMIT_SOURCE_DESCRIPTION", "comment": null}, "ADMIT_TYPE_CODE": {"type": "TEXT", "index": 9, "name": "ADMIT_TYPE_CODE", "comment": null}, "ADMIT_TYPE_DESCRIPTION": {"type": "TEXT", "index": 10, "name": "ADMIT_TYPE_DESCRIPTION", "comment": null}, "DISCHARGE_DISPOSITION_CODE": {"type": "TEXT", "index": 11, "name": "DISCHARGE_DISPOSITION_CODE", "comment": null}, "DISCHARGE_DISPOSITION_DESCRIPTION": {"type": "TEXT", "index": 12, "name": "DISCHARGE_DISPOSITION_DESCRIPTION", "comment": null}, "ATTENDING_PROVIDER_ID": {"type": "TEXT", "index": 13, "name": "ATTENDING_PROVIDER_ID", "comment": null}, "FACILITY_NPI": {"type": "TEXT", "index": 14, "name": "FACILITY_NPI", "comment": null}, "PRIMARY_DIAGNOSIS_CODE_TYPE": {"type": "TEXT", "index": 15, "name": "PRIMARY_DIAGNOSIS_CODE_TYPE", "comment": null}, "PRIMARY_DIAGNOSIS_CODE": {"type": "TEXT", "index": 16, "name": "PRIMARY_DIAGNOSIS_CODE", "comment": null}, "PRIMARY_DIAGNOSIS_DESCRIPTION": {"type": "TEXT", "index": 17, "name": "PRIMARY_DIAGNOSIS_DESCRIPTION", "comment": null}, "MS_DRG_CODE": {"type": "TEXT", "index": 18, "name": "MS_DRG_CODE", "comment": null}, "MS_DRG_DESCRIPTION": {"type": "TEXT", "index": 19, "name": "MS_DRG_DESCRIPTION", "comment": null}, "APR_DRG_CODE": {"type": "TEXT", "index": 20, "name": "APR_DRG_CODE", "comment": null}, "APR_DRG_DESCRIPTION": {"type": "TEXT", "index": 21, "name": "APR_DRG_DESCRIPTION", "comment": null}, "PAID_AMOUNT": {"type": "NUMBER", "index": 22, "name": "PAID_AMOUNT", "comment": null}, "ALLOWED_AMOUNT": {"type": "NUMBER", "index": 23, "name": "ALLOWED_AMOUNT", "comment": null}, "CHARGE_AMOUNT": {"type": "NUMBER", "index": 24, "name": "CHARGE_AMOUNT", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 25, "name": "DATA_SOURCE", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.input_layer.encounter"}, "model.input_layer.location": {"metadata": {"type": "VIEW", "schema": "INPUT_LAYER", "name": "LOCATION", "database": "TUVA", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"LOCATION_ID": {"type": "TEXT", "index": 1, "name": "LOCATION_ID", "comment": null}, "NPI": {"type": "TEXT", "index": 2, "name": "NPI", "comment": null}, "NAME": {"type": "TEXT", "index": 3, "name": "NAME", "comment": null}, "FACILITY_TYPE": {"type": "TEXT", "index": 4, "name": "FACILITY_TYPE", "comment": null}, "PARENT_ORGANIZATION": {"type": "TEXT", "index": 5, "name": "PARENT_ORGANIZATION", "comment": null}, "ADDRESS": {"type": "TEXT", "index": 6, "name": "ADDRESS", "comment": null}, "CITY": {"type": "TEXT", "index": 7, "name": "CITY", "comment": null}, "STATE": {"type": "TEXT", "index": 8, "name": "STATE", "comment": null}, "ZIP_CODE": {"type": "TEXT", "index": 9, "name": "ZIP_CODE", "comment": null}, "LATITUDE": {"type": "FLOAT", "index": 10, "name": "LATITUDE", "comment": null}, "LONGITUDE": {"type": "FLOAT", "index": 11, "name": "LONGITUDE", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 12, "name": "DATA_SOURCE", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.input_layer.location"}, "model.the_tuva_project.core__patient": {"metadata": {"type": "BASE TABLE", "schema": "CORE", "name": "PATIENT", "database": "DEV_SARAH", "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": {"last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-11-28 23:51UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.core__patient"}, "model.the_tuva_project.service_category__duplicate_bill_types": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_DUPLICATE_BILL_TYPES", "database": "DEV_SARAH", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"CLAIM_ID": {"type": "TEXT", "index": 1, "name": "CLAIM_ID", "comment": null}, "CNT": {"type": "NUMBER", "index": 2, "name": "CNT", "comment": null}}, "stats": {"last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-11-28 23:50UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.service_category__duplicate_bill_types"}, "model.the_tuva_project.acute_inpatient__summary": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "ACUTE_INPATIENT_SUMMARY", "database": "DEV_SARAH", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"ENCOUNTER_ID": {"type": "TEXT", "index": 1, "name": "ENCOUNTER_ID", "comment": null}, "ENCOUNTER_START_DATE": {"type": "DATE", "index": 2, "name": "ENCOUNTER_START_DATE", "comment": null}, "ENCOUNTER_END_DATE": {"type": "DATE", "index": 3, "name": "ENCOUNTER_END_DATE", "comment": null}, "PATIENT_ID": {"type": "TEXT", "index": 4, "name": "PATIENT_ID", "comment": null}, "ADMIT_AGE": {"type": "NUMBER", "index": 5, "name": "ADMIT_AGE", "comment": null}, "GENDER": {"type": "TEXT", "index": 6, "name": "GENDER", "comment": null}, "RACE": {"type": "TEXT", "index": 7, "name": "RACE", "comment": null}, "PRIMARY_DIAGNOSIS_CODE_TYPE": {"type": "TEXT", "index": 8, "name": "PRIMARY_DIAGNOSIS_CODE_TYPE", "comment": null}, "PRIMARY_DIAGNOSIS_CODE": {"type": "TEXT", "index": 9, "name": "PRIMARY_DIAGNOSIS_CODE", "comment": null}, "PRIMARY_DIAGNOSIS_DESCRIPTION": {"type": "TEXT", "index": 10, "name": "PRIMARY_DIAGNOSIS_DESCRIPTION", "comment": null}, "FACILITY_NPI": {"type": "TEXT", "index": 11, "name": "FACILITY_NPI", "comment": null}, "PROVIDER_FIRST_NAME": {"type": "TEXT", "index": 12, "name": "PROVIDER_FIRST_NAME", "comment": null}, "PROVIDER_LAST_NAME": {"type": "TEXT", "index": 13, "name": "PROVIDER_LAST_NAME", "comment": null}, "MS_DRG_CODE": {"type": "TEXT", "index": 14, "name": "MS_DRG_CODE", "comment": null}, "MS_DRG_DESCRIPTION": {"type": "TEXT", "index": 15, "name": "MS_DRG_DESCRIPTION", "comment": null}, "MEDICAL_SURGICAL": {"type": "TEXT", "index": 16, "name": "MEDICAL_SURGICAL", "comment": null}, "APR_DRG_CODE": {"type": "TEXT", "index": 17, "name": "APR_DRG_CODE", "comment": null}, "APR_DRG_DESCRIPTION": {"type": "TEXT", "index": 18, "name": "APR_DRG_DESCRIPTION", "comment": null}, "ADMIT_SOURCE_CODE": {"type": "TEXT", "index": 19, "name": "ADMIT_SOURCE_CODE", "comment": null}, "ADMIT_SOURCE_DESCRIPTION": {"type": "TEXT", "index": 20, "name": "ADMIT_SOURCE_DESCRIPTION", "comment": null}, "ADMIT_TYPE_CODE": {"type": "TEXT", "index": 21, "name": "ADMIT_TYPE_CODE", "comment": null}, "ADMIT_TYPE_DESCRIPTION": {"type": "TEXT", "index": 22, "name": "ADMIT_TYPE_DESCRIPTION", "comment": null}, "DISCHARGE_DISPOSITION_CODE": {"type": "TEXT", "index": 23, "name": "DISCHARGE_DISPOSITION_CODE", "comment": null}, "DISCHARGE_DISPOSITION_DESCRIPTION": {"type": "TEXT", "index": 24, "name": "DISCHARGE_DISPOSITION_DESCRIPTION", "comment": null}, "TOTAL_PAID_AMOUNT": {"type": "FLOAT", "index": 25, "name": "TOTAL_PAID_AMOUNT", "comment": null}, "TOTAL_ALLOWED_AMOUNT": {"type": "FLOAT", "index": 26, "name": "TOTAL_ALLOWED_AMOUNT", "comment": null}, "TOTAL_CHARGE_AMOUNT": {"type": "FLOAT", "index": 27, "name": "TOTAL_CHARGE_AMOUNT", "comment": null}, "LENGTH_OF_STAY": {"type": "NUMBER", "index": 28, "name": "LENGTH_OF_STAY", "comment": null}, "MORTALITY_FLAG": {"type": "NUMBER", "index": 29, "name": "MORTALITY_FLAG", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 30, "name": "DATA_SOURCE", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 31, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-11-28 23:51UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.acute_inpatient__summary"}, "model.the_tuva_project.service_category__outpatient_rehab_professional": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_OUTPATIENT_REHAB_PROFESSIONAL", "database": "DEV_SARAH", "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-11-28 23:51UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.service_category__outpatient_rehab_professional"}, "model.the_tuva_project.data_profiling__medical_claim_duplicates": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_MEDICAL_CLAIM_DUPLICATES", "database": "DEV_SARAH", "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-11-28 23:50UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.data_profiling__medical_claim_duplicates"}, "model.the_tuva_project.insights__trend_sum_amount_by_claim_type": {"metadata": {"type": "BASE TABLE", "schema": "INSIGHTS", "name": "TREND_SUM_AMOUNT_BY_CLAIM_TYPE", "database": "DEV_SARAH", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"YEAR_MONTH": {"type": "TEXT", "index": 1, "name": "YEAR_MONTH", "comment": null}, "CLAIM_TYPE": {"type": "TEXT", "index": 2, "name": "CLAIM_TYPE", "comment": null}, "TOTAL_PAID_AMOUNT": {"type": "NUMBER", "index": 3, "name": "TOTAL_PAID_AMOUNT", "comment": null}, "TOTAL_PAID_AMOUNT_CHANGE": {"type": "NUMBER", "index": 4, "name": "TOTAL_PAID_AMOUNT_CHANGE", "comment": null}, "TOTAL_PAID_AMOUNT_PERCENT_CHANGE": {"type": "NUMBER", "index": 5, "name": "TOTAL_PAID_AMOUNT_PERCENT_CHANGE", "comment": null}, "TOTAL_ALLOWED_AMOUNT": {"type": "NUMBER", "index": 6, "name": "TOTAL_ALLOWED_AMOUNT", "comment": null}, "TOTAL_ALLOWED_AMOUNT_CHANGE": {"type": "NUMBER", "index": 7, "name": "TOTAL_ALLOWED_AMOUNT_CHANGE", "comment": null}, "TOTAL_ALLOWED_AMOUNT_PERCENT_CHANGE": {"type": "NUMBER", "index": 8, "name": "TOTAL_ALLOWED_AMOUNT_PERCENT_CHANGE", "comment": null}, "TOTAL_CHARGE_AMOUNT": {"type": "NUMBER", "index": 9, "name": "TOTAL_CHARGE_AMOUNT", "comment": null}, "TOTAL_CHARGE_AMOUNT_CHANGE": {"type": "NUMBER", "index": 10, "name": "TOTAL_CHARGE_AMOUNT_CHANGE", "comment": null}, "TOTAL_CHARGE_AMOUNT_PERCENT_CHANGE": {"type": "NUMBER", "index": 11, "name": "TOTAL_CHARGE_AMOUNT_PERCENT_CHANGE", "comment": null}}, "stats": {"last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-11-28 23:51UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.insights__trend_sum_amount_by_claim_type"}, "model.the_tuva_project.data_profiling__medical_claim_invalid_values": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_MEDICAL_CLAIM_INVALID_VALUES", "database": "DEV_SARAH", "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-11-28 23:50UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.data_profiling__medical_claim_invalid_values"}, "model.the_tuva_project.ccsr__long_procedure_category": {"metadata": {"type": "BASE TABLE", "schema": "CCSR", "name": "LONG_PROCEDURE_CATEGORY", "database": "DEV_SARAH", "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-11-28 23:51UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.ccsr__long_procedure_category"}, "model.the_tuva_project.service_category__dq_multiple_service_categories_professional": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_DQ_MULTIPLE_SERVICE_CATEGORIES_PROFESSIONAL", "database": "DEV_SARAH", "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-11-28 23:51UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.service_category__dq_multiple_service_categories_professional"}, "model.the_tuva_project.service_category__home_health_professional": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_HOME_HEALTH_PROFESSIONAL", "database": "DEV_SARAH", "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-11-28 23:51UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.service_category__home_health_professional"}, "seed.the_tuva_project.cms_hcc__payment_hcc_count_factors": {"metadata": {"type": "BASE TABLE", "schema": "CMS_HCC", "name": "_VALUE_SET_PAYMENT_HCC_COUNT_FACTORS", "database": "DEV_SARAH", "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-11-28 23:49UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 4096.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 36.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.the_tuva_project.cms_hcc__payment_hcc_count_factors"}, "model.the_tuva_project.insights__sum_amount_by_service_category": {"metadata": {"type": "BASE TABLE", "schema": "INSIGHTS", "name": "SUM_AMOUNT_BY_SERVICE_CATEGORY", "database": "DEV_SARAH", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"SERVICE_CATEGORY_TYPE": {"type": "TEXT", "index": 1, "name": "SERVICE_CATEGORY_TYPE", "comment": null}, "SERVICE_CATEGORY_1": {"type": "TEXT", "index": 2, "name": "SERVICE_CATEGORY_1", "comment": null}, "TOTAL_PAID_AMOUNT": {"type": "NUMBER", "index": 3, "name": "TOTAL_PAID_AMOUNT", "comment": null}, "TOTAL_ALLOWED_AMOUNT": {"type": "NUMBER", "index": 4, "name": "TOTAL_ALLOWED_AMOUNT", "comment": null}, "TOTAL_CHARGE_AMOUNT": {"type": "NUMBER", "index": 5, "name": "TOTAL_CHARGE_AMOUNT", "comment": null}}, "stats": {"last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-11-28 23:51UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.insights__sum_amount_by_service_category"}, "model.the_tuva_project.data_profiling__test_detail": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "TEST_DETAIL", "database": "DEV_SARAH", "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-11-28 23:51UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.data_profiling__test_detail"}, "seed.the_tuva_project.terminology__code_type": {"metadata": {"type": "BASE TABLE", "schema": "TERMINOLOGY", "name": "CODE_TYPE", "database": "DEV_SARAH", "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-11-28 23:50UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 1024.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 6.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.the_tuva_project.terminology__code_type"}, "model.the_tuva_project.readmissions__encounter_augmented": {"metadata": {"type": "BASE TABLE", "schema": "READMISSIONS", "name": "ENCOUNTER_AUGMENTED", "database": "DEV_SARAH", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"ENCOUNTER_ID": {"type": "TEXT", "index": 1, "name": "ENCOUNTER_ID", "comment": null}, "PATIENT_ID": {"type": "TEXT", "index": 2, "name": "PATIENT_ID", "comment": null}, "ADMIT_DATE": {"type": "DATE", "index": 3, "name": "ADMIT_DATE", "comment": null}, "DISCHARGE_DATE": {"type": "DATE", "index": 4, "name": "DISCHARGE_DATE", "comment": null}, "DISCHARGE_DISPOSITION_CODE": {"type": "TEXT", "index": 5, "name": "DISCHARGE_DISPOSITION_CODE", "comment": null}, "FACILITY_NPI": {"type": "TEXT", "index": 6, "name": "FACILITY_NPI", "comment": null}, "MS_DRG_CODE": {"type": "TEXT", "index": 7, "name": "MS_DRG_CODE", "comment": null}, "PAID_AMOUNT": {"type": "NUMBER", "index": 8, "name": "PAID_AMOUNT", "comment": null}, "LENGTH_OF_STAY": {"type": "NUMBER", "index": 9, "name": "LENGTH_OF_STAY", "comment": null}, "INDEX_ADMISSION_FLAG": {"type": "NUMBER", "index": 10, "name": "INDEX_ADMISSION_FLAG", "comment": null}, "PLANNED_FLAG": {"type": "NUMBER", "index": 11, "name": "PLANNED_FLAG", "comment": null}, "SPECIALTY_COHORT": {"type": "TEXT", "index": 12, "name": "SPECIALTY_COHORT", "comment": null}, "DIED_FLAG": {"type": "NUMBER", "index": 13, "name": "DIED_FLAG", "comment": null}, "DIAGNOSIS_CCS": {"type": "TEXT", "index": 14, "name": "DIAGNOSIS_CCS", "comment": null}, "DISQUALIFIED_ENCOUNTER_FLAG": {"type": "NUMBER", "index": 15, "name": "DISQUALIFIED_ENCOUNTER_FLAG", "comment": null}, "MISSING_ADMIT_DATE_FLAG": {"type": "NUMBER", "index": 16, "name": "MISSING_ADMIT_DATE_FLAG", "comment": null}, "MISSING_DISCHARGE_DATE_FLAG": {"type": "NUMBER", "index": 17, "name": "MISSING_DISCHARGE_DATE_FLAG", "comment": null}, "ADMIT_AFTER_DISCHARGE_FLAG": {"type": "NUMBER", "index": 18, "name": "ADMIT_AFTER_DISCHARGE_FLAG", "comment": null}, "MISSING_DISCHARGE_DISPOSITION_CODE_FLAG": {"type": "NUMBER", "index": 19, "name": "MISSING_DISCHARGE_DISPOSITION_CODE_FLAG", "comment": null}, "INVALID_DISCHARGE_DISPOSITION_CODE_FLAG": {"type": "NUMBER", "index": 20, "name": "INVALID_DISCHARGE_DISPOSITION_CODE_FLAG", "comment": null}, "MISSING_PRIMARY_DIAGNOSIS_FLAG": {"type": "NUMBER", "index": 21, "name": "MISSING_PRIMARY_DIAGNOSIS_FLAG", "comment": null}, "INVALID_PRIMARY_DIAGNOSIS_CODE_FLAG": {"type": "NUMBER", "index": 22, "name": "INVALID_PRIMARY_DIAGNOSIS_CODE_FLAG", "comment": null}, "NO_DIAGNOSIS_CCS_FLAG": {"type": "NUMBER", "index": 23, "name": "NO_DIAGNOSIS_CCS_FLAG", "comment": null}, "OVERLAPS_WITH_ANOTHER_ENCOUNTER_FLAG": {"type": "NUMBER", "index": 24, "name": "OVERLAPS_WITH_ANOTHER_ENCOUNTER_FLAG", "comment": null}, "MISSING_MS_DRG_FLAG": {"type": "NUMBER", "index": 25, "name": "MISSING_MS_DRG_FLAG", "comment": null}, "INVALID_MS_DRG_FLAG": {"type": "NUMBER", "index": 26, "name": "INVALID_MS_DRG_FLAG", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 27, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-11-28 23:52UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.readmissions__encounter_augmented"}, "model.the_tuva_project.quality_measures__summary_counts": {"metadata": {"type": "BASE TABLE", "schema": "QUALITY_MEASURES", "name": "SUMMARY_COUNTS", "database": "DEV_SARAH", "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-11-28 23:52UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.quality_measures__summary_counts"}, "model.the_tuva_project.quality_measures__int_nqf0034_denominator": {"metadata": {"type": "BASE TABLE", "schema": "QUALITY_MEASURES", "name": "_INT_NQF0034_DENOMINATOR", "database": "DEV_SARAH", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"PATIENT_ID": {"type": "TEXT", "index": 1, "name": "PATIENT_ID", "comment": null}, "MIN_AGE": {"type": "NUMBER", "index": 2, "name": "MIN_AGE", "comment": null}, "MAX_AGE": {"type": "NUMBER", "index": 3, "name": "MAX_AGE", "comment": null}, "QUALIFYING_TYPES": {"type": "TEXT", "index": 4, "name": "QUALIFYING_TYPES", "comment": null}}, "stats": {"last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-11-28 23:51UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.quality_measures__int_nqf0034_denominator"}, "seed.the_tuva_project.terminology__ssa_fips_state": {"metadata": {"type": "BASE TABLE", "schema": "TERMINOLOGY", "name": "SSA_FIPS_STATE", "database": "DEV_SARAH", "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-11-28 23:50UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 2048.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 78.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.the_tuva_project.terminology__ssa_fips_state"}, "model.the_tuva_project.readmissions__encounter_with_ccs": {"metadata": {"type": "VIEW", "schema": "READMISSIONS", "name": "_INT_ENCOUNTER_WITH_CCS", "database": "DEV_SARAH", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"ENCOUNTER_ID": {"type": "TEXT", "index": 1, "name": "ENCOUNTER_ID", "comment": null}, "PATIENT_ID": {"type": "TEXT", "index": 2, "name": "PATIENT_ID", "comment": null}, "ADMIT_DATE": {"type": "DATE", "index": 3, "name": "ADMIT_DATE", "comment": null}, "DISCHARGE_DATE": {"type": "DATE", "index": 4, "name": "DISCHARGE_DATE", "comment": null}, "DISCHARGE_DISPOSITION_CODE": {"type": "TEXT", "index": 5, "name": "DISCHARGE_DISPOSITION_CODE", "comment": null}, "FACILITY_NPI": {"type": "TEXT", "index": 6, "name": "FACILITY_NPI", "comment": null}, "MS_DRG_CODE": {"type": "TEXT", "index": 7, "name": "MS_DRG_CODE", "comment": null}, "PAID_AMOUNT": {"type": "NUMBER", "index": 8, "name": "PAID_AMOUNT", "comment": null}, "PRIMARY_DIAGNOSIS_CODE": {"type": "TEXT", "index": 9, "name": "PRIMARY_DIAGNOSIS_CODE", "comment": null}, "VALID_PRIMARY_DIAGNOSIS_CODE_FLAG": {"type": "NUMBER", "index": 10, "name": "VALID_PRIMARY_DIAGNOSIS_CODE_FLAG", "comment": null}, "CCS_DIAGNOSIS_CATEGORY": {"type": "TEXT", "index": 11, "name": "CCS_DIAGNOSIS_CATEGORY", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 12, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.readmissions__encounter_with_ccs"}, "model.the_tuva_project.data_profiling__use_case": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "USE_CASE", "database": "DEV_SARAH", "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-11-28 23:51UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.data_profiling__use_case"}, "model.the_tuva_project.insights__count_claim_by_date_column": {"metadata": {"type": "BASE TABLE", "schema": "INSIGHTS", "name": "COUNT_CLAIM_BY_DATE_COLUMN", "database": "DEV_SARAH", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"YEAR_MONTH": {"type": "NUMBER", "index": 1, "name": "YEAR_MONTH", "comment": null}, "MEMBER_MONTHS": {"type": "NUMBER", "index": 2, "name": "MEMBER_MONTHS", "comment": null}, "CLAIM_START_DATE": {"type": "NUMBER", "index": 3, "name": "CLAIM_START_DATE", "comment": null}, "CLAIM_END_DATE": {"type": "NUMBER", "index": 4, "name": "CLAIM_END_DATE", "comment": null}, "ADMISSION_DATE": {"type": "NUMBER", "index": 5, "name": "ADMISSION_DATE", "comment": null}, "DISCHARGE_DATE": {"type": "NUMBER", "index": 6, "name": "DISCHARGE_DATE", "comment": null}, "MEDICAL_PAID_DATE": {"type": "NUMBER", "index": 7, "name": "MEDICAL_PAID_DATE", "comment": null}, "DISPENSING_DATE": {"type": "NUMBER", "index": 8, "name": "DISPENSING_DATE", "comment": null}, "PHARMACY_PAID_DATE": {"type": "NUMBER", "index": 9, "name": "PHARMACY_PAID_DATE", "comment": null}}, "stats": {"last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-11-28 23:51UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.insights__count_claim_by_date_column"}, "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": "DEV_SARAH", "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-11-28 23:50UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.data_profiling__test_detail_stage_pharmacy_claim"}, "model.the_tuva_project.readmissions__readmission_crude": {"metadata": {"type": "VIEW", "schema": "READMISSIONS", "name": "_INT_READMISSION_CRUDE", "database": "DEV_SARAH", "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.insights__trend_sum_amount_by_service_category": {"metadata": {"type": "BASE TABLE", "schema": "INSIGHTS", "name": "TREND_SUM_AMOUNT_BY_SERVICE_CATEGORY", "database": "DEV_SARAH", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"YEAR_MONTH": {"type": "TEXT", "index": 1, "name": "YEAR_MONTH", "comment": null}, "SERVICE_CATEGORY_TYPE": {"type": "TEXT", "index": 2, "name": "SERVICE_CATEGORY_TYPE", "comment": null}, "SERVICE_CATEGORY": {"type": "TEXT", "index": 3, "name": "SERVICE_CATEGORY", "comment": null}, "TOTAL_PAID_AMOUNT": {"type": "NUMBER", "index": 4, "name": "TOTAL_PAID_AMOUNT", "comment": null}, "TOTAL_PAID_AMOUNT_CHANGE": {"type": "NUMBER", "index": 5, "name": "TOTAL_PAID_AMOUNT_CHANGE", "comment": null}, "TOTAL_PAID_AMOUNT_PERCENT_CHANGE": {"type": "NUMBER", "index": 6, "name": "TOTAL_PAID_AMOUNT_PERCENT_CHANGE", "comment": null}, "TOTAL_ALLOWED_AMOUNT": {"type": "NUMBER", "index": 7, "name": "TOTAL_ALLOWED_AMOUNT", "comment": null}, "TOTAL_ALLOWED_AMOUNT_CHANGE": {"type": "NUMBER", "index": 8, "name": "TOTAL_ALLOWED_AMOUNT_CHANGE", "comment": null}, "TOTAL_ALLOWED_AMOUNT_PERCENT_CHANGE": {"type": "NUMBER", "index": 9, "name": "TOTAL_ALLOWED_AMOUNT_PERCENT_CHANGE", "comment": null}, "TOTAL_CHARGE_AMOUNT": {"type": "NUMBER", "index": 10, "name": "TOTAL_CHARGE_AMOUNT", "comment": null}, "TOTAL_CHARGE_AMOUNT_CHANGE": {"type": "NUMBER", "index": 11, "name": "TOTAL_CHARGE_AMOUNT_CHANGE", "comment": null}, "TOTAL_CHARGE_AMOUNT_PERCENT_CHANGE": {"type": "NUMBER", "index": 12, "name": "TOTAL_CHARGE_AMOUNT_PERCENT_CHANGE", "comment": null}}, "stats": {"last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-11-28 23:51UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.insights__trend_sum_amount_by_service_category"}, "seed.the_tuva_project.terminology__loinc_deprecated_mapping": {"metadata": {"type": "BASE TABLE", "schema": "TERMINOLOGY", "name": "LOINC_DEPRECATED_MAPPING", "database": "DEV_SARAH", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"LOINC": {"type": "TEXT", "index": 1, "name": "LOINC", "comment": null}, "MAP_TO": {"type": "TEXT", "index": 2, "name": "MAP_TO", "comment": null}, "COMMENT": {"type": "TEXT", "index": 3, "name": "COMMENT", "comment": null}, "FINAL_MAP_TO": {"type": "TEXT", "index": 4, "name": "FINAL_MAP_TO", "comment": null}, "ALL_COMMENTS": {"type": "TEXT", "index": 5, "name": "ALL_COMMENTS", "comment": null}, "DEPTH": {"type": "TEXT", "index": 6, "name": "DEPTH", "comment": null}}, "stats": {"last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-11-28 23:50UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 97280.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 4613.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.the_tuva_project.terminology__loinc_deprecated_mapping"}, "model.the_tuva_project.core__stg_claims_encounter": {"metadata": {"type": "VIEW", "schema": "CORE", "name": "_STG_CLAIMS_ENCOUNTER", "database": "DEV_SARAH", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"ENCOUNTER_ID": {"type": "TEXT", "index": 1, "name": "ENCOUNTER_ID", "comment": null}, "PATIENT_ID": {"type": "TEXT", "index": 2, "name": "PATIENT_ID", "comment": null}, "ENCOUNTER_TYPE": {"type": "TEXT", "index": 3, "name": "ENCOUNTER_TYPE", "comment": null}, "ENCOUNTER_START_DATE": {"type": "DATE", "index": 4, "name": "ENCOUNTER_START_DATE", "comment": null}, "ENCOUNTER_END_DATE": {"type": "DATE", "index": 5, "name": "ENCOUNTER_END_DATE", "comment": null}, "LENGTH_OF_STAY": {"type": "NUMBER", "index": 6, "name": "LENGTH_OF_STAY", "comment": null}, "ADMIT_SOURCE_CODE": {"type": "TEXT", "index": 7, "name": "ADMIT_SOURCE_CODE", "comment": null}, "ADMIT_SOURCE_DESCRIPTION": {"type": "TEXT", "index": 8, "name": "ADMIT_SOURCE_DESCRIPTION", "comment": null}, "ADMIT_TYPE_CODE": {"type": "TEXT", "index": 9, "name": "ADMIT_TYPE_CODE", "comment": null}, "ADMIT_TYPE_DESCRIPTION": {"type": "TEXT", "index": 10, "name": "ADMIT_TYPE_DESCRIPTION", "comment": null}, "DISCHARGE_DISPOSITION_CODE": {"type": "TEXT", "index": 11, "name": "DISCHARGE_DISPOSITION_CODE", "comment": null}, "DISCHARGE_DISPOSITION_DESCRIPTION": {"type": "TEXT", "index": 12, "name": "DISCHARGE_DISPOSITION_DESCRIPTION", "comment": null}, "ATTENDING_PROVIDER_ID": {"type": "TEXT", "index": 13, "name": "ATTENDING_PROVIDER_ID", "comment": null}, "FACILITY_NPI": {"type": "TEXT", "index": 14, "name": "FACILITY_NPI", "comment": null}, "PRIMARY_DIAGNOSIS_CODE_TYPE": {"type": "TEXT", "index": 15, "name": "PRIMARY_DIAGNOSIS_CODE_TYPE", "comment": null}, "PRIMARY_DIAGNOSIS_CODE": {"type": "TEXT", "index": 16, "name": "PRIMARY_DIAGNOSIS_CODE", "comment": null}, "PRIMARY_DIAGNOSIS_DESCRIPTION": {"type": "TEXT", "index": 17, "name": "PRIMARY_DIAGNOSIS_DESCRIPTION", "comment": null}, "MS_DRG_CODE": {"type": "TEXT", "index": 18, "name": "MS_DRG_CODE", "comment": null}, "MS_DRG_DESCRIPTION": {"type": "TEXT", "index": 19, "name": "MS_DRG_DESCRIPTION", "comment": null}, "APR_DRG_CODE": {"type": "TEXT", "index": 20, "name": "APR_DRG_CODE", "comment": null}, "APR_DRG_DESCRIPTION": {"type": "TEXT", "index": 21, "name": "APR_DRG_DESCRIPTION", "comment": null}, "PAID_AMOUNT": {"type": "NUMBER", "index": 22, "name": "PAID_AMOUNT", "comment": null}, "ALLOWED_AMOUNT": {"type": "NUMBER", "index": 23, "name": "ALLOWED_AMOUNT", "comment": null}, "CHARGE_AMOUNT": {"type": "NUMBER", "index": 24, "name": "CHARGE_AMOUNT", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 25, "name": "DATA_SOURCE", "comment": null}, "TUVA_LAST_RUN": {"type": "TIMESTAMP_NTZ", "index": 26, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.core__stg_claims_encounter"}, "seed.the_tuva_project.readmissions__always_planned_ccs_diagnosis_category": {"metadata": {"type": "BASE TABLE", "schema": "READMISSIONS", "name": "_VALUE_SET_ALWAYS_PLANNED_CCS_DIAGNOSIS_CATEGORY", "database": "DEV_SARAH", "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-11-28 23:49UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 1536.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 2.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.the_tuva_project.readmissions__always_planned_ccs_diagnosis_category"}, "model.the_tuva_project.quality_measures__int_nqf2372_denominator": {"metadata": {"type": "BASE TABLE", "schema": "QUALITY_MEASURES", "name": "_INT_NQF2372_DENOMINATOR", "database": "DEV_SARAH", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"PATIENT_ID": {"type": "TEXT", "index": 1, "name": "PATIENT_ID", "comment": null}, "AGE": {"type": "NUMBER", "index": 2, "name": "AGE", "comment": null}, "PERFORMANCE_PERIOD_BEGIN": {"type": "DATE", "index": 3, "name": "PERFORMANCE_PERIOD_BEGIN", "comment": null}, "PERFORMANCE_PERIOD_END": {"type": "DATE", "index": 4, "name": "PERFORMANCE_PERIOD_END", "comment": null}, "PERFORMANCE_PERIOD_LOOKBACK": {"type": "DATE", "index": 5, "name": "PERFORMANCE_PERIOD_LOOKBACK", "comment": null}, "MEASURE_ID": {"type": "TEXT", "index": 6, "name": "MEASURE_ID", "comment": null}, "MEASURE_NAME": {"type": "TEXT", "index": 7, "name": "MEASURE_NAME", "comment": null}, "MEASURE_VERSION": {"type": "TEXT", "index": 8, "name": "MEASURE_VERSION", "comment": null}, "DENOMINATOR_FLAG": {"type": "NUMBER", "index": 9, "name": "DENOMINATOR_FLAG", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 10, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-11-28 23:51UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.quality_measures__int_nqf2372_denominator"}, "model.the_tuva_project.acute_inpatient__encounter_start_and_end_dates": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_ACUTE_INPATIENT_ENCOUNTER_START_AND_END_DATES", "database": "DEV_SARAH", "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-11-28 23:51UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.acute_inpatient__encounter_start_and_end_dates"}, "model.the_tuva_project.financial_pmpm__pmpm": {"metadata": {"type": "BASE TABLE", "schema": "FINANCIAL_PMPM", "name": "PMPM", "database": "DEV_SARAH", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"YEAR_MONTH": {"type": "TEXT", "index": 1, "name": "YEAR_MONTH", "comment": null}, "PAYER": {"type": "TEXT", "index": 2, "name": "PAYER", "comment": null}, "PLAN": {"type": "TEXT", "index": 3, "name": "PLAN", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 4, "name": "DATA_SOURCE", "comment": null}, "MEMBER_MONTHS": {"type": "NUMBER", "index": 5, "name": "MEMBER_MONTHS", "comment": null}, "TOTAL_PAID": {"type": "NUMBER", "index": 6, "name": "TOTAL_PAID", "comment": null}, "MEDICAL_PAID": {"type": "NUMBER", "index": 7, "name": "MEDICAL_PAID", "comment": null}, "INPATIENT_PAID": {"type": "NUMBER", "index": 8, "name": "INPATIENT_PAID", "comment": null}, "OUTPATIENT_PAID": {"type": "NUMBER", "index": 9, "name": "OUTPATIENT_PAID", "comment": null}, "OFFICE_VISIT_PAID": {"type": "NUMBER", "index": 10, "name": "OFFICE_VISIT_PAID", "comment": null}, "ANCILLARY_PAID": {"type": "NUMBER", "index": 11, "name": "ANCILLARY_PAID", "comment": null}, "PHARMACY_PAID": {"type": "NUMBER", "index": 12, "name": "PHARMACY_PAID", "comment": null}, "OTHER_PAID": {"type": "NUMBER", "index": 13, "name": "OTHER_PAID", "comment": null}, "ACUTE_INPATIENT_PAID": {"type": "NUMBER", "index": 14, "name": "ACUTE_INPATIENT_PAID", "comment": null}, "AMBULANCE_PAID": {"type": "NUMBER", "index": 15, "name": "AMBULANCE_PAID", "comment": null}, "AMBULATORY_SURGERY_PAID": {"type": "NUMBER", "index": 16, "name": "AMBULATORY_SURGERY_PAID", "comment": null}, "DIALYSIS_PAID": {"type": "NUMBER", "index": 17, "name": "DIALYSIS_PAID", "comment": null}, "DURABLE_MEDICAL_EQUIPMENT_PAID": {"type": "NUMBER", "index": 18, "name": "DURABLE_MEDICAL_EQUIPMENT_PAID", "comment": null}, "EMERGENCY_DEPARTMENT_PAID": {"type": "NUMBER", "index": 19, "name": "EMERGENCY_DEPARTMENT_PAID", "comment": null}, "HOME_HEALTH_PAID": {"type": "NUMBER", "index": 20, "name": "HOME_HEALTH_PAID", "comment": null}, "HOSPICE_PAID": {"type": "NUMBER", "index": 21, "name": "HOSPICE_PAID", "comment": null}, "INPATIENT_PSYCHIATRIC_PAID": {"type": "NUMBER", "index": 22, "name": "INPATIENT_PSYCHIATRIC_PAID", "comment": null}, "INPATIENT_REHABILITATION_PAID": {"type": "NUMBER", "index": 23, "name": "INPATIENT_REHABILITATION_PAID", "comment": null}, "LAB_PAID": {"type": "NUMBER", "index": 24, "name": "LAB_PAID", "comment": null}, "OFFICE_VISIT_PAID_2": {"type": "NUMBER", "index": 25, "name": "OFFICE_VISIT_PAID_2", "comment": null}, "OUTPATIENT_HOSPITAL_OR_CLINIC_PAID": {"type": "NUMBER", "index": 26, "name": "OUTPATIENT_HOSPITAL_OR_CLINIC_PAID", "comment": null}, "OUTPATIENT_PSYCHIATRIC_PAID": {"type": "NUMBER", "index": 27, "name": "OUTPATIENT_PSYCHIATRIC_PAID", "comment": null}, "OUTPATIENT_REHABILITATION_PAID": {"type": "NUMBER", "index": 28, "name": "OUTPATIENT_REHABILITATION_PAID", "comment": null}, "SKILLED_NURSING_PAID": {"type": "NUMBER", "index": 29, "name": "SKILLED_NURSING_PAID", "comment": null}, "URGENT_CARE_PAID": {"type": "NUMBER", "index": 30, "name": "URGENT_CARE_PAID", "comment": null}, "TOTAL_ALLOWED": {"type": "NUMBER", "index": 31, "name": "TOTAL_ALLOWED", "comment": null}, "MEDICAL_ALLOWED": {"type": "NUMBER", "index": 32, "name": "MEDICAL_ALLOWED", "comment": null}, "INPATIENT_ALLOWED": {"type": "NUMBER", "index": 33, "name": "INPATIENT_ALLOWED", "comment": null}, "OUTPATIENT_ALLOWED": {"type": "NUMBER", "index": 34, "name": "OUTPATIENT_ALLOWED", "comment": null}, "OFFICE_VISIT_ALLOWED": {"type": "NUMBER", "index": 35, "name": "OFFICE_VISIT_ALLOWED", "comment": null}, "ANCILLARY_ALLOWED": {"type": "NUMBER", "index": 36, "name": "ANCILLARY_ALLOWED", "comment": null}, "PHARMACY_ALLOWED": {"type": "NUMBER", "index": 37, "name": "PHARMACY_ALLOWED", "comment": null}, "OTHER_ALLOWED": {"type": "NUMBER", "index": 38, "name": "OTHER_ALLOWED", "comment": null}, "ACUTE_INPATIENT_ALLOWED": {"type": "NUMBER", "index": 39, "name": "ACUTE_INPATIENT_ALLOWED", "comment": null}, "AMBULANCE_ALLOWED": {"type": "NUMBER", "index": 40, "name": "AMBULANCE_ALLOWED", "comment": null}, "AMBULATORY_SURGERY_ALLOWED": {"type": "NUMBER", "index": 41, "name": "AMBULATORY_SURGERY_ALLOWED", "comment": null}, "DIALYSIS_ALLOWED": {"type": "NUMBER", "index": 42, "name": "DIALYSIS_ALLOWED", "comment": null}, "DURABLE_MEDICAL_EQUIPMENT_ALLOWED": {"type": "NUMBER", "index": 43, "name": "DURABLE_MEDICAL_EQUIPMENT_ALLOWED", "comment": null}, "EMERGENCY_DEPARTMENT_ALLOWED": {"type": "NUMBER", "index": 44, "name": "EMERGENCY_DEPARTMENT_ALLOWED", "comment": null}, "HOME_HEALTH_ALLOWED": {"type": "NUMBER", "index": 45, "name": "HOME_HEALTH_ALLOWED", "comment": null}, "HOSPICE_ALLOWED": {"type": "NUMBER", "index": 46, "name": "HOSPICE_ALLOWED", "comment": null}, "INPATIENT_PSYCHIATRIC_ALLOWED": {"type": "NUMBER", "index": 47, "name": "INPATIENT_PSYCHIATRIC_ALLOWED", "comment": null}, "INPATIENT_REHABILITATION_ALLOWED": {"type": "NUMBER", "index": 48, "name": "INPATIENT_REHABILITATION_ALLOWED", "comment": null}, "LAB_ALLOWED": {"type": "NUMBER", "index": 49, "name": "LAB_ALLOWED", "comment": null}, "OFFICE_VISIT_ALLOWED_2": {"type": "NUMBER", "index": 50, "name": "OFFICE_VISIT_ALLOWED_2", "comment": null}, "OUTPATIENT_HOSPITAL_OR_CLINIC_ALLOWED": {"type": "NUMBER", "index": 51, "name": "OUTPATIENT_HOSPITAL_OR_CLINIC_ALLOWED", "comment": null}, "OUTPATIENT_PSYCHIATRIC_ALLOWED": {"type": "NUMBER", "index": 52, "name": "OUTPATIENT_PSYCHIATRIC_ALLOWED", "comment": null}, "OUTPATIENT_REHABILITATION_ALLOWED": {"type": "NUMBER", "index": 53, "name": "OUTPATIENT_REHABILITATION_ALLOWED", "comment": null}, "SKILLED_NURSING_ALLOWED": {"type": "NUMBER", "index": 54, "name": "SKILLED_NURSING_ALLOWED", "comment": null}, "URGENT_CARE_ALLOWED": {"type": "NUMBER", "index": 55, "name": "URGENT_CARE_ALLOWED", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 56, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-11-28 23:52UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.financial_pmpm__pmpm"}, "seed.the_tuva_project.terminology__other_provider_taxonomy": {"metadata": {"type": "BASE TABLE", "schema": "TERMINOLOGY", "name": "OTHER_PROVIDER_TAXONOMY", "database": "DEV_SARAH", "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-11-28 23:50UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 68268544.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 9413513.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.the_tuva_project.terminology__other_provider_taxonomy"}, "model.the_tuva_project.quality_measures__int_nqf2372__frailty": {"metadata": {"type": "VIEW", "schema": "QUALITY_MEASURES", "name": "_INT_NQF2372__FRAILTY", "database": "DEV_SARAH", "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}, "EXCLUSION_DATE": {"type": "DATE", "index": 4, "name": "EXCLUSION_DATE", "comment": null}, "EXCLUSION_REASON": {"type": "TEXT", "index": 5, "name": "EXCLUSION_REASON", "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.quality_measures__int_nqf2372__frailty"}, "seed.the_tuva_project.readmissions__potentially_planned_icd_10_pcs": {"metadata": {"type": "BASE TABLE", "schema": "READMISSIONS", "name": "_VALUE_SET_POTENTIALLY_PLANNED_ICD_10_PCS", "database": "DEV_SARAH", "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-11-28 23:49UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 34304.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 2521.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.the_tuva_project.readmissions__potentially_planned_icd_10_pcs"}, "model.the_tuva_project.acute_inpatient__institutional_claims": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_ACUTE_INPATIENT_INSTITUTIONAL_CLAIMS", "database": "DEV_SARAH", "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-11-28 23:51UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.acute_inpatient__institutional_claims"}, "model.the_tuva_project.service_category__emergency_department_professional": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_EMERGENCY_DEPARTMENT_PROFESSIONAL", "database": "DEV_SARAH", "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-11-28 23:50UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.service_category__emergency_department_professional"}, "model.the_tuva_project.readmissions__encounter_data_quality": {"metadata": {"type": "VIEW", "schema": "READMISSIONS", "name": "_INT_ENCOUNTER_DATA_QUALITY", "database": "DEV_SARAH", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"ENCOUNTER_ID": {"type": "TEXT", "index": 1, "name": "ENCOUNTER_ID", "comment": null}, "DIAGNOSIS_CCS": {"type": "TEXT", "index": 2, "name": "DIAGNOSIS_CCS", "comment": null}, "DISQUALIFIED_ENCOUNTER_FLAG": {"type": "NUMBER", "index": 3, "name": "DISQUALIFIED_ENCOUNTER_FLAG", "comment": null}, "MISSING_ADMIT_DATE_FLAG": {"type": "NUMBER", "index": 4, "name": "MISSING_ADMIT_DATE_FLAG", "comment": null}, "MISSING_DISCHARGE_DATE_FLAG": {"type": "NUMBER", "index": 5, "name": "MISSING_DISCHARGE_DATE_FLAG", "comment": null}, "ADMIT_AFTER_DISCHARGE_FLAG": {"type": "NUMBER", "index": 6, "name": "ADMIT_AFTER_DISCHARGE_FLAG", "comment": null}, "MISSING_DISCHARGE_DISPOSITION_CODE_FLAG": {"type": "NUMBER", "index": 7, "name": "MISSING_DISCHARGE_DISPOSITION_CODE_FLAG", "comment": null}, "INVALID_DISCHARGE_DISPOSITION_CODE_FLAG": {"type": "NUMBER", "index": 8, "name": "INVALID_DISCHARGE_DISPOSITION_CODE_FLAG", "comment": null}, "MISSING_PRIMARY_DIAGNOSIS_FLAG": {"type": "NUMBER", "index": 9, "name": "MISSING_PRIMARY_DIAGNOSIS_FLAG", "comment": null}, "INVALID_PRIMARY_DIAGNOSIS_CODE_FLAG": {"type": "NUMBER", "index": 10, "name": "INVALID_PRIMARY_DIAGNOSIS_CODE_FLAG", "comment": null}, "NO_DIAGNOSIS_CCS_FLAG": {"type": "NUMBER", "index": 11, "name": "NO_DIAGNOSIS_CCS_FLAG", "comment": null}, "OVERLAPS_WITH_ANOTHER_ENCOUNTER_FLAG": {"type": "NUMBER", "index": 12, "name": "OVERLAPS_WITH_ANOTHER_ENCOUNTER_FLAG", "comment": null}, "MISSING_MS_DRG_FLAG": {"type": "NUMBER", "index": 13, "name": "MISSING_MS_DRG_FLAG", "comment": null}, "INVALID_MS_DRG_FLAG": {"type": "NUMBER", "index": 14, "name": "INVALID_MS_DRG_FLAG", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 15, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.readmissions__encounter_data_quality"}, "model.the_tuva_project.cms_hcc__patient_risk_factors": {"metadata": {"type": "BASE TABLE", "schema": "CMS_HCC", "name": "PATIENT_RISK_FACTORS", "database": "DEV_SARAH", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"PATIENT_ID": {"type": "TEXT", "index": 1, "name": "PATIENT_ID", "comment": null}, "ENROLLMENT_STATUS_DEFAULT": {"type": "BOOLEAN", "index": 2, "name": "ENROLLMENT_STATUS_DEFAULT", "comment": null}, "MEDICAID_DUAL_STATUS_DEFAULT": {"type": "BOOLEAN", "index": 3, "name": "MEDICAID_DUAL_STATUS_DEFAULT", "comment": null}, "OREC_DEFAULT": {"type": "BOOLEAN", "index": 4, "name": "OREC_DEFAULT", "comment": null}, "INSTITUTIONAL_STATUS_DEFAULT": {"type": "BOOLEAN", "index": 5, "name": "INSTITUTIONAL_STATUS_DEFAULT", "comment": null}, "FACTOR_TYPE": {"type": "TEXT", "index": 6, "name": "FACTOR_TYPE", "comment": null}, "RISK_FACTOR_DESCRIPTION": {"type": "TEXT", "index": 7, "name": "RISK_FACTOR_DESCRIPTION", "comment": null}, "COEFFICIENT": {"type": "NUMBER", "index": 8, "name": "COEFFICIENT", "comment": null}, "MODEL_VERSION": {"type": "TEXT", "index": 9, "name": "MODEL_VERSION", "comment": null}, "PAYMENT_YEAR": {"type": "NUMBER", "index": 10, "name": "PAYMENT_YEAR", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 11, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-11-28 23:52UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.cms_hcc__patient_risk_factors"}, "model.the_tuva_project.core__stg_claims_patient": {"metadata": {"type": "VIEW", "schema": "CORE", "name": "_STG_CLAIMS_PATIENT", "database": "DEV_SARAH", "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_claims_patient"}, "seed.the_tuva_project.cms_hcc__disease_hierarchy": {"metadata": {"type": "BASE TABLE", "schema": "CMS_HCC", "name": "_VALUE_SET_DISEASE_HIERARCHY", "database": "DEV_SARAH", "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-11-28 23:49UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 3072.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 72.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.the_tuva_project.cms_hcc__disease_hierarchy"}, "model.the_tuva_project.financial_pmpm__pmpm_prep": {"metadata": {"type": "BASE TABLE", "schema": "FINANCIAL_PMPM", "name": "PMPM_PREP", "database": "DEV_SARAH", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"PATIENT_ID": {"type": "TEXT", "index": 1, "name": "PATIENT_ID", "comment": null}, "YEAR_MONTH": {"type": "TEXT", "index": 2, "name": "YEAR_MONTH", "comment": null}, "PAYER": {"type": "TEXT", "index": 3, "name": "PAYER", "comment": null}, "PLAN": {"type": "TEXT", "index": 4, "name": "PLAN", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 5, "name": "DATA_SOURCE", "comment": null}, "INPATIENT_PAID": {"type": "NUMBER", "index": 6, "name": "INPATIENT_PAID", "comment": null}, "OUTPATIENT_PAID": {"type": "NUMBER", "index": 7, "name": "OUTPATIENT_PAID", "comment": null}, "OFFICE_VISIT_PAID": {"type": "NUMBER", "index": 8, "name": "OFFICE_VISIT_PAID", "comment": null}, "ANCILLARY_PAID": {"type": "NUMBER", "index": 9, "name": "ANCILLARY_PAID", "comment": null}, "PHARMACY_PAID": {"type": "NUMBER", "index": 10, "name": "PHARMACY_PAID", "comment": null}, "OTHER_PAID": {"type": "NUMBER", "index": 11, "name": "OTHER_PAID", "comment": null}, "ACUTE_INPATIENT_PAID": {"type": "NUMBER", "index": 12, "name": "ACUTE_INPATIENT_PAID", "comment": null}, "AMBULANCE_PAID": {"type": "NUMBER", "index": 13, "name": "AMBULANCE_PAID", "comment": null}, "AMBULATORY_SURGERY_PAID": {"type": "NUMBER", "index": 14, "name": "AMBULATORY_SURGERY_PAID", "comment": null}, "DIALYSIS_PAID": {"type": "NUMBER", "index": 15, "name": "DIALYSIS_PAID", "comment": null}, "DURABLE_MEDICAL_EQUIPMENT_PAID": {"type": "NUMBER", "index": 16, "name": "DURABLE_MEDICAL_EQUIPMENT_PAID", "comment": null}, "EMERGENCY_DEPARTMENT_PAID": {"type": "NUMBER", "index": 17, "name": "EMERGENCY_DEPARTMENT_PAID", "comment": null}, "HOME_HEALTH_PAID": {"type": "NUMBER", "index": 18, "name": "HOME_HEALTH_PAID", "comment": null}, "HOSPICE_PAID": {"type": "NUMBER", "index": 19, "name": "HOSPICE_PAID", "comment": null}, "INPATIENT_PSYCHIATRIC_PAID": {"type": "NUMBER", "index": 20, "name": "INPATIENT_PSYCHIATRIC_PAID", "comment": null}, "INPATIENT_REHABILITATION_PAID": {"type": "NUMBER", "index": 21, "name": "INPATIENT_REHABILITATION_PAID", "comment": null}, "LAB_PAID": {"type": "NUMBER", "index": 22, "name": "LAB_PAID", "comment": null}, "OFFICE_VISIT_PAID_2": {"type": "NUMBER", "index": 23, "name": "OFFICE_VISIT_PAID_2", "comment": null}, "OUTPATIENT_HOSPITAL_OR_CLINIC_PAID": {"type": "NUMBER", "index": 24, "name": "OUTPATIENT_HOSPITAL_OR_CLINIC_PAID", "comment": null}, "OUTPATIENT_PSYCHIATRIC_PAID": {"type": "NUMBER", "index": 25, "name": "OUTPATIENT_PSYCHIATRIC_PAID", "comment": null}, "OUTPATIENT_REHABILITATION_PAID": {"type": "NUMBER", "index": 26, "name": "OUTPATIENT_REHABILITATION_PAID", "comment": null}, "SKILLED_NURSING_PAID": {"type": "NUMBER", "index": 27, "name": "SKILLED_NURSING_PAID", "comment": null}, "URGENT_CARE_PAID": {"type": "NUMBER", "index": 28, "name": "URGENT_CARE_PAID", "comment": null}, "INPATIENT_ALLOWED": {"type": "NUMBER", "index": 29, "name": "INPATIENT_ALLOWED", "comment": null}, "OUTPATIENT_ALLOWED": {"type": "NUMBER", "index": 30, "name": "OUTPATIENT_ALLOWED", "comment": null}, "OFFICE_VISIT_ALLOWED": {"type": "NUMBER", "index": 31, "name": "OFFICE_VISIT_ALLOWED", "comment": null}, "ANCILLARY_ALLOWED": {"type": "NUMBER", "index": 32, "name": "ANCILLARY_ALLOWED", "comment": null}, "PHARMACY_ALLOWED": {"type": "NUMBER", "index": 33, "name": "PHARMACY_ALLOWED", "comment": null}, "OTHER_ALLOWED": {"type": "NUMBER", "index": 34, "name": "OTHER_ALLOWED", "comment": null}, "ACUTE_INPATIENT_ALLOWED": {"type": "NUMBER", "index": 35, "name": "ACUTE_INPATIENT_ALLOWED", "comment": null}, "AMBULANCE_ALLOWED": {"type": "NUMBER", "index": 36, "name": "AMBULANCE_ALLOWED", "comment": null}, "AMBULATORY_SURGERY_ALLOWED": {"type": "NUMBER", "index": 37, "name": "AMBULATORY_SURGERY_ALLOWED", "comment": null}, "DIALYSIS_ALLOWED": {"type": "NUMBER", "index": 38, "name": "DIALYSIS_ALLOWED", "comment": null}, "DURABLE_MEDICAL_EQUIPMENT_ALLOWED": {"type": "NUMBER", "index": 39, "name": "DURABLE_MEDICAL_EQUIPMENT_ALLOWED", "comment": null}, "EMERGENCY_DEPARTMENT_ALLOWED": {"type": "NUMBER", "index": 40, "name": "EMERGENCY_DEPARTMENT_ALLOWED", "comment": null}, "HOME_HEALTH_ALLOWED": {"type": "NUMBER", "index": 41, "name": "HOME_HEALTH_ALLOWED", "comment": null}, "HOSPICE_ALLOWED": {"type": "NUMBER", "index": 42, "name": "HOSPICE_ALLOWED", "comment": null}, "INPATIENT_PSYCHIATRIC_ALLOWED": {"type": "NUMBER", "index": 43, "name": "INPATIENT_PSYCHIATRIC_ALLOWED", "comment": null}, "INPATIENT_REHABILITATION_ALLOWED": {"type": "NUMBER", "index": 44, "name": "INPATIENT_REHABILITATION_ALLOWED", "comment": null}, "LAB_ALLOWED": {"type": "NUMBER", "index": 45, "name": "LAB_ALLOWED", "comment": null}, "OFFICE_VISIT_ALLOWED_2": {"type": "NUMBER", "index": 46, "name": "OFFICE_VISIT_ALLOWED_2", "comment": null}, "OUTPATIENT_HOSPITAL_OR_CLINIC_ALLOWED": {"type": "NUMBER", "index": 47, "name": "OUTPATIENT_HOSPITAL_OR_CLINIC_ALLOWED", "comment": null}, "OUTPATIENT_PSYCHIATRIC_ALLOWED": {"type": "NUMBER", "index": 48, "name": "OUTPATIENT_PSYCHIATRIC_ALLOWED", "comment": null}, "OUTPATIENT_REHABILITATION_ALLOWED": {"type": "NUMBER", "index": 49, "name": "OUTPATIENT_REHABILITATION_ALLOWED", "comment": null}, "SKILLED_NURSING_ALLOWED": {"type": "NUMBER", "index": 50, "name": "SKILLED_NURSING_ALLOWED", "comment": null}, "URGENT_CARE_ALLOWED": {"type": "NUMBER", "index": 51, "name": "URGENT_CARE_ALLOWED", "comment": null}, "TOTAL_PAID": {"type": "NUMBER", "index": 52, "name": "TOTAL_PAID", "comment": null}, "MEDICAL_PAID": {"type": "NUMBER", "index": 53, "name": "MEDICAL_PAID", "comment": null}, "TOTAL_ALLOWED": {"type": "NUMBER", "index": 54, "name": "TOTAL_ALLOWED", "comment": null}, "MEDICAL_ALLOWED": {"type": "NUMBER", "index": 55, "name": "MEDICAL_ALLOWED", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 56, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-11-28 23:51UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.financial_pmpm__pmpm_prep"}, "model.the_tuva_project.emergency_department__int_institutional_claims": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_EMERGENCY_DEPARTMENT_INSTITUTIONAL_CLAIMS", "database": "DEV_SARAH", "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-11-28 23:51UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.emergency_department__int_institutional_claims"}, "seed.the_tuva_project.chronic_conditions__tuva_chronic_conditions_hierarchy": {"metadata": {"type": "BASE TABLE", "schema": "CHRONIC_CONDITIONS", "name": "_VALUE_SET_TUVA_CHRONIC_CONDITIONS_HIERARCHY", "database": "DEV_SARAH", "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-11-28 23:49UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 35840.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 1583.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.the_tuva_project.chronic_conditions__tuva_chronic_conditions_hierarchy"}, "model.the_tuva_project.core__stg_claims_eligibility": {"metadata": {"type": "VIEW", "schema": "CORE", "name": "_STG_CLAIMS_ELIGIBILITY", "database": "DEV_SARAH", "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}, "BIRTH_DATE": {"type": "DATE", "index": 3, "name": "BIRTH_DATE", "comment": null}, "DEATH_DATE": {"type": "DATE", "index": 4, "name": "DEATH_DATE", "comment": null}, "ENROLLMENT_START_DATE": {"type": "DATE", "index": 5, "name": "ENROLLMENT_START_DATE", "comment": null}, "ENROLLMENT_END_DATE": {"type": "DATE", "index": 6, "name": "ENROLLMENT_END_DATE", "comment": null}, "PAYER": {"type": "TEXT", "index": 7, "name": "PAYER", "comment": null}, "PAYER_TYPE": {"type": "TEXT", "index": 8, "name": "PAYER_TYPE", "comment": null}, "PLAN": {"type": "TEXT", "index": 9, "name": "PLAN", "comment": null}, "ORIGINAL_REASON_ENTITLEMENT_CODE": {"type": "TEXT", "index": 10, "name": "ORIGINAL_REASON_ENTITLEMENT_CODE", "comment": null}, "DUAL_STATUS_CODE": {"type": "TEXT", "index": 11, "name": "DUAL_STATUS_CODE", "comment": null}, "MEDICARE_STATUS_CODE": {"type": "TEXT", "index": 12, "name": "MEDICARE_STATUS_CODE", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 13, "name": "DATA_SOURCE", "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.core__stg_claims_eligibility"}, "seed.the_tuva_project.ed_classification__icd_10_cm_to_ccs": {"metadata": {"type": "BASE TABLE", "schema": "ED_CLASSIFICATION", "name": "_VALUE_SET_ICD_10_CM_TO_CCS", "database": "DEV_SARAH", "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-11-28 23:49UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 1313792.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 72776.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.the_tuva_project.ed_classification__icd_10_cm_to_ccs"}, "model.the_tuva_project.data_profiling__professional_header_failures": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_PROFESSIONAL_HEADER_FAILURES", "database": "DEV_SARAH", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"CLAIM_ID": {"type": "TEXT", "index": 1, "name": "CLAIM_ID", "comment": null}, "CLAIM_LINE_NUMBER": {"type": "NUMBER", "index": 2, "name": "CLAIM_LINE_NUMBER", "comment": null}, "CLAIM_TYPE": {"type": "TEXT", "index": 3, "name": "CLAIM_TYPE", "comment": null}, "PATIENT_ID": {"type": "TEXT", "index": 4, "name": "PATIENT_ID", "comment": null}, "MEMBER_ID": {"type": "TEXT", "index": 5, "name": "MEMBER_ID", "comment": null}, "PAYER": {"type": "TEXT", "index": 6, "name": "PAYER", "comment": null}, "PLAN": {"type": "TEXT", "index": 7, "name": "PLAN", "comment": null}, "CLAIM_START_DATE": {"type": "DATE", "index": 8, "name": "CLAIM_START_DATE", "comment": null}, "CLAIM_END_DATE": {"type": "DATE", "index": 9, "name": "CLAIM_END_DATE", "comment": null}, "CLAIM_LINE_START_DATE": {"type": "DATE", "index": 10, "name": "CLAIM_LINE_START_DATE", "comment": null}, "CLAIM_LINE_END_DATE": {"type": "DATE", "index": 11, "name": "CLAIM_LINE_END_DATE", "comment": null}, "ADMISSION_DATE": {"type": "DATE", "index": 12, "name": "ADMISSION_DATE", "comment": null}, "DISCHARGE_DATE": {"type": "DATE", "index": 13, "name": "DISCHARGE_DATE", "comment": null}, "ADMIT_SOURCE_CODE": {"type": "TEXT", "index": 14, "name": "ADMIT_SOURCE_CODE", "comment": null}, "ADMIT_TYPE_CODE": {"type": "TEXT", "index": 15, "name": "ADMIT_TYPE_CODE", "comment": null}, "DISCHARGE_DISPOSITION_CODE": {"type": "TEXT", "index": 16, "name": "DISCHARGE_DISPOSITION_CODE", "comment": null}, "PLACE_OF_SERVICE_CODE": {"type": "TEXT", "index": 17, "name": "PLACE_OF_SERVICE_CODE", "comment": null}, "BILL_TYPE_CODE": {"type": "TEXT", "index": 18, "name": "BILL_TYPE_CODE", "comment": null}, "MS_DRG_CODE": {"type": "TEXT", "index": 19, "name": "MS_DRG_CODE", "comment": null}, "APR_DRG_CODE": {"type": "TEXT", "index": 20, "name": "APR_DRG_CODE", "comment": null}, "REVENUE_CENTER_CODE": {"type": "TEXT", "index": 21, "name": "REVENUE_CENTER_CODE", "comment": null}, "SERVICE_UNIT_QUANTITY": {"type": "NUMBER", "index": 22, "name": "SERVICE_UNIT_QUANTITY", "comment": null}, "HCPCS_CODE": {"type": "TEXT", "index": 23, "name": "HCPCS_CODE", "comment": null}, "HCPCS_MODIFIER_1": {"type": "TEXT", "index": 24, "name": "HCPCS_MODIFIER_1", "comment": null}, "HCPCS_MODIFIER_2": {"type": "TEXT", "index": 25, "name": "HCPCS_MODIFIER_2", "comment": null}, "HCPCS_MODIFIER_3": {"type": "TEXT", "index": 26, "name": "HCPCS_MODIFIER_3", "comment": null}, "HCPCS_MODIFIER_4": {"type": "TEXT", "index": 27, "name": "HCPCS_MODIFIER_4", "comment": null}, "HCPCS_MODIFIER_5": {"type": "TEXT", "index": 28, "name": "HCPCS_MODIFIER_5", "comment": null}, "RENDERING_NPI": {"type": "TEXT", "index": 29, "name": "RENDERING_NPI", "comment": null}, "BILLING_NPI": {"type": "TEXT", "index": 30, "name": "BILLING_NPI", "comment": null}, "FACILITY_NPI": {"type": "TEXT", "index": 31, "name": "FACILITY_NPI", "comment": null}, "PAID_DATE": {"type": "DATE", "index": 32, "name": "PAID_DATE", "comment": null}, "PAID_AMOUNT": {"type": "FLOAT", "index": 33, "name": "PAID_AMOUNT", "comment": null}, "ALLOWED_AMOUNT": {"type": "FLOAT", "index": 34, "name": "ALLOWED_AMOUNT", "comment": null}, "CHARGE_AMOUNT": {"type": "FLOAT", "index": 35, "name": "CHARGE_AMOUNT", "comment": null}, "COINSURANCE_AMOUNT": {"type": "FLOAT", "index": 36, "name": "COINSURANCE_AMOUNT", "comment": null}, "COPAYMENT_AMOUNT": {"type": "FLOAT", "index": 37, "name": "COPAYMENT_AMOUNT", "comment": null}, "DEDUCTIBLE_AMOUNT": {"type": "FLOAT", "index": 38, "name": "DEDUCTIBLE_AMOUNT", "comment": null}, "TOTAL_COST_AMOUNT": {"type": "FLOAT", "index": 39, "name": "TOTAL_COST_AMOUNT", "comment": null}, "DIAGNOSIS_CODE_TYPE": {"type": "TEXT", "index": 40, "name": "DIAGNOSIS_CODE_TYPE", "comment": null}, "DIAGNOSIS_CODE_1": {"type": "TEXT", "index": 41, "name": "DIAGNOSIS_CODE_1", "comment": null}, "DIAGNOSIS_CODE_2": {"type": "TEXT", "index": 42, "name": "DIAGNOSIS_CODE_2", "comment": null}, "DIAGNOSIS_CODE_3": {"type": "TEXT", "index": 43, "name": "DIAGNOSIS_CODE_3", "comment": null}, "DIAGNOSIS_CODE_4": {"type": "TEXT", "index": 44, "name": "DIAGNOSIS_CODE_4", "comment": null}, "DIAGNOSIS_CODE_5": {"type": "TEXT", "index": 45, "name": "DIAGNOSIS_CODE_5", "comment": null}, "DIAGNOSIS_CODE_6": {"type": "TEXT", "index": 46, "name": "DIAGNOSIS_CODE_6", "comment": null}, "DIAGNOSIS_CODE_7": {"type": "TEXT", "index": 47, "name": "DIAGNOSIS_CODE_7", "comment": null}, "DIAGNOSIS_CODE_8": {"type": "TEXT", "index": 48, "name": "DIAGNOSIS_CODE_8", "comment": null}, "DIAGNOSIS_CODE_9": {"type": "TEXT", "index": 49, "name": "DIAGNOSIS_CODE_9", "comment": null}, "DIAGNOSIS_CODE_10": {"type": "TEXT", "index": 50, "name": "DIAGNOSIS_CODE_10", "comment": null}, "DIAGNOSIS_CODE_11": {"type": "TEXT", "index": 51, "name": "DIAGNOSIS_CODE_11", "comment": null}, "DIAGNOSIS_CODE_12": {"type": "TEXT", "index": 52, "name": "DIAGNOSIS_CODE_12", "comment": null}, "DIAGNOSIS_CODE_13": {"type": "TEXT", "index": 53, "name": "DIAGNOSIS_CODE_13", "comment": null}, "DIAGNOSIS_CODE_14": {"type": "TEXT", "index": 54, "name": "DIAGNOSIS_CODE_14", "comment": null}, "DIAGNOSIS_CODE_15": {"type": "TEXT", "index": 55, "name": "DIAGNOSIS_CODE_15", "comment": null}, "DIAGNOSIS_CODE_16": {"type": "TEXT", "index": 56, "name": "DIAGNOSIS_CODE_16", "comment": null}, "DIAGNOSIS_CODE_17": {"type": "TEXT", "index": 57, "name": "DIAGNOSIS_CODE_17", "comment": null}, "DIAGNOSIS_CODE_18": {"type": "TEXT", "index": 58, "name": "DIAGNOSIS_CODE_18", "comment": null}, "DIAGNOSIS_CODE_19": {"type": "TEXT", "index": 59, "name": "DIAGNOSIS_CODE_19", "comment": null}, "DIAGNOSIS_CODE_20": {"type": "TEXT", "index": 60, "name": "DIAGNOSIS_CODE_20", "comment": null}, "DIAGNOSIS_CODE_21": {"type": "TEXT", "index": 61, "name": "DIAGNOSIS_CODE_21", "comment": null}, "DIAGNOSIS_CODE_22": {"type": "TEXT", "index": 62, "name": "DIAGNOSIS_CODE_22", "comment": null}, "DIAGNOSIS_CODE_23": {"type": "TEXT", "index": 63, "name": "DIAGNOSIS_CODE_23", "comment": null}, "DIAGNOSIS_CODE_24": {"type": "TEXT", "index": 64, "name": "DIAGNOSIS_CODE_24", "comment": null}, "DIAGNOSIS_CODE_25": {"type": "TEXT", "index": 65, "name": "DIAGNOSIS_CODE_25", "comment": null}, "DIAGNOSIS_POA_1": {"type": "TEXT", "index": 66, "name": "DIAGNOSIS_POA_1", "comment": null}, "DIAGNOSIS_POA_2": {"type": "TEXT", "index": 67, "name": "DIAGNOSIS_POA_2", "comment": null}, "DIAGNOSIS_POA_3": {"type": "TEXT", "index": 68, "name": "DIAGNOSIS_POA_3", "comment": null}, "DIAGNOSIS_POA_4": {"type": "TEXT", "index": 69, "name": "DIAGNOSIS_POA_4", "comment": null}, "DIAGNOSIS_POA_5": {"type": "TEXT", "index": 70, "name": "DIAGNOSIS_POA_5", "comment": null}, "DIAGNOSIS_POA_6": {"type": "TEXT", "index": 71, "name": "DIAGNOSIS_POA_6", "comment": null}, "DIAGNOSIS_POA_7": {"type": "TEXT", "index": 72, "name": "DIAGNOSIS_POA_7", "comment": null}, "DIAGNOSIS_POA_8": {"type": "TEXT", "index": 73, "name": "DIAGNOSIS_POA_8", "comment": null}, "DIAGNOSIS_POA_9": {"type": "TEXT", "index": 74, "name": "DIAGNOSIS_POA_9", "comment": null}, "DIAGNOSIS_POA_10": {"type": "TEXT", "index": 75, "name": "DIAGNOSIS_POA_10", "comment": null}, "DIAGNOSIS_POA_11": {"type": "TEXT", "index": 76, "name": "DIAGNOSIS_POA_11", "comment": null}, "DIAGNOSIS_POA_12": {"type": "TEXT", "index": 77, "name": "DIAGNOSIS_POA_12", "comment": null}, "DIAGNOSIS_POA_13": {"type": "TEXT", "index": 78, "name": "DIAGNOSIS_POA_13", "comment": null}, "DIAGNOSIS_POA_14": {"type": "TEXT", "index": 79, "name": "DIAGNOSIS_POA_14", "comment": null}, "DIAGNOSIS_POA_15": {"type": "TEXT", "index": 80, "name": "DIAGNOSIS_POA_15", "comment": null}, "DIAGNOSIS_POA_16": {"type": "TEXT", "index": 81, "name": "DIAGNOSIS_POA_16", "comment": null}, "DIAGNOSIS_POA_17": {"type": "TEXT", "index": 82, "name": "DIAGNOSIS_POA_17", "comment": null}, "DIAGNOSIS_POA_18": {"type": "TEXT", "index": 83, "name": "DIAGNOSIS_POA_18", "comment": null}, "DIAGNOSIS_POA_19": {"type": "TEXT", "index": 84, "name": "DIAGNOSIS_POA_19", "comment": null}, "DIAGNOSIS_POA_20": {"type": "TEXT", "index": 85, "name": "DIAGNOSIS_POA_20", "comment": null}, "DIAGNOSIS_POA_21": {"type": "TEXT", "index": 86, "name": "DIAGNOSIS_POA_21", "comment": null}, "DIAGNOSIS_POA_22": {"type": "TEXT", "index": 87, "name": "DIAGNOSIS_POA_22", "comment": null}, "DIAGNOSIS_POA_23": {"type": "TEXT", "index": 88, "name": "DIAGNOSIS_POA_23", "comment": null}, "DIAGNOSIS_POA_24": {"type": "TEXT", "index": 89, "name": "DIAGNOSIS_POA_24", "comment": null}, "DIAGNOSIS_POA_25": {"type": "TEXT", "index": 90, "name": "DIAGNOSIS_POA_25", "comment": null}, "PROCEDURE_CODE_TYPE": {"type": "TEXT", "index": 91, "name": "PROCEDURE_CODE_TYPE", "comment": null}, "PROCEDURE_CODE_1": {"type": "TEXT", "index": 92, "name": "PROCEDURE_CODE_1", "comment": null}, "PROCEDURE_CODE_2": {"type": "TEXT", "index": 93, "name": "PROCEDURE_CODE_2", "comment": null}, "PROCEDURE_CODE_3": {"type": "TEXT", "index": 94, "name": "PROCEDURE_CODE_3", "comment": null}, "PROCEDURE_CODE_4": {"type": "TEXT", "index": 95, "name": "PROCEDURE_CODE_4", "comment": null}, "PROCEDURE_CODE_5": {"type": "TEXT", "index": 96, "name": "PROCEDURE_CODE_5", "comment": null}, "PROCEDURE_CODE_6": {"type": "TEXT", "index": 97, "name": "PROCEDURE_CODE_6", "comment": null}, "PROCEDURE_CODE_7": {"type": "TEXT", "index": 98, "name": "PROCEDURE_CODE_7", "comment": null}, "PROCEDURE_CODE_8": {"type": "TEXT", "index": 99, "name": "PROCEDURE_CODE_8", "comment": null}, "PROCEDURE_CODE_9": {"type": "TEXT", "index": 100, "name": "PROCEDURE_CODE_9", "comment": null}, "PROCEDURE_CODE_10": {"type": "TEXT", "index": 101, "name": "PROCEDURE_CODE_10", "comment": null}, "PROCEDURE_CODE_11": {"type": "TEXT", "index": 102, "name": "PROCEDURE_CODE_11", "comment": null}, "PROCEDURE_CODE_12": {"type": "TEXT", "index": 103, "name": "PROCEDURE_CODE_12", "comment": null}, "PROCEDURE_CODE_13": {"type": "TEXT", "index": 104, "name": "PROCEDURE_CODE_13", "comment": null}, "PROCEDURE_CODE_14": {"type": "TEXT", "index": 105, "name": "PROCEDURE_CODE_14", "comment": null}, "PROCEDURE_CODE_15": {"type": "TEXT", "index": 106, "name": "PROCEDURE_CODE_15", "comment": null}, "PROCEDURE_CODE_16": {"type": "TEXT", "index": 107, "name": "PROCEDURE_CODE_16", "comment": null}, "PROCEDURE_CODE_17": {"type": "TEXT", "index": 108, "name": "PROCEDURE_CODE_17", "comment": null}, "PROCEDURE_CODE_18": {"type": "TEXT", "index": 109, "name": "PROCEDURE_CODE_18", "comment": null}, "PROCEDURE_CODE_19": {"type": "TEXT", "index": 110, "name": "PROCEDURE_CODE_19", "comment": null}, "PROCEDURE_CODE_20": {"type": "TEXT", "index": 111, "name": "PROCEDURE_CODE_20", "comment": null}, "PROCEDURE_CODE_21": {"type": "TEXT", "index": 112, "name": "PROCEDURE_CODE_21", "comment": null}, "PROCEDURE_CODE_22": {"type": "TEXT", "index": 113, "name": "PROCEDURE_CODE_22", "comment": null}, "PROCEDURE_CODE_23": {"type": "TEXT", "index": 114, "name": "PROCEDURE_CODE_23", "comment": null}, "PROCEDURE_CODE_24": {"type": "TEXT", "index": 115, "name": "PROCEDURE_CODE_24", "comment": null}, "PROCEDURE_CODE_25": {"type": "TEXT", "index": 116, "name": "PROCEDURE_CODE_25", "comment": null}, "PROCEDURE_DATE_1": {"type": "DATE", "index": 117, "name": "PROCEDURE_DATE_1", "comment": null}, "PROCEDURE_DATE_2": {"type": "DATE", "index": 118, "name": "PROCEDURE_DATE_2", "comment": null}, "PROCEDURE_DATE_3": {"type": "DATE", "index": 119, "name": "PROCEDURE_DATE_3", "comment": null}, "PROCEDURE_DATE_4": {"type": "DATE", "index": 120, "name": "PROCEDURE_DATE_4", "comment": null}, "PROCEDURE_DATE_5": {"type": "DATE", "index": 121, "name": "PROCEDURE_DATE_5", "comment": null}, "PROCEDURE_DATE_6": {"type": "DATE", "index": 122, "name": "PROCEDURE_DATE_6", "comment": null}, "PROCEDURE_DATE_7": {"type": "DATE", "index": 123, "name": "PROCEDURE_DATE_7", "comment": null}, "PROCEDURE_DATE_8": {"type": "DATE", "index": 124, "name": "PROCEDURE_DATE_8", "comment": null}, "PROCEDURE_DATE_9": {"type": "DATE", "index": 125, "name": "PROCEDURE_DATE_9", "comment": null}, "PROCEDURE_DATE_10": {"type": "DATE", "index": 126, "name": "PROCEDURE_DATE_10", "comment": null}, "PROCEDURE_DATE_11": {"type": "DATE", "index": 127, "name": "PROCEDURE_DATE_11", "comment": null}, "PROCEDURE_DATE_12": {"type": "DATE", "index": 128, "name": "PROCEDURE_DATE_12", "comment": null}, "PROCEDURE_DATE_13": {"type": "DATE", "index": 129, "name": "PROCEDURE_DATE_13", "comment": null}, "PROCEDURE_DATE_14": {"type": "DATE", "index": 130, "name": "PROCEDURE_DATE_14", "comment": null}, "PROCEDURE_DATE_15": {"type": "DATE", "index": 131, "name": "PROCEDURE_DATE_15", "comment": null}, "PROCEDURE_DATE_16": {"type": "DATE", "index": 132, "name": "PROCEDURE_DATE_16", "comment": null}, "PROCEDURE_DATE_17": {"type": "DATE", "index": 133, "name": "PROCEDURE_DATE_17", "comment": null}, "PROCEDURE_DATE_18": {"type": "DATE", "index": 134, "name": "PROCEDURE_DATE_18", "comment": null}, "PROCEDURE_DATE_19": {"type": "DATE", "index": 135, "name": "PROCEDURE_DATE_19", "comment": null}, "PROCEDURE_DATE_20": {"type": "DATE", "index": 136, "name": "PROCEDURE_DATE_20", "comment": null}, "PROCEDURE_DATE_21": {"type": "DATE", "index": 137, "name": "PROCEDURE_DATE_21", "comment": null}, "PROCEDURE_DATE_22": {"type": "DATE", "index": 138, "name": "PROCEDURE_DATE_22", "comment": null}, "PROCEDURE_DATE_23": {"type": "DATE", "index": 139, "name": "PROCEDURE_DATE_23", "comment": null}, "PROCEDURE_DATE_24": {"type": "DATE", "index": 140, "name": "PROCEDURE_DATE_24", "comment": null}, "PROCEDURE_DATE_25": {"type": "DATE", "index": 141, "name": "PROCEDURE_DATE_25", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 142, "name": "DATA_SOURCE", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 143, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-11-28 23:50UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.data_profiling__professional_header_failures"}, "model.the_tuva_project.quality_measures__int_nqf0034_numerator": {"metadata": {"type": "BASE TABLE", "schema": "QUALITY_MEASURES", "name": "_INT_NQF0034_NUMERATOR", "database": "DEV_SARAH", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"PATIENT_ID": {"type": "TEXT", "index": 1, "name": "PATIENT_ID", "comment": null}, "EVIDENCE_DATE": {"type": "DATE", "index": 2, "name": "EVIDENCE_DATE", "comment": null}, "EVIDENCE": {"type": "TEXT", "index": 3, "name": "EVIDENCE", "comment": null}}, "stats": {"last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-11-28 23:51UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.quality_measures__int_nqf0034_numerator"}, "model.the_tuva_project.financial_pmpm__service_category_1_allowed_pivot": {"metadata": {"type": "BASE TABLE", "schema": "FINANCIAL_PMPM", "name": "_INT_SERVICE_CATEGORY_1_ALLOWED_PIVOT", "database": "DEV_SARAH", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"PATIENT_ID": {"type": "TEXT", "index": 1, "name": "PATIENT_ID", "comment": null}, "YEAR_MONTH": {"type": "TEXT", "index": 2, "name": "YEAR_MONTH", "comment": null}, "PAYER": {"type": "TEXT", "index": 3, "name": "PAYER", "comment": null}, "PLAN": {"type": "TEXT", "index": 4, "name": "PLAN", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 5, "name": "DATA_SOURCE", "comment": null}, "INPATIENT_ALLOWED": {"type": "NUMBER", "index": 6, "name": "INPATIENT_ALLOWED", "comment": null}, "OUTPATIENT_ALLOWED": {"type": "NUMBER", "index": 7, "name": "OUTPATIENT_ALLOWED", "comment": null}, "OFFICE_VISIT_ALLOWED": {"type": "NUMBER", "index": 8, "name": "OFFICE_VISIT_ALLOWED", "comment": null}, "ANCILLARY_ALLOWED": {"type": "NUMBER", "index": 9, "name": "ANCILLARY_ALLOWED", "comment": null}, "OTHER_ALLOWED": {"type": "NUMBER", "index": 10, "name": "OTHER_ALLOWED", "comment": null}, "PHARMACY_ALLOWED": {"type": "NUMBER", "index": 11, "name": "PHARMACY_ALLOWED", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 12, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-11-28 23:51UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.financial_pmpm__service_category_1_allowed_pivot"}, "model.the_tuva_project.data_profiling__medical_claim_plausibility": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_MEDICAL_CLAIM_PLAUSIBILITY", "database": "DEV_SARAH", "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-11-28 23:50UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.data_profiling__medical_claim_plausibility"}, "model.the_tuva_project.service_category__outpatient_psychiatric_professional": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_OUTPATIENT_PSYCHIATRIC_PROFESSIONAL", "database": "DEV_SARAH", "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-11-28 23:51UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.service_category__outpatient_psychiatric_professional"}, "model.the_tuva_project.ccsr__long_condition_category": {"metadata": {"type": "BASE TABLE", "schema": "CCSR", "name": "LONG_CONDITION_CATEGORY", "database": "DEV_SARAH", "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-11-28 23:51UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.ccsr__long_condition_category"}, "model.the_tuva_project.core__stg_clinical_patient": {"metadata": {"type": "VIEW", "schema": "CORE", "name": "_STG_CLINICAL_PATIENT", "database": "DEV_SARAH", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"PATIENT_ID": {"type": "TEXT", "index": 1, "name": "PATIENT_ID", "comment": null}, "FIRST_NAME": {"type": "TEXT", "index": 2, "name": "FIRST_NAME", "comment": null}, "LAST_NAME": {"type": "TEXT", "index": 3, "name": "LAST_NAME", "comment": null}, "SEX": {"type": "TEXT", "index": 4, "name": "SEX", "comment": null}, "RACE": {"type": "TEXT", "index": 5, "name": "RACE", "comment": null}, "BIRTH_DATE": {"type": "DATE", "index": 6, "name": "BIRTH_DATE", "comment": null}, "DEATH_DATE": {"type": "DATE", "index": 7, "name": "DEATH_DATE", "comment": null}, "DEATH_FLAG": {"type": "NUMBER", "index": 8, "name": "DEATH_FLAG", "comment": null}, "ADDRESS": {"type": "TEXT", "index": 9, "name": "ADDRESS", "comment": null}, "CITY": {"type": "TEXT", "index": 10, "name": "CITY", "comment": null}, "STATE": {"type": "TEXT", "index": 11, "name": "STATE", "comment": null}, "ZIP_CODE": {"type": "TEXT", "index": 12, "name": "ZIP_CODE", "comment": null}, "COUNTY": {"type": "TEXT", "index": 13, "name": "COUNTY", "comment": null}, "LATITUDE": {"type": "FLOAT", "index": 14, "name": "LATITUDE", "comment": null}, "LONGITUDE": {"type": "FLOAT", "index": 15, "name": "LONGITUDE", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 16, "name": "DATA_SOURCE", "comment": null}, "TUVA_LAST_RUN": {"type": "TIMESTAMP_NTZ", "index": 17, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.core__stg_clinical_patient"}, "seed.the_tuva_project.terminology__icd_9_pcs": {"metadata": {"type": "BASE TABLE", "schema": "TERMINOLOGY", "name": "ICD_9_PCS", "database": "DEV_SARAH", "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-11-28 23:50UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 105984.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 3882.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.the_tuva_project.terminology__icd_9_pcs"}, "model.the_tuva_project.core__stg_clinical_encounter": {"metadata": {"type": "VIEW", "schema": "CORE", "name": "_STG_CLINICAL_ENCOUNTER", "database": "DEV_SARAH", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"ENCOUNTER_ID": {"type": "TEXT", "index": 1, "name": "ENCOUNTER_ID", "comment": null}, "PATIENT_ID": {"type": "TEXT", "index": 2, "name": "PATIENT_ID", "comment": null}, "ENCOUNTER_TYPE": {"type": "TEXT", "index": 3, "name": "ENCOUNTER_TYPE", "comment": null}, "ENCOUNTER_START_DATE": {"type": "DATE", "index": 4, "name": "ENCOUNTER_START_DATE", "comment": null}, "ENCOUNTER_END_DATE": {"type": "DATE", "index": 5, "name": "ENCOUNTER_END_DATE", "comment": null}, "LENGTH_OF_STAY": {"type": "NUMBER", "index": 6, "name": "LENGTH_OF_STAY", "comment": null}, "ADMIT_SOURCE_CODE": {"type": "TEXT", "index": 7, "name": "ADMIT_SOURCE_CODE", "comment": null}, "ADMIT_SOURCE_DESCRIPTION": {"type": "TEXT", "index": 8, "name": "ADMIT_SOURCE_DESCRIPTION", "comment": null}, "ADMIT_TYPE_CODE": {"type": "TEXT", "index": 9, "name": "ADMIT_TYPE_CODE", "comment": null}, "ADMIT_TYPE_DESCRIPTION": {"type": "TEXT", "index": 10, "name": "ADMIT_TYPE_DESCRIPTION", "comment": null}, "DISCHARGE_DISPOSITION_CODE": {"type": "TEXT", "index": 11, "name": "DISCHARGE_DISPOSITION_CODE", "comment": null}, "DISCHARGE_DISPOSITION_DESCRIPTION": {"type": "TEXT", "index": 12, "name": "DISCHARGE_DISPOSITION_DESCRIPTION", "comment": null}, "ATTENDING_PROVIDER_ID": {"type": "TEXT", "index": 13, "name": "ATTENDING_PROVIDER_ID", "comment": null}, "FACILITY_NPI": {"type": "TEXT", "index": 14, "name": "FACILITY_NPI", "comment": null}, "PRIMARY_DIAGNOSIS_CODE_TYPE": {"type": "TEXT", "index": 15, "name": "PRIMARY_DIAGNOSIS_CODE_TYPE", "comment": null}, "PRIMARY_DIAGNOSIS_CODE": {"type": "TEXT", "index": 16, "name": "PRIMARY_DIAGNOSIS_CODE", "comment": null}, "PRIMARY_DIAGNOSIS_DESCRIPTION": {"type": "TEXT", "index": 17, "name": "PRIMARY_DIAGNOSIS_DESCRIPTION", "comment": null}, "MS_DRG_CODE": {"type": "TEXT", "index": 18, "name": "MS_DRG_CODE", "comment": null}, "MS_DRG_DESCRIPTION": {"type": "TEXT", "index": 19, "name": "MS_DRG_DESCRIPTION", "comment": null}, "APR_DRG_CODE": {"type": "TEXT", "index": 20, "name": "APR_DRG_CODE", "comment": null}, "APR_DRG_DESCRIPTION": {"type": "TEXT", "index": 21, "name": "APR_DRG_DESCRIPTION", "comment": null}, "PAID_AMOUNT": {"type": "NUMBER", "index": 22, "name": "PAID_AMOUNT", "comment": null}, "ALLOWED_AMOUNT": {"type": "NUMBER", "index": 23, "name": "ALLOWED_AMOUNT", "comment": null}, "CHARGE_AMOUNT": {"type": "NUMBER", "index": 24, "name": "CHARGE_AMOUNT", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 25, "name": "DATA_SOURCE", "comment": null}, "TUVA_LAST_RUN": {"type": "TIMESTAMP_NTZ", "index": 26, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.core__stg_clinical_encounter"}, "model.the_tuva_project.core__stg_clinical_practitioner": {"metadata": {"type": "VIEW", "schema": "CORE", "name": "_STG_CLINICAL_PRACTITIONER", "database": "DEV_SARAH", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"PRACTITIONER_ID": {"type": "TEXT", "index": 1, "name": "PRACTITIONER_ID", "comment": null}, "NPI": {"type": "TEXT", "index": 2, "name": "NPI", "comment": null}, "FIRST_NAME": {"type": "TEXT", "index": 3, "name": "FIRST_NAME", "comment": null}, "LAST_NAME": {"type": "TEXT", "index": 4, "name": "LAST_NAME", "comment": null}, "PRACTICE_AFFILIATION": {"type": "TEXT", "index": 5, "name": "PRACTICE_AFFILIATION", "comment": null}, "SPECIALTY": {"type": "TEXT", "index": 6, "name": "SPECIALTY", "comment": null}, "SUB_SPECIALTY": {"type": "TEXT", "index": 7, "name": "SUB_SPECIALTY", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 8, "name": "DATA_SOURCE", "comment": null}, "TUVA_LAST_RUN": {"type": "TIMESTAMP_NTZ", "index": 9, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.core__stg_clinical_practitioner"}, "seed.the_tuva_project.terminology__payer_type": {"metadata": {"type": "BASE TABLE", "schema": "TERMINOLOGY", "name": "PAYER_TYPE", "database": "DEV_SARAH", "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-11-28 23:50UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 1024.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 4.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.the_tuva_project.terminology__payer_type"}, "model.the_tuva_project.acute_inpatient__professional_encounter_id": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_ACUTE_INPATIENT_PROFESSIONAL_ENCOUNTER_ID", "database": "DEV_SARAH", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"PATIENT_ID": {"type": "TEXT", "index": 1, "name": "PATIENT_ID", "comment": null}, "CLAIM_ID": {"type": "TEXT", "index": 2, "name": "CLAIM_ID", "comment": null}, "CLAIM_LINE_NUMBER": {"type": "NUMBER", "index": 3, "name": "CLAIM_LINE_NUMBER", "comment": null}, "START_DATE": {"type": "DATE", "index": 4, "name": "START_DATE", "comment": null}, "END_DATE": {"type": "DATE", "index": 5, "name": "END_DATE", "comment": null}, "ENCOUNTER_ID": {"type": "TEXT", "index": 6, "name": "ENCOUNTER_ID", "comment": null}, "ORPHAN_CLAIM_FLAG": {"type": "NUMBER", "index": 7, "name": "ORPHAN_CLAIM_FLAG", "comment": null}, "ENCOUNTER_COUNT": {"type": "NUMBER", "index": 8, "name": "ENCOUNTER_COUNT", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 9, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-11-28 23:51UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.acute_inpatient__professional_encounter_id"}, "model.the_tuva_project.readmissions__encounter_overlap": {"metadata": {"type": "VIEW", "schema": "READMISSIONS", "name": "_INT_ENCOUNTER_OVERLAP", "database": "DEV_SARAH", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"PATIENT_ID": {"type": "TEXT", "index": 1, "name": "PATIENT_ID", "comment": null}, "ENCOUNTER_ID_A": {"type": "TEXT", "index": 2, "name": "ENCOUNTER_ID_A", "comment": null}, "ENCOUNTER_ID_B": {"type": "TEXT", "index": 3, "name": "ENCOUNTER_ID_B", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 4, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.readmissions__encounter_overlap"}, "model.the_tuva_project.data_profiling__eligibility_duplicates": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_ELIGIBILITY_DUPLICATES", "database": "DEV_SARAH", "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-11-28 23:50UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.data_profiling__eligibility_duplicates"}, "seed.the_tuva_project.terminology__ethnicity": {"metadata": {"type": "BASE TABLE", "schema": "TERMINOLOGY", "name": "ETHNICITY", "database": "DEV_SARAH", "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-11-28 23:50UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 1536.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 4.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.the_tuva_project.terminology__ethnicity"}, "model.the_tuva_project.emergency_department__int_institutional_encounter_id": {"metadata": {"type": "VIEW", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_EMERGENCY_DEPARTMENT_INSTITUTIONAL_ENCOUNTER_ID", "database": "DEV_SARAH", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"PATIENT_ID": {"type": "TEXT", "index": 1, "name": "PATIENT_ID", "comment": null}, "CLAIM_ID": {"type": "TEXT", "index": 2, "name": "CLAIM_ID", "comment": null}, "START_DATE": {"type": "DATE", "index": 3, "name": "START_DATE", "comment": null}, "END_DATE": {"type": "DATE", "index": 4, "name": "END_DATE", "comment": null}, "DISCHARGE_DISPOSITION_CODE": {"type": "TEXT", "index": 5, "name": "DISCHARGE_DISPOSITION_CODE", "comment": null}, "FACILITY_NPI": {"type": "TEXT", "index": 6, "name": "FACILITY_NPI", "comment": null}, "ROW_NUM": {"type": "NUMBER", "index": 7, "name": "ROW_NUM", "comment": null}, "CLOSE_FLAG": {"type": "NUMBER", "index": 8, "name": "CLOSE_FLAG", "comment": null}, "MIN_CLOSING_ROW": {"type": "NUMBER", "index": 9, "name": "MIN_CLOSING_ROW", "comment": null}, "ENCOUNTER_ID": {"type": "TEXT", "index": 10, "name": "ENCOUNTER_ID", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 11, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.emergency_department__int_institutional_encounter_id"}, "model.the_tuva_project.service_category__combined_professional": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_COMBINED_PROFESSIONAL", "database": "DEV_SARAH", "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-11-28 23:51UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.service_category__combined_professional"}, "model.the_tuva_project.cms_hcc__int_all_conditions": {"metadata": {"type": "BASE TABLE", "schema": "CMS_HCC", "name": "_INT_ALL_CONDITIONS", "database": "DEV_SARAH", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"PATIENT_ID": {"type": "TEXT", "index": 1, "name": "PATIENT_ID", "comment": null}, "RECORDED_DATE": {"type": "DATE", "index": 2, "name": "RECORDED_DATE", "comment": null}, "CONDITION_TYPE": {"type": "TEXT", "index": 3, "name": "CONDITION_TYPE", "comment": null}, "ICD_10_CM_CODE": {"type": "TEXT", "index": 4, "name": "ICD_10_CM_CODE", "comment": null}, "HCC_CODE": {"type": "TEXT", "index": 5, "name": "HCC_CODE", "comment": null}, "HCC_DESCRIPTION": {"type": "TEXT", "index": 6, "name": "HCC_DESCRIPTION", "comment": null}, "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-11-28 23:51UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.cms_hcc__int_all_conditions"}, "seed.the_tuva_project.terminology__admit_type": {"metadata": {"type": "BASE TABLE", "schema": "TERMINOLOGY", "name": "ADMIT_TYPE", "database": "DEV_SARAH", "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-11-28 23:50UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 1536.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 9.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.the_tuva_project.terminology__admit_type"}, "seed.the_tuva_project.terminology__icd_9_cm": {"metadata": {"type": "BASE TABLE", "schema": "TERMINOLOGY", "name": "ICD_9_CM", "database": "DEV_SARAH", "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-11-28 23:50UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 390144.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 14567.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.the_tuva_project.terminology__icd_9_cm"}, "model.the_tuva_project.service_category__dme_professional": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_DME_PROFESSIONAL", "database": "DEV_SARAH", "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-11-28 23:50UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.service_category__dme_professional"}, "model.the_tuva_project.insights__count_claim_by_service_category": {"metadata": {"type": "BASE TABLE", "schema": "INSIGHTS", "name": "COUNT_CLAIM_BY_SERVICE_CATEGORY", "database": "DEV_SARAH", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"SERVICE_CATEGORY_TYPE": {"type": "TEXT", "index": 1, "name": "SERVICE_CATEGORY_TYPE", "comment": null}, "SERVICE_CATEGORY": {"type": "TEXT", "index": 2, "name": "SERVICE_CATEGORY", "comment": null}, "DISTINCT_CLAIM_COUNT": {"type": "NUMBER", "index": 3, "name": "DISTINCT_CLAIM_COUNT", "comment": null}}, "stats": {"last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-11-28 23:51UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.insights__count_claim_by_service_category"}, "model.the_tuva_project.quality_measures__summary_long": {"metadata": {"type": "BASE TABLE", "schema": "QUALITY_MEASURES", "name": "SUMMARY_LONG", "database": "DEV_SARAH", "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-11-28 23:52UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.quality_measures__summary_long"}, "model.the_tuva_project.quality_measures__int_nqf2372_exclude_dementia": {"metadata": {"type": "BASE TABLE", "schema": "QUALITY_MEASURES", "name": "_INT_NQF2372_EXCLUDE_DEMENTIA", "database": "DEV_SARAH", "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-11-28 23:52UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.quality_measures__int_nqf2372_exclude_dementia"}, "model.the_tuva_project.acute_inpatient__last_claim_values": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_ACUTE_INPATIENT_LAST_CLAIM_VALUES", "database": "DEV_SARAH", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"ENCOUNTER_ID": {"type": "TEXT", "index": 1, "name": "ENCOUNTER_ID", "comment": null}, "CLAIM_START": {"type": "DATE", "index": 2, "name": "CLAIM_START", "comment": null}, "DISCHARGE_DISPOSITION_CODE": {"type": "TEXT", "index": 3, "name": "DISCHARGE_DISPOSITION_CODE", "comment": null}, "CLAIM_ROW": {"type": "NUMBER", "index": 4, "name": "CLAIM_ROW", "comment": null}}, "stats": {"last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-11-28 23:51UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.acute_inpatient__last_claim_values"}, "model.the_tuva_project.service_category__hospice_institutional": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_HOSPICE_INSTITUTIONAL", "database": "DEV_SARAH", "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-11-28 23:50UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.service_category__hospice_institutional"}, "model.the_tuva_project.data_profiling__test_result_stage_pharmacy_claim": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_TEST_RESULT_STAGE_PHARMACY_CLAIM", "database": "DEV_SARAH", "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-11-28 23:51UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.data_profiling__test_result_stage_pharmacy_claim"}, "seed.the_tuva_project.cms_hcc__cpt_hcpcs": {"metadata": {"type": "BASE TABLE", "schema": "CMS_HCC", "name": "_VALUE_SET_CPT_HCPCS", "database": "DEV_SARAH", "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-11-28 23:49UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 89600.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 32741.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.the_tuva_project.cms_hcc__cpt_hcpcs"}, "model.the_tuva_project.data_profiling__test_result_stage_medical_claim": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_TEST_RESULT_STAGE_MEDICAL_CLAIM", "database": "DEV_SARAH", "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-11-28 23:51UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.data_profiling__test_result_stage_medical_claim"}, "model.the_tuva_project.financial_pmpm__service_category_2_paid_pivot": {"metadata": {"type": "BASE TABLE", "schema": "FINANCIAL_PMPM", "name": "_INT_SERVICE_CATEGORY_2_PAID_PIVOT", "database": "DEV_SARAH", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"PATIENT_ID": {"type": "TEXT", "index": 1, "name": "PATIENT_ID", "comment": null}, "YEAR_MONTH": {"type": "TEXT", "index": 2, "name": "YEAR_MONTH", "comment": null}, "PAYER": {"type": "TEXT", "index": 3, "name": "PAYER", "comment": null}, "PLAN": {"type": "TEXT", "index": 4, "name": "PLAN", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 5, "name": "DATA_SOURCE", "comment": null}, "ACUTE_INPATIENT_PAID": {"type": "NUMBER", "index": 6, "name": "ACUTE_INPATIENT_PAID", "comment": null}, "AMBULANCE_PAID": {"type": "NUMBER", "index": 7, "name": "AMBULANCE_PAID", "comment": null}, "AMBULATORY_SURGERY_PAID": {"type": "NUMBER", "index": 8, "name": "AMBULATORY_SURGERY_PAID", "comment": null}, "DIALYSIS_PAID": {"type": "NUMBER", "index": 9, "name": "DIALYSIS_PAID", "comment": null}, "DURABLE_MEDICAL_EQUIPMENT_PAID": {"type": "NUMBER", "index": 10, "name": "DURABLE_MEDICAL_EQUIPMENT_PAID", "comment": null}, "EMERGENCY_DEPARTMENT_PAID": {"type": "NUMBER", "index": 11, "name": "EMERGENCY_DEPARTMENT_PAID", "comment": null}, "HOME_HEALTH_PAID": {"type": "NUMBER", "index": 12, "name": "HOME_HEALTH_PAID", "comment": null}, "HOSPICE_PAID": {"type": "NUMBER", "index": 13, "name": "HOSPICE_PAID", "comment": null}, "INPATIENT_PSYCHIATRIC_PAID": {"type": "NUMBER", "index": 14, "name": "INPATIENT_PSYCHIATRIC_PAID", "comment": null}, "INPATIENT_REHABILITATION_PAID": {"type": "NUMBER", "index": 15, "name": "INPATIENT_REHABILITATION_PAID", "comment": null}, "LAB_PAID": {"type": "NUMBER", "index": 16, "name": "LAB_PAID", "comment": null}, "OFFICE_VISIT_PAID": {"type": "NUMBER", "index": 17, "name": "OFFICE_VISIT_PAID", "comment": null}, "OUTPATIENT_HOSPITAL_OR_CLINIC_PAID": {"type": "NUMBER", "index": 18, "name": "OUTPATIENT_HOSPITAL_OR_CLINIC_PAID", "comment": null}, "OUTPATIENT_PSYCHIATRIC_PAID": {"type": "NUMBER", "index": 19, "name": "OUTPATIENT_PSYCHIATRIC_PAID", "comment": null}, "OUTPATIENT_REHABILITATION_PAID": {"type": "NUMBER", "index": 20, "name": "OUTPATIENT_REHABILITATION_PAID", "comment": null}, "SKILLED_NURSING_PAID": {"type": "NUMBER", "index": 21, "name": "SKILLED_NURSING_PAID", "comment": null}, "URGENT_CARE_PAID": {"type": "NUMBER", "index": 22, "name": "URGENT_CARE_PAID", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 23, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-11-28 23:51UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.financial_pmpm__service_category_2_paid_pivot"}, "model.the_tuva_project.ed_classification__int_filter_encounter_with_classification": {"metadata": {"type": "BASE TABLE", "schema": "ED_CLASSIFICATION", "name": "_INT_FILTER_ENCOUNTER_WITH_CLASSIFICATION", "database": "DEV_SARAH", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"ENCOUNTER_ID": {"type": "TEXT", "index": 1, "name": "ENCOUNTER_ID", "comment": null}, "ENCOUNTER_TYPE": {"type": "TEXT", "index": 2, "name": "ENCOUNTER_TYPE", "comment": null}, "PATIENT_ID": {"type": "TEXT", "index": 3, "name": "PATIENT_ID", "comment": null}, "ENCOUNTER_END_DATE": {"type": "DATE", "index": 4, "name": "ENCOUNTER_END_DATE", "comment": null}, "FACILITY_NPI": {"type": "TEXT", "index": 5, "name": "FACILITY_NPI", "comment": null}, "PRIMARY_DIAGNOSIS_CODE_TYPE": {"type": "TEXT", "index": 6, "name": "PRIMARY_DIAGNOSIS_CODE_TYPE", "comment": null}, "PRIMARY_DIAGNOSIS_CODE": {"type": "TEXT", "index": 7, "name": "PRIMARY_DIAGNOSIS_CODE", "comment": null}, "PRIMARY_DIAGNOSIS_DESCRIPTION": {"type": "TEXT", "index": 8, "name": "PRIMARY_DIAGNOSIS_DESCRIPTION", "comment": null}, "PAID_AMOUNT": {"type": "NUMBER", "index": 9, "name": "PAID_AMOUNT", "comment": null}, "ALLOWED_AMOUNT": {"type": "NUMBER", "index": 10, "name": "ALLOWED_AMOUNT", "comment": null}, "CHARGE_AMOUNT": {"type": "NUMBER", "index": 11, "name": "CHARGE_AMOUNT", "comment": null}, "EDCNNPA": {"type": "FLOAT", "index": 12, "name": "EDCNNPA", "comment": null}, "EDCNPA": {"type": "FLOAT", "index": 13, "name": "EDCNPA", "comment": null}, "EPCT": {"type": "FLOAT", "index": 14, "name": "EPCT", "comment": null}, "NONER": {"type": "FLOAT", "index": 15, "name": "NONER", "comment": null}, "INJURY": {"type": "NUMBER", "index": 16, "name": "INJURY", "comment": null}, "PSYCH": {"type": "NUMBER", "index": 17, "name": "PSYCH", "comment": null}, "ALCOHOL": {"type": "NUMBER", "index": 18, "name": "ALCOHOL", "comment": null}, "DRUG": {"type": "NUMBER", "index": 19, "name": "DRUG", "comment": null}, "ED_CLASSIFICATION_CAPTURE": {"type": "NUMBER", "index": 20, "name": "ED_CLASSIFICATION_CAPTURE", "comment": null}, "CLASSIFICATION": {"type": "TEXT", "index": 21, "name": "CLASSIFICATION", "comment": null}}, "stats": {"last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-11-28 23:51UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.ed_classification__int_filter_encounter_with_classification"}, "seed.the_tuva_project.terminology__loinc": {"metadata": {"type": "BASE TABLE", "schema": "TERMINOLOGY", "name": "LOINC", "database": "DEV_SARAH", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"LOINC": {"type": "TEXT", "index": 1, "name": "LOINC", "comment": null}, "SHORT_NAME": {"type": "TEXT", "index": 2, "name": "SHORT_NAME", "comment": null}, "LONG_COMMON_NAME": {"type": "TEXT", "index": 3, "name": "LONG_COMMON_NAME", "comment": null}, "COMPONENT": {"type": "TEXT", "index": 4, "name": "COMPONENT", "comment": null}, "PROPERTY": {"type": "TEXT", "index": 5, "name": "PROPERTY", "comment": null}, "TIME_ASPECT": {"type": "TEXT", "index": 6, "name": "TIME_ASPECT", "comment": null}, "SYSTEM": {"type": "TEXT", "index": 7, "name": "SYSTEM", "comment": null}, "SCALE_TYPE": {"type": "TEXT", "index": 8, "name": "SCALE_TYPE", "comment": null}, "METHOD_TYPE": {"type": "TEXT", "index": 9, "name": "METHOD_TYPE", "comment": null}, "CLASS_CODE": {"type": "TEXT", "index": 10, "name": "CLASS_CODE", "comment": null}, "CLASS_DESCRIPTION": {"type": "TEXT", "index": 11, "name": "CLASS_DESCRIPTION", "comment": null}, "CLASS_TYPE_CODE": {"type": "TEXT", "index": 12, "name": "CLASS_TYPE_CODE", "comment": null}, "CLASS_TYPE_DESCRIPTION": {"type": "TEXT", "index": 13, "name": "CLASS_TYPE_DESCRIPTION", "comment": null}, "EXTERNAL_COPYRIGHT_NOTICE": {"type": "TEXT", "index": 14, "name": "EXTERNAL_COPYRIGHT_NOTICE", "comment": null}, "STATUS": {"type": "TEXT", "index": 15, "name": "STATUS", "comment": null}, "VERSION_FIRST_RELEASED": {"type": "TEXT", "index": 16, "name": "VERSION_FIRST_RELEASED", "comment": null}, "VERSION_LAST_CHANGED": {"type": "TEXT", "index": 17, "name": "VERSION_LAST_CHANGED", "comment": null}}, "stats": {"last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-11-28 23:50UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 4118528.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 101632.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.the_tuva_project.terminology__loinc"}, "model.the_tuva_project.insights__orphan_claim_by_claim_type": {"metadata": {"type": "BASE TABLE", "schema": "INSIGHTS", "name": "ORPHAN_CLAIM_BY_CLAIM_TYPE", "database": "DEV_SARAH", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"CLAIM_CATEGORY": {"type": "TEXT", "index": 1, "name": "CLAIM_CATEGORY", "comment": null}, "DISTINCT_CLAIM_COUNT": {"type": "NUMBER", "index": 2, "name": "DISTINCT_CLAIM_COUNT", "comment": null}}, "stats": {"last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-11-28 23:51UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.insights__orphan_claim_by_claim_type"}, "model.the_tuva_project.service_category__outpatient_hospital_or_clinic_institutional": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_OUTPATIENT_HOSPITAL_OR_CLINIC_INSTITUTIONAL", "database": "DEV_SARAH", "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-11-28 23:51UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.service_category__outpatient_hospital_or_clinic_institutional"}, "model.the_tuva_project.insights__count_claim_by_claim_type": {"metadata": {"type": "BASE TABLE", "schema": "INSIGHTS", "name": "COUNT_CLAIM_BY_CLAIM_TYPE", "database": "DEV_SARAH", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"CLAIM_TYPE": {"type": "TEXT", "index": 1, "name": "CLAIM_TYPE", "comment": null}, "DISTINCT_CLAIM_COUNT": {"type": "NUMBER", "index": 2, "name": "DISTINCT_CLAIM_COUNT", "comment": null}}, "stats": {"last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-11-28 23:51UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 1024.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 1.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.insights__count_claim_by_claim_type"}, "model.the_tuva_project.service_category__skilled_nursing_professional": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_SKILLED_NURSING_PROFESSIONAL", "database": "DEV_SARAH", "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-11-28 23:51UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.service_category__skilled_nursing_professional"}, "model.the_tuva_project.service_category__service_category_grouper": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "SERVICE_CATEGORY_GROUPER", "database": "DEV_SARAH", "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-11-28 23:51UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.service_category__service_category_grouper"}, "model.the_tuva_project.core__stg_clinical_observation": {"metadata": {"type": "VIEW", "schema": "CORE", "name": "_STG_CLINICAL_OBSERVATION", "database": "DEV_SARAH", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"OBSERVATION_ID": {"type": "TEXT", "index": 1, "name": "OBSERVATION_ID", "comment": null}, "PATIENT_ID": {"type": "TEXT", "index": 2, "name": "PATIENT_ID", "comment": null}, "ENCOUNTER_ID": {"type": "TEXT", "index": 3, "name": "ENCOUNTER_ID", "comment": null}, "PANEL_ID": {"type": "TEXT", "index": 4, "name": "PANEL_ID", "comment": null}, "OBSERVATION_DATE": {"type": "DATE", "index": 5, "name": "OBSERVATION_DATE", "comment": null}, "OBSERVATION_TYPE": {"type": "TEXT", "index": 6, "name": "OBSERVATION_TYPE", "comment": null}, "SOURCE_CODE_TYPE": {"type": "TEXT", "index": 7, "name": "SOURCE_CODE_TYPE", "comment": null}, "SOURCE_CODE": {"type": "TEXT", "index": 8, "name": "SOURCE_CODE", "comment": null}, "SOURCE_DESCRIPTION": {"type": "TEXT", "index": 9, "name": "SOURCE_DESCRIPTION", "comment": null}, "NORMALIZED_CODE_TYPE": {"type": "TEXT", "index": 10, "name": "NORMALIZED_CODE_TYPE", "comment": null}, "NORMALIZED_CODE": {"type": "TEXT", "index": 11, "name": "NORMALIZED_CODE", "comment": null}, "NORMALIZED_DESCRIPTION": {"type": "TEXT", "index": 12, "name": "NORMALIZED_DESCRIPTION", "comment": null}, "RESULT": {"type": "TEXT", "index": 13, "name": "RESULT", "comment": null}, "SOURCE_UNITS": {"type": "TEXT", "index": 14, "name": "SOURCE_UNITS", "comment": null}, "NORMALIZED_UNITS": {"type": "TEXT", "index": 15, "name": "NORMALIZED_UNITS", "comment": null}, "SOURCE_REFERENCE_RANGE_LOW": {"type": "TEXT", "index": 16, "name": "SOURCE_REFERENCE_RANGE_LOW", "comment": null}, "SOURCE_REFERENCE_RANGE_HIGH": {"type": "TEXT", "index": 17, "name": "SOURCE_REFERENCE_RANGE_HIGH", "comment": null}, "NORMALIZED_REFERENCE_RANGE_LOW": {"type": "TEXT", "index": 18, "name": "NORMALIZED_REFERENCE_RANGE_LOW", "comment": null}, "NORMALIZED_REFERENCE_RANGE_HIGH": {"type": "TEXT", "index": 19, "name": "NORMALIZED_REFERENCE_RANGE_HIGH", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 20, "name": "DATA_SOURCE", "comment": null}, "TUVA_LAST_RUN": {"type": "TIMESTAMP_NTZ", "index": 21, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.core__stg_clinical_observation"}, "model.the_tuva_project.quality_measures__int_nqf0034_exclude_colectomy_cancer": {"metadata": {"type": "BASE TABLE", "schema": "QUALITY_MEASURES", "name": "_INT_NQF0034_EXCLUDE_COLECTOMY_CANCER", "database": "DEV_SARAH", "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-11-28 23:51UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.quality_measures__int_nqf0034_exclude_colectomy_cancer"}, "model.the_tuva_project.data_profiling__institutional_header_fail_details": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_INSTITUTIONAL_HEADER_FAIL_DETAILS", "database": "DEV_SARAH", "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-11-28 23:50UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.data_profiling__institutional_header_fail_details"}, "model.the_tuva_project.emergency_department__int_first_claim_values": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_EMERGENCY_DEPARTMENT_FIRST_CLAIM_VALUES", "database": "DEV_SARAH", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"ENCOUNTER_ID": {"type": "TEXT", "index": 1, "name": "ENCOUNTER_ID", "comment": null}, "CLAIM_START": {"type": "DATE", "index": 2, "name": "CLAIM_START", "comment": null}, "DIAGNOSIS_CODE_1": {"type": "TEXT", "index": 3, "name": "DIAGNOSIS_CODE_1", "comment": null}, "DIAGNOSIS_CODE_TYPE": {"type": "TEXT", "index": 4, "name": "DIAGNOSIS_CODE_TYPE", "comment": null}, "ADMIT_SOURCE_CODE": {"type": "TEXT", "index": 5, "name": "ADMIT_SOURCE_CODE", "comment": null}, "ADMIT_TYPE_CODE": {"type": "TEXT", "index": 6, "name": "ADMIT_TYPE_CODE", "comment": null}, "FACILITY_NPI": {"type": "TEXT", "index": 7, "name": "FACILITY_NPI", "comment": null}, "MS_DRG_CODE": {"type": "TEXT", "index": 8, "name": "MS_DRG_CODE", "comment": null}, "APR_DRG_CODE": {"type": "TEXT", "index": 9, "name": "APR_DRG_CODE", "comment": null}, "CLAIM_ROW": {"type": "NUMBER", "index": 10, "name": "CLAIM_ROW", "comment": null}}, "stats": {"last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-11-28 23:51UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.emergency_department__int_first_claim_values"}, "model.the_tuva_project.data_profiling__claim_type_mapping_failures": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_CLAIM_TYPE_MAPPING_FAILURES", "database": "DEV_SARAH", "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-11-28 23:50UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.data_profiling__claim_type_mapping_failures"}, "model.the_tuva_project.cms_hcc__patient_hcc_history": {"metadata": {"type": "BASE TABLE", "schema": "CMS_HCC", "name": "PATIENT_HCC_HISTORY", "database": "DEV_SARAH", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"PATIENT_ID": {"type": "TEXT", "index": 1, "name": "PATIENT_ID", "comment": null}, "RECORDED_DATE": {"type": "DATE", "index": 2, "name": "RECORDED_DATE", "comment": null}, "CONDITION_TYPE": {"type": "TEXT", "index": 3, "name": "CONDITION_TYPE", "comment": null}, "ICD_10_CM_CODE": {"type": "TEXT", "index": 4, "name": "ICD_10_CM_CODE", "comment": null}, "HCC_CODE": {"type": "TEXT", "index": 5, "name": "HCC_CODE", "comment": null}, "HCC_DESCRIPTION": {"type": "TEXT", "index": 6, "name": "HCC_DESCRIPTION", "comment": null}, "FIRST_RECORDED": {"type": "DATE", "index": 7, "name": "FIRST_RECORDED", "comment": null}, "LAST_RECORDED": {"type": "DATE", "index": 8, "name": "LAST_RECORDED", "comment": null}, "PAYMENT_YEAR_RECORDED": {"type": "BOOLEAN", "index": 9, "name": "PAYMENT_YEAR_RECORDED", "comment": null}, "MODEL_VERSION": {"type": "TEXT", "index": 10, "name": "MODEL_VERSION", "comment": null}, "PAYMENT_YEAR": {"type": "NUMBER", "index": 11, "name": "PAYMENT_YEAR", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 12, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-11-28 23:51UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.cms_hcc__patient_hcc_history"}, "model.the_tuva_project.readmissions__exclusion": {"metadata": {"type": "VIEW", "schema": "READMISSIONS", "name": "_INT_EXCLUSION", "database": "DEV_SARAH", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"ENCOUNTER_ID": {"type": "TEXT", "index": 1, "name": "ENCOUNTER_ID", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 2, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.readmissions__exclusion"}, "seed.the_tuva_project.terminology__encounter_type": {"metadata": {"type": "BASE TABLE", "schema": "TERMINOLOGY", "name": "ENCOUNTER_TYPE", "database": "DEV_SARAH", "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-11-28 23:50UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 1024.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 18.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.the_tuva_project.terminology__encounter_type"}, "model.the_tuva_project.service_category__lab_professional": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_LAB_PROFESSIONAL", "database": "DEV_SARAH", "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-11-28 23:51UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.service_category__lab_professional"}, "seed.the_tuva_project.terminology__gender": {"metadata": {"type": "BASE TABLE", "schema": "TERMINOLOGY", "name": "GENDER", "database": "DEV_SARAH", "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-11-28 23:50UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 1024.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 3.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.the_tuva_project.terminology__gender"}, "seed.the_tuva_project.cms_hcc__enrollment_interaction_factors": {"metadata": {"type": "BASE TABLE", "schema": "CMS_HCC", "name": "_VALUE_SET_ENROLLMENT_INTERACTION_FACTORS", "database": "DEV_SARAH", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"MODEL_VERSION": {"type": "TEXT", "index": 1, "name": "MODEL_VERSION", "comment": null}, "FACTOR_TYPE": {"type": "TEXT", "index": 2, "name": "FACTOR_TYPE", "comment": null}, "GENDER": {"type": "TEXT", "index": 3, "name": "GENDER", "comment": null}, "ENROLLMENT_STATUS": {"type": "TEXT", "index": 4, "name": "ENROLLMENT_STATUS", "comment": null}, "MEDICAID_STATUS": {"type": "TEXT", "index": 5, "name": "MEDICAID_STATUS", "comment": null}, "DUAL_STATUS": {"type": "TEXT", "index": 6, "name": "DUAL_STATUS", "comment": null}, "INSTITUTIONAL_STATUS": {"type": "TEXT", "index": 7, "name": "INSTITUTIONAL_STATUS", "comment": null}, "DESCRIPTION": {"type": "TEXT", "index": 8, "name": "DESCRIPTION", "comment": null}, "COEFFICIENT": {"type": "FLOAT", "index": 9, "name": "COEFFICIENT", "comment": null}}, "stats": {"last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-11-28 23:49UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 3584.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 7.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.the_tuva_project.cms_hcc__enrollment_interaction_factors"}, "model.the_tuva_project.data_profiling__eligibility_missing_values": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_ELIGIBILITY_MISSING_VALUES", "database": "DEV_SARAH", "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-11-28 23:50UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.data_profiling__eligibility_missing_values"}, "model.the_tuva_project.ccsr__procedure_category_map": {"metadata": {"type": "BASE TABLE", "schema": "CCSR", "name": "PROCEDURE_CATEGORY_MAP", "database": "DEV_SARAH", "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-11-28 23:50UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 1553408.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 81597.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.ccsr__procedure_category_map"}, "model.the_tuva_project.emergency_department__int_last_claim_values": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_EMERGENCY_DEPARTMENT_LAST_CLAIM_VALUES", "database": "DEV_SARAH", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"ENCOUNTER_ID": {"type": "TEXT", "index": 1, "name": "ENCOUNTER_ID", "comment": null}, "CLAIM_START": {"type": "DATE", "index": 2, "name": "CLAIM_START", "comment": null}, "DISCHARGE_DISPOSITION_CODE": {"type": "TEXT", "index": 3, "name": "DISCHARGE_DISPOSITION_CODE", "comment": null}, "CLAIM_ROW": {"type": "NUMBER", "index": 4, "name": "CLAIM_ROW", "comment": null}}, "stats": {"last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-11-28 23:51UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.emergency_department__int_last_claim_values"}, "seed.the_tuva_project.ed_classification__categories": {"metadata": {"type": "BASE TABLE", "schema": "ED_CLASSIFICATION", "name": "_VALUE_SET_CATEGORIES", "database": "DEV_SARAH", "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-11-28 23:49UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 2560.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 9.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.the_tuva_project.ed_classification__categories"}, "model.the_tuva_project.quality_measures__int_nqf0034_exclude_advanced_illness": {"metadata": {"type": "BASE TABLE", "schema": "QUALITY_MEASURES", "name": "_INT_NQF0034_EXCLUDE_ADVANCED_ILLNESS", "database": "DEV_SARAH", "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-11-28 23:52UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.quality_measures__int_nqf0034_exclude_advanced_illness"}, "model.the_tuva_project.data_profiling__eligibility_denominators": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_ELIGIBILITY_DENOMINATORS", "database": "DEV_SARAH", "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-11-28 23:50UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 1536.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 7.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.data_profiling__eligibility_denominators"}, "model.the_tuva_project.core__stg_clinical_lab_result": {"metadata": {"type": "VIEW", "schema": "CORE", "name": "_STG_CLINICAL_LAB_RESULT", "database": "DEV_SARAH", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"LAB_RESULT_ID": {"type": "TEXT", "index": 1, "name": "LAB_RESULT_ID", "comment": null}, "PATIENT_ID": {"type": "TEXT", "index": 2, "name": "PATIENT_ID", "comment": null}, "ENCOUNTER_ID": {"type": "TEXT", "index": 3, "name": "ENCOUNTER_ID", "comment": null}, "ACCESSION_NUMBER": {"type": "TEXT", "index": 4, "name": "ACCESSION_NUMBER", "comment": null}, "SOURCE_CODE_TYPE": {"type": "TEXT", "index": 5, "name": "SOURCE_CODE_TYPE", "comment": null}, "SOURCE_CODE": {"type": "TEXT", "index": 6, "name": "SOURCE_CODE", "comment": null}, "SOURCE_DESCRIPTION": {"type": "TEXT", "index": 7, "name": "SOURCE_DESCRIPTION", "comment": null}, "SOURCE_COMPONENT": {"type": "TEXT", "index": 8, "name": "SOURCE_COMPONENT", "comment": null}, "NORMALIZED_CODE_TYPE": {"type": "TEXT", "index": 9, "name": "NORMALIZED_CODE_TYPE", "comment": null}, "NORMALIZED_CODE": {"type": "TEXT", "index": 10, "name": "NORMALIZED_CODE", "comment": null}, "NORMALIZED_DESCRIPTION": {"type": "TEXT", "index": 11, "name": "NORMALIZED_DESCRIPTION", "comment": null}, "NORMALIZED_COMPONENT": {"type": "TEXT", "index": 12, "name": "NORMALIZED_COMPONENT", "comment": null}, "STATUS": {"type": "TEXT", "index": 13, "name": "STATUS", "comment": null}, "RESULT": {"type": "TEXT", "index": 14, "name": "RESULT", "comment": null}, "RESULT_DATE": {"type": "DATE", "index": 15, "name": "RESULT_DATE", "comment": null}, "COLLECTION_DATE": {"type": "DATE", "index": 16, "name": "COLLECTION_DATE", "comment": null}, "SOURCE_UNITS": {"type": "TEXT", "index": 17, "name": "SOURCE_UNITS", "comment": null}, "NORMALIZED_UNITS": {"type": "TEXT", "index": 18, "name": "NORMALIZED_UNITS", "comment": null}, "SOURCE_REFERENCE_RANGE_LOW": {"type": "TEXT", "index": 19, "name": "SOURCE_REFERENCE_RANGE_LOW", "comment": null}, "SOURCE_REFERENCE_RANGE_HIGH": {"type": "TEXT", "index": 20, "name": "SOURCE_REFERENCE_RANGE_HIGH", "comment": null}, "NORMALIZED_REFERENCE_RANGE_LOW": {"type": "TEXT", "index": 21, "name": "NORMALIZED_REFERENCE_RANGE_LOW", "comment": null}, "NORMALIZED_REFERENCE_RANGE_HIGH": {"type": "TEXT", "index": 22, "name": "NORMALIZED_REFERENCE_RANGE_HIGH", "comment": null}, "SOURCE_ABNORMAL_FLAG": {"type": "NUMBER", "index": 23, "name": "SOURCE_ABNORMAL_FLAG", "comment": null}, "NORMALIZED_ABNORMAL_FLAG": {"type": "NUMBER", "index": 24, "name": "NORMALIZED_ABNORMAL_FLAG", "comment": null}, "SPECIMEN": {"type": "TEXT", "index": 25, "name": "SPECIMEN", "comment": null}, "ORDERING_PRACTITIONER_ID": {"type": "TEXT", "index": 26, "name": "ORDERING_PRACTITIONER_ID", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 27, "name": "DATA_SOURCE", "comment": null}, "TUVA_LAST_RUN": {"type": "TIMESTAMP_NTZ", "index": 28, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.core__stg_clinical_lab_result"}, "seed.the_tuva_project.readmissions__always_planned_ccs_procedure_category": {"metadata": {"type": "BASE TABLE", "schema": "READMISSIONS", "name": "_VALUE_SET_ALWAYS_PLANNED_CCS_PROCEDURE_CATEGORY", "database": "DEV_SARAH", "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-11-28 23:49UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 1536.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 3.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.the_tuva_project.readmissions__always_planned_ccs_procedure_category"}, "model.the_tuva_project.data_profiling__summary": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "DATA_PROFILING_SUMMARY", "database": "DEV_SARAH", "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-11-28 23:51UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 2048.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 10.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.data_profiling__summary"}, "model.the_tuva_project.quality_measures__int_nqf2372_exclude_institutional": {"metadata": {"type": "BASE TABLE", "schema": "QUALITY_MEASURES", "name": "_INT_NQF2372_EXCLUDE_INSTITUTIONAL", "database": "DEV_SARAH", "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-11-28 23:51UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.quality_measures__int_nqf2372_exclude_institutional"}, "model.the_tuva_project.core__medical_claim": {"metadata": {"type": "BASE TABLE", "schema": "CORE", "name": "MEDICAL_CLAIM", "database": "DEV_SARAH", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"CLAIM_ID": {"type": "TEXT", "index": 1, "name": "CLAIM_ID", "comment": null}, "CLAIM_LINE_NUMBER": {"type": "NUMBER", "index": 2, "name": "CLAIM_LINE_NUMBER", "comment": null}, "ENCOUNTER_ID": {"type": "TEXT", "index": 3, "name": "ENCOUNTER_ID", "comment": null}, "CLAIM_TYPE": {"type": "TEXT", "index": 4, "name": "CLAIM_TYPE", "comment": null}, "PATIENT_ID": {"type": "TEXT", "index": 5, "name": "PATIENT_ID", "comment": null}, "MEMBER_ID": {"type": "TEXT", "index": 6, "name": "MEMBER_ID", "comment": null}, "PAYER": {"type": "TEXT", "index": 7, "name": "PAYER", "comment": null}, "PLAN": {"type": "TEXT", "index": 8, "name": "PLAN", "comment": null}, "CLAIM_START_DATE": {"type": "DATE", "index": 9, "name": "CLAIM_START_DATE", "comment": null}, "CLAIM_END_DATE": {"type": "DATE", "index": 10, "name": "CLAIM_END_DATE", "comment": null}, "CLAIM_LINE_START_DATE": {"type": "DATE", "index": 11, "name": "CLAIM_LINE_START_DATE", "comment": null}, "CLAIM_LINE_END_DATE": {"type": "DATE", "index": 12, "name": "CLAIM_LINE_END_DATE", "comment": null}, "ADMISSION_DATE": {"type": "DATE", "index": 13, "name": "ADMISSION_DATE", "comment": null}, "DISCHARGE_DATE": {"type": "DATE", "index": 14, "name": "DISCHARGE_DATE", "comment": null}, "SERVICE_CATEGORY_1": {"type": "TEXT", "index": 15, "name": "SERVICE_CATEGORY_1", "comment": null}, "SERVICE_CATEGORY_2": {"type": "TEXT", "index": 16, "name": "SERVICE_CATEGORY_2", "comment": null}, "ADMIT_SOURCE_CODE": {"type": "TEXT", "index": 17, "name": "ADMIT_SOURCE_CODE", "comment": null}, "ADMIT_TYPE_CODE": {"type": "TEXT", "index": 18, "name": "ADMIT_TYPE_CODE", "comment": null}, "DISCHARGE_DISPOSITION_CODE": {"type": "TEXT", "index": 19, "name": "DISCHARGE_DISPOSITION_CODE", "comment": null}, "PLACE_OF_SERVICE_CODE": {"type": "TEXT", "index": 20, "name": "PLACE_OF_SERVICE_CODE", "comment": null}, "BILL_TYPE_CODE": {"type": "TEXT", "index": 21, "name": "BILL_TYPE_CODE", "comment": null}, "MS_DRG_CODE": {"type": "TEXT", "index": 22, "name": "MS_DRG_CODE", "comment": null}, "APR_DRG_CODE": {"type": "TEXT", "index": 23, "name": "APR_DRG_CODE", "comment": null}, "REVENUE_CENTER_CODE": {"type": "TEXT", "index": 24, "name": "REVENUE_CENTER_CODE", "comment": null}, "SERVICE_UNIT_QUANTITY": {"type": "NUMBER", "index": 25, "name": "SERVICE_UNIT_QUANTITY", "comment": null}, "HCPCS_CODE": {"type": "TEXT", "index": 26, "name": "HCPCS_CODE", "comment": null}, "HCPCS_MODIFIER_1": {"type": "TEXT", "index": 27, "name": "HCPCS_MODIFIER_1", "comment": null}, "HCPCS_MODIFIER_2": {"type": "TEXT", "index": 28, "name": "HCPCS_MODIFIER_2", "comment": null}, "HCPCS_MODIFIER_3": {"type": "TEXT", "index": 29, "name": "HCPCS_MODIFIER_3", "comment": null}, "HCPCS_MODIFIER_4": {"type": "TEXT", "index": 30, "name": "HCPCS_MODIFIER_4", "comment": null}, "HCPCS_MODIFIER_5": {"type": "TEXT", "index": 31, "name": "HCPCS_MODIFIER_5", "comment": null}, "RENDERING_NPI": {"type": "TEXT", "index": 32, "name": "RENDERING_NPI", "comment": null}, "BILLING_NPI": {"type": "TEXT", "index": 33, "name": "BILLING_NPI", "comment": null}, "FACILITY_NPI": {"type": "TEXT", "index": 34, "name": "FACILITY_NPI", "comment": null}, "PAID_DATE": {"type": "DATE", "index": 35, "name": "PAID_DATE", "comment": null}, "PAID_AMOUNT": {"type": "NUMBER", "index": 36, "name": "PAID_AMOUNT", "comment": null}, "ALLOWED_AMOUNT": {"type": "NUMBER", "index": 37, "name": "ALLOWED_AMOUNT", "comment": null}, "CHARGE_AMOUNT": {"type": "NUMBER", "index": 38, "name": "CHARGE_AMOUNT", "comment": null}, "COINSURANCE_AMOUNT": {"type": "NUMBER", "index": 39, "name": "COINSURANCE_AMOUNT", "comment": null}, "COPAYMENT_AMOUNT": {"type": "NUMBER", "index": 40, "name": "COPAYMENT_AMOUNT", "comment": null}, "DEDUCTIBLE_AMOUNT": {"type": "NUMBER", "index": 41, "name": "DEDUCTIBLE_AMOUNT", "comment": null}, "TOTAL_COST_AMOUNT": {"type": "NUMBER", "index": 42, "name": "TOTAL_COST_AMOUNT", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 43, "name": "DATA_SOURCE", "comment": null}, "TUVA_LAST_RUN": {"type": "TIMESTAMP_NTZ", "index": 44, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-11-28 23:51UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.core__medical_claim"}, "seed.the_tuva_project.cms_hcc__icd_10_cm_mappings": {"metadata": {"type": "BASE TABLE", "schema": "CMS_HCC", "name": "_VALUE_SET_ICD_10_CM_MAPPINGS", "database": "DEV_SARAH", "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-11-28 23:49UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 300032.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 55368.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.the_tuva_project.cms_hcc__icd_10_cm_mappings"}, "model.the_tuva_project.data_profiling__test_result": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "TEST_RESULT", "database": "DEV_SARAH", "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-11-28 23:51UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.data_profiling__test_result"}, "model.the_tuva_project.insights__sum_amount_by_claim_type": {"metadata": {"type": "BASE TABLE", "schema": "INSIGHTS", "name": "SUM_AMOUNT_BY_CLAIM_TYPE", "database": "DEV_SARAH", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"CLAIM_TYPE": {"type": "TEXT", "index": 1, "name": "CLAIM_TYPE", "comment": null}, "TOTAL_PAID_AMOUNT": {"type": "NUMBER", "index": 2, "name": "TOTAL_PAID_AMOUNT", "comment": null}, "TOTAL_ALLOWED_AMOUNT": {"type": "NUMBER", "index": 3, "name": "TOTAL_ALLOWED_AMOUNT", "comment": null}, "TOTAL_CHARGE_AMOUNT": {"type": "NUMBER", "index": 4, "name": "TOTAL_CHARGE_AMOUNT", "comment": null}}, "stats": {"last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-11-28 23:51UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 1536.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 1.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.insights__sum_amount_by_claim_type"}, "model.the_tuva_project.readmissions__index_discharge_requirement": {"metadata": {"type": "VIEW", "schema": "READMISSIONS", "name": "_INT_INDEX_DISCHARGE_REQUIREMENT", "database": "DEV_SARAH", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"ENCOUNTER_ID": {"type": "TEXT", "index": 1, "name": "ENCOUNTER_ID", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 2, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.readmissions__index_discharge_requirement"}, "model.the_tuva_project.service_category__ambulatory_surgery_professional": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_AMBULATORY_SURGERY_PROFESSIONAL", "database": "DEV_SARAH", "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-11-28 23:51UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.service_category__ambulatory_surgery_professional"}, "model.the_tuva_project.core__stg_claims_condition": {"metadata": {"type": "VIEW", "schema": "CORE", "name": "_STG_CLAIMS_CONDITION", "database": "DEV_SARAH", "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__medicare_dual_eligibility": {"metadata": {"type": "BASE TABLE", "schema": "TERMINOLOGY", "name": "MEDICARE_DUAL_ELIGIBILITY", "database": "DEV_SARAH", "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-11-28 23:50UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 1536.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 11.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.the_tuva_project.terminology__medicare_dual_eligibility"}, "seed.the_tuva_project.readmissions__acute_diagnosis_ccs": {"metadata": {"type": "BASE TABLE", "schema": "READMISSIONS", "name": "_VALUE_SET_ACUTE_DIAGNOSIS_CCS", "database": "DEV_SARAH", "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-11-28 23:49UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 3584.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 80.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.the_tuva_project.readmissions__acute_diagnosis_ccs"}, "model.the_tuva_project.quality_measures__int_nqf2372_exclude_mastectomy": {"metadata": {"type": "BASE TABLE", "schema": "QUALITY_MEASURES", "name": "_INT_NQF2372_EXCLUDE_MASTECTOMY", "database": "DEV_SARAH", "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-11-28 23:51UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.quality_measures__int_nqf2372_exclude_mastectomy"}, "seed.the_tuva_project.terminology__ansi_fips_state": {"metadata": {"type": "BASE TABLE", "schema": "TERMINOLOGY", "name": "ANSI_FIPS_STATE", "database": "DEV_SARAH", "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-11-28 23:50UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 2560.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 55.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.the_tuva_project.terminology__ansi_fips_state"}, "model.the_tuva_project.core__stg_clinical_condition": {"metadata": {"type": "VIEW", "schema": "CORE", "name": "_STG_CLINICAL_CONDITION", "database": "DEV_SARAH", "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.chronic_conditions__cms_chronic_conditions_hiv_aids": {"metadata": {"type": "BASE TABLE", "schema": "CHRONIC_CONDITIONS", "name": "_INT_CMS_CHRONIC_CONDITION_HIV_AIDS", "database": "DEV_SARAH", "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-11-28 23:51UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.chronic_conditions__cms_chronic_conditions_hiv_aids"}, "model.the_tuva_project.service_category__urgent_care_institutional": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_URGENT_CARE_INSTITUTIONAL", "database": "DEV_SARAH", "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-11-28 23:51UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.service_category__urgent_care_institutional"}, "seed.the_tuva_project.terminology__mdc": {"metadata": {"type": "BASE TABLE", "schema": "TERMINOLOGY", "name": "MDC", "database": "DEV_SARAH", "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-11-28 23:50UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 2048.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 25.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.the_tuva_project.terminology__mdc"}, "model.the_tuva_project.quality_measures__int_nqf0034_exclude_institutional_snp": {"metadata": {"type": "BASE TABLE", "schema": "QUALITY_MEASURES", "name": "_INT_NQF0034_EXCLUDE_INSTITUTIONAL_SNP", "database": "DEV_SARAH", "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-11-28 23:51UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.quality_measures__int_nqf0034_exclude_institutional_snp"}, "model.the_tuva_project.service_category__emergency_department_institutional": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_EMERGENCY_DEPARTMENT_INSTITUTIONAL", "database": "DEV_SARAH", "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-11-28 23:51UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.service_category__emergency_department_institutional"}, "seed.the_tuva_project.cms_hcc__disabled_interaction_factors": {"metadata": {"type": "BASE TABLE", "schema": "CMS_HCC", "name": "_VALUE_SET_DISABLED_INTERACTION_FACTORS", "database": "DEV_SARAH", "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-11-28 23:49UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 3584.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 8.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.the_tuva_project.cms_hcc__disabled_interaction_factors"}, "model.the_tuva_project.service_category__acute_inpatient_institutional": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_ACUTE_INPATIENT_INSTITUTIONAL", "database": "DEV_SARAH", "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-11-28 23:50UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.service_category__acute_inpatient_institutional"}, "model.the_tuva_project.data_profiling__medical_claim_denominators": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_MEDICAL_CLAIM_DENOMINATORS", "database": "DEV_SARAH", "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-11-28 23:50UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 1536.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 14.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.data_profiling__medical_claim_denominators"}, "model.the_tuva_project.data_profiling__pharmacy_claim_duplicates": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_PHARMACY_CLAIM_DUPLICATES", "database": "DEV_SARAH", "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-11-28 23:50UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.data_profiling__pharmacy_claim_duplicates"}, "model.the_tuva_project.service_category__outpatient_hospital_or_clinic_professional": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_OUTPATIENT_HOSPITAL_OR_CLINIC_PROFESSIONAL", "database": "DEV_SARAH", "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-11-28 23:51UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.service_category__outpatient_hospital_or_clinic_professional"}, "seed.the_tuva_project.terminology__admit_source": {"metadata": {"type": "BASE TABLE", "schema": "TERMINOLOGY", "name": "ADMIT_SOURCE", "database": "DEV_SARAH", "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-11-28 23:50UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 2048.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 16.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.the_tuva_project.terminology__admit_source"}, "seed.the_tuva_project.terminology__fips_county": {"metadata": {"type": "BASE TABLE", "schema": "TERMINOLOGY", "name": "FIPS_COUNTY", "database": "DEV_SARAH", "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-11-28 23:50UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 31232.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 3232.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.the_tuva_project.terminology__fips_county"}, "seed.the_tuva_project.cms_hcc__disease_interaction_factors": {"metadata": {"type": "BASE TABLE", "schema": "CMS_HCC", "name": "_VALUE_SET_DISEASE_INTERACTION_FACTORS", "database": "DEV_SARAH", "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-11-28 23:49UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 8192.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 223.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.the_tuva_project.cms_hcc__disease_interaction_factors"}, "seed.the_tuva_project.terminology__hcpcs_level_2": {"metadata": {"type": "BASE TABLE", "schema": "TERMINOLOGY", "name": "HCPCS_LEVEL_2", "database": "DEV_SARAH", "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-11-28 23:50UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 368640.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 7501.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.the_tuva_project.terminology__hcpcs_level_2"}, "model.the_tuva_project.core__practitioner": {"metadata": {"type": "BASE TABLE", "schema": "CORE", "name": "PRACTITIONER", "database": "DEV_SARAH", "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-11-28 23:51UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.core__practitioner"}, "model.the_tuva_project.service_category__outpatient_psychiatric_institutional": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_OUTPATIENT_PSYCHIATRIC_INSTITUTIONAL", "database": "DEV_SARAH", "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-11-28 23:51UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.service_category__outpatient_psychiatric_institutional"}, "model.the_tuva_project.ed_classification__int_map_primary_dx": {"metadata": {"type": "BASE TABLE", "schema": "ED_CLASSIFICATION", "name": "_INT_BY_PROVIDER_PARENT_ORGANIZATION", "database": "DEV_SARAH", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"ENCOUNTER_ID": {"type": "TEXT", "index": 1, "name": "ENCOUNTER_ID", "comment": null}, "ENCOUNTER_TYPE": {"type": "TEXT", "index": 2, "name": "ENCOUNTER_TYPE", "comment": null}, "PATIENT_ID": {"type": "TEXT", "index": 3, "name": "PATIENT_ID", "comment": null}, "ENCOUNTER_END_DATE": {"type": "DATE", "index": 4, "name": "ENCOUNTER_END_DATE", "comment": null}, "FACILITY_NPI": {"type": "TEXT", "index": 5, "name": "FACILITY_NPI", "comment": null}, "PRIMARY_DIAGNOSIS_CODE_TYPE": {"type": "TEXT", "index": 6, "name": "PRIMARY_DIAGNOSIS_CODE_TYPE", "comment": null}, "PRIMARY_DIAGNOSIS_CODE": {"type": "TEXT", "index": 7, "name": "PRIMARY_DIAGNOSIS_CODE", "comment": null}, "PRIMARY_DIAGNOSIS_DESCRIPTION": {"type": "TEXT", "index": 8, "name": "PRIMARY_DIAGNOSIS_DESCRIPTION", "comment": null}, "PAID_AMOUNT": {"type": "NUMBER", "index": 9, "name": "PAID_AMOUNT", "comment": null}, "ALLOWED_AMOUNT": {"type": "NUMBER", "index": 10, "name": "ALLOWED_AMOUNT", "comment": null}, "CHARGE_AMOUNT": {"type": "NUMBER", "index": 11, "name": "CHARGE_AMOUNT", "comment": null}, "EDCNNPA": {"type": "FLOAT", "index": 12, "name": "EDCNNPA", "comment": null}, "EDCNPA": {"type": "FLOAT", "index": 13, "name": "EDCNPA", "comment": null}, "EPCT": {"type": "FLOAT", "index": 14, "name": "EPCT", "comment": null}, "NONER": {"type": "FLOAT", "index": 15, "name": "NONER", "comment": null}, "INJURY": {"type": "NUMBER", "index": 16, "name": "INJURY", "comment": null}, "PSYCH": {"type": "NUMBER", "index": 17, "name": "PSYCH", "comment": null}, "ALCOHOL": {"type": "NUMBER", "index": 18, "name": "ALCOHOL", "comment": null}, "DRUG": {"type": "NUMBER", "index": 19, "name": "DRUG", "comment": null}, "ED_CLASSIFICATION_CAPTURE": {"type": "NUMBER", "index": 20, "name": "ED_CLASSIFICATION_CAPTURE", "comment": null}}, "stats": {"last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-11-28 23:51UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.ed_classification__int_map_primary_dx"}, "seed.the_tuva_project.service_category__service_categories": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_VALUE_SET_SERVICE_CATEGORIES", "database": "DEV_SARAH", "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-11-28 23:50UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 1536.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 18.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.the_tuva_project.service_category__service_categories"}, "model.the_tuva_project.readmissions__index_admission": {"metadata": {"type": "VIEW", "schema": "READMISSIONS", "name": "_INT_INDEX_ADMISSION", "database": "DEV_SARAH", "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.quality_measures__int_nqf2372_numerator": {"metadata": {"type": "BASE TABLE", "schema": "QUALITY_MEASURES", "name": "_INT_NQF2372_NUMERATOR", "database": "DEV_SARAH", "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-11-28 23:52UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.quality_measures__int_nqf2372_numerator"}, "seed.the_tuva_project.cms_hcc__adjustment_rates": {"metadata": {"type": "BASE TABLE", "schema": "CMS_HCC", "name": "_VALUE_SET_ADJUSTMENT_RATES", "database": "DEV_SARAH", "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-11-28 23:49UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 2048.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 6.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.the_tuva_project.cms_hcc__adjustment_rates"}, "seed.the_tuva_project.readmissions__surgery_gynecology_cohort": {"metadata": {"type": "BASE TABLE", "schema": "READMISSIONS", "name": "_VALUE_SET_SURGERY_GYNECOLOGY_COHORT", "database": "DEV_SARAH", "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-11-28 23:50UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 28672.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 1676.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.the_tuva_project.readmissions__surgery_gynecology_cohort"}, "model.the_tuva_project.data_profiling__test_detail_stage_eligibility": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_TEST_DETAIL_STAGE_ELIGIBILITY", "database": "DEV_SARAH", "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-11-28 23:51UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.data_profiling__test_detail_stage_eligibility"}, "seed.the_tuva_project.readmissions__icd_10_pcs_to_ccs": {"metadata": {"type": "BASE TABLE", "schema": "READMISSIONS", "name": "_VALUE_SET_ICD_10_PCS_TO_CCS", "database": "DEV_SARAH", "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-11-28 23:49UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 1416192.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 80493.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.the_tuva_project.readmissions__icd_10_pcs_to_ccs"}, "model.the_tuva_project.quality_measures__int_nqf0034__frailty": {"metadata": {"type": "VIEW", "schema": "QUALITY_MEASURES", "name": "_INT_NQF0034__FRAILTY", "database": "DEV_SARAH", "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}, "CONCEPT_NAME": {"type": "TEXT", "index": 3, "name": "CONCEPT_NAME", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.quality_measures__int_nqf0034__frailty"}, "model.the_tuva_project.core__procedure": {"metadata": {"type": "BASE TABLE", "schema": "CORE", "name": "PROCEDURE", "database": "DEV_SARAH", "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-11-28 23:51UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.core__procedure"}, "model.the_tuva_project.readmissions__planned_encounter": {"metadata": {"type": "VIEW", "schema": "READMISSIONS", "name": "_INT_PLANNED_ENCOUNTER", "database": "DEV_SARAH", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"ENCOUNTER_ID": {"type": "TEXT", "index": 1, "name": "ENCOUNTER_ID", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 2, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.readmissions__planned_encounter"}, "model.the_tuva_project.core__stg_claims_practitioner": {"metadata": {"type": "VIEW", "schema": "CORE", "name": "_STG_CLAIMS_PRACTITIONER", "database": "DEV_SARAH", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"PRACTITIONER_ID": {"type": "TEXT", "index": 1, "name": "PRACTITIONER_ID", "comment": null}, "NPI": {"type": "TEXT", "index": 2, "name": "NPI", "comment": null}, "PROVIDER_FIRST_NAME": {"type": "TEXT", "index": 3, "name": "PROVIDER_FIRST_NAME", "comment": null}, "PROVIDER_LAST_NAME": {"type": "TEXT", "index": 4, "name": "PROVIDER_LAST_NAME", "comment": null}, "PRACTICE_AFFILIATION": {"type": "TEXT", "index": 5, "name": "PRACTICE_AFFILIATION", "comment": null}, "SPECIALTY": {"type": "TEXT", "index": 6, "name": "SPECIALTY", "comment": null}, "SUB_SPECIALTY": {"type": "TEXT", "index": 7, "name": "SUB_SPECIALTY", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 8, "name": "DATA_SOURCE", "comment": null}, "TUVA_LAST_RUN": {"type": "TIMESTAMP_NTZ", "index": 9, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.core__stg_claims_practitioner"}, "model.the_tuva_project.service_category__combined_institutional": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_COMBINED_INSTITUTIONAL", "database": "DEV_SARAH", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"CLAIM_ID": {"type": "TEXT", "index": 1, "name": "CLAIM_ID", "comment": null}, "SERVICE_CATEGORY_2": {"type": "TEXT", "index": 2, "name": "SERVICE_CATEGORY_2", "comment": null}}, "stats": {"last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-11-28 23:51UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.service_category__combined_institutional"}, "model.the_tuva_project.readmissions__encounter_specialty_cohort": {"metadata": {"type": "VIEW", "schema": "READMISSIONS", "name": "_INT_ENCOUNTER_SPECIALTY_COHORT", "database": "DEV_SARAH", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"ENCOUNTER_ID": {"type": "TEXT", "index": 1, "name": "ENCOUNTER_ID", "comment": null}, "SPECIALTY_COHORT": {"type": "TEXT", "index": 2, "name": "SPECIALTY_COHORT", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 3, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.readmissions__encounter_specialty_cohort"}, "model.the_tuva_project.data_profiling__eligibility_plausibility": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_ELIGIBILITY_PLAUSIBILITY", "database": "DEV_SARAH", "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-11-28 23:50UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.data_profiling__eligibility_plausibility"}, "seed.the_tuva_project.ed_classification__johnston_icd9": {"metadata": {"type": "BASE TABLE", "schema": "ED_CLASSIFICATION", "name": "_VALUE_SET_JOHNSTON_ICD9", "database": "DEV_SARAH", "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-11-28 23:49UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 57344.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 7443.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.the_tuva_project.ed_classification__johnston_icd9"}, "seed.the_tuva_project.chronic_conditions__cms_chronic_conditions_hierarchy": {"metadata": {"type": "BASE TABLE", "schema": "CHRONIC_CONDITIONS", "name": "_VALUE_SET_CMS_CHRONIC_CONDITIONS_HIERARCHY", "database": "DEV_SARAH", "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-11-28 23:49UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 147456.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 6532.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.the_tuva_project.chronic_conditions__cms_chronic_conditions_hierarchy"}, "model.the_tuva_project.data_profiling__pharmacy_claim_missing_values": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_PHARMACY_CLAIM_MISSING_VALUES", "database": "DEV_SARAH", "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-11-28 23:50UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.data_profiling__pharmacy_claim_missing_values"}, "seed.the_tuva_project.terminology__icd_10_cm": {"metadata": {"type": "BASE TABLE", "schema": "TERMINOLOGY", "name": "ICD_10_CM", "database": "DEV_SARAH", "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-11-28 23:50UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 1063936.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 74044.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.the_tuva_project.terminology__icd_10_cm"}, "model.the_tuva_project.core__stg_clinical_medication": {"metadata": {"type": "VIEW", "schema": "CORE", "name": "_STG_CLINICAL_MEDICATION", "database": "DEV_SARAH", "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.data_profiling__test_catalog": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_VALUE_SET_TEST_CATALOG", "database": "DEV_SARAH", "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-11-28 23:49UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 4608.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 242.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.the_tuva_project.data_profiling__test_catalog"}, "model.the_tuva_project.service_category__hospice_professional": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_HOSPICE_PROFESSIONAL", "database": "DEV_SARAH", "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-11-28 23:50UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.service_category__hospice_professional"}, "seed.the_tuva_project.readmissions__specialty_cohort": {"metadata": {"type": "BASE TABLE", "schema": "READMISSIONS", "name": "_VALUE_SET_SPECIALTY_COHORT", "database": "DEV_SARAH", "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-11-28 23:49UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 8192.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 276.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.the_tuva_project.readmissions__specialty_cohort"}, "seed.the_tuva_project.terminology__medicare_status": {"metadata": {"type": "BASE TABLE", "schema": "TERMINOLOGY", "name": "MEDICARE_STATUS", "database": "DEV_SARAH", "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-11-28 23:50UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 1536.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 5.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.the_tuva_project.terminology__medicare_status"}, "model.the_tuva_project.ccsr__dx_vertical_pivot": {"metadata": {"type": "BASE TABLE", "schema": "CCSR", "name": "DX_VERTICAL_PIVOT", "database": "DEV_SARAH", "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-11-28 23:50UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 2373632.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 86288.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.ccsr__dx_vertical_pivot"}, "model.the_tuva_project.quality_measures__int_nqf0034_long": {"metadata": {"type": "BASE TABLE", "schema": "QUALITY_MEASURES", "name": "_INT_NQF0034_LONG", "database": "DEV_SARAH", "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-11-28 23:52UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.quality_measures__int_nqf0034_long"}, "model.the_tuva_project.data_profiling__professional_header_fail_details": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_PROFESSIONAL_HEADER_FAIL_DETAILS", "database": "DEV_SARAH", "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-11-28 23:51UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.data_profiling__professional_header_fail_details"}, "model.the_tuva_project.core__condition": {"metadata": {"type": "BASE TABLE", "schema": "CORE", "name": "CONDITION", "database": "DEV_SARAH", "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-11-28 23:51UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.core__condition"}, "model.the_tuva_project.emergency_department__int_encounter_start_and_end_dates": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_EMERGENCY_DEPARTMENT_ENCOUNTER_START_AND_END_DATES", "database": "DEV_SARAH", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"PATIENT_ID": {"type": "TEXT", "index": 1, "name": "PATIENT_ID", "comment": null}, "ENCOUNTER_ID": {"type": "TEXT", "index": 2, "name": "ENCOUNTER_ID", "comment": null}, "ENCOUNTER_START_DATE": {"type": "DATE", "index": 3, "name": "ENCOUNTER_START_DATE", "comment": null}, "ENCOUNTER_END_DATE": {"type": "DATE", "index": 4, "name": "ENCOUNTER_END_DATE", "comment": null}, "DETERMINED_ENCOUNTER_START_DATE": {"type": "DATE", "index": 5, "name": "DETERMINED_ENCOUNTER_START_DATE", "comment": null}, "DETERMINED_ENCOUNTER_END_DATE": {"type": "DATE", "index": 6, "name": "DETERMINED_ENCOUNTER_END_DATE", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 7, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-11-28 23:51UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.emergency_department__int_encounter_start_and_end_dates"}, "seed.the_tuva_project.terminology__present_on_admission": {"metadata": {"type": "BASE TABLE", "schema": "TERMINOLOGY", "name": "PRESENT_ON_ADMISSION", "database": "DEV_SARAH", "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-11-28 23:50UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 1536.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 4.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.the_tuva_project.terminology__present_on_admission"}, "model.the_tuva_project.core__location": {"metadata": {"type": "BASE TABLE", "schema": "CORE", "name": "LOCATION", "database": "DEV_SARAH", "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-11-28 23:51UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.core__location"}, "model.the_tuva_project.quality_measures__summary_wide": {"metadata": {"type": "BASE TABLE", "schema": "QUALITY_MEASURES", "name": "SUMMARY_WIDE", "database": "DEV_SARAH", "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-11-28 23:52UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.quality_measures__summary_wide"}, "model.the_tuva_project.acute_inpatient__institutional_encounter_id": {"metadata": {"type": "VIEW", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_ACUTE_INPATIENT_INSTITUTIONAL_ENCOUNTER_ID", "database": "DEV_SARAH", "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.insights__trend_count_claim_by_service_category": {"metadata": {"type": "BASE TABLE", "schema": "INSIGHTS", "name": "TREND_COUNT_CLAIM_BY_SERVICE_CATEGORY", "database": "DEV_SARAH", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"YEAR_MONTH": {"type": "TEXT", "index": 1, "name": "YEAR_MONTH", "comment": null}, "SERVICE_CATEGORY": {"type": "TEXT", "index": 2, "name": "SERVICE_CATEGORY", "comment": null}, "DISTINCT_CLAIM_COUNT": {"type": "NUMBER", "index": 3, "name": "DISTINCT_CLAIM_COUNT", "comment": null}, "DISTINCT_CLAIM_COUNT_CHANGE": {"type": "NUMBER", "index": 4, "name": "DISTINCT_CLAIM_COUNT_CHANGE", "comment": null}, "DISTINCT_CLAIM_PERCENTAGE_CHANGE": {"type": "NUMBER", "index": 5, "name": "DISTINCT_CLAIM_PERCENTAGE_CHANGE", "comment": null}}, "stats": {"last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-11-28 23:51UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.insights__trend_count_claim_by_service_category"}, "seed.the_tuva_project.ccsr__dxccsr_v2023_1_cleaned_map": {"metadata": {"type": "BASE TABLE", "schema": "CCSR", "name": "_VALUE_SET_DXCCSR_V2023_1_CLEANED_MAP", "database": "DEV_SARAH", "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-11-28 23:49UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 1899008.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 74549.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.the_tuva_project.ccsr__dxccsr_v2023_1_cleaned_map"}, "model.the_tuva_project.ed_classification__summary": {"metadata": {"type": "BASE TABLE", "schema": "ED_CLASSIFICATION", "name": "SUMMARY", "database": "DEV_SARAH", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"ENCOUNTER_ID": {"type": "TEXT", "index": 1, "name": "ENCOUNTER_ID", "comment": null}, "ED_CLASSIFICATION_DESCRIPTION": {"type": "TEXT", "index": 2, "name": "ED_CLASSIFICATION_DESCRIPTION", "comment": null}, "ED_CLASSIFICATION_ORDER": {"type": "NUMBER", "index": 3, "name": "ED_CLASSIFICATION_ORDER", "comment": null}, "PATIENT_ID": {"type": "TEXT", "index": 4, "name": "PATIENT_ID", "comment": null}, "ENCOUNTER_END_DATE": {"type": "DATE", "index": 5, "name": "ENCOUNTER_END_DATE", "comment": null}, "YEAR_MONTH": {"type": "TEXT", "index": 6, "name": "YEAR_MONTH", "comment": null}, "PRIMARY_DIAGNOSIS_CODE": {"type": "TEXT", "index": 7, "name": "PRIMARY_DIAGNOSIS_CODE", "comment": null}, "PRIMARY_DIAGNOSIS_DESCRIPTION": {"type": "TEXT", "index": 8, "name": "PRIMARY_DIAGNOSIS_DESCRIPTION", "comment": null}, "PRIMARY_CCSR_CODE": {"type": "TEXT", "index": 9, "name": "PRIMARY_CCSR_CODE", "comment": null}, "PRIMARY_CCSR_DESCRIPTION": {"type": "TEXT", "index": 10, "name": "PRIMARY_CCSR_DESCRIPTION", "comment": null}, "PAID_AMOUNT": {"type": "NUMBER", "index": 11, "name": "PAID_AMOUNT", "comment": null}, "ALLOWED_AMOUNT": {"type": "NUMBER", "index": 12, "name": "ALLOWED_AMOUNT", "comment": null}, "CHARGE_AMOUNT": {"type": "NUMBER", "index": 13, "name": "CHARGE_AMOUNT", "comment": null}, "FACILITY_NPI": {"type": "TEXT", "index": 14, "name": "FACILITY_NPI", "comment": null}, "FACILITY_NAME": {"type": "TEXT", "index": 15, "name": "FACILITY_NAME", "comment": null}, "FACILITY_STATE": {"type": "TEXT", "index": 16, "name": "FACILITY_STATE", "comment": null}, "FACILITY_CITY": {"type": "TEXT", "index": 17, "name": "FACILITY_CITY", "comment": null}, "FACILITY_ZIP_CODE": {"type": "TEXT", "index": 18, "name": "FACILITY_ZIP_CODE", "comment": null}, "FACILITY_LATITUDE": {"type": "TEXT", "index": 19, "name": "FACILITY_LATITUDE", "comment": null}, "FACILITY_LONGITUDE": {"type": "TEXT", "index": 20, "name": "FACILITY_LONGITUDE", "comment": null}, "PATIENT_SEX": {"type": "TEXT", "index": 21, "name": "PATIENT_SEX", "comment": null}, "PATIENT_AGE": {"type": "NUMBER", "index": 22, "name": "PATIENT_AGE", "comment": null}, "PATIENT_ZIP_CODE": {"type": "TEXT", "index": 23, "name": "PATIENT_ZIP_CODE", "comment": null}, "PATIENT_LATITUDE": {"type": "FLOAT", "index": 24, "name": "PATIENT_LATITUDE", "comment": null}, "PATIENT_LONGITUDE": {"type": "FLOAT", "index": 25, "name": "PATIENT_LONGITUDE", "comment": null}, "PATIENT_RACE": {"type": "TEXT", "index": 26, "name": "PATIENT_RACE", "comment": null}}, "stats": {"last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-11-28 23:51UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.ed_classification__summary"}, "model.the_tuva_project.data_profiling__test_detail_stage_medical_claim": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_TEST_DETAIL_STAGE_MEDICAL_CLAIM", "database": "DEV_SARAH", "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-11-28 23:51UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.data_profiling__test_detail_stage_medical_claim"}, "model.the_tuva_project.quality_measures__int_nqf2372__performance_period": {"metadata": {"type": "VIEW", "schema": "QUALITY_MEASURES", "name": "_INT_NQF2372__PERFORMANCE_PERIOD", "database": "DEV_SARAH", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"MEASURE_ID": {"type": "TEXT", "index": 1, "name": "MEASURE_ID", "comment": null}, "MEASURE_NAME": {"type": "TEXT", "index": 2, "name": "MEASURE_NAME", "comment": null}, "MEASURE_VERSION": {"type": "TEXT", "index": 3, "name": "MEASURE_VERSION", "comment": null}, "PERFORMANCE_PERIOD_END": {"type": "DATE", "index": 4, "name": "PERFORMANCE_PERIOD_END", "comment": null}, "PERFORMANCE_PERIOD_BEGIN": {"type": "DATE", "index": 5, "name": "PERFORMANCE_PERIOD_BEGIN", "comment": null}, "PERFORMANCE_PERIOD_LOOKBACK": {"type": "DATE", "index": 6, "name": "PERFORMANCE_PERIOD_LOOKBACK", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.quality_measures__int_nqf2372__performance_period"}, "model.the_tuva_project.service_category__dq_input_layer_tests": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_DQ_INPUT_LAYER_TESTS", "database": "DEV_SARAH", "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-11-28 23:50UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.service_category__dq_input_layer_tests"}, "model.the_tuva_project.service_category__office_visit_professional": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_OFFICE_VISIT_PROFESSIONAL", "database": "DEV_SARAH", "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-11-28 23:51UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.service_category__office_visit_professional"}, "seed.the_tuva_project.terminology__provider": {"metadata": {"type": "BASE TABLE", "schema": "TERMINOLOGY", "name": "PROVIDER", "database": "DEV_SARAH", "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-11-28 23:50UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 248282624.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 8070845.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.the_tuva_project.terminology__provider"}, "model.the_tuva_project.chronic_conditions__cms_chronic_conditions_oud": {"metadata": {"type": "BASE TABLE", "schema": "CHRONIC_CONDITIONS", "name": "_INT_CMS_CHRONIC_CONDITION_OUD", "database": "DEV_SARAH", "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-11-28 23:52UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.chronic_conditions__cms_chronic_conditions_oud"}, "model.the_tuva_project.cms_hcc__int_hcc_hierarchy": {"metadata": {"type": "BASE TABLE", "schema": "CMS_HCC", "name": "_INT_HCC_HIERARCHY", "database": "DEV_SARAH", "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-11-28 23:52UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.cms_hcc__int_hcc_hierarchy"}, "model.the_tuva_project.cms_hcc__int_hcc_count_factors": {"metadata": {"type": "BASE TABLE", "schema": "CMS_HCC", "name": "_INT_HCC_COUNT_FACTORS", "database": "DEV_SARAH", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"PATIENT_ID": {"type": "TEXT", "index": 1, "name": "PATIENT_ID", "comment": null}, "DESCRIPTION": {"type": "TEXT", "index": 2, "name": "DESCRIPTION", "comment": null}, "COEFFICIENT": {"type": "NUMBER", "index": 3, "name": "COEFFICIENT", "comment": null}, "FACTOR_TYPE": {"type": "TEXT", "index": 4, "name": "FACTOR_TYPE", "comment": null}, "MODEL_VERSION": {"type": "TEXT", "index": 5, "name": "MODEL_VERSION", "comment": null}, "PAYMENT_YEAR": {"type": "NUMBER", "index": 6, "name": "PAYMENT_YEAR", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 7, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-11-28 23:52UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.cms_hcc__int_hcc_count_factors"}, "model.the_tuva_project.readmissions__readmission_summary": {"metadata": {"type": "BASE TABLE", "schema": "READMISSIONS", "name": "READMISSION_SUMMARY", "database": "DEV_SARAH", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"ENCOUNTER_ID": {"type": "TEXT", "index": 1, "name": "ENCOUNTER_ID", "comment": null}, "PATIENT_ID": {"type": "TEXT", "index": 2, "name": "PATIENT_ID", "comment": null}, "ADMIT_DATE": {"type": "DATE", "index": 3, "name": "ADMIT_DATE", "comment": null}, "DISCHARGE_DATE": {"type": "DATE", "index": 4, "name": "DISCHARGE_DATE", "comment": null}, "DISCHARGE_DISPOSITION_CODE": {"type": "TEXT", "index": 5, "name": "DISCHARGE_DISPOSITION_CODE", "comment": null}, "FACILITY_NPI": {"type": "TEXT", "index": 6, "name": "FACILITY_NPI", "comment": null}, "MS_DRG_CODE": {"type": "TEXT", "index": 7, "name": "MS_DRG_CODE", "comment": null}, "PAID_AMOUNT": {"type": "NUMBER", "index": 8, "name": "PAID_AMOUNT", "comment": null}, "LENGTH_OF_STAY": {"type": "NUMBER", "index": 9, "name": "LENGTH_OF_STAY", "comment": null}, "INDEX_ADMISSION_FLAG": {"type": "NUMBER", "index": 10, "name": "INDEX_ADMISSION_FLAG", "comment": null}, "PLANNED_FLAG": {"type": "NUMBER", "index": 11, "name": "PLANNED_FLAG", "comment": null}, "SPECIALTY_COHORT": {"type": "TEXT", "index": 12, "name": "SPECIALTY_COHORT", "comment": null}, "DIED_FLAG": {"type": "NUMBER", "index": 13, "name": "DIED_FLAG", "comment": null}, "DIAGNOSIS_CCS": {"type": "TEXT", "index": 14, "name": "DIAGNOSIS_CCS", "comment": null}, "HAD_READMISSION_FLAG": {"type": "NUMBER", "index": 15, "name": "HAD_READMISSION_FLAG", "comment": null}, "DAYS_TO_READMIT": {"type": "NUMBER", "index": 16, "name": "DAYS_TO_READMIT", "comment": null}, "READMIT_30_FLAG": {"type": "NUMBER", "index": 17, "name": "READMIT_30_FLAG", "comment": null}, "UNPLANNED_READMIT_30_FLAG": {"type": "NUMBER", "index": 18, "name": "UNPLANNED_READMIT_30_FLAG", "comment": null}, "READMISSION_ENCOUNTER_ID": {"type": "TEXT", "index": 19, "name": "READMISSION_ENCOUNTER_ID", "comment": null}, "READMISSION_ADMIT_DATE": {"type": "DATE", "index": 20, "name": "READMISSION_ADMIT_DATE", "comment": null}, "READMISSION_DISCHARGE_DATE": {"type": "DATE", "index": 21, "name": "READMISSION_DISCHARGE_DATE", "comment": null}, "READMISSION_DISCHARGE_DISPOSITION_CODE": {"type": "TEXT", "index": 22, "name": "READMISSION_DISCHARGE_DISPOSITION_CODE", "comment": null}, "READMISSION_FACILITY": {"type": "TEXT", "index": 23, "name": "READMISSION_FACILITY", "comment": null}, "READMISSION_MS_DRG": {"type": "TEXT", "index": 24, "name": "READMISSION_MS_DRG", "comment": null}, "READMISSION_LENGTH_OF_STAY": {"type": "NUMBER", "index": 25, "name": "READMISSION_LENGTH_OF_STAY", "comment": null}, "READMISSION_INDEX_ADMISSION_FLAG": {"type": "NUMBER", "index": 26, "name": "READMISSION_INDEX_ADMISSION_FLAG", "comment": null}, "READMISSION_PLANNED_FLAG": {"type": "NUMBER", "index": 27, "name": "READMISSION_PLANNED_FLAG", "comment": null}, "READMISSION_SPECIALTY_COHORT": {"type": "TEXT", "index": 28, "name": "READMISSION_SPECIALTY_COHORT", "comment": null}, "READMISSION_DIED_FLAG": {"type": "NUMBER", "index": 29, "name": "READMISSION_DIED_FLAG", "comment": null}, "READMISSION_DIAGNOSIS_CCS": {"type": "TEXT", "index": 30, "name": "READMISSION_DIAGNOSIS_CCS", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 31, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-11-28 23:52UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.readmissions__readmission_summary"}, "seed.the_tuva_project.readmissions__exclusion_ccs_diagnosis_category": {"metadata": {"type": "BASE TABLE", "schema": "READMISSIONS", "name": "_VALUE_SET_EXCLUSION_CCS_DIAGNOSIS_CATEGORY", "database": "DEV_SARAH", "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-11-28 23:49UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 3072.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 47.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.the_tuva_project.readmissions__exclusion_ccs_diagnosis_category"}, "model.the_tuva_project.chronic_conditions__cms_chronic_conditions_all": {"metadata": {"type": "BASE TABLE", "schema": "CHRONIC_CONDITIONS", "name": "_INT_CMS_CHRONIC_CONDITION_ALL", "database": "DEV_SARAH", "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-11-28 23:51UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.chronic_conditions__cms_chronic_conditions_all"}, "seed.the_tuva_project.terminology__claim_type": {"metadata": {"type": "BASE TABLE", "schema": "TERMINOLOGY", "name": "CLAIM_TYPE", "database": "DEV_SARAH", "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-11-28 23:50UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 1024.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 4.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.the_tuva_project.terminology__claim_type"}, "model.the_tuva_project.cms_hcc__patient_risk_scores": {"metadata": {"type": "BASE TABLE", "schema": "CMS_HCC", "name": "PATIENT_RISK_SCORES", "database": "DEV_SARAH", "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-11-28 23:52UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.cms_hcc__patient_risk_scores"}, "model.the_tuva_project.readmissions__index_time_requirement": {"metadata": {"type": "VIEW", "schema": "READMISSIONS", "name": "_INT_INDEX_TIME_REQUIREMENT", "database": "DEV_SARAH", "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"}, "seed.the_tuva_project.terminology__discharge_disposition": {"metadata": {"type": "BASE TABLE", "schema": "TERMINOLOGY", "name": "DISCHARGE_DISPOSITION", "database": "DEV_SARAH", "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-11-28 23:50UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 3072.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 41.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.the_tuva_project.terminology__discharge_disposition"}, "seed.the_tuva_project.readmissions__acute_diagnosis_icd_10_cm": {"metadata": {"type": "BASE TABLE", "schema": "READMISSIONS", "name": "_VALUE_SET_ACUTE_DIAGNOSIS_ICD_10_CM", "database": "DEV_SARAH", "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-11-28 23:49UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 183808.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 12333.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.the_tuva_project.readmissions__acute_diagnosis_icd_10_cm"}, "model.the_tuva_project.financial_pmpm__member_months": {"metadata": {"type": "BASE TABLE", "schema": "FINANCIAL_PMPM", "name": "MEMBER_MONTHS", "database": "DEV_SARAH", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"PATIENT_ID": {"type": "TEXT", "index": 1, "name": "PATIENT_ID", "comment": null}, "YEAR_MONTH": {"type": "TEXT", "index": 2, "name": "YEAR_MONTH", "comment": null}, "PAYER": {"type": "TEXT", "index": 3, "name": "PAYER", "comment": null}, "PLAN": {"type": "TEXT", "index": 4, "name": "PLAN", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 5, "name": "DATA_SOURCE", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 6, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-11-28 23:51UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.financial_pmpm__member_months"}, "model.the_tuva_project.quality_measures__int_nqf0034_exclude_hospice_palliative": {"metadata": {"type": "BASE TABLE", "schema": "QUALITY_MEASURES", "name": "_INT_NQF0034_EXCLUDE_HOSPICE_PALLIATIVE", "database": "DEV_SARAH", "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-11-28 23:51UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.quality_measures__int_nqf0034_exclude_hospice_palliative"}, "model.the_tuva_project.cms_hcc__int_demographic_factors": {"metadata": {"type": "BASE TABLE", "schema": "CMS_HCC", "name": "_INT_DEMOGRAPHIC_FACTORS", "database": "DEV_SARAH", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"PATIENT_ID": {"type": "TEXT", "index": 1, "name": "PATIENT_ID", "comment": null}, "ENROLLMENT_STATUS": {"type": "TEXT", "index": 2, "name": "ENROLLMENT_STATUS", "comment": null}, "GENDER": {"type": "TEXT", "index": 3, "name": "GENDER", "comment": null}, "AGE_GROUP": {"type": "TEXT", "index": 4, "name": "AGE_GROUP", "comment": null}, "MEDICAID_STATUS": {"type": "TEXT", "index": 5, "name": "MEDICAID_STATUS", "comment": null}, "DUAL_STATUS": {"type": "TEXT", "index": 6, "name": "DUAL_STATUS", "comment": null}, "OREC": {"type": "TEXT", "index": 7, "name": "OREC", "comment": null}, "INSTITUTIONAL_STATUS": {"type": "TEXT", "index": 8, "name": "INSTITUTIONAL_STATUS", "comment": null}, "ENROLLMENT_STATUS_DEFAULT": {"type": "BOOLEAN", "index": 9, "name": "ENROLLMENT_STATUS_DEFAULT", "comment": null}, "MEDICAID_DUAL_STATUS_DEFAULT": {"type": "BOOLEAN", "index": 10, "name": "MEDICAID_DUAL_STATUS_DEFAULT", "comment": null}, "OREC_DEFAULT": {"type": "BOOLEAN", "index": 11, "name": "OREC_DEFAULT", "comment": null}, "INSTITUTIONAL_STATUS_DEFAULT": {"type": "BOOLEAN", "index": 12, "name": "INSTITUTIONAL_STATUS_DEFAULT", "comment": null}, "COEFFICIENT": {"type": "NUMBER", "index": 13, "name": "COEFFICIENT", "comment": null}, "FACTOR_TYPE": {"type": "TEXT", "index": 14, "name": "FACTOR_TYPE", "comment": null}, "MODEL_VERSION": {"type": "TEXT", "index": 15, "name": "MODEL_VERSION", "comment": null}, "PAYMENT_YEAR": {"type": "NUMBER", "index": 16, "name": "PAYMENT_YEAR", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 17, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-11-28 23:51UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.cms_hcc__int_demographic_factors"}, "seed.the_tuva_project.ed_classification__johnston_icd10": {"metadata": {"type": "BASE TABLE", "schema": "ED_CLASSIFICATION", "name": "_VALUE_SET_JOHNSTON_ICD10", "database": "DEV_SARAH", "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-11-28 23:50UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 350208.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 47132.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.the_tuva_project.ed_classification__johnston_icd10"}, "seed.the_tuva_project.terminology__apr_drg": {"metadata": {"type": "BASE TABLE", "schema": "TERMINOLOGY", "name": "APR_DRG", "database": "DEV_SARAH", "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-11-28 23:50UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 12288.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 1272.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.the_tuva_project.terminology__apr_drg"}, "model.the_tuva_project.ccsr__singular_condition_category": {"metadata": {"type": "BASE TABLE", "schema": "CCSR", "name": "SINGULAR_CONDITION_CATEGORY", "database": "DEV_SARAH", "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-11-28 23:51UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.ccsr__singular_condition_category"}, "seed.the_tuva_project.terminology__bill_type": {"metadata": {"type": "BASE TABLE", "schema": "TERMINOLOGY", "name": "BILL_TYPE", "database": "DEV_SARAH", "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-11-28 23:50UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 22016.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 1701.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.the_tuva_project.terminology__bill_type"}, "model.the_tuva_project.service_category__ambulance_professional": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_AMBULANCE_PROFESSIONAL", "database": "DEV_SARAH", "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-11-28 23:50UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.service_category__ambulance_professional"}, "seed.the_tuva_project.terminology__medicare_orec": {"metadata": {"type": "BASE TABLE", "schema": "TERMINOLOGY", "name": "MEDICARE_OREC", "database": "DEV_SARAH", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"ORIGINAL_REASON_ENTITLEMENT_CODE": {"type": "TEXT", "index": 1, "name": "ORIGINAL_REASON_ENTITLEMENT_CODE", "comment": null}, "ORIGINAL_REASON_ENTITLEMENT_DESCRIPTION": {"type": "TEXT", "index": 2, "name": "ORIGINAL_REASON_ENTITLEMENT_DESCRIPTION", "comment": null}}, "stats": {"last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-11-28 23:50UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 1536.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 4.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.the_tuva_project.terminology__medicare_orec"}, "seed.the_tuva_project.readmissions__potentially_planned_ccs_procedure_category": {"metadata": {"type": "BASE TABLE", "schema": "READMISSIONS", "name": "_VALUE_SET_POTENTIALLY_PLANNED_CCS_PROCEDURE_CATEGORY", "database": "DEV_SARAH", "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-11-28 23:49UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 3072.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 65.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.the_tuva_project.readmissions__potentially_planned_ccs_procedure_category"}, "model.the_tuva_project.cms_hcc__int_disease_interaction_factors": {"metadata": {"type": "BASE TABLE", "schema": "CMS_HCC", "name": "_INT_DISEASE_INTERACTION_FACTORS", "database": "DEV_SARAH", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"PATIENT_ID": {"type": "TEXT", "index": 1, "name": "PATIENT_ID", "comment": null}, "HCC_CODE_1": {"type": "TEXT", "index": 2, "name": "HCC_CODE_1", "comment": null}, "HCC_CODE_2": {"type": "TEXT", "index": 3, "name": "HCC_CODE_2", "comment": null}, "DESCRIPTION": {"type": "TEXT", "index": 4, "name": "DESCRIPTION", "comment": null}, "COEFFICIENT": {"type": "NUMBER", "index": 5, "name": "COEFFICIENT", "comment": null}, "FACTOR_TYPE": {"type": "TEXT", "index": 6, "name": "FACTOR_TYPE", "comment": null}, "MODEL_VERSION": {"type": "TEXT", "index": 7, "name": "MODEL_VERSION", "comment": null}, "PAYMENT_YEAR": {"type": "NUMBER", "index": 8, "name": "PAYMENT_YEAR", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 9, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-11-28 23:52UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.cms_hcc__int_disease_interaction_factors"}, "model.the_tuva_project.quality_measures__int_nqf2372_exclude_hospice": {"metadata": {"type": "BASE TABLE", "schema": "QUALITY_MEASURES", "name": "_INT_NQF2372_EXCLUDE_HOSPICE", "database": "DEV_SARAH", "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-11-28 23:51UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.quality_measures__int_nqf2372_exclude_hospice"}, "model.the_tuva_project.core__stg_clinical_procedure": {"metadata": {"type": "VIEW", "schema": "CORE", "name": "_STG_CLINICAL_PROCEDURE", "database": "DEV_SARAH", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"PROCEDURE_ID": {"type": "TEXT", "index": 1, "name": "PROCEDURE_ID", "comment": null}, "PATIENT_ID": {"type": "TEXT", "index": 2, "name": "PATIENT_ID", "comment": null}, "ENCOUNTER_ID": {"type": "TEXT", "index": 3, "name": "ENCOUNTER_ID", "comment": null}, "CLAIM_ID": {"type": "TEXT", "index": 4, "name": "CLAIM_ID", "comment": null}, "PROCEDURE_DATE": {"type": "DATE", "index": 5, "name": "PROCEDURE_DATE", "comment": null}, "SOURCE_CODE_TYPE": {"type": "TEXT", "index": 6, "name": "SOURCE_CODE_TYPE", "comment": null}, "SOURCE_CODE": {"type": "TEXT", "index": 7, "name": "SOURCE_CODE", "comment": null}, "SOURCE_DESCRIPTION": {"type": "TEXT", "index": 8, "name": "SOURCE_DESCRIPTION", "comment": null}, "NORMALIZED_CODE_TYPE": {"type": "TEXT", "index": 9, "name": "NORMALIZED_CODE_TYPE", "comment": null}, "NORMALIZED_CODE": {"type": "TEXT", "index": 10, "name": "NORMALIZED_CODE", "comment": null}, "NORMALIZED_DESCRIPTION": {"type": "TEXT", "index": 11, "name": "NORMALIZED_DESCRIPTION", "comment": null}, "MODIFIER_1": {"type": "TEXT", "index": 12, "name": "MODIFIER_1", "comment": null}, "MODIFIER_2": {"type": "TEXT", "index": 13, "name": "MODIFIER_2", "comment": null}, "MODIFIER_3": {"type": "TEXT", "index": 14, "name": "MODIFIER_3", "comment": null}, "MODIFIER_4": {"type": "TEXT", "index": 15, "name": "MODIFIER_4", "comment": null}, "MODIFIER_5": {"type": "TEXT", "index": 16, "name": "MODIFIER_5", "comment": null}, "PRACTITIONER_ID": {"type": "TEXT", "index": 17, "name": "PRACTITIONER_ID", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 18, "name": "DATA_SOURCE", "comment": null}, "TUVA_LAST_RUN": {"type": "TIMESTAMP_NTZ", "index": 19, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.core__stg_clinical_procedure"}, "model.the_tuva_project.core__stg_claims_location": {"metadata": {"type": "VIEW", "schema": "CORE", "name": "_STG_CLAIMS_LOCATION", "database": "DEV_SARAH", "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"}, "model.the_tuva_project.service_category__dialysis_institutional": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_DIALYSIS_INSTITUTIONAL", "database": "DEV_SARAH", "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-11-28 23:50UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.service_category__dialysis_institutional"}, "model.the_tuva_project.readmissions__encounter": {"metadata": {"type": "VIEW", "schema": "READMISSIONS", "name": "_INT_ENCOUNTER", "database": "DEV_SARAH", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"ENCOUNTER_ID": {"type": "TEXT", "index": 1, "name": "ENCOUNTER_ID", "comment": null}, "PATIENT_ID": {"type": "TEXT", "index": 2, "name": "PATIENT_ID", "comment": null}, "ADMIT_DATE": {"type": "DATE", "index": 3, "name": "ADMIT_DATE", "comment": null}, "DISCHARGE_DATE": {"type": "DATE", "index": 4, "name": "DISCHARGE_DATE", "comment": null}, "DISCHARGE_DISPOSITION_CODE": {"type": "TEXT", "index": 5, "name": "DISCHARGE_DISPOSITION_CODE", "comment": null}, "FACILITY_NPI": {"type": "TEXT", "index": 6, "name": "FACILITY_NPI", "comment": null}, "MS_DRG_CODE": {"type": "TEXT", "index": 7, "name": "MS_DRG_CODE", "comment": null}, "PAID_AMOUNT": {"type": "NUMBER", "index": 8, "name": "PAID_AMOUNT", "comment": null}, "PRIMARY_DIAGNOSIS_CODE": {"type": "TEXT", "index": 9, "name": "PRIMARY_DIAGNOSIS_CODE", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 10, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.readmissions__encounter"}, "seed.input_layer.eligibility_seed": {"metadata": {"type": "BASE TABLE", "schema": "_TUVA_SYNTHETIC", "name": "ELIGIBILITY_SEED", "database": "DEV_SARAH", "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}, "PLAN": {"type": "TEXT", "index": 12, "name": "PLAN", "comment": null}, "ORIGINAL_REASON_ENTITLEMENT_CODE": {"type": "TEXT", "index": 13, "name": "ORIGINAL_REASON_ENTITLEMENT_CODE", "comment": null}, "DUAL_STATUS_CODE": {"type": "TEXT", "index": 14, "name": "DUAL_STATUS_CODE", "comment": null}, "MEDICARE_STATUS_CODE": {"type": "TEXT", "index": 15, "name": "MEDICARE_STATUS_CODE", "comment": null}, "FIRST_NAME": {"type": "TEXT", "index": 16, "name": "FIRST_NAME", "comment": null}, "LAST_NAME": {"type": "TEXT", "index": 17, "name": "LAST_NAME", "comment": null}, "ADDRESS": {"type": "TEXT", "index": 18, "name": "ADDRESS", "comment": null}, "CITY": {"type": "TEXT", "index": 19, "name": "CITY", "comment": null}, "STATE": {"type": "TEXT", "index": 20, "name": "STATE", "comment": null}, "ZIP_CODE": {"type": "TEXT", "index": 21, "name": "ZIP_CODE", "comment": null}, "PHONE": {"type": "TEXT", "index": 22, "name": "PHONE", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 23, "name": "DATA_SOURCE", "comment": null}}, "stats": {"last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-11-28 23:49UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.input_layer.eligibility_seed"}, "model.the_tuva_project.cms_hcc__int_disease_factors": {"metadata": {"type": "BASE TABLE", "schema": "CMS_HCC", "name": "_INT_DISEASE_FACTORS", "database": "DEV_SARAH", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"PATIENT_ID": {"type": "TEXT", "index": 1, "name": "PATIENT_ID", "comment": null}, "HCC_CODE": {"type": "TEXT", "index": 2, "name": "HCC_CODE", "comment": null}, "HCC_DESCRIPTION": {"type": "TEXT", "index": 3, "name": "HCC_DESCRIPTION", "comment": null}, "COEFFICIENT": {"type": "NUMBER", "index": 4, "name": "COEFFICIENT", "comment": null}, "FACTOR_TYPE": {"type": "TEXT", "index": 5, "name": "FACTOR_TYPE", "comment": null}, "MODEL_VERSION": {"type": "TEXT", "index": 6, "name": "MODEL_VERSION", "comment": null}, "PAYMENT_YEAR": {"type": "NUMBER", "index": 7, "name": "PAYMENT_YEAR", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 8, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-11-28 23:52UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.cms_hcc__int_disease_factors"}, "model.the_tuva_project.quality_measures__int_nqf0034_exclude_dementia": {"metadata": {"type": "BASE TABLE", "schema": "QUALITY_MEASURES", "name": "_INT_NQF0034_EXCLUDE_DEMENTIA", "database": "DEV_SARAH", "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-11-28 23:52UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.quality_measures__int_nqf0034_exclude_dementia"}, "model.the_tuva_project.chronic_conditions__cms_chronic_conditions_long": {"metadata": {"type": "BASE TABLE", "schema": "CHRONIC_CONDITIONS", "name": "CMS_CHRONIC_CONDITIONS_LONG", "database": "DEV_SARAH", "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-11-28 23:52UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.chronic_conditions__cms_chronic_conditions_long"}, "model.the_tuva_project.financial_pmpm__service_category_1_paid_pivot": {"metadata": {"type": "BASE TABLE", "schema": "FINANCIAL_PMPM", "name": "_INT_SERVICE_CATEGORY_1_PAID_PIVOT", "database": "DEV_SARAH", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"PATIENT_ID": {"type": "TEXT", "index": 1, "name": "PATIENT_ID", "comment": null}, "YEAR_MONTH": {"type": "TEXT", "index": 2, "name": "YEAR_MONTH", "comment": null}, "PAYER": {"type": "TEXT", "index": 3, "name": "PAYER", "comment": null}, "PLAN": {"type": "TEXT", "index": 4, "name": "PLAN", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 5, "name": "DATA_SOURCE", "comment": null}, "INPATIENT_PAID": {"type": "NUMBER", "index": 6, "name": "INPATIENT_PAID", "comment": null}, "OUTPATIENT_PAID": {"type": "NUMBER", "index": 7, "name": "OUTPATIENT_PAID", "comment": null}, "OFFICE_VISIT_PAID": {"type": "NUMBER", "index": 8, "name": "OFFICE_VISIT_PAID", "comment": null}, "ANCILLARY_PAID": {"type": "NUMBER", "index": 9, "name": "ANCILLARY_PAID", "comment": null}, "OTHER_PAID": {"type": "NUMBER", "index": 10, "name": "OTHER_PAID", "comment": null}, "PHARMACY_PAID": {"type": "NUMBER", "index": 11, "name": "PHARMACY_PAID", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 12, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-11-28 23:51UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.financial_pmpm__service_category_1_paid_pivot"}, "model.the_tuva_project.service_category__urgent_care_professional": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_URGENT_CARE_PROFESSIONAL", "database": "DEV_SARAH", "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-11-28 23:51UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.service_category__urgent_care_professional"}, "model.the_tuva_project.service_category__dialysis_professional": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_DIALYSIS_PROFESSIONAL", "database": "DEV_SARAH", "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-11-28 23:50UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.service_category__dialysis_professional"}, "model.the_tuva_project.core__encounter": {"metadata": {"type": "BASE TABLE", "schema": "CORE", "name": "ENCOUNTER", "database": "DEV_SARAH", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"ENCOUNTER_ID": {"type": "TEXT", "index": 1, "name": "ENCOUNTER_ID", "comment": null}, "PATIENT_ID": {"type": "TEXT", "index": 2, "name": "PATIENT_ID", "comment": null}, "ENCOUNTER_TYPE": {"type": "TEXT", "index": 3, "name": "ENCOUNTER_TYPE", "comment": null}, "ENCOUNTER_START_DATE": {"type": "DATE", "index": 4, "name": "ENCOUNTER_START_DATE", "comment": null}, "ENCOUNTER_END_DATE": {"type": "DATE", "index": 5, "name": "ENCOUNTER_END_DATE", "comment": null}, "LENGTH_OF_STAY": {"type": "NUMBER", "index": 6, "name": "LENGTH_OF_STAY", "comment": null}, "ADMIT_SOURCE_CODE": {"type": "TEXT", "index": 7, "name": "ADMIT_SOURCE_CODE", "comment": null}, "ADMIT_SOURCE_DESCRIPTION": {"type": "TEXT", "index": 8, "name": "ADMIT_SOURCE_DESCRIPTION", "comment": null}, "ADMIT_TYPE_CODE": {"type": "TEXT", "index": 9, "name": "ADMIT_TYPE_CODE", "comment": null}, "ADMIT_TYPE_DESCRIPTION": {"type": "TEXT", "index": 10, "name": "ADMIT_TYPE_DESCRIPTION", "comment": null}, "DISCHARGE_DISPOSITION_CODE": {"type": "TEXT", "index": 11, "name": "DISCHARGE_DISPOSITION_CODE", "comment": null}, "DISCHARGE_DISPOSITION_DESCRIPTION": {"type": "TEXT", "index": 12, "name": "DISCHARGE_DISPOSITION_DESCRIPTION", "comment": null}, "ATTENDING_PROVIDER_ID": {"type": "TEXT", "index": 13, "name": "ATTENDING_PROVIDER_ID", "comment": null}, "FACILITY_NPI": {"type": "TEXT", "index": 14, "name": "FACILITY_NPI", "comment": null}, "PRIMARY_DIAGNOSIS_CODE_TYPE": {"type": "TEXT", "index": 15, "name": "PRIMARY_DIAGNOSIS_CODE_TYPE", "comment": null}, "PRIMARY_DIAGNOSIS_CODE": {"type": "TEXT", "index": 16, "name": "PRIMARY_DIAGNOSIS_CODE", "comment": null}, "PRIMARY_DIAGNOSIS_DESCRIPTION": {"type": "TEXT", "index": 17, "name": "PRIMARY_DIAGNOSIS_DESCRIPTION", "comment": null}, "MS_DRG_CODE": {"type": "TEXT", "index": 18, "name": "MS_DRG_CODE", "comment": null}, "MS_DRG_DESCRIPTION": {"type": "TEXT", "index": 19, "name": "MS_DRG_DESCRIPTION", "comment": null}, "APR_DRG_CODE": {"type": "TEXT", "index": 20, "name": "APR_DRG_CODE", "comment": null}, "APR_DRG_DESCRIPTION": {"type": "TEXT", "index": 21, "name": "APR_DRG_DESCRIPTION", "comment": null}, "PAID_AMOUNT": {"type": "NUMBER", "index": 22, "name": "PAID_AMOUNT", "comment": null}, "ALLOWED_AMOUNT": {"type": "NUMBER", "index": 23, "name": "ALLOWED_AMOUNT", "comment": null}, "CHARGE_AMOUNT": {"type": "NUMBER", "index": 24, "name": "CHARGE_AMOUNT", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 25, "name": "DATA_SOURCE", "comment": null}, "TUVA_LAST_RUN": {"type": "TIMESTAMP_NTZ", "index": 26, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-11-28 23:50UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.core__encounter"}, "model.the_tuva_project.quality_measures__int_nqf0034__performance_period": {"metadata": {"type": "VIEW", "schema": "QUALITY_MEASURES", "name": "_INT_NQF0034__PERFORMANCE_PERIOD", "database": "DEV_SARAH", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"PERFORMANCE_PERIOD_BEGIN": {"type": "DATE", "index": 1, "name": "PERFORMANCE_PERIOD_BEGIN", "comment": null}, "PERFORMANCE_PERIOD_END": {"type": "DATE", "index": 2, "name": "PERFORMANCE_PERIOD_END", "comment": null}, "PERFORMANCE_PERIOD_BEGIN_1YP": {"type": "DATE", "index": 3, "name": "PERFORMANCE_PERIOD_BEGIN_1YP", "comment": null}, "PERFORMANCE_PERIOD_BEGIN_2YP": {"type": "DATE", "index": 4, "name": "PERFORMANCE_PERIOD_BEGIN_2YP", "comment": null}, "PERFORMANCE_PERIOD_BEGIN_4YP": {"type": "DATE", "index": 5, "name": "PERFORMANCE_PERIOD_BEGIN_4YP", "comment": null}, "PERFORMANCE_PERIOD_BEGIN_9YP": {"type": "DATE", "index": 6, "name": "PERFORMANCE_PERIOD_BEGIN_9YP", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.quality_measures__int_nqf0034__performance_period"}, "model.the_tuva_project.cms_hcc__int_hcc_mapping": {"metadata": {"type": "BASE TABLE", "schema": "CMS_HCC", "name": "_INT_HCC_MAPPING", "database": "DEV_SARAH", "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-11-28 23:51UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.cms_hcc__int_hcc_mapping"}, "model.the_tuva_project.cms_hcc__int_disabled_interaction_factors": {"metadata": {"type": "BASE TABLE", "schema": "CMS_HCC", "name": "_INT_DISABLED_INTERACTION_FACTORS", "database": "DEV_SARAH", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"PATIENT_ID": {"type": "TEXT", "index": 1, "name": "PATIENT_ID", "comment": null}, "DESCRIPTION": {"type": "TEXT", "index": 2, "name": "DESCRIPTION", "comment": null}, "COEFFICIENT": {"type": "NUMBER", "index": 3, "name": "COEFFICIENT", "comment": null}, "FACTOR_TYPE": {"type": "TEXT", "index": 4, "name": "FACTOR_TYPE", "comment": null}, "MODEL_VERSION": {"type": "TEXT", "index": 5, "name": "MODEL_VERSION", "comment": null}, "PAYMENT_YEAR": {"type": "NUMBER", "index": 6, "name": "PAYMENT_YEAR", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 7, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-11-28 23:52UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.cms_hcc__int_disabled_interaction_factors"}, "model.the_tuva_project.chronic_conditions__cms_chronic_conditions_wide": {"metadata": {"type": "BASE TABLE", "schema": "CHRONIC_CONDITIONS", "name": "CMS_CHRONIC_CONDITIONS_WIDE", "database": "DEV_SARAH", "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-11-28 23:52UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.chronic_conditions__cms_chronic_conditions_wide"}, "model.the_tuva_project.data_profiling__institutional_header_failures": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_INSTITUTIONAL_HEADER_FAILURES", "database": "DEV_SARAH", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"CLAIM_ID": {"type": "TEXT", "index": 1, "name": "CLAIM_ID", "comment": null}, "CLAIM_LINE_NUMBER": {"type": "NUMBER", "index": 2, "name": "CLAIM_LINE_NUMBER", "comment": null}, "CLAIM_TYPE": {"type": "TEXT", "index": 3, "name": "CLAIM_TYPE", "comment": null}, "PATIENT_ID": {"type": "TEXT", "index": 4, "name": "PATIENT_ID", "comment": null}, "MEMBER_ID": {"type": "TEXT", "index": 5, "name": "MEMBER_ID", "comment": null}, "PAYER": {"type": "TEXT", "index": 6, "name": "PAYER", "comment": null}, "PLAN": {"type": "TEXT", "index": 7, "name": "PLAN", "comment": null}, "CLAIM_START_DATE": {"type": "DATE", "index": 8, "name": "CLAIM_START_DATE", "comment": null}, "CLAIM_END_DATE": {"type": "DATE", "index": 9, "name": "CLAIM_END_DATE", "comment": null}, "CLAIM_LINE_START_DATE": {"type": "DATE", "index": 10, "name": "CLAIM_LINE_START_DATE", "comment": null}, "CLAIM_LINE_END_DATE": {"type": "DATE", "index": 11, "name": "CLAIM_LINE_END_DATE", "comment": null}, "ADMISSION_DATE": {"type": "DATE", "index": 12, "name": "ADMISSION_DATE", "comment": null}, "DISCHARGE_DATE": {"type": "DATE", "index": 13, "name": "DISCHARGE_DATE", "comment": null}, "ADMIT_SOURCE_CODE": {"type": "TEXT", "index": 14, "name": "ADMIT_SOURCE_CODE", "comment": null}, "ADMIT_TYPE_CODE": {"type": "TEXT", "index": 15, "name": "ADMIT_TYPE_CODE", "comment": null}, "DISCHARGE_DISPOSITION_CODE": {"type": "TEXT", "index": 16, "name": "DISCHARGE_DISPOSITION_CODE", "comment": null}, "PLACE_OF_SERVICE_CODE": {"type": "TEXT", "index": 17, "name": "PLACE_OF_SERVICE_CODE", "comment": null}, "BILL_TYPE_CODE": {"type": "TEXT", "index": 18, "name": "BILL_TYPE_CODE", "comment": null}, "MS_DRG_CODE": {"type": "TEXT", "index": 19, "name": "MS_DRG_CODE", "comment": null}, "APR_DRG_CODE": {"type": "TEXT", "index": 20, "name": "APR_DRG_CODE", "comment": null}, "REVENUE_CENTER_CODE": {"type": "TEXT", "index": 21, "name": "REVENUE_CENTER_CODE", "comment": null}, "SERVICE_UNIT_QUANTITY": {"type": "NUMBER", "index": 22, "name": "SERVICE_UNIT_QUANTITY", "comment": null}, "HCPCS_CODE": {"type": "TEXT", "index": 23, "name": "HCPCS_CODE", "comment": null}, "HCPCS_MODIFIER_1": {"type": "TEXT", "index": 24, "name": "HCPCS_MODIFIER_1", "comment": null}, "HCPCS_MODIFIER_2": {"type": "TEXT", "index": 25, "name": "HCPCS_MODIFIER_2", "comment": null}, "HCPCS_MODIFIER_3": {"type": "TEXT", "index": 26, "name": "HCPCS_MODIFIER_3", "comment": null}, "HCPCS_MODIFIER_4": {"type": "TEXT", "index": 27, "name": "HCPCS_MODIFIER_4", "comment": null}, "HCPCS_MODIFIER_5": {"type": "TEXT", "index": 28, "name": "HCPCS_MODIFIER_5", "comment": null}, "RENDERING_NPI": {"type": "TEXT", "index": 29, "name": "RENDERING_NPI", "comment": null}, "BILLING_NPI": {"type": "TEXT", "index": 30, "name": "BILLING_NPI", "comment": null}, "FACILITY_NPI": {"type": "TEXT", "index": 31, "name": "FACILITY_NPI", "comment": null}, "PAID_DATE": {"type": "DATE", "index": 32, "name": "PAID_DATE", "comment": null}, "PAID_AMOUNT": {"type": "FLOAT", "index": 33, "name": "PAID_AMOUNT", "comment": null}, "ALLOWED_AMOUNT": {"type": "FLOAT", "index": 34, "name": "ALLOWED_AMOUNT", "comment": null}, "CHARGE_AMOUNT": {"type": "FLOAT", "index": 35, "name": "CHARGE_AMOUNT", "comment": null}, "COINSURANCE_AMOUNT": {"type": "FLOAT", "index": 36, "name": "COINSURANCE_AMOUNT", "comment": null}, "COPAYMENT_AMOUNT": {"type": "FLOAT", "index": 37, "name": "COPAYMENT_AMOUNT", "comment": null}, "DEDUCTIBLE_AMOUNT": {"type": "FLOAT", "index": 38, "name": "DEDUCTIBLE_AMOUNT", "comment": null}, "TOTAL_COST_AMOUNT": {"type": "FLOAT", "index": 39, "name": "TOTAL_COST_AMOUNT", "comment": null}, "DIAGNOSIS_CODE_TYPE": {"type": "TEXT", "index": 40, "name": "DIAGNOSIS_CODE_TYPE", "comment": null}, "DIAGNOSIS_CODE_1": {"type": "TEXT", "index": 41, "name": "DIAGNOSIS_CODE_1", "comment": null}, "DIAGNOSIS_CODE_2": {"type": "TEXT", "index": 42, "name": "DIAGNOSIS_CODE_2", "comment": null}, "DIAGNOSIS_CODE_3": {"type": "TEXT", "index": 43, "name": "DIAGNOSIS_CODE_3", "comment": null}, "DIAGNOSIS_CODE_4": {"type": "TEXT", "index": 44, "name": "DIAGNOSIS_CODE_4", "comment": null}, "DIAGNOSIS_CODE_5": {"type": "TEXT", "index": 45, "name": "DIAGNOSIS_CODE_5", "comment": null}, "DIAGNOSIS_CODE_6": {"type": "TEXT", "index": 46, "name": "DIAGNOSIS_CODE_6", "comment": null}, "DIAGNOSIS_CODE_7": {"type": "TEXT", "index": 47, "name": "DIAGNOSIS_CODE_7", "comment": null}, "DIAGNOSIS_CODE_8": {"type": "TEXT", "index": 48, "name": "DIAGNOSIS_CODE_8", "comment": null}, "DIAGNOSIS_CODE_9": {"type": "TEXT", "index": 49, "name": "DIAGNOSIS_CODE_9", "comment": null}, "DIAGNOSIS_CODE_10": {"type": "TEXT", "index": 50, "name": "DIAGNOSIS_CODE_10", "comment": null}, "DIAGNOSIS_CODE_11": {"type": "TEXT", "index": 51, "name": "DIAGNOSIS_CODE_11", "comment": null}, "DIAGNOSIS_CODE_12": {"type": "TEXT", "index": 52, "name": "DIAGNOSIS_CODE_12", "comment": null}, "DIAGNOSIS_CODE_13": {"type": "TEXT", "index": 53, "name": "DIAGNOSIS_CODE_13", "comment": null}, "DIAGNOSIS_CODE_14": {"type": "TEXT", "index": 54, "name": "DIAGNOSIS_CODE_14", "comment": null}, "DIAGNOSIS_CODE_15": {"type": "TEXT", "index": 55, "name": "DIAGNOSIS_CODE_15", "comment": null}, "DIAGNOSIS_CODE_16": {"type": "TEXT", "index": 56, "name": "DIAGNOSIS_CODE_16", "comment": null}, "DIAGNOSIS_CODE_17": {"type": "TEXT", "index": 57, "name": "DIAGNOSIS_CODE_17", "comment": null}, "DIAGNOSIS_CODE_18": {"type": "TEXT", "index": 58, "name": "DIAGNOSIS_CODE_18", "comment": null}, "DIAGNOSIS_CODE_19": {"type": "TEXT", "index": 59, "name": "DIAGNOSIS_CODE_19", "comment": null}, "DIAGNOSIS_CODE_20": {"type": "TEXT", "index": 60, "name": "DIAGNOSIS_CODE_20", "comment": null}, "DIAGNOSIS_CODE_21": {"type": "TEXT", "index": 61, "name": "DIAGNOSIS_CODE_21", "comment": null}, "DIAGNOSIS_CODE_22": {"type": "TEXT", "index": 62, "name": "DIAGNOSIS_CODE_22", "comment": null}, "DIAGNOSIS_CODE_23": {"type": "TEXT", "index": 63, "name": "DIAGNOSIS_CODE_23", "comment": null}, "DIAGNOSIS_CODE_24": {"type": "TEXT", "index": 64, "name": "DIAGNOSIS_CODE_24", "comment": null}, "DIAGNOSIS_CODE_25": {"type": "TEXT", "index": 65, "name": "DIAGNOSIS_CODE_25", "comment": null}, "DIAGNOSIS_POA_1": {"type": "TEXT", "index": 66, "name": "DIAGNOSIS_POA_1", "comment": null}, "DIAGNOSIS_POA_2": {"type": "TEXT", "index": 67, "name": "DIAGNOSIS_POA_2", "comment": null}, "DIAGNOSIS_POA_3": {"type": "TEXT", "index": 68, "name": "DIAGNOSIS_POA_3", "comment": null}, "DIAGNOSIS_POA_4": {"type": "TEXT", "index": 69, "name": "DIAGNOSIS_POA_4", "comment": null}, "DIAGNOSIS_POA_5": {"type": "TEXT", "index": 70, "name": "DIAGNOSIS_POA_5", "comment": null}, "DIAGNOSIS_POA_6": {"type": "TEXT", "index": 71, "name": "DIAGNOSIS_POA_6", "comment": null}, "DIAGNOSIS_POA_7": {"type": "TEXT", "index": 72, "name": "DIAGNOSIS_POA_7", "comment": null}, "DIAGNOSIS_POA_8": {"type": "TEXT", "index": 73, "name": "DIAGNOSIS_POA_8", "comment": null}, "DIAGNOSIS_POA_9": {"type": "TEXT", "index": 74, "name": "DIAGNOSIS_POA_9", "comment": null}, "DIAGNOSIS_POA_10": {"type": "TEXT", "index": 75, "name": "DIAGNOSIS_POA_10", "comment": null}, "DIAGNOSIS_POA_11": {"type": "TEXT", "index": 76, "name": "DIAGNOSIS_POA_11", "comment": null}, "DIAGNOSIS_POA_12": {"type": "TEXT", "index": 77, "name": "DIAGNOSIS_POA_12", "comment": null}, "DIAGNOSIS_POA_13": {"type": "TEXT", "index": 78, "name": "DIAGNOSIS_POA_13", "comment": null}, "DIAGNOSIS_POA_14": {"type": "TEXT", "index": 79, "name": "DIAGNOSIS_POA_14", "comment": null}, "DIAGNOSIS_POA_15": {"type": "TEXT", "index": 80, "name": "DIAGNOSIS_POA_15", "comment": null}, "DIAGNOSIS_POA_16": {"type": "TEXT", "index": 81, "name": "DIAGNOSIS_POA_16", "comment": null}, "DIAGNOSIS_POA_17": {"type": "TEXT", "index": 82, "name": "DIAGNOSIS_POA_17", "comment": null}, "DIAGNOSIS_POA_18": {"type": "TEXT", "index": 83, "name": "DIAGNOSIS_POA_18", "comment": null}, "DIAGNOSIS_POA_19": {"type": "TEXT", "index": 84, "name": "DIAGNOSIS_POA_19", "comment": null}, "DIAGNOSIS_POA_20": {"type": "TEXT", "index": 85, "name": "DIAGNOSIS_POA_20", "comment": null}, "DIAGNOSIS_POA_21": {"type": "TEXT", "index": 86, "name": "DIAGNOSIS_POA_21", "comment": null}, "DIAGNOSIS_POA_22": {"type": "TEXT", "index": 87, "name": "DIAGNOSIS_POA_22", "comment": null}, "DIAGNOSIS_POA_23": {"type": "TEXT", "index": 88, "name": "DIAGNOSIS_POA_23", "comment": null}, "DIAGNOSIS_POA_24": {"type": "TEXT", "index": 89, "name": "DIAGNOSIS_POA_24", "comment": null}, "DIAGNOSIS_POA_25": {"type": "TEXT", "index": 90, "name": "DIAGNOSIS_POA_25", "comment": null}, "PROCEDURE_CODE_TYPE": {"type": "TEXT", "index": 91, "name": "PROCEDURE_CODE_TYPE", "comment": null}, "PROCEDURE_CODE_1": {"type": "TEXT", "index": 92, "name": "PROCEDURE_CODE_1", "comment": null}, "PROCEDURE_CODE_2": {"type": "TEXT", "index": 93, "name": "PROCEDURE_CODE_2", "comment": null}, "PROCEDURE_CODE_3": {"type": "TEXT", "index": 94, "name": "PROCEDURE_CODE_3", "comment": null}, "PROCEDURE_CODE_4": {"type": "TEXT", "index": 95, "name": "PROCEDURE_CODE_4", "comment": null}, "PROCEDURE_CODE_5": {"type": "TEXT", "index": 96, "name": "PROCEDURE_CODE_5", "comment": null}, "PROCEDURE_CODE_6": {"type": "TEXT", "index": 97, "name": "PROCEDURE_CODE_6", "comment": null}, "PROCEDURE_CODE_7": {"type": "TEXT", "index": 98, "name": "PROCEDURE_CODE_7", "comment": null}, "PROCEDURE_CODE_8": {"type": "TEXT", "index": 99, "name": "PROCEDURE_CODE_8", "comment": null}, "PROCEDURE_CODE_9": {"type": "TEXT", "index": 100, "name": "PROCEDURE_CODE_9", "comment": null}, "PROCEDURE_CODE_10": {"type": "TEXT", "index": 101, "name": "PROCEDURE_CODE_10", "comment": null}, "PROCEDURE_CODE_11": {"type": "TEXT", "index": 102, "name": "PROCEDURE_CODE_11", "comment": null}, "PROCEDURE_CODE_12": {"type": "TEXT", "index": 103, "name": "PROCEDURE_CODE_12", "comment": null}, "PROCEDURE_CODE_13": {"type": "TEXT", "index": 104, "name": "PROCEDURE_CODE_13", "comment": null}, "PROCEDURE_CODE_14": {"type": "TEXT", "index": 105, "name": "PROCEDURE_CODE_14", "comment": null}, "PROCEDURE_CODE_15": {"type": "TEXT", "index": 106, "name": "PROCEDURE_CODE_15", "comment": null}, "PROCEDURE_CODE_16": {"type": "TEXT", "index": 107, "name": "PROCEDURE_CODE_16", "comment": null}, "PROCEDURE_CODE_17": {"type": "TEXT", "index": 108, "name": "PROCEDURE_CODE_17", "comment": null}, "PROCEDURE_CODE_18": {"type": "TEXT", "index": 109, "name": "PROCEDURE_CODE_18", "comment": null}, "PROCEDURE_CODE_19": {"type": "TEXT", "index": 110, "name": "PROCEDURE_CODE_19", "comment": null}, "PROCEDURE_CODE_20": {"type": "TEXT", "index": 111, "name": "PROCEDURE_CODE_20", "comment": null}, "PROCEDURE_CODE_21": {"type": "TEXT", "index": 112, "name": "PROCEDURE_CODE_21", "comment": null}, "PROCEDURE_CODE_22": {"type": "TEXT", "index": 113, "name": "PROCEDURE_CODE_22", "comment": null}, "PROCEDURE_CODE_23": {"type": "TEXT", "index": 114, "name": "PROCEDURE_CODE_23", "comment": null}, "PROCEDURE_CODE_24": {"type": "TEXT", "index": 115, "name": "PROCEDURE_CODE_24", "comment": null}, "PROCEDURE_CODE_25": {"type": "TEXT", "index": 116, "name": "PROCEDURE_CODE_25", "comment": null}, "PROCEDURE_DATE_1": {"type": "DATE", "index": 117, "name": "PROCEDURE_DATE_1", "comment": null}, "PROCEDURE_DATE_2": {"type": "DATE", "index": 118, "name": "PROCEDURE_DATE_2", "comment": null}, "PROCEDURE_DATE_3": {"type": "DATE", "index": 119, "name": "PROCEDURE_DATE_3", "comment": null}, "PROCEDURE_DATE_4": {"type": "DATE", "index": 120, "name": "PROCEDURE_DATE_4", "comment": null}, "PROCEDURE_DATE_5": {"type": "DATE", "index": 121, "name": "PROCEDURE_DATE_5", "comment": null}, "PROCEDURE_DATE_6": {"type": "DATE", "index": 122, "name": "PROCEDURE_DATE_6", "comment": null}, "PROCEDURE_DATE_7": {"type": "DATE", "index": 123, "name": "PROCEDURE_DATE_7", "comment": null}, "PROCEDURE_DATE_8": {"type": "DATE", "index": 124, "name": "PROCEDURE_DATE_8", "comment": null}, "PROCEDURE_DATE_9": {"type": "DATE", "index": 125, "name": "PROCEDURE_DATE_9", "comment": null}, "PROCEDURE_DATE_10": {"type": "DATE", "index": 126, "name": "PROCEDURE_DATE_10", "comment": null}, "PROCEDURE_DATE_11": {"type": "DATE", "index": 127, "name": "PROCEDURE_DATE_11", "comment": null}, "PROCEDURE_DATE_12": {"type": "DATE", "index": 128, "name": "PROCEDURE_DATE_12", "comment": null}, "PROCEDURE_DATE_13": {"type": "DATE", "index": 129, "name": "PROCEDURE_DATE_13", "comment": null}, "PROCEDURE_DATE_14": {"type": "DATE", "index": 130, "name": "PROCEDURE_DATE_14", "comment": null}, "PROCEDURE_DATE_15": {"type": "DATE", "index": 131, "name": "PROCEDURE_DATE_15", "comment": null}, "PROCEDURE_DATE_16": {"type": "DATE", "index": 132, "name": "PROCEDURE_DATE_16", "comment": null}, "PROCEDURE_DATE_17": {"type": "DATE", "index": 133, "name": "PROCEDURE_DATE_17", "comment": null}, "PROCEDURE_DATE_18": {"type": "DATE", "index": 134, "name": "PROCEDURE_DATE_18", "comment": null}, "PROCEDURE_DATE_19": {"type": "DATE", "index": 135, "name": "PROCEDURE_DATE_19", "comment": null}, "PROCEDURE_DATE_20": {"type": "DATE", "index": 136, "name": "PROCEDURE_DATE_20", "comment": null}, "PROCEDURE_DATE_21": {"type": "DATE", "index": 137, "name": "PROCEDURE_DATE_21", "comment": null}, "PROCEDURE_DATE_22": {"type": "DATE", "index": 138, "name": "PROCEDURE_DATE_22", "comment": null}, "PROCEDURE_DATE_23": {"type": "DATE", "index": 139, "name": "PROCEDURE_DATE_23", "comment": null}, "PROCEDURE_DATE_24": {"type": "DATE", "index": 140, "name": "PROCEDURE_DATE_24", "comment": null}, "PROCEDURE_DATE_25": {"type": "DATE", "index": 141, "name": "PROCEDURE_DATE_25", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 142, "name": "DATA_SOURCE", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 143, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-11-28 23:50UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.data_profiling__institutional_header_failures"}, "model.the_tuva_project.quality_measures__int_nqf2372_exclusions": {"metadata": {"type": "BASE TABLE", "schema": "QUALITY_MEASURES", "name": "_INT_NQF2372_EXCLUSIONS", "database": "DEV_SARAH", "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-11-28 23:52UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.quality_measures__int_nqf2372_exclusions"}, "seed.the_tuva_project.terminology__icd_10_pcs": {"metadata": {"type": "BASE TABLE", "schema": "TERMINOLOGY", "name": "ICD_10_PCS", "database": "DEV_SARAH", "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-11-28 23:50UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 1000960.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 78603.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.the_tuva_project.terminology__icd_10_pcs"}, "seed.the_tuva_project.quality_measures__measures": {"metadata": {"type": "BASE TABLE", "schema": "QUALITY_MEASURES", "name": "_VALUE_SET_MEASURES", "database": "DEV_SARAH", "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-11-28 23:49UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 2560.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 2.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.the_tuva_project.quality_measures__measures"}, "model.the_tuva_project.quality_measures__int_nqf0034_exclusions": {"metadata": {"type": "BASE TABLE", "schema": "QUALITY_MEASURES", "name": "_INT_NQF0034_EXCLUSIONS", "database": "DEV_SARAH", "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-11-28 23:52UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.quality_measures__int_nqf0034_exclusions"}, "model.the_tuva_project.service_category__home_health_institutional": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_HOME_HEALTH_INSTITUTIONAL", "database": "DEV_SARAH", "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-11-28 23:50UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.service_category__home_health_institutional"}, "model.the_tuva_project.data_profiling__eligibility_invalid_values": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_ELIGIBILITY_INVALID_VALUES", "database": "DEV_SARAH", "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-11-28 23:50UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.data_profiling__eligibility_invalid_values"}, "model.the_tuva_project.service_category__inpatient_psychiatric_professional": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_INPATIENT_PSYCHIATRIC_PROFESSIONAL", "database": "DEV_SARAH", "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-11-28 23:51UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.service_category__inpatient_psychiatric_professional"}, "model.the_tuva_project.core__lab_result": {"metadata": {"type": "BASE TABLE", "schema": "CORE", "name": "LAB_RESULT", "database": "DEV_SARAH", "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-11-28 23:50UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.core__lab_result"}, "model.the_tuva_project.core__stg_claims_procedure": {"metadata": {"type": "VIEW", "schema": "CORE", "name": "_STG_CLAIMS_PROCEDURE", "database": "DEV_SARAH", "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"}, "seed.the_tuva_project.terminology__calendar": {"metadata": {"type": "BASE TABLE", "schema": "TERMINOLOGY", "name": "CALENDAR", "database": "DEV_SARAH", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"FULL_DATE": {"type": "DATE", "index": 1, "name": "FULL_DATE", "comment": null}, "YEAR": {"type": "NUMBER", "index": 2, "name": "YEAR", "comment": null}, "MONTH": {"type": "NUMBER", "index": 3, "name": "MONTH", "comment": null}, "DAY": {"type": "NUMBER", "index": 4, "name": "DAY", "comment": null}, "MONTH_NAME": {"type": "TEXT", "index": 5, "name": "MONTH_NAME", "comment": null}, "DAY_OF_WEEK_NUMBER": {"type": "NUMBER", "index": 6, "name": "DAY_OF_WEEK_NUMBER", "comment": null}, "DAY_OF_WEEK_NAME": {"type": "TEXT", "index": 7, "name": "DAY_OF_WEEK_NAME", "comment": null}, "WEEK_OF_YEAR": {"type": "NUMBER", "index": 8, "name": "WEEK_OF_YEAR", "comment": null}, "DAY_OF_YEAR": {"type": "NUMBER", "index": 9, "name": "DAY_OF_YEAR", "comment": null}, "YEAR_MONTH": {"type": "TEXT", "index": 10, "name": "YEAR_MONTH", "comment": null}, "FIRST_DAY_OF_MONTH": {"type": "DATE", "index": 11, "name": "FIRST_DAY_OF_MONTH", "comment": null}, "LAST_DAY_OF_MONTH": {"type": "DATE", "index": 12, "name": "LAST_DAY_OF_MONTH", "comment": null}}, "stats": {"last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-11-28 23:50UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 882176.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 80000.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.the_tuva_project.terminology__calendar"}, "seed.the_tuva_project.ccsr__dxccsr_v2023_1_body_systems": {"metadata": {"type": "BASE TABLE", "schema": "CCSR", "name": "_VALUE_SET_DXCCSR_V2023_1_BODY_SYSTEMS", "database": "DEV_SARAH", "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-11-28 23:49UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 5120.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 22.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.the_tuva_project.ccsr__dxccsr_v2023_1_body_systems"}, "model.the_tuva_project.service_category__dq_input_layer_results": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_DQ_INPUT_LAYER_RESULTS", "database": "DEV_SARAH", "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-11-28 23:51UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.service_category__dq_input_layer_results"}, "model.the_tuva_project.emergency_department__summary": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "EMERGENCY_DEPARTMENT_SUMMARY", "database": "DEV_SARAH", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"ENCOUNTER_ID": {"type": "TEXT", "index": 1, "name": "ENCOUNTER_ID", "comment": null}, "ENCOUNTER_START_DATE": {"type": "DATE", "index": 2, "name": "ENCOUNTER_START_DATE", "comment": null}, "ENCOUNTER_END_DATE": {"type": "DATE", "index": 3, "name": "ENCOUNTER_END_DATE", "comment": null}, "PATIENT_ID": {"type": "TEXT", "index": 4, "name": "PATIENT_ID", "comment": null}, "ADMIT_AGE": {"type": "NUMBER", "index": 5, "name": "ADMIT_AGE", "comment": null}, "GENDER": {"type": "TEXT", "index": 6, "name": "GENDER", "comment": null}, "RACE": {"type": "TEXT", "index": 7, "name": "RACE", "comment": null}, "PRIMARY_DIAGNOSIS_CODE_TYPE": {"type": "TEXT", "index": 8, "name": "PRIMARY_DIAGNOSIS_CODE_TYPE", "comment": null}, "PRIMARY_DIAGNOSIS_CODE": {"type": "TEXT", "index": 9, "name": "PRIMARY_DIAGNOSIS_CODE", "comment": null}, "PRIMARY_DIAGNOSIS_DESCRIPTION": {"type": "TEXT", "index": 10, "name": "PRIMARY_DIAGNOSIS_DESCRIPTION", "comment": null}, "FACILITY_NPI": {"type": "TEXT", "index": 11, "name": "FACILITY_NPI", "comment": null}, "PROVIDER_FIRST_NAME": {"type": "TEXT", "index": 12, "name": "PROVIDER_FIRST_NAME", "comment": null}, "PROVIDER_LAST_NAME": {"type": "TEXT", "index": 13, "name": "PROVIDER_LAST_NAME", "comment": null}, "MS_DRG_CODE": {"type": "TEXT", "index": 14, "name": "MS_DRG_CODE", "comment": null}, "MS_DRG_DESCRIPTION": {"type": "TEXT", "index": 15, "name": "MS_DRG_DESCRIPTION", "comment": null}, "MEDICAL_SURGICAL": {"type": "TEXT", "index": 16, "name": "MEDICAL_SURGICAL", "comment": null}, "APR_DRG_CODE": {"type": "TEXT", "index": 17, "name": "APR_DRG_CODE", "comment": null}, "APR_DRG_DESCRIPTION": {"type": "TEXT", "index": 18, "name": "APR_DRG_DESCRIPTION", "comment": null}, "ADMIT_SOURCE_CODE": {"type": "TEXT", "index": 19, "name": "ADMIT_SOURCE_CODE", "comment": null}, "ADMIT_SOURCE_DESCRIPTION": {"type": "TEXT", "index": 20, "name": "ADMIT_SOURCE_DESCRIPTION", "comment": null}, "ADMIT_TYPE_CODE": {"type": "TEXT", "index": 21, "name": "ADMIT_TYPE_CODE", "comment": null}, "ADMIT_TYPE_DESCRIPTION": {"type": "TEXT", "index": 22, "name": "ADMIT_TYPE_DESCRIPTION", "comment": null}, "DISCHARGE_DISPOSITION_CODE": {"type": "TEXT", "index": 23, "name": "DISCHARGE_DISPOSITION_CODE", "comment": null}, "DISCHARGE_DISPOSITION_DESCRIPTION": {"type": "TEXT", "index": 24, "name": "DISCHARGE_DISPOSITION_DESCRIPTION", "comment": null}, "TOTAL_PAID_AMOUNT": {"type": "FLOAT", "index": 25, "name": "TOTAL_PAID_AMOUNT", "comment": null}, "TOTAL_ALLOWED_AMOUNT": {"type": "FLOAT", "index": 26, "name": "TOTAL_ALLOWED_AMOUNT", "comment": null}, "TOTAL_CHARGE_AMOUNT": {"type": "FLOAT", "index": 27, "name": "TOTAL_CHARGE_AMOUNT", "comment": null}, "LENGTH_OF_STAY": {"type": "NUMBER", "index": 28, "name": "LENGTH_OF_STAY", "comment": null}, "MORTALITY_FLAG": {"type": "NUMBER", "index": 29, "name": "MORTALITY_FLAG", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 30, "name": "DATA_SOURCE", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 31, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-11-28 23:51UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.emergency_department__summary"}, "model.the_tuva_project.service_category__lab_institutional": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_LAB_INSTITUTIONAL", "database": "DEV_SARAH", "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-11-28 23:51UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.service_category__lab_institutional"}, "model.the_tuva_project.insights__trend_count_claim_by_claim_type": {"metadata": {"type": "BASE TABLE", "schema": "INSIGHTS", "name": "TREND_COUNT_CLAIM_BY_CLAIM_TYPE", "database": "DEV_SARAH", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"YEAR_MONTH": {"type": "TEXT", "index": 1, "name": "YEAR_MONTH", "comment": null}, "CLAIM_TYPE": {"type": "TEXT", "index": 2, "name": "CLAIM_TYPE", "comment": null}, "DISTINCT_CLAIM_COUNT": {"type": "NUMBER", "index": 3, "name": "DISTINCT_CLAIM_COUNT", "comment": null}, "DISTINCT_CLAIM_COUNT_CHANGE": {"type": "NUMBER", "index": 4, "name": "DISTINCT_CLAIM_COUNT_CHANGE", "comment": null}, "DISTINCT_CLAIM_PERCENTAGE_CHANGE": {"type": "NUMBER", "index": 5, "name": "DISTINCT_CLAIM_PERCENTAGE_CHANGE", "comment": null}}, "stats": {"last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-11-28 23:51UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.insights__trend_count_claim_by_claim_type"}, "seed.input_layer.medical_claim_seed": {"metadata": {"type": "BASE TABLE", "schema": "_TUVA_SYNTHETIC", "name": "MEDICAL_CLAIM_SEED", "database": "DEV_SARAH", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"CLAIM_ID": {"type": "TEXT", "index": 1, "name": "CLAIM_ID", "comment": null}, "CLAIM_LINE_NUMBER": {"type": "NUMBER", "index": 2, "name": "CLAIM_LINE_NUMBER", "comment": null}, "CLAIM_TYPE": {"type": "TEXT", "index": 3, "name": "CLAIM_TYPE", "comment": null}, "PATIENT_ID": {"type": "TEXT", "index": 4, "name": "PATIENT_ID", "comment": null}, "MEMBER_ID": {"type": "TEXT", "index": 5, "name": "MEMBER_ID", "comment": null}, "PAYER": {"type": "TEXT", "index": 6, "name": "PAYER", "comment": null}, "PLAN": {"type": "TEXT", "index": 7, "name": "PLAN", "comment": null}, "CLAIM_START_DATE": {"type": "DATE", "index": 8, "name": "CLAIM_START_DATE", "comment": null}, "CLAIM_END_DATE": {"type": "DATE", "index": 9, "name": "CLAIM_END_DATE", "comment": null}, "CLAIM_LINE_START_DATE": {"type": "DATE", "index": 10, "name": "CLAIM_LINE_START_DATE", "comment": null}, "CLAIM_LINE_END_DATE": {"type": "DATE", "index": 11, "name": "CLAIM_LINE_END_DATE", "comment": null}, "ADMISSION_DATE": {"type": "DATE", "index": 12, "name": "ADMISSION_DATE", "comment": null}, "DISCHARGE_DATE": {"type": "DATE", "index": 13, "name": "DISCHARGE_DATE", "comment": null}, "ADMIT_SOURCE_CODE": {"type": "TEXT", "index": 14, "name": "ADMIT_SOURCE_CODE", "comment": null}, "ADMIT_TYPE_CODE": {"type": "TEXT", "index": 15, "name": "ADMIT_TYPE_CODE", "comment": null}, "DISCHARGE_DISPOSITION_CODE": {"type": "TEXT", "index": 16, "name": "DISCHARGE_DISPOSITION_CODE", "comment": null}, "PLACE_OF_SERVICE_CODE": {"type": "TEXT", "index": 17, "name": "PLACE_OF_SERVICE_CODE", "comment": null}, "BILL_TYPE_CODE": {"type": "TEXT", "index": 18, "name": "BILL_TYPE_CODE", "comment": null}, "MS_DRG_CODE": {"type": "TEXT", "index": 19, "name": "MS_DRG_CODE", "comment": null}, "APR_DRG_CODE": {"type": "TEXT", "index": 20, "name": "APR_DRG_CODE", "comment": null}, "REVENUE_CENTER_CODE": {"type": "TEXT", "index": 21, "name": "REVENUE_CENTER_CODE", "comment": null}, "SERVICE_UNIT_QUANTITY": {"type": "NUMBER", "index": 22, "name": "SERVICE_UNIT_QUANTITY", "comment": null}, "HCPCS_CODE": {"type": "TEXT", "index": 23, "name": "HCPCS_CODE", "comment": null}, "HCPCS_MODIFIER_1": {"type": "TEXT", "index": 24, "name": "HCPCS_MODIFIER_1", "comment": null}, "HCPCS_MODIFIER_2": {"type": "TEXT", "index": 25, "name": "HCPCS_MODIFIER_2", "comment": null}, "HCPCS_MODIFIER_3": {"type": "TEXT", "index": 26, "name": "HCPCS_MODIFIER_3", "comment": null}, "HCPCS_MODIFIER_4": {"type": "TEXT", "index": 27, "name": "HCPCS_MODIFIER_4", "comment": null}, "HCPCS_MODIFIER_5": {"type": "TEXT", "index": 28, "name": "HCPCS_MODIFIER_5", "comment": null}, "RENDERING_NPI": {"type": "TEXT", "index": 29, "name": "RENDERING_NPI", "comment": null}, "BILLING_NPI": {"type": "TEXT", "index": 30, "name": "BILLING_NPI", "comment": null}, "FACILITY_NPI": {"type": "TEXT", "index": 31, "name": "FACILITY_NPI", "comment": null}, "PAID_DATE": {"type": "DATE", "index": 32, "name": "PAID_DATE", "comment": null}, "PAID_AMOUNT": {"type": "FLOAT", "index": 33, "name": "PAID_AMOUNT", "comment": null}, "ALLOWED_AMOUNT": {"type": "FLOAT", "index": 34, "name": "ALLOWED_AMOUNT", "comment": null}, "CHARGE_AMOUNT": {"type": "FLOAT", "index": 35, "name": "CHARGE_AMOUNT", "comment": null}, "COINSURANCE_AMOUNT": {"type": "FLOAT", "index": 36, "name": "COINSURANCE_AMOUNT", "comment": null}, "COPAYMENT_AMOUNT": {"type": "FLOAT", "index": 37, "name": "COPAYMENT_AMOUNT", "comment": null}, "DEDUCTIBLE_AMOUNT": {"type": "FLOAT", "index": 38, "name": "DEDUCTIBLE_AMOUNT", "comment": null}, "TOTAL_COST_AMOUNT": {"type": "FLOAT", "index": 39, "name": "TOTAL_COST_AMOUNT", "comment": null}, "DIAGNOSIS_CODE_TYPE": {"type": "TEXT", "index": 40, "name": "DIAGNOSIS_CODE_TYPE", "comment": null}, "DIAGNOSIS_CODE_1": {"type": "TEXT", "index": 41, "name": "DIAGNOSIS_CODE_1", "comment": null}, "DIAGNOSIS_CODE_2": {"type": "TEXT", "index": 42, "name": "DIAGNOSIS_CODE_2", "comment": null}, "DIAGNOSIS_CODE_3": {"type": "TEXT", "index": 43, "name": "DIAGNOSIS_CODE_3", "comment": null}, "DIAGNOSIS_CODE_4": {"type": "TEXT", "index": 44, "name": "DIAGNOSIS_CODE_4", "comment": null}, "DIAGNOSIS_CODE_5": {"type": "TEXT", "index": 45, "name": "DIAGNOSIS_CODE_5", "comment": null}, "DIAGNOSIS_CODE_6": {"type": "TEXT", "index": 46, "name": "DIAGNOSIS_CODE_6", "comment": null}, "DIAGNOSIS_CODE_7": {"type": "TEXT", "index": 47, "name": "DIAGNOSIS_CODE_7", "comment": null}, "DIAGNOSIS_CODE_8": {"type": "TEXT", "index": 48, "name": "DIAGNOSIS_CODE_8", "comment": null}, "DIAGNOSIS_CODE_9": {"type": "TEXT", "index": 49, "name": "DIAGNOSIS_CODE_9", "comment": null}, "DIAGNOSIS_CODE_10": {"type": "TEXT", "index": 50, "name": "DIAGNOSIS_CODE_10", "comment": null}, "DIAGNOSIS_CODE_11": {"type": "TEXT", "index": 51, "name": "DIAGNOSIS_CODE_11", "comment": null}, "DIAGNOSIS_CODE_12": {"type": "TEXT", "index": 52, "name": "DIAGNOSIS_CODE_12", "comment": null}, "DIAGNOSIS_CODE_13": {"type": "TEXT", "index": 53, "name": "DIAGNOSIS_CODE_13", "comment": null}, "DIAGNOSIS_CODE_14": {"type": "TEXT", "index": 54, "name": "DIAGNOSIS_CODE_14", "comment": null}, "DIAGNOSIS_CODE_15": {"type": "TEXT", "index": 55, "name": "DIAGNOSIS_CODE_15", "comment": null}, "DIAGNOSIS_CODE_16": {"type": "TEXT", "index": 56, "name": "DIAGNOSIS_CODE_16", "comment": null}, "DIAGNOSIS_CODE_17": {"type": "TEXT", "index": 57, "name": "DIAGNOSIS_CODE_17", "comment": null}, "DIAGNOSIS_CODE_18": {"type": "TEXT", "index": 58, "name": "DIAGNOSIS_CODE_18", "comment": null}, "DIAGNOSIS_CODE_19": {"type": "TEXT", "index": 59, "name": "DIAGNOSIS_CODE_19", "comment": null}, "DIAGNOSIS_CODE_20": {"type": "TEXT", "index": 60, "name": "DIAGNOSIS_CODE_20", "comment": null}, "DIAGNOSIS_CODE_21": {"type": "TEXT", "index": 61, "name": "DIAGNOSIS_CODE_21", "comment": null}, "DIAGNOSIS_CODE_22": {"type": "TEXT", "index": 62, "name": "DIAGNOSIS_CODE_22", "comment": null}, "DIAGNOSIS_CODE_23": {"type": "TEXT", "index": 63, "name": "DIAGNOSIS_CODE_23", "comment": null}, "DIAGNOSIS_CODE_24": {"type": "TEXT", "index": 64, "name": "DIAGNOSIS_CODE_24", "comment": null}, "DIAGNOSIS_CODE_25": {"type": "TEXT", "index": 65, "name": "DIAGNOSIS_CODE_25", "comment": null}, "DIAGNOSIS_POA_1": {"type": "TEXT", "index": 66, "name": "DIAGNOSIS_POA_1", "comment": null}, "DIAGNOSIS_POA_2": {"type": "TEXT", "index": 67, "name": "DIAGNOSIS_POA_2", "comment": null}, "DIAGNOSIS_POA_3": {"type": "TEXT", "index": 68, "name": "DIAGNOSIS_POA_3", "comment": null}, "DIAGNOSIS_POA_4": {"type": "TEXT", "index": 69, "name": "DIAGNOSIS_POA_4", "comment": null}, "DIAGNOSIS_POA_5": {"type": "TEXT", "index": 70, "name": "DIAGNOSIS_POA_5", "comment": null}, "DIAGNOSIS_POA_6": {"type": "TEXT", "index": 71, "name": "DIAGNOSIS_POA_6", "comment": null}, "DIAGNOSIS_POA_7": {"type": "TEXT", "index": 72, "name": "DIAGNOSIS_POA_7", "comment": null}, "DIAGNOSIS_POA_8": {"type": "TEXT", "index": 73, "name": "DIAGNOSIS_POA_8", "comment": null}, "DIAGNOSIS_POA_9": {"type": "TEXT", "index": 74, "name": "DIAGNOSIS_POA_9", "comment": null}, "DIAGNOSIS_POA_10": {"type": "TEXT", "index": 75, "name": "DIAGNOSIS_POA_10", "comment": null}, "DIAGNOSIS_POA_11": {"type": "TEXT", "index": 76, "name": "DIAGNOSIS_POA_11", "comment": null}, "DIAGNOSIS_POA_12": {"type": "TEXT", "index": 77, "name": "DIAGNOSIS_POA_12", "comment": null}, "DIAGNOSIS_POA_13": {"type": "TEXT", "index": 78, "name": "DIAGNOSIS_POA_13", "comment": null}, "DIAGNOSIS_POA_14": {"type": "TEXT", "index": 79, "name": "DIAGNOSIS_POA_14", "comment": null}, "DIAGNOSIS_POA_15": {"type": "TEXT", "index": 80, "name": "DIAGNOSIS_POA_15", "comment": null}, "DIAGNOSIS_POA_16": {"type": "TEXT", "index": 81, "name": "DIAGNOSIS_POA_16", "comment": null}, "DIAGNOSIS_POA_17": {"type": "TEXT", "index": 82, "name": "DIAGNOSIS_POA_17", "comment": null}, "DIAGNOSIS_POA_18": {"type": "TEXT", "index": 83, "name": "DIAGNOSIS_POA_18", "comment": null}, "DIAGNOSIS_POA_19": {"type": "TEXT", "index": 84, "name": "DIAGNOSIS_POA_19", "comment": null}, "DIAGNOSIS_POA_20": {"type": "TEXT", "index": 85, "name": "DIAGNOSIS_POA_20", "comment": null}, "DIAGNOSIS_POA_21": {"type": "TEXT", "index": 86, "name": "DIAGNOSIS_POA_21", "comment": null}, "DIAGNOSIS_POA_22": {"type": "TEXT", "index": 87, "name": "DIAGNOSIS_POA_22", "comment": null}, "DIAGNOSIS_POA_23": {"type": "TEXT", "index": 88, "name": "DIAGNOSIS_POA_23", "comment": null}, "DIAGNOSIS_POA_24": {"type": "TEXT", "index": 89, "name": "DIAGNOSIS_POA_24", "comment": null}, "DIAGNOSIS_POA_25": {"type": "TEXT", "index": 90, "name": "DIAGNOSIS_POA_25", "comment": null}, "PROCEDURE_CODE_TYPE": {"type": "TEXT", "index": 91, "name": "PROCEDURE_CODE_TYPE", "comment": null}, "PROCEDURE_CODE_1": {"type": "TEXT", "index": 92, "name": "PROCEDURE_CODE_1", "comment": null}, "PROCEDURE_CODE_2": {"type": "TEXT", "index": 93, "name": "PROCEDURE_CODE_2", "comment": null}, "PROCEDURE_CODE_3": {"type": "TEXT", "index": 94, "name": "PROCEDURE_CODE_3", "comment": null}, "PROCEDURE_CODE_4": {"type": "TEXT", "index": 95, "name": "PROCEDURE_CODE_4", "comment": null}, "PROCEDURE_CODE_5": {"type": "TEXT", "index": 96, "name": "PROCEDURE_CODE_5", "comment": null}, "PROCEDURE_CODE_6": {"type": "TEXT", "index": 97, "name": "PROCEDURE_CODE_6", "comment": null}, "PROCEDURE_CODE_7": {"type": "TEXT", "index": 98, "name": "PROCEDURE_CODE_7", "comment": null}, "PROCEDURE_CODE_8": {"type": "TEXT", "index": 99, "name": "PROCEDURE_CODE_8", "comment": null}, "PROCEDURE_CODE_9": {"type": "TEXT", "index": 100, "name": "PROCEDURE_CODE_9", "comment": null}, "PROCEDURE_CODE_10": {"type": "TEXT", "index": 101, "name": "PROCEDURE_CODE_10", "comment": null}, "PROCEDURE_CODE_11": {"type": "TEXT", "index": 102, "name": "PROCEDURE_CODE_11", "comment": null}, "PROCEDURE_CODE_12": {"type": "TEXT", "index": 103, "name": "PROCEDURE_CODE_12", "comment": null}, "PROCEDURE_CODE_13": {"type": "TEXT", "index": 104, "name": "PROCEDURE_CODE_13", "comment": null}, "PROCEDURE_CODE_14": {"type": "TEXT", "index": 105, "name": "PROCEDURE_CODE_14", "comment": null}, "PROCEDURE_CODE_15": {"type": "TEXT", "index": 106, "name": "PROCEDURE_CODE_15", "comment": null}, "PROCEDURE_CODE_16": {"type": "TEXT", "index": 107, "name": "PROCEDURE_CODE_16", "comment": null}, "PROCEDURE_CODE_17": {"type": "TEXT", "index": 108, "name": "PROCEDURE_CODE_17", "comment": null}, "PROCEDURE_CODE_18": {"type": "TEXT", "index": 109, "name": "PROCEDURE_CODE_18", "comment": null}, "PROCEDURE_CODE_19": {"type": "TEXT", "index": 110, "name": "PROCEDURE_CODE_19", "comment": null}, "PROCEDURE_CODE_20": {"type": "TEXT", "index": 111, "name": "PROCEDURE_CODE_20", "comment": null}, "PROCEDURE_CODE_21": {"type": "TEXT", "index": 112, "name": "PROCEDURE_CODE_21", "comment": null}, "PROCEDURE_CODE_22": {"type": "TEXT", "index": 113, "name": "PROCEDURE_CODE_22", "comment": null}, "PROCEDURE_CODE_23": {"type": "TEXT", "index": 114, "name": "PROCEDURE_CODE_23", "comment": null}, "PROCEDURE_CODE_24": {"type": "TEXT", "index": 115, "name": "PROCEDURE_CODE_24", "comment": null}, "PROCEDURE_CODE_25": {"type": "TEXT", "index": 116, "name": "PROCEDURE_CODE_25", "comment": null}, "PROCEDURE_DATE_1": {"type": "DATE", "index": 117, "name": "PROCEDURE_DATE_1", "comment": null}, "PROCEDURE_DATE_2": {"type": "DATE", "index": 118, "name": "PROCEDURE_DATE_2", "comment": null}, "PROCEDURE_DATE_3": {"type": "DATE", "index": 119, "name": "PROCEDURE_DATE_3", "comment": null}, "PROCEDURE_DATE_4": {"type": "DATE", "index": 120, "name": "PROCEDURE_DATE_4", "comment": null}, "PROCEDURE_DATE_5": {"type": "DATE", "index": 121, "name": "PROCEDURE_DATE_5", "comment": null}, "PROCEDURE_DATE_6": {"type": "DATE", "index": 122, "name": "PROCEDURE_DATE_6", "comment": null}, "PROCEDURE_DATE_7": {"type": "DATE", "index": 123, "name": "PROCEDURE_DATE_7", "comment": null}, "PROCEDURE_DATE_8": {"type": "DATE", "index": 124, "name": "PROCEDURE_DATE_8", "comment": null}, "PROCEDURE_DATE_9": {"type": "DATE", "index": 125, "name": "PROCEDURE_DATE_9", "comment": null}, "PROCEDURE_DATE_10": {"type": "DATE", "index": 126, "name": "PROCEDURE_DATE_10", "comment": null}, "PROCEDURE_DATE_11": {"type": "DATE", "index": 127, "name": "PROCEDURE_DATE_11", "comment": null}, "PROCEDURE_DATE_12": {"type": "DATE", "index": 128, "name": "PROCEDURE_DATE_12", "comment": null}, "PROCEDURE_DATE_13": {"type": "DATE", "index": 129, "name": "PROCEDURE_DATE_13", "comment": null}, "PROCEDURE_DATE_14": {"type": "DATE", "index": 130, "name": "PROCEDURE_DATE_14", "comment": null}, "PROCEDURE_DATE_15": {"type": "DATE", "index": 131, "name": "PROCEDURE_DATE_15", "comment": null}, "PROCEDURE_DATE_16": {"type": "DATE", "index": 132, "name": "PROCEDURE_DATE_16", "comment": null}, "PROCEDURE_DATE_17": {"type": "DATE", "index": 133, "name": "PROCEDURE_DATE_17", "comment": null}, "PROCEDURE_DATE_18": {"type": "DATE", "index": 134, "name": "PROCEDURE_DATE_18", "comment": null}, "PROCEDURE_DATE_19": {"type": "DATE", "index": 135, "name": "PROCEDURE_DATE_19", "comment": null}, "PROCEDURE_DATE_20": {"type": "DATE", "index": 136, "name": "PROCEDURE_DATE_20", "comment": null}, "PROCEDURE_DATE_21": {"type": "DATE", "index": 137, "name": "PROCEDURE_DATE_21", "comment": null}, "PROCEDURE_DATE_22": {"type": "DATE", "index": 138, "name": "PROCEDURE_DATE_22", "comment": null}, "PROCEDURE_DATE_23": {"type": "DATE", "index": 139, "name": "PROCEDURE_DATE_23", "comment": null}, "PROCEDURE_DATE_24": {"type": "DATE", "index": 140, "name": "PROCEDURE_DATE_24", "comment": null}, "PROCEDURE_DATE_25": {"type": "DATE", "index": 141, "name": "PROCEDURE_DATE_25", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 142, "name": "DATA_SOURCE", "comment": null}}, "stats": {"last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-11-28 23:49UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.input_layer.medical_claim_seed"}, "model.the_tuva_project.quality_measures__int_nqf2372_long": {"metadata": {"type": "BASE TABLE", "schema": "QUALITY_MEASURES", "name": "_INT_NQF2372_LONG", "database": "DEV_SARAH", "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-11-28 23:52UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.quality_measures__int_nqf2372_long"}, "model.the_tuva_project.data_profiling__claim_type_unmapped": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_CLAIM_TYPE_UNMAPPED", "database": "DEV_SARAH", "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-11-28 23:50UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.data_profiling__claim_type_unmapped"}, "model.the_tuva_project.service_category__acute_inpatient_professional": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_ACUTE_INPATIENT_PROFESSIONAL", "database": "DEV_SARAH", "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-11-28 23:50UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.service_category__acute_inpatient_professional"}, "model.the_tuva_project.financial_pmpm__service_category_2_allowed_pivot": {"metadata": {"type": "BASE TABLE", "schema": "FINANCIAL_PMPM", "name": "_INT_SERVICE_CATEGORY_2_ALLOWED_PIVOT", "database": "DEV_SARAH", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"PATIENT_ID": {"type": "TEXT", "index": 1, "name": "PATIENT_ID", "comment": null}, "YEAR_MONTH": {"type": "TEXT", "index": 2, "name": "YEAR_MONTH", "comment": null}, "PAYER": {"type": "TEXT", "index": 3, "name": "PAYER", "comment": null}, "PLAN": {"type": "TEXT", "index": 4, "name": "PLAN", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 5, "name": "DATA_SOURCE", "comment": null}, "ACUTE_INPATIENT_ALLOWED": {"type": "NUMBER", "index": 6, "name": "ACUTE_INPATIENT_ALLOWED", "comment": null}, "AMBULANCE_ALLOWED": {"type": "NUMBER", "index": 7, "name": "AMBULANCE_ALLOWED", "comment": null}, "AMBULATORY_SURGERY_ALLOWED": {"type": "NUMBER", "index": 8, "name": "AMBULATORY_SURGERY_ALLOWED", "comment": null}, "DIALYSIS_ALLOWED": {"type": "NUMBER", "index": 9, "name": "DIALYSIS_ALLOWED", "comment": null}, "DURABLE_MEDICAL_EQUIPMENT_ALLOWED": {"type": "NUMBER", "index": 10, "name": "DURABLE_MEDICAL_EQUIPMENT_ALLOWED", "comment": null}, "EMERGENCY_DEPARTMENT_ALLOWED": {"type": "NUMBER", "index": 11, "name": "EMERGENCY_DEPARTMENT_ALLOWED", "comment": null}, "HOME_HEALTH_ALLOWED": {"type": "NUMBER", "index": 12, "name": "HOME_HEALTH_ALLOWED", "comment": null}, "HOSPICE_ALLOWED": {"type": "NUMBER", "index": 13, "name": "HOSPICE_ALLOWED", "comment": null}, "INPATIENT_PSYCHIATRIC_ALLOWED": {"type": "NUMBER", "index": 14, "name": "INPATIENT_PSYCHIATRIC_ALLOWED", "comment": null}, "INPATIENT_REHABILITATION_ALLOWED": {"type": "NUMBER", "index": 15, "name": "INPATIENT_REHABILITATION_ALLOWED", "comment": null}, "LAB_ALLOWED": {"type": "NUMBER", "index": 16, "name": "LAB_ALLOWED", "comment": null}, "OFFICE_VISIT_ALLOWED": {"type": "NUMBER", "index": 17, "name": "OFFICE_VISIT_ALLOWED", "comment": null}, "OUTPATIENT_HOSPITAL_OR_CLINIC_ALLOWED": {"type": "NUMBER", "index": 18, "name": "OUTPATIENT_HOSPITAL_OR_CLINIC_ALLOWED", "comment": null}, "OUTPATIENT_PSYCHIATRIC_ALLOWED": {"type": "NUMBER", "index": 19, "name": "OUTPATIENT_PSYCHIATRIC_ALLOWED", "comment": null}, "OUTPATIENT_REHABILITATION_ALLOWED": {"type": "NUMBER", "index": 20, "name": "OUTPATIENT_REHABILITATION_ALLOWED", "comment": null}, "SKILLED_NURSING_ALLOWED": {"type": "NUMBER", "index": 21, "name": "SKILLED_NURSING_ALLOWED", "comment": null}, "URGENT_CARE_ALLOWED": {"type": "NUMBER", "index": 22, "name": "URGENT_CARE_ALLOWED", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 23, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-11-28 23:51UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.financial_pmpm__service_category_2_allowed_pivot"}, "model.the_tuva_project.acute_inpatient__encounter_data_for_medical_claims": {"metadata": {"type": "VIEW", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_ENCOUNTER_DATA_FOR_MEDICAL_CLAIMS", "database": "DEV_SARAH", "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__skilled_nursing_institutional": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_SKILLED_NURSING_INSTITUTIONAL", "database": "DEV_SARAH", "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-11-28 23:51UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.service_category__skilled_nursing_institutional"}, "seed.the_tuva_project.terminology__race": {"metadata": {"type": "BASE TABLE", "schema": "TERMINOLOGY", "name": "RACE", "database": "DEV_SARAH", "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-11-28 23:50UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 1536.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 8.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.the_tuva_project.terminology__race"}, "model.the_tuva_project.acute_inpatient__encounter_id": {"metadata": {"type": "VIEW", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_ACUTE_INPATIENT_ENCOUNTER_ID", "database": "DEV_SARAH", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"PATIENT_ID": {"type": "TEXT", "index": 1, "name": "PATIENT_ID", "comment": null}, "CLAIM_ID": {"type": "TEXT", "index": 2, "name": "CLAIM_ID", "comment": null}, "CLAIM_LINE_NUMBER": {"type": "NUMBER", "index": 3, "name": "CLAIM_LINE_NUMBER", "comment": null}, "ENCOUNTER_ID": {"type": "TEXT", "index": 4, "name": "ENCOUNTER_ID", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 5, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.acute_inpatient__encounter_id"}, "model.the_tuva_project.core__pharmacy_claim": {"metadata": {"type": "BASE TABLE", "schema": "CORE", "name": "PHARMACY_CLAIM", "database": "DEV_SARAH", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"CLAIM_ID": {"type": "TEXT", "index": 1, "name": "CLAIM_ID", "comment": null}, "CLAIM_LINE_NUMBER": {"type": "NUMBER", "index": 2, "name": "CLAIM_LINE_NUMBER", "comment": null}, "PATIENT_ID": {"type": "TEXT", "index": 3, "name": "PATIENT_ID", "comment": null}, "MEMBER_ID": {"type": "TEXT", "index": 4, "name": "MEMBER_ID", "comment": null}, "PAYER": {"type": "TEXT", "index": 5, "name": "PAYER", "comment": null}, "PLAN": {"type": "TEXT", "index": 6, "name": "PLAN", "comment": null}, "PRESCRIBING_PROVIDER_NPI": {"type": "TEXT", "index": 7, "name": "PRESCRIBING_PROVIDER_NPI", "comment": null}, "DISPENSING_PROVIDER_NPI": {"type": "TEXT", "index": 8, "name": "DISPENSING_PROVIDER_NPI", "comment": null}, "DISPENSING_DATE": {"type": "DATE", "index": 9, "name": "DISPENSING_DATE", "comment": null}, "NDC_CODE": {"type": "TEXT", "index": 10, "name": "NDC_CODE", "comment": null}, "QUANTITY": {"type": "NUMBER", "index": 11, "name": "QUANTITY", "comment": null}, "DAYS_SUPPLY": {"type": "NUMBER", "index": 12, "name": "DAYS_SUPPLY", "comment": null}, "REFILLS": {"type": "NUMBER", "index": 13, "name": "REFILLS", "comment": null}, "PAID_DATE": {"type": "DATE", "index": 14, "name": "PAID_DATE", "comment": null}, "PAID_AMOUNT": {"type": "NUMBER", "index": 15, "name": "PAID_AMOUNT", "comment": null}, "ALLOWED_AMOUNT": {"type": "NUMBER", "index": 16, "name": "ALLOWED_AMOUNT", "comment": null}, "COINSURANCE_AMOUNT": {"type": "NUMBER", "index": 17, "name": "COINSURANCE_AMOUNT", "comment": null}, "COPAYMENT_AMOUNT": {"type": "NUMBER", "index": 18, "name": "COPAYMENT_AMOUNT", "comment": null}, "DEDUCTIBLE_AMOUNT": {"type": "NUMBER", "index": 19, "name": "DEDUCTIBLE_AMOUNT", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 20, "name": "DATA_SOURCE", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 21, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-11-28 23:50UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.core__pharmacy_claim"}, "model.the_tuva_project.data_profiling__medical_claim_inst_missing_values": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_MEDICAL_CLAIM_INST_MISSING_VALUES", "database": "DEV_SARAH", "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-11-28 23:50UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.data_profiling__medical_claim_inst_missing_values"}, "model.the_tuva_project.readmissions__procedure_ccs": {"metadata": {"type": "VIEW", "schema": "READMISSIONS", "name": "_INT_PROCEDURE_CCS", "database": "DEV_SARAH", "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.chronic_conditions__tuva_chronic_conditions_wide": {"metadata": {"type": "BASE TABLE", "schema": "CHRONIC_CONDITIONS", "name": "TUVA_CHRONIC_CONDITIONS_WIDE", "database": "DEV_SARAH", "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-11-28 23:51UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_wide"}, "model.the_tuva_project.cms_hcc__int_members": {"metadata": {"type": "BASE TABLE", "schema": "CMS_HCC", "name": "_INT_MEMBERS", "database": "DEV_SARAH", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"PATIENT_ID": {"type": "TEXT", "index": 1, "name": "PATIENT_ID", "comment": null}, "ENROLLMENT_STATUS": {"type": "TEXT", "index": 2, "name": "ENROLLMENT_STATUS", "comment": null}, "GENDER": {"type": "TEXT", "index": 3, "name": "GENDER", "comment": null}, "AGE_GROUP": {"type": "TEXT", "index": 4, "name": "AGE_GROUP", "comment": null}, "MEDICAID_STATUS": {"type": "TEXT", "index": 5, "name": "MEDICAID_STATUS", "comment": null}, "DUAL_STATUS": {"type": "TEXT", "index": 6, "name": "DUAL_STATUS", "comment": null}, "OREC": {"type": "TEXT", "index": 7, "name": "OREC", "comment": null}, "INSTITUTIONAL_STATUS": {"type": "TEXT", "index": 8, "name": "INSTITUTIONAL_STATUS", "comment": null}, "ENROLLMENT_STATUS_DEFAULT": {"type": "BOOLEAN", "index": 9, "name": "ENROLLMENT_STATUS_DEFAULT", "comment": null}, "MEDICAID_DUAL_STATUS_DEFAULT": {"type": "BOOLEAN", "index": 10, "name": "MEDICAID_DUAL_STATUS_DEFAULT", "comment": null}, "OREC_DEFAULT": {"type": "BOOLEAN", "index": 11, "name": "OREC_DEFAULT", "comment": null}, "INSTITUTIONAL_STATUS_DEFAULT": {"type": "BOOLEAN", "index": 12, "name": "INSTITUTIONAL_STATUS_DEFAULT", "comment": null}, "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-11-28 23:51UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.cms_hcc__int_members"}, "seed.the_tuva_project.terminology__place_of_service": {"metadata": {"type": "BASE TABLE", "schema": "TERMINOLOGY", "name": "PLACE_OF_SERVICE", "database": "DEV_SARAH", "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-11-28 23:50UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 2048.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 50.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.the_tuva_project.terminology__place_of_service"}, "model.the_tuva_project.core__stg_claims_pharmacy_claim": {"metadata": {"type": "VIEW", "schema": "CORE", "name": "_STG_CLAIMS_PHARMACY_CLAIM", "database": "DEV_SARAH", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"CLAIM_ID": {"type": "TEXT", "index": 1, "name": "CLAIM_ID", "comment": null}, "CLAIM_LINE_NUMBER": {"type": "NUMBER", "index": 2, "name": "CLAIM_LINE_NUMBER", "comment": null}, "PATIENT_ID": {"type": "TEXT", "index": 3, "name": "PATIENT_ID", "comment": null}, "MEMBER_ID": {"type": "TEXT", "index": 4, "name": "MEMBER_ID", "comment": null}, "PAYER": {"type": "TEXT", "index": 5, "name": "PAYER", "comment": null}, "PLAN": {"type": "TEXT", "index": 6, "name": "PLAN", "comment": null}, "PRESCRIBING_PROVIDER_NPI": {"type": "TEXT", "index": 7, "name": "PRESCRIBING_PROVIDER_NPI", "comment": null}, "DISPENSING_PROVIDER_NPI": {"type": "TEXT", "index": 8, "name": "DISPENSING_PROVIDER_NPI", "comment": null}, "DISPENSING_DATE": {"type": "DATE", "index": 9, "name": "DISPENSING_DATE", "comment": null}, "NDC_CODE": {"type": "TEXT", "index": 10, "name": "NDC_CODE", "comment": null}, "QUANTITY": {"type": "NUMBER", "index": 11, "name": "QUANTITY", "comment": null}, "DAYS_SUPPLY": {"type": "NUMBER", "index": 12, "name": "DAYS_SUPPLY", "comment": null}, "REFILLS": {"type": "NUMBER", "index": 13, "name": "REFILLS", "comment": null}, "PAID_DATE": {"type": "DATE", "index": 14, "name": "PAID_DATE", "comment": null}, "PAID_AMOUNT": {"type": "NUMBER", "index": 15, "name": "PAID_AMOUNT", "comment": null}, "ALLOWED_AMOUNT": {"type": "NUMBER", "index": 16, "name": "ALLOWED_AMOUNT", "comment": null}, "COINSURANCE_AMOUNT": {"type": "NUMBER", "index": 17, "name": "COINSURANCE_AMOUNT", "comment": null}, "COPAYMENT_AMOUNT": {"type": "NUMBER", "index": 18, "name": "COPAYMENT_AMOUNT", "comment": null}, "DEDUCTIBLE_AMOUNT": {"type": "NUMBER", "index": 19, "name": "DEDUCTIBLE_AMOUNT", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 20, "name": "DATA_SOURCE", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 21, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"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.core__observation": {"metadata": {"type": "BASE TABLE", "schema": "CORE", "name": "OBSERVATION", "database": "DEV_SARAH", "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-11-28 23:50UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.core__observation"}, "model.the_tuva_project.data_profiling__test_result_stage_eligibility": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_TEST_RESULT_STAGE_ELIGIBILITY", "database": "DEV_SARAH", "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-11-28 23:51UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.data_profiling__test_result_stage_eligibility"}, "seed.the_tuva_project.cms_hcc__disease_factors": {"metadata": {"type": "BASE TABLE", "schema": "CMS_HCC", "name": "_VALUE_SET_DISEASE_FACTORS", "database": "DEV_SARAH", "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-11-28 23:49UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 13312.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 580.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.the_tuva_project.cms_hcc__disease_factors"}, "model.the_tuva_project.acute_inpatient__claims_with_encounter_data": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_ACUTE_INPATIENT_CLAIMS_WITH_ENCOUNTER_DATA", "database": "DEV_SARAH", "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-11-28 23:51UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.acute_inpatient__claims_with_encounter_data"}, "seed.the_tuva_project.terminology__revenue_center": {"metadata": {"type": "BASE TABLE", "schema": "TERMINOLOGY", "name": "REVENUE_CENTER", "database": "DEV_SARAH", "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-11-28 23:50UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 8704.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 526.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.the_tuva_project.terminology__revenue_center"}, "seed.the_tuva_project.quality_measures__value_sets": {"metadata": {"type": "BASE TABLE", "schema": "QUALITY_MEASURES", "name": "_VALUE_SET_CODES", "database": "DEV_SARAH", "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-11-28 23:49UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 49152.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 4518.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.the_tuva_project.quality_measures__value_sets"}, "model.the_tuva_project.core__stg_claims_medical_claim": {"metadata": {"type": "VIEW", "schema": "CORE", "name": "_STG_CLAIMS_MEDICAL_CLAIM", "database": "DEV_SARAH", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"CLAIM_ID": {"type": "TEXT", "index": 1, "name": "CLAIM_ID", "comment": null}, "CLAIM_LINE_NUMBER": {"type": "NUMBER", "index": 2, "name": "CLAIM_LINE_NUMBER", "comment": null}, "ENCOUNTER_ID": {"type": "TEXT", "index": 3, "name": "ENCOUNTER_ID", "comment": null}, "CLAIM_TYPE": {"type": "TEXT", "index": 4, "name": "CLAIM_TYPE", "comment": null}, "PATIENT_ID": {"type": "TEXT", "index": 5, "name": "PATIENT_ID", "comment": null}, "MEMBER_ID": {"type": "TEXT", "index": 6, "name": "MEMBER_ID", "comment": null}, "PAYER": {"type": "TEXT", "index": 7, "name": "PAYER", "comment": null}, "PLAN": {"type": "TEXT", "index": 8, "name": "PLAN", "comment": null}, "CLAIM_START_DATE": {"type": "DATE", "index": 9, "name": "CLAIM_START_DATE", "comment": null}, "CLAIM_END_DATE": {"type": "DATE", "index": 10, "name": "CLAIM_END_DATE", "comment": null}, "CLAIM_LINE_START_DATE": {"type": "DATE", "index": 11, "name": "CLAIM_LINE_START_DATE", "comment": null}, "CLAIM_LINE_END_DATE": {"type": "DATE", "index": 12, "name": "CLAIM_LINE_END_DATE", "comment": null}, "ADMISSION_DATE": {"type": "DATE", "index": 13, "name": "ADMISSION_DATE", "comment": null}, "DISCHARGE_DATE": {"type": "DATE", "index": 14, "name": "DISCHARGE_DATE", "comment": null}, "SERVICE_CATEGORY_1": {"type": "TEXT", "index": 15, "name": "SERVICE_CATEGORY_1", "comment": null}, "SERVICE_CATEGORY_2": {"type": "TEXT", "index": 16, "name": "SERVICE_CATEGORY_2", "comment": null}, "ADMIT_SOURCE_CODE": {"type": "TEXT", "index": 17, "name": "ADMIT_SOURCE_CODE", "comment": null}, "ADMIT_TYPE_CODE": {"type": "TEXT", "index": 18, "name": "ADMIT_TYPE_CODE", "comment": null}, "DISCHARGE_DISPOSITION_CODE": {"type": "TEXT", "index": 19, "name": "DISCHARGE_DISPOSITION_CODE", "comment": null}, "PLACE_OF_SERVICE_CODE": {"type": "TEXT", "index": 20, "name": "PLACE_OF_SERVICE_CODE", "comment": null}, "BILL_TYPE_CODE": {"type": "TEXT", "index": 21, "name": "BILL_TYPE_CODE", "comment": null}, "MS_DRG_CODE": {"type": "TEXT", "index": 22, "name": "MS_DRG_CODE", "comment": null}, "APR_DRG_CODE": {"type": "TEXT", "index": 23, "name": "APR_DRG_CODE", "comment": null}, "REVENUE_CENTER_CODE": {"type": "TEXT", "index": 24, "name": "REVENUE_CENTER_CODE", "comment": null}, "SERVICE_UNIT_QUANTITY": {"type": "NUMBER", "index": 25, "name": "SERVICE_UNIT_QUANTITY", "comment": null}, "HCPCS_CODE": {"type": "TEXT", "index": 26, "name": "HCPCS_CODE", "comment": null}, "HCPCS_MODIFIER_1": {"type": "TEXT", "index": 27, "name": "HCPCS_MODIFIER_1", "comment": null}, "HCPCS_MODIFIER_2": {"type": "TEXT", "index": 28, "name": "HCPCS_MODIFIER_2", "comment": null}, "HCPCS_MODIFIER_3": {"type": "TEXT", "index": 29, "name": "HCPCS_MODIFIER_3", "comment": null}, "HCPCS_MODIFIER_4": {"type": "TEXT", "index": 30, "name": "HCPCS_MODIFIER_4", "comment": null}, "HCPCS_MODIFIER_5": {"type": "TEXT", "index": 31, "name": "HCPCS_MODIFIER_5", "comment": null}, "RENDERING_NPI": {"type": "TEXT", "index": 32, "name": "RENDERING_NPI", "comment": null}, "BILLING_NPI": {"type": "TEXT", "index": 33, "name": "BILLING_NPI", "comment": null}, "FACILITY_NPI": {"type": "TEXT", "index": 34, "name": "FACILITY_NPI", "comment": null}, "PAID_DATE": {"type": "DATE", "index": 35, "name": "PAID_DATE", "comment": null}, "PAID_AMOUNT": {"type": "NUMBER", "index": 36, "name": "PAID_AMOUNT", "comment": null}, "ALLOWED_AMOUNT": {"type": "NUMBER", "index": 37, "name": "ALLOWED_AMOUNT", "comment": null}, "CHARGE_AMOUNT": {"type": "NUMBER", "index": 38, "name": "CHARGE_AMOUNT", "comment": null}, "COINSURANCE_AMOUNT": {"type": "NUMBER", "index": 39, "name": "COINSURANCE_AMOUNT", "comment": null}, "COPAYMENT_AMOUNT": {"type": "NUMBER", "index": 40, "name": "COPAYMENT_AMOUNT", "comment": null}, "DEDUCTIBLE_AMOUNT": {"type": "NUMBER", "index": 41, "name": "DEDUCTIBLE_AMOUNT", "comment": null}, "TOTAL_COST_AMOUNT": {"type": "NUMBER", "index": 42, "name": "TOTAL_COST_AMOUNT", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 43, "name": "DATA_SOURCE", "comment": null}, "TUVA_LAST_RUN": {"type": "TIMESTAMP_NTZ", "index": 44, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"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.acute_inpatient__data_quality_summary": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_ACUTE_INPATIENT_DATA_QUALITY_SUMMARY", "database": "DEV_SARAH", "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-11-28 23:51UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 2048.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 29.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.acute_inpatient__data_quality_summary"}, "seed.input_layer.pharmacy_claim_seed": {"metadata": {"type": "BASE TABLE", "schema": "_TUVA_SYNTHETIC", "name": "PHARMACY_CLAIM_SEED", "database": "DEV_SARAH", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"CLAIM_ID": {"type": "TEXT", "index": 1, "name": "CLAIM_ID", "comment": null}, "CLAIM_LINE_NUMBER": {"type": "NUMBER", "index": 2, "name": "CLAIM_LINE_NUMBER", "comment": null}, "PATIENT_ID": {"type": "TEXT", "index": 3, "name": "PATIENT_ID", "comment": null}, "MEMBER_ID": {"type": "TEXT", "index": 4, "name": "MEMBER_ID", "comment": null}, "PAYER": {"type": "TEXT", "index": 5, "name": "PAYER", "comment": null}, "PLAN": {"type": "TEXT", "index": 6, "name": "PLAN", "comment": null}, "PRESCRIBING_PROVIDER_NPI": {"type": "TEXT", "index": 7, "name": "PRESCRIBING_PROVIDER_NPI", "comment": null}, "DISPENSING_PROVIDER_NPI": {"type": "TEXT", "index": 8, "name": "DISPENSING_PROVIDER_NPI", "comment": null}, "DISPENSING_DATE": {"type": "DATE", "index": 9, "name": "DISPENSING_DATE", "comment": null}, "NDC_CODE": {"type": "TEXT", "index": 10, "name": "NDC_CODE", "comment": null}, "QUANTITY": {"type": "NUMBER", "index": 11, "name": "QUANTITY", "comment": null}, "DAYS_SUPPLY": {"type": "NUMBER", "index": 12, "name": "DAYS_SUPPLY", "comment": null}, "REFILLS": {"type": "NUMBER", "index": 13, "name": "REFILLS", "comment": null}, "PAID_DATE": {"type": "DATE", "index": 14, "name": "PAID_DATE", "comment": null}, "PAID_AMOUNT": {"type": "FLOAT", "index": 15, "name": "PAID_AMOUNT", "comment": null}, "ALLOWED_AMOUNT": {"type": "FLOAT", "index": 16, "name": "ALLOWED_AMOUNT", "comment": null}, "COINSURANCE_AMOUNT": {"type": "NUMBER", "index": 17, "name": "COINSURANCE_AMOUNT", "comment": null}, "COPAYMENT_AMOUNT": {"type": "NUMBER", "index": 18, "name": "COPAYMENT_AMOUNT", "comment": null}, "DEDUCTIBLE_AMOUNT": {"type": "NUMBER", "index": 19, "name": "DEDUCTIBLE_AMOUNT", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 20, "name": "DATA_SOURCE", "comment": null}}, "stats": {"last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-11-28 23:49UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.input_layer.pharmacy_claim_seed"}, "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": "DEV_SARAH", "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-11-28 23:52UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.quality_measures__int_nqf2372_exclude_advanced_illness"}, "model.the_tuva_project.core__stg_clinical_location": {"metadata": {"type": "VIEW", "schema": "CORE", "name": "_STG_CLINICAL_LOCATION", "database": "DEV_SARAH", "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_palliative": {"metadata": {"type": "BASE TABLE", "schema": "QUALITY_MEASURES", "name": "_INT_NQF2372_EXCLUDE_PALLIATIVE", "database": "DEV_SARAH", "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-11-28 23:52UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.quality_measures__int_nqf2372_exclude_palliative"}, "model.the_tuva_project.service_category__dq_multiple_service_categories_institutional": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_DQ_MULTIPLE_SERVICE_CATEGORIES_INSTITUTIONAL", "database": "DEV_SARAH", "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-11-28 23:51UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.service_category__dq_multiple_service_categories_institutional"}, "model.the_tuva_project.cms_hcc__int_enrollment_interaction_factors": {"metadata": {"type": "BASE TABLE", "schema": "CMS_HCC", "name": "_INT_ENROLLMENT_INTERACTION_FACTORS", "database": "DEV_SARAH", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"PATIENT_ID": {"type": "TEXT", "index": 1, "name": "PATIENT_ID", "comment": null}, "DESCRIPTION": {"type": "TEXT", "index": 2, "name": "DESCRIPTION", "comment": null}, "COEFFICIENT": {"type": "NUMBER", "index": 3, "name": "COEFFICIENT", "comment": null}, "FACTOR_TYPE": {"type": "TEXT", "index": 4, "name": "FACTOR_TYPE", "comment": null}, "MODEL_VERSION": {"type": "TEXT", "index": 5, "name": "MODEL_VERSION", "comment": null}, "PAYMENT_YEAR": {"type": "NUMBER", "index": 6, "name": "PAYMENT_YEAR", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 7, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-11-28 23:51UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.cms_hcc__int_enrollment_interaction_factors"}, "model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_long": {"metadata": {"type": "BASE TABLE", "schema": "CHRONIC_CONDITIONS", "name": "TUVA_CHRONIC_CONDITIONS_LONG", "database": "DEV_SARAH", "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-11-28 23:51UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_long"}, "seed.the_tuva_project.readmissions__icd_10_cm_to_ccs": {"metadata": {"type": "BASE TABLE", "schema": "READMISSIONS", "name": "_VALUE_SET_ICD_10_CM_TO_CCS", "database": "DEV_SARAH", "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-11-28 23:49UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 1313792.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 72776.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.the_tuva_project.readmissions__icd_10_cm_to_ccs"}, "seed.the_tuva_project.ccsr__prccsr_v2023_1_cleaned_map": {"metadata": {"type": "BASE TABLE", "schema": "CCSR", "name": "_VALUE_SET_PRCCSR_V2023_1_CLEANED_MAP", "database": "DEV_SARAH", "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-11-28 23:49UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 1539584.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 81597.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.the_tuva_project.ccsr__prccsr_v2023_1_cleaned_map"}, "seed.the_tuva_project.terminology__ms_drg": {"metadata": {"type": "BASE TABLE", "schema": "TERMINOLOGY", "name": "MS_DRG", "database": "DEV_SARAH", "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-11-28 23:50UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 16384.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 797.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.the_tuva_project.terminology__ms_drg"}, "model.the_tuva_project.core__eligibility": {"metadata": {"type": "BASE TABLE", "schema": "CORE", "name": "ELIGIBILITY", "database": "DEV_SARAH", "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}, "BIRTH_DATE": {"type": "DATE", "index": 3, "name": "BIRTH_DATE", "comment": null}, "DEATH_DATE": {"type": "DATE", "index": 4, "name": "DEATH_DATE", "comment": null}, "ENROLLMENT_START_DATE": {"type": "DATE", "index": 5, "name": "ENROLLMENT_START_DATE", "comment": null}, "ENROLLMENT_END_DATE": {"type": "DATE", "index": 6, "name": "ENROLLMENT_END_DATE", "comment": null}, "PAYER": {"type": "TEXT", "index": 7, "name": "PAYER", "comment": null}, "PAYER_TYPE": {"type": "TEXT", "index": 8, "name": "PAYER_TYPE", "comment": null}, "PLAN": {"type": "TEXT", "index": 9, "name": "PLAN", "comment": null}, "ORIGINAL_REASON_ENTITLEMENT_CODE": {"type": "TEXT", "index": 10, "name": "ORIGINAL_REASON_ENTITLEMENT_CODE", "comment": null}, "DUAL_STATUS_CODE": {"type": "TEXT", "index": 11, "name": "DUAL_STATUS_CODE", "comment": null}, "MEDICARE_STATUS_CODE": {"type": "TEXT", "index": 12, "name": "MEDICARE_STATUS_CODE", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 13, "name": "DATA_SOURCE", "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-11-28 23:51UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.core__eligibility"}, "model.the_tuva_project.emergency_department__int_encounter_id": {"metadata": {"type": "VIEW", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_EMERGENCY_DEPARTMENT_ENCOUNTER_ID", "database": "DEV_SARAH", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"PATIENT_ID": {"type": "TEXT", "index": 1, "name": "PATIENT_ID", "comment": null}, "CLAIM_ID": {"type": "TEXT", "index": 2, "name": "CLAIM_ID", "comment": null}, "CLAIM_LINE_NUMBER": {"type": "NUMBER", "index": 3, "name": "CLAIM_LINE_NUMBER", "comment": null}, "ENCOUNTER_ID": {"type": "TEXT", "index": 4, "name": "ENCOUNTER_ID", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 5, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.emergency_department__int_encounter_id"}, "seed.the_tuva_project.cms_hcc__demographic_factors": {"metadata": {"type": "BASE TABLE", "schema": "CMS_HCC", "name": "_VALUE_SET_DEMOGRAPHIC_FACTORS", "database": "DEV_SARAH", "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-11-28 23:49UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 8704.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 424.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.the_tuva_project.cms_hcc__demographic_factors"}, "model.the_tuva_project.core__medication": {"metadata": {"type": "BASE TABLE", "schema": "CORE", "name": "MEDICATION", "database": "DEV_SARAH", "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-11-28 23:50UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.core__medication"}, "model.the_tuva_project.emergency_department__int_professional_encounter_id": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_EMERGENCY_DEPARTMENT_PROFESSIONAL_ENCOUNTER_ID", "database": "DEV_SARAH", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"PATIENT_ID": {"type": "TEXT", "index": 1, "name": "PATIENT_ID", "comment": null}, "CLAIM_ID": {"type": "TEXT", "index": 2, "name": "CLAIM_ID", "comment": null}, "CLAIM_LINE_NUMBER": {"type": "NUMBER", "index": 3, "name": "CLAIM_LINE_NUMBER", "comment": null}, "START_DATE": {"type": "DATE", "index": 4, "name": "START_DATE", "comment": null}, "END_DATE": {"type": "DATE", "index": 5, "name": "END_DATE", "comment": null}, "ENCOUNTER_ID": {"type": "TEXT", "index": 6, "name": "ENCOUNTER_ID", "comment": null}, "ORPHAN_CLAIM_FLAG": {"type": "NUMBER", "index": 7, "name": "ORPHAN_CLAIM_FLAG", "comment": null}, "ENCOUNTER_COUNT": {"type": "NUMBER", "index": 8, "name": "ENCOUNTER_COUNT", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 9, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-11-28 23:51UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.emergency_department__int_professional_encounter_id"}, "model.the_tuva_project.cms_hcc__int_eligible_conditions": {"metadata": {"type": "BASE TABLE", "schema": "CMS_HCC", "name": "_INT_ELIGIBLE_CONDITIONS", "database": "DEV_SARAH", "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-11-28 23:51UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.cms_hcc__int_eligible_conditions"}, "seed.the_tuva_project.quality_measures__concepts": {"metadata": {"type": "BASE TABLE", "schema": "QUALITY_MEASURES", "name": "_VALUE_SET_CONCEPTS", "database": "DEV_SARAH", "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-11-28 23:49UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 3584.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 73.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.the_tuva_project.quality_measures__concepts"}, "model.the_tuva_project.acute_inpatient__first_claim_values": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_ACUTE_INPATIENT_FIRST_CLAIM_VALUES", "database": "DEV_SARAH", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"ENCOUNTER_ID": {"type": "TEXT", "index": 1, "name": "ENCOUNTER_ID", "comment": null}, "CLAIM_START": {"type": "DATE", "index": 2, "name": "CLAIM_START", "comment": null}, "DIAGNOSIS_CODE_1": {"type": "TEXT", "index": 3, "name": "DIAGNOSIS_CODE_1", "comment": null}, "DIAGNOSIS_CODE_TYPE": {"type": "TEXT", "index": 4, "name": "DIAGNOSIS_CODE_TYPE", "comment": null}, "ADMIT_SOURCE_CODE": {"type": "TEXT", "index": 5, "name": "ADMIT_SOURCE_CODE", "comment": null}, "ADMIT_TYPE_CODE": {"type": "TEXT", "index": 6, "name": "ADMIT_TYPE_CODE", "comment": null}, "FACILITY_NPI": {"type": "TEXT", "index": 7, "name": "FACILITY_NPI", "comment": null}, "MS_DRG_CODE": {"type": "TEXT", "index": 8, "name": "MS_DRG_CODE", "comment": null}, "APR_DRG_CODE": {"type": "TEXT", "index": 9, "name": "APR_DRG_CODE", "comment": null}, "CLAIM_ROW": {"type": "NUMBER", "index": 10, "name": "CLAIM_ROW", "comment": null}}, "stats": {"last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-11-28 23:51UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.acute_inpatient__first_claim_values"}, "model.the_tuva_project.service_category__inpatient_rehab_professional": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_INPATIENT_REHAB_PROFESSIONAL", "database": "DEV_SARAH", "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-11-28 23:51UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.service_category__inpatient_rehab_professional"}, "model.the_tuva_project.financial_pmpm__patient_spend_with_service_categories": {"metadata": {"type": "BASE TABLE", "schema": "FINANCIAL_PMPM", "name": "_INT_PATIENT_SPEND_WITH_SERVICE_CATEGORIES", "database": "DEV_SARAH", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"PATIENT_ID": {"type": "TEXT", "index": 1, "name": "PATIENT_ID", "comment": null}, "YEAR_MONTH": {"type": "TEXT", "index": 2, "name": "YEAR_MONTH", "comment": null}, "PAYER": {"type": "TEXT", "index": 3, "name": "PAYER", "comment": null}, "PLAN": {"type": "TEXT", "index": 4, "name": "PLAN", "comment": null}, "SERVICE_CATEGORY_1": {"type": "TEXT", "index": 5, "name": "SERVICE_CATEGORY_1", "comment": null}, "SERVICE_CATEGORY_2": {"type": "TEXT", "index": 6, "name": "SERVICE_CATEGORY_2", "comment": null}, "TOTAL_PAID": {"type": "NUMBER", "index": 7, "name": "TOTAL_PAID", "comment": null}, "TOTAL_ALLOWED": {"type": "NUMBER", "index": 8, "name": "TOTAL_ALLOWED", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 9, "name": "DATA_SOURCE", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 10, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-11-28 23:51UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.financial_pmpm__patient_spend_with_service_categories"}, "model.the_tuva_project.data_profiling__medical_claim_prof_missing_values": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_MEDICAL_CLAIM_PROF_MISSING_VALUES", "database": "DEV_SARAH", "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-11-28 23:50UTC", "include": true, "description": "The timestamp for last update/change"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.data_profiling__medical_claim_prof_missing_values"}}, "sources": {}, "errors": null} \ No newline at end of file +{"metadata": {"dbt_schema_version": "https://schemas.getdbt.com/dbt/catalog/v1.json", "dbt_version": "1.4.5", "generated_at": "2023-12-13T23:32:13.447509Z", "invocation_id": "f31303e4-74ec-429d-9417-b329af1ae438", "env": {}}, "nodes": {"model.input_layer.condition": {"metadata": {"type": "VIEW", "schema": "INPUT_LAYER", "name": "CONDITION", "database": "TUVA", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"CONDITION_ID": {"type": "TEXT", "index": 1, "name": "CONDITION_ID", "comment": null}, "PATIENT_ID": {"type": "TEXT", "index": 2, "name": "PATIENT_ID", "comment": null}, "ENCOUNTER_ID": {"type": "TEXT", "index": 3, "name": "ENCOUNTER_ID", "comment": null}, "CLAIM_ID": {"type": "TEXT", "index": 4, "name": "CLAIM_ID", "comment": null}, "RECORDED_DATE": {"type": "DATE", "index": 5, "name": "RECORDED_DATE", "comment": null}, "ONSET_DATE": {"type": "DATE", "index": 6, "name": "ONSET_DATE", "comment": null}, "RESOLVED_DATE": {"type": "DATE", "index": 7, "name": "RESOLVED_DATE", "comment": null}, "STATUS": {"type": "TEXT", "index": 8, "name": "STATUS", "comment": null}, "CONDITION_TYPE": {"type": "TEXT", "index": 9, "name": "CONDITION_TYPE", "comment": null}, "SOURCE_CODE_TYPE": {"type": "TEXT", "index": 10, "name": "SOURCE_CODE_TYPE", "comment": null}, "SOURCE_CODE": {"type": "TEXT", "index": 11, "name": "SOURCE_CODE", "comment": null}, "SOURCE_DESCRIPTION": {"type": "TEXT", "index": 12, "name": "SOURCE_DESCRIPTION", "comment": null}, "NORMALIZED_CODE_TYPE": {"type": "TEXT", "index": 13, "name": "NORMALIZED_CODE_TYPE", "comment": null}, "NORMALIZED_CODE": {"type": "TEXT", "index": 14, "name": "NORMALIZED_CODE", "comment": null}, "NORMALIZED_DESCRIPTION": {"type": "TEXT", "index": 15, "name": "NORMALIZED_DESCRIPTION", "comment": null}, "CONDITION_RANK": {"type": "NUMBER", "index": 16, "name": "CONDITION_RANK", "comment": null}, "PRESENT_ON_ADMIT_CODE": {"type": "TEXT", "index": 17, "name": "PRESENT_ON_ADMIT_CODE", "comment": null}, "PRESENT_ON_ADMIT_DESCRIPTION": {"type": "TEXT", "index": 18, "name": "PRESENT_ON_ADMIT_DESCRIPTION", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 19, "name": "DATA_SOURCE", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.input_layer.condition"}, "model.input_layer.patient": {"metadata": {"type": "VIEW", "schema": "INPUT_LAYER", "name": "PATIENT", "database": "TUVA", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"PATIENT_ID": {"type": "TEXT", "index": 1, "name": "PATIENT_ID", "comment": null}, "FIRST_NAME": {"type": "TEXT", "index": 2, "name": "FIRST_NAME", "comment": null}, "LAST_NAME": {"type": "TEXT", "index": 3, "name": "LAST_NAME", "comment": null}, "SEX": {"type": "TEXT", "index": 4, "name": "SEX", "comment": null}, "RACE": {"type": "TEXT", "index": 5, "name": "RACE", "comment": null}, "BIRTH_DATE": {"type": "DATE", "index": 6, "name": "BIRTH_DATE", "comment": null}, "DEATH_DATE": {"type": "DATE", "index": 7, "name": "DEATH_DATE", "comment": null}, "DEATH_FLAG": {"type": "NUMBER", "index": 8, "name": "DEATH_FLAG", "comment": null}, "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}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.input_layer.patient"}, "model.input_layer.medical_claim": {"metadata": {"type": "VIEW", "schema": "INPUT_LAYER", "name": "MEDICAL_CLAIM", "database": "TUVA", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"CLAIM_ID": {"type": "TEXT", "index": 1, "name": "CLAIM_ID", "comment": null}, "CLAIM_LINE_NUMBER": {"type": "NUMBER", "index": 2, "name": "CLAIM_LINE_NUMBER", "comment": null}, "CLAIM_TYPE": {"type": "TEXT", "index": 3, "name": "CLAIM_TYPE", "comment": null}, "PATIENT_ID": {"type": "TEXT", "index": 4, "name": "PATIENT_ID", "comment": null}, "MEMBER_ID": {"type": "TEXT", "index": 5, "name": "MEMBER_ID", "comment": null}, "PAYER": {"type": "TEXT", "index": 6, "name": "PAYER", "comment": null}, "PLAN": {"type": "TEXT", "index": 7, "name": "PLAN", "comment": null}, "CLAIM_START_DATE": {"type": "DATE", "index": 8, "name": "CLAIM_START_DATE", "comment": null}, "CLAIM_END_DATE": {"type": "DATE", "index": 9, "name": "CLAIM_END_DATE", "comment": null}, "CLAIM_LINE_START_DATE": {"type": "DATE", "index": 10, "name": "CLAIM_LINE_START_DATE", "comment": null}, "CLAIM_LINE_END_DATE": {"type": "DATE", "index": 11, "name": "CLAIM_LINE_END_DATE", "comment": null}, "ADMISSION_DATE": {"type": "DATE", "index": 12, "name": "ADMISSION_DATE", "comment": null}, "DISCHARGE_DATE": {"type": "DATE", "index": 13, "name": "DISCHARGE_DATE", "comment": null}, "ADMIT_SOURCE_CODE": {"type": "TEXT", "index": 14, "name": "ADMIT_SOURCE_CODE", "comment": null}, "ADMIT_TYPE_CODE": {"type": "TEXT", "index": 15, "name": "ADMIT_TYPE_CODE", "comment": null}, "DISCHARGE_DISPOSITION_CODE": {"type": "TEXT", "index": 16, "name": "DISCHARGE_DISPOSITION_CODE", "comment": null}, "PLACE_OF_SERVICE_CODE": {"type": "TEXT", "index": 17, "name": "PLACE_OF_SERVICE_CODE", "comment": null}, "BILL_TYPE_CODE": {"type": "TEXT", "index": 18, "name": "BILL_TYPE_CODE", "comment": null}, "MS_DRG_CODE": {"type": "TEXT", "index": 19, "name": "MS_DRG_CODE", "comment": null}, "APR_DRG_CODE": {"type": "TEXT", "index": 20, "name": "APR_DRG_CODE", "comment": null}, "REVENUE_CENTER_CODE": {"type": "TEXT", "index": 21, "name": "REVENUE_CENTER_CODE", "comment": null}, "SERVICE_UNIT_QUANTITY": {"type": "NUMBER", "index": 22, "name": "SERVICE_UNIT_QUANTITY", "comment": null}, "HCPCS_CODE": {"type": "TEXT", "index": 23, "name": "HCPCS_CODE", "comment": null}, "HCPCS_MODIFIER_1": {"type": "TEXT", "index": 24, "name": "HCPCS_MODIFIER_1", "comment": null}, "HCPCS_MODIFIER_2": {"type": "TEXT", "index": 25, "name": "HCPCS_MODIFIER_2", "comment": null}, "HCPCS_MODIFIER_3": {"type": "TEXT", "index": 26, "name": "HCPCS_MODIFIER_3", "comment": null}, "HCPCS_MODIFIER_4": {"type": "TEXT", "index": 27, "name": "HCPCS_MODIFIER_4", "comment": null}, "HCPCS_MODIFIER_5": {"type": "TEXT", "index": 28, "name": "HCPCS_MODIFIER_5", "comment": null}, "RENDERING_NPI": {"type": "TEXT", "index": 29, "name": "RENDERING_NPI", "comment": null}, "BILLING_NPI": {"type": "TEXT", "index": 30, "name": "BILLING_NPI", "comment": null}, "FACILITY_NPI": {"type": "TEXT", "index": 31, "name": "FACILITY_NPI", "comment": null}, "PAID_DATE": {"type": "DATE", "index": 32, "name": "PAID_DATE", "comment": null}, "PAID_AMOUNT": {"type": "FLOAT", "index": 33, "name": "PAID_AMOUNT", "comment": null}, "ALLOWED_AMOUNT": {"type": "FLOAT", "index": 34, "name": "ALLOWED_AMOUNT", "comment": null}, "CHARGE_AMOUNT": {"type": "FLOAT", "index": 35, "name": "CHARGE_AMOUNT", "comment": null}, "COINSURANCE_AMOUNT": {"type": "FLOAT", "index": 36, "name": "COINSURANCE_AMOUNT", "comment": null}, "COPAYMENT_AMOUNT": {"type": "FLOAT", "index": 37, "name": "COPAYMENT_AMOUNT", "comment": null}, "DEDUCTIBLE_AMOUNT": {"type": "FLOAT", "index": 38, "name": "DEDUCTIBLE_AMOUNT", "comment": null}, "TOTAL_COST_AMOUNT": {"type": "FLOAT", "index": 39, "name": "TOTAL_COST_AMOUNT", "comment": null}, "DIAGNOSIS_CODE_TYPE": {"type": "TEXT", "index": 40, "name": "DIAGNOSIS_CODE_TYPE", "comment": null}, "DIAGNOSIS_CODE_1": {"type": "TEXT", "index": 41, "name": "DIAGNOSIS_CODE_1", "comment": null}, "DIAGNOSIS_CODE_2": {"type": "TEXT", "index": 42, "name": "DIAGNOSIS_CODE_2", "comment": null}, "DIAGNOSIS_CODE_3": {"type": "TEXT", "index": 43, "name": "DIAGNOSIS_CODE_3", "comment": null}, "DIAGNOSIS_CODE_4": {"type": "TEXT", "index": 44, "name": "DIAGNOSIS_CODE_4", "comment": null}, "DIAGNOSIS_CODE_5": {"type": "TEXT", "index": 45, "name": "DIAGNOSIS_CODE_5", "comment": null}, "DIAGNOSIS_CODE_6": {"type": "TEXT", "index": 46, "name": "DIAGNOSIS_CODE_6", "comment": null}, "DIAGNOSIS_CODE_7": {"type": "TEXT", "index": 47, "name": "DIAGNOSIS_CODE_7", "comment": null}, "DIAGNOSIS_CODE_8": {"type": "TEXT", "index": 48, "name": "DIAGNOSIS_CODE_8", "comment": null}, "DIAGNOSIS_CODE_9": {"type": "TEXT", "index": 49, "name": "DIAGNOSIS_CODE_9", "comment": null}, "DIAGNOSIS_CODE_10": {"type": "TEXT", "index": 50, "name": "DIAGNOSIS_CODE_10", "comment": null}, "DIAGNOSIS_CODE_11": {"type": "TEXT", "index": 51, "name": "DIAGNOSIS_CODE_11", "comment": null}, "DIAGNOSIS_CODE_12": {"type": "TEXT", "index": 52, "name": "DIAGNOSIS_CODE_12", "comment": null}, "DIAGNOSIS_CODE_13": {"type": "TEXT", "index": 53, "name": "DIAGNOSIS_CODE_13", "comment": null}, "DIAGNOSIS_CODE_14": {"type": "TEXT", "index": 54, "name": "DIAGNOSIS_CODE_14", "comment": null}, "DIAGNOSIS_CODE_15": {"type": "TEXT", "index": 55, "name": "DIAGNOSIS_CODE_15", "comment": null}, "DIAGNOSIS_CODE_16": {"type": "TEXT", "index": 56, "name": "DIAGNOSIS_CODE_16", "comment": null}, "DIAGNOSIS_CODE_17": {"type": "TEXT", "index": 57, "name": "DIAGNOSIS_CODE_17", "comment": null}, "DIAGNOSIS_CODE_18": {"type": "TEXT", "index": 58, "name": "DIAGNOSIS_CODE_18", "comment": null}, "DIAGNOSIS_CODE_19": {"type": "TEXT", "index": 59, "name": "DIAGNOSIS_CODE_19", "comment": null}, "DIAGNOSIS_CODE_20": {"type": "TEXT", "index": 60, "name": "DIAGNOSIS_CODE_20", "comment": null}, "DIAGNOSIS_CODE_21": {"type": "TEXT", "index": 61, "name": "DIAGNOSIS_CODE_21", "comment": null}, "DIAGNOSIS_CODE_22": {"type": "TEXT", "index": 62, "name": "DIAGNOSIS_CODE_22", "comment": null}, "DIAGNOSIS_CODE_23": {"type": "TEXT", "index": 63, "name": "DIAGNOSIS_CODE_23", "comment": null}, "DIAGNOSIS_CODE_24": {"type": "TEXT", "index": 64, "name": "DIAGNOSIS_CODE_24", "comment": null}, "DIAGNOSIS_CODE_25": {"type": "TEXT", "index": 65, "name": "DIAGNOSIS_CODE_25", "comment": null}, "DIAGNOSIS_POA_1": {"type": "TEXT", "index": 66, "name": "DIAGNOSIS_POA_1", "comment": null}, "DIAGNOSIS_POA_2": {"type": "TEXT", "index": 67, "name": "DIAGNOSIS_POA_2", "comment": null}, "DIAGNOSIS_POA_3": {"type": "TEXT", "index": 68, "name": "DIAGNOSIS_POA_3", "comment": null}, "DIAGNOSIS_POA_4": {"type": "TEXT", "index": 69, "name": "DIAGNOSIS_POA_4", "comment": null}, "DIAGNOSIS_POA_5": {"type": "TEXT", "index": 70, "name": "DIAGNOSIS_POA_5", "comment": null}, "DIAGNOSIS_POA_6": {"type": "TEXT", "index": 71, "name": "DIAGNOSIS_POA_6", "comment": null}, "DIAGNOSIS_POA_7": {"type": "TEXT", "index": 72, "name": "DIAGNOSIS_POA_7", "comment": null}, "DIAGNOSIS_POA_8": {"type": "TEXT", "index": 73, "name": "DIAGNOSIS_POA_8", "comment": null}, "DIAGNOSIS_POA_9": {"type": "TEXT", "index": 74, "name": "DIAGNOSIS_POA_9", "comment": null}, "DIAGNOSIS_POA_10": {"type": "TEXT", "index": 75, "name": "DIAGNOSIS_POA_10", "comment": null}, "DIAGNOSIS_POA_11": {"type": "TEXT", "index": 76, "name": "DIAGNOSIS_POA_11", "comment": null}, "DIAGNOSIS_POA_12": {"type": "TEXT", "index": 77, "name": "DIAGNOSIS_POA_12", "comment": null}, "DIAGNOSIS_POA_13": {"type": "TEXT", "index": 78, "name": "DIAGNOSIS_POA_13", "comment": null}, "DIAGNOSIS_POA_14": {"type": "TEXT", "index": 79, "name": "DIAGNOSIS_POA_14", "comment": null}, "DIAGNOSIS_POA_15": {"type": "TEXT", "index": 80, "name": "DIAGNOSIS_POA_15", "comment": null}, "DIAGNOSIS_POA_16": {"type": "TEXT", "index": 81, "name": "DIAGNOSIS_POA_16", "comment": null}, "DIAGNOSIS_POA_17": {"type": "TEXT", "index": 82, "name": "DIAGNOSIS_POA_17", "comment": null}, "DIAGNOSIS_POA_18": {"type": "TEXT", "index": 83, "name": "DIAGNOSIS_POA_18", "comment": null}, "DIAGNOSIS_POA_19": {"type": "TEXT", "index": 84, "name": "DIAGNOSIS_POA_19", "comment": null}, "DIAGNOSIS_POA_20": {"type": "TEXT", "index": 85, "name": "DIAGNOSIS_POA_20", "comment": null}, "DIAGNOSIS_POA_21": {"type": "TEXT", "index": 86, "name": "DIAGNOSIS_POA_21", "comment": null}, "DIAGNOSIS_POA_22": {"type": "TEXT", "index": 87, "name": "DIAGNOSIS_POA_22", "comment": null}, "DIAGNOSIS_POA_23": {"type": "TEXT", "index": 88, "name": "DIAGNOSIS_POA_23", "comment": null}, "DIAGNOSIS_POA_24": {"type": "TEXT", "index": 89, "name": "DIAGNOSIS_POA_24", "comment": null}, "DIAGNOSIS_POA_25": {"type": "TEXT", "index": 90, "name": "DIAGNOSIS_POA_25", "comment": null}, "PROCEDURE_CODE_TYPE": {"type": "TEXT", "index": 91, "name": "PROCEDURE_CODE_TYPE", "comment": null}, "PROCEDURE_CODE_1": {"type": "TEXT", "index": 92, "name": "PROCEDURE_CODE_1", "comment": null}, "PROCEDURE_CODE_2": {"type": "TEXT", "index": 93, "name": "PROCEDURE_CODE_2", "comment": null}, "PROCEDURE_CODE_3": {"type": "TEXT", "index": 94, "name": "PROCEDURE_CODE_3", "comment": null}, "PROCEDURE_CODE_4": {"type": "TEXT", "index": 95, "name": "PROCEDURE_CODE_4", "comment": null}, "PROCEDURE_CODE_5": {"type": "TEXT", "index": 96, "name": "PROCEDURE_CODE_5", "comment": null}, "PROCEDURE_CODE_6": {"type": "TEXT", "index": 97, "name": "PROCEDURE_CODE_6", "comment": null}, "PROCEDURE_CODE_7": {"type": "TEXT", "index": 98, "name": "PROCEDURE_CODE_7", "comment": null}, "PROCEDURE_CODE_8": {"type": "TEXT", "index": 99, "name": "PROCEDURE_CODE_8", "comment": null}, "PROCEDURE_CODE_9": {"type": "TEXT", "index": 100, "name": "PROCEDURE_CODE_9", "comment": null}, "PROCEDURE_CODE_10": {"type": "TEXT", "index": 101, "name": "PROCEDURE_CODE_10", "comment": null}, "PROCEDURE_CODE_11": {"type": "TEXT", "index": 102, "name": "PROCEDURE_CODE_11", "comment": null}, "PROCEDURE_CODE_12": {"type": "TEXT", "index": 103, "name": "PROCEDURE_CODE_12", "comment": null}, "PROCEDURE_CODE_13": {"type": "TEXT", "index": 104, "name": "PROCEDURE_CODE_13", "comment": null}, "PROCEDURE_CODE_14": {"type": "TEXT", "index": 105, "name": "PROCEDURE_CODE_14", "comment": null}, "PROCEDURE_CODE_15": {"type": "TEXT", "index": 106, "name": "PROCEDURE_CODE_15", "comment": null}, "PROCEDURE_CODE_16": {"type": "TEXT", "index": 107, "name": "PROCEDURE_CODE_16", "comment": null}, "PROCEDURE_CODE_17": {"type": "TEXT", "index": 108, "name": "PROCEDURE_CODE_17", "comment": null}, "PROCEDURE_CODE_18": {"type": "TEXT", "index": 109, "name": "PROCEDURE_CODE_18", "comment": null}, "PROCEDURE_CODE_19": {"type": "TEXT", "index": 110, "name": "PROCEDURE_CODE_19", "comment": null}, "PROCEDURE_CODE_20": {"type": "TEXT", "index": 111, "name": "PROCEDURE_CODE_20", "comment": null}, "PROCEDURE_CODE_21": {"type": "TEXT", "index": 112, "name": "PROCEDURE_CODE_21", "comment": null}, "PROCEDURE_CODE_22": {"type": "TEXT", "index": 113, "name": "PROCEDURE_CODE_22", "comment": null}, "PROCEDURE_CODE_23": {"type": "TEXT", "index": 114, "name": "PROCEDURE_CODE_23", "comment": null}, "PROCEDURE_CODE_24": {"type": "TEXT", "index": 115, "name": "PROCEDURE_CODE_24", "comment": null}, "PROCEDURE_CODE_25": {"type": "TEXT", "index": 116, "name": "PROCEDURE_CODE_25", "comment": null}, "PROCEDURE_DATE_1": {"type": "DATE", "index": 117, "name": "PROCEDURE_DATE_1", "comment": null}, "PROCEDURE_DATE_2": {"type": "DATE", "index": 118, "name": "PROCEDURE_DATE_2", "comment": null}, "PROCEDURE_DATE_3": {"type": "DATE", "index": 119, "name": "PROCEDURE_DATE_3", "comment": null}, "PROCEDURE_DATE_4": {"type": "DATE", "index": 120, "name": "PROCEDURE_DATE_4", "comment": null}, "PROCEDURE_DATE_5": {"type": "DATE", "index": 121, "name": "PROCEDURE_DATE_5", "comment": null}, "PROCEDURE_DATE_6": {"type": "DATE", "index": 122, "name": "PROCEDURE_DATE_6", "comment": null}, "PROCEDURE_DATE_7": {"type": "DATE", "index": 123, "name": "PROCEDURE_DATE_7", "comment": null}, "PROCEDURE_DATE_8": {"type": "DATE", "index": 124, "name": "PROCEDURE_DATE_8", "comment": null}, "PROCEDURE_DATE_9": {"type": "DATE", "index": 125, "name": "PROCEDURE_DATE_9", "comment": null}, "PROCEDURE_DATE_10": {"type": "DATE", "index": 126, "name": "PROCEDURE_DATE_10", "comment": null}, "PROCEDURE_DATE_11": {"type": "DATE", "index": 127, "name": "PROCEDURE_DATE_11", "comment": null}, "PROCEDURE_DATE_12": {"type": "DATE", "index": 128, "name": "PROCEDURE_DATE_12", "comment": null}, "PROCEDURE_DATE_13": {"type": "DATE", "index": 129, "name": "PROCEDURE_DATE_13", "comment": null}, "PROCEDURE_DATE_14": {"type": "DATE", "index": 130, "name": "PROCEDURE_DATE_14", "comment": null}, "PROCEDURE_DATE_15": {"type": "DATE", "index": 131, "name": "PROCEDURE_DATE_15", "comment": null}, "PROCEDURE_DATE_16": {"type": "DATE", "index": 132, "name": "PROCEDURE_DATE_16", "comment": null}, "PROCEDURE_DATE_17": {"type": "DATE", "index": 133, "name": "PROCEDURE_DATE_17", "comment": null}, "PROCEDURE_DATE_18": {"type": "DATE", "index": 134, "name": "PROCEDURE_DATE_18", "comment": null}, "PROCEDURE_DATE_19": {"type": "DATE", "index": 135, "name": "PROCEDURE_DATE_19", "comment": null}, "PROCEDURE_DATE_20": {"type": "DATE", "index": 136, "name": "PROCEDURE_DATE_20", "comment": null}, "PROCEDURE_DATE_21": {"type": "DATE", "index": 137, "name": "PROCEDURE_DATE_21", "comment": null}, "PROCEDURE_DATE_22": {"type": "DATE", "index": 138, "name": "PROCEDURE_DATE_22", "comment": null}, "PROCEDURE_DATE_23": {"type": "DATE", "index": 139, "name": "PROCEDURE_DATE_23", "comment": null}, "PROCEDURE_DATE_24": {"type": "DATE", "index": 140, "name": "PROCEDURE_DATE_24", "comment": null}, "PROCEDURE_DATE_25": {"type": "DATE", "index": 141, "name": "PROCEDURE_DATE_25", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 142, "name": "DATA_SOURCE", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.input_layer.medical_claim"}, "model.input_layer.lab_result": {"metadata": {"type": "VIEW", "schema": "INPUT_LAYER", "name": "LAB_RESULT", "database": "TUVA", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"LAB_RESULT_ID": {"type": "TEXT", "index": 1, "name": "LAB_RESULT_ID", "comment": null}, "PATIENT_ID": {"type": "TEXT", "index": 2, "name": "PATIENT_ID", "comment": null}, "ENCOUNTER_ID": {"type": "TEXT", "index": 3, "name": "ENCOUNTER_ID", "comment": null}, "ACCESSION_NUMBER": {"type": "TEXT", "index": 4, "name": "ACCESSION_NUMBER", "comment": null}, "SOURCE_CODE_TYPE": {"type": "TEXT", "index": 5, "name": "SOURCE_CODE_TYPE", "comment": null}, "SOURCE_CODE": {"type": "TEXT", "index": 6, "name": "SOURCE_CODE", "comment": null}, "SOURCE_DESCRIPTION": {"type": "TEXT", "index": 7, "name": "SOURCE_DESCRIPTION", "comment": null}, "SOURCE_COMPONENT": {"type": "TEXT", "index": 8, "name": "SOURCE_COMPONENT", "comment": null}, "NORMALIZED_CODE_TYPE": {"type": "TEXT", "index": 9, "name": "NORMALIZED_CODE_TYPE", "comment": null}, "NORMALIZED_CODE": {"type": "TEXT", "index": 10, "name": "NORMALIZED_CODE", "comment": null}, "NORMALIZED_DESCRIPTION": {"type": "TEXT", "index": 11, "name": "NORMALIZED_DESCRIPTION", "comment": null}, "NORMALIZED_COMPONENT": {"type": "TEXT", "index": 12, "name": "NORMALIZED_COMPONENT", "comment": null}, "STATUS": {"type": "TEXT", "index": 13, "name": "STATUS", "comment": null}, "RESULT": {"type": "TEXT", "index": 14, "name": "RESULT", "comment": null}, "RESULT_DATE": {"type": "DATE", "index": 15, "name": "RESULT_DATE", "comment": null}, "COLLECTION_DATE": {"type": "DATE", "index": 16, "name": "COLLECTION_DATE", "comment": null}, "SOURCE_UNITS": {"type": "TEXT", "index": 17, "name": "SOURCE_UNITS", "comment": null}, "NORMALIZED_UNITS": {"type": "TEXT", "index": 18, "name": "NORMALIZED_UNITS", "comment": null}, "SOURCE_REFERENCE_RANGE_LOW": {"type": "TEXT", "index": 19, "name": "SOURCE_REFERENCE_RANGE_LOW", "comment": null}, "SOURCE_REFERENCE_RANGE_HIGH": {"type": "TEXT", "index": 20, "name": "SOURCE_REFERENCE_RANGE_HIGH", "comment": null}, "NORMALIZED_REFERENCE_RANGE_LOW": {"type": "TEXT", "index": 21, "name": "NORMALIZED_REFERENCE_RANGE_LOW", "comment": null}, "NORMALIZED_REFERENCE_RANGE_HIGH": {"type": "TEXT", "index": 22, "name": "NORMALIZED_REFERENCE_RANGE_HIGH", "comment": null}, "SOURCE_ABNORMAL_FLAG": {"type": "NUMBER", "index": 23, "name": "SOURCE_ABNORMAL_FLAG", "comment": null}, "NORMALIZED_ABNORMAL_FLAG": {"type": "NUMBER", "index": 24, "name": "NORMALIZED_ABNORMAL_FLAG", "comment": null}, "SPECIMEN": {"type": "TEXT", "index": 25, "name": "SPECIMEN", "comment": null}, "ORDERING_PRACTITIONER_ID": {"type": "TEXT", "index": 26, "name": "ORDERING_PRACTITIONER_ID", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 27, "name": "DATA_SOURCE", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.input_layer.lab_result"}, "model.input_layer.encounter": {"metadata": {"type": "VIEW", "schema": "INPUT_LAYER", "name": "ENCOUNTER", "database": "TUVA", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"ENCOUNTER_ID": {"type": "TEXT", "index": 1, "name": "ENCOUNTER_ID", "comment": null}, "PATIENT_ID": {"type": "TEXT", "index": 2, "name": "PATIENT_ID", "comment": null}, "ENCOUNTER_TYPE": {"type": "TEXT", "index": 3, "name": "ENCOUNTER_TYPE", "comment": null}, "ENCOUNTER_START_DATE": {"type": "DATE", "index": 4, "name": "ENCOUNTER_START_DATE", "comment": null}, "ENCOUNTER_END_DATE": {"type": "DATE", "index": 5, "name": "ENCOUNTER_END_DATE", "comment": null}, "LENGTH_OF_STAY": {"type": "NUMBER", "index": 6, "name": "LENGTH_OF_STAY", "comment": null}, "ADMIT_SOURCE_CODE": {"type": "TEXT", "index": 7, "name": "ADMIT_SOURCE_CODE", "comment": null}, "ADMIT_SOURCE_DESCRIPTION": {"type": "TEXT", "index": 8, "name": "ADMIT_SOURCE_DESCRIPTION", "comment": null}, "ADMIT_TYPE_CODE": {"type": "TEXT", "index": 9, "name": "ADMIT_TYPE_CODE", "comment": null}, "ADMIT_TYPE_DESCRIPTION": {"type": "TEXT", "index": 10, "name": "ADMIT_TYPE_DESCRIPTION", "comment": null}, "DISCHARGE_DISPOSITION_CODE": {"type": "TEXT", "index": 11, "name": "DISCHARGE_DISPOSITION_CODE", "comment": null}, "DISCHARGE_DISPOSITION_DESCRIPTION": {"type": "TEXT", "index": 12, "name": "DISCHARGE_DISPOSITION_DESCRIPTION", "comment": null}, "ATTENDING_PROVIDER_ID": {"type": "TEXT", "index": 13, "name": "ATTENDING_PROVIDER_ID", "comment": null}, "FACILITY_NPI": {"type": "TEXT", "index": 14, "name": "FACILITY_NPI", "comment": null}, "PRIMARY_DIAGNOSIS_CODE_TYPE": {"type": "TEXT", "index": 15, "name": "PRIMARY_DIAGNOSIS_CODE_TYPE", "comment": null}, "PRIMARY_DIAGNOSIS_CODE": {"type": "TEXT", "index": 16, "name": "PRIMARY_DIAGNOSIS_CODE", "comment": null}, "PRIMARY_DIAGNOSIS_DESCRIPTION": {"type": "TEXT", "index": 17, "name": "PRIMARY_DIAGNOSIS_DESCRIPTION", "comment": null}, "MS_DRG_CODE": {"type": "TEXT", "index": 18, "name": "MS_DRG_CODE", "comment": null}, "MS_DRG_DESCRIPTION": {"type": "TEXT", "index": 19, "name": "MS_DRG_DESCRIPTION", "comment": null}, "APR_DRG_CODE": {"type": "TEXT", "index": 20, "name": "APR_DRG_CODE", "comment": null}, "APR_DRG_DESCRIPTION": {"type": "TEXT", "index": 21, "name": "APR_DRG_DESCRIPTION", "comment": null}, "PAID_AMOUNT": {"type": "NUMBER", "index": 22, "name": "PAID_AMOUNT", "comment": null}, "ALLOWED_AMOUNT": {"type": "NUMBER", "index": 23, "name": "ALLOWED_AMOUNT", "comment": null}, "CHARGE_AMOUNT": {"type": "NUMBER", "index": 24, "name": "CHARGE_AMOUNT", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 25, "name": "DATA_SOURCE", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.input_layer.encounter"}, "model.input_layer.practitioner": {"metadata": {"type": "VIEW", "schema": "INPUT_LAYER", "name": "PRACTITIONER", "database": "TUVA", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"PRACTITIONER_ID": {"type": "TEXT", "index": 1, "name": "PRACTITIONER_ID", "comment": null}, "NPI": {"type": "TEXT", "index": 2, "name": "NPI", "comment": null}, "FIRST_NAME": {"type": "TEXT", "index": 3, "name": "FIRST_NAME", "comment": null}, "LAST_NAME": {"type": "TEXT", "index": 4, "name": "LAST_NAME", "comment": null}, "PRACTICE_AFFILIATION": {"type": "TEXT", "index": 5, "name": "PRACTICE_AFFILIATION", "comment": null}, "SPECIALTY": {"type": "TEXT", "index": 6, "name": "SPECIALTY", "comment": null}, "SUB_SPECIALTY": {"type": "TEXT", "index": 7, "name": "SUB_SPECIALTY", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 8, "name": "DATA_SOURCE", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.input_layer.practitioner"}, "model.input_layer.location": {"metadata": {"type": "VIEW", "schema": "INPUT_LAYER", "name": "LOCATION", "database": "TUVA", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"LOCATION_ID": {"type": "TEXT", "index": 1, "name": "LOCATION_ID", "comment": null}, "NPI": {"type": "TEXT", "index": 2, "name": "NPI", "comment": null}, "NAME": {"type": "TEXT", "index": 3, "name": "NAME", "comment": null}, "FACILITY_TYPE": {"type": "TEXT", "index": 4, "name": "FACILITY_TYPE", "comment": null}, "PARENT_ORGANIZATION": {"type": "TEXT", "index": 5, "name": "PARENT_ORGANIZATION", "comment": null}, "ADDRESS": {"type": "TEXT", "index": 6, "name": "ADDRESS", "comment": null}, "CITY": {"type": "TEXT", "index": 7, "name": "CITY", "comment": null}, "STATE": {"type": "TEXT", "index": 8, "name": "STATE", "comment": null}, "ZIP_CODE": {"type": "TEXT", "index": 9, "name": "ZIP_CODE", "comment": null}, "LATITUDE": {"type": "FLOAT", "index": 10, "name": "LATITUDE", "comment": null}, "LONGITUDE": {"type": "FLOAT", "index": 11, "name": "LONGITUDE", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 12, "name": "DATA_SOURCE", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.input_layer.location"}, "model.input_layer.observation": {"metadata": {"type": "VIEW", "schema": "INPUT_LAYER", "name": "OBSERVATION", "database": "TUVA", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"OBSERVATION_ID": {"type": "TEXT", "index": 1, "name": "OBSERVATION_ID", "comment": null}, "PATIENT_ID": {"type": "TEXT", "index": 2, "name": "PATIENT_ID", "comment": null}, "ENCOUNTER_ID": {"type": "TEXT", "index": 3, "name": "ENCOUNTER_ID", "comment": null}, "PANEL_ID": {"type": "TEXT", "index": 4, "name": "PANEL_ID", "comment": null}, "OBSERVATION_DATE": {"type": "DATE", "index": 5, "name": "OBSERVATION_DATE", "comment": null}, "OBSERVATION_TYPE": {"type": "TEXT", "index": 6, "name": "OBSERVATION_TYPE", "comment": null}, "SOURCE_CODE_TYPE": {"type": "TEXT", "index": 7, "name": "SOURCE_CODE_TYPE", "comment": null}, "SOURCE_CODE": {"type": "TEXT", "index": 8, "name": "SOURCE_CODE", "comment": null}, "SOURCE_DESCRIPTION": {"type": "TEXT", "index": 9, "name": "SOURCE_DESCRIPTION", "comment": null}, "NORMALIZED_CODE_TYPE": {"type": "TEXT", "index": 10, "name": "NORMALIZED_CODE_TYPE", "comment": null}, "NORMALIZED_CODE": {"type": "TEXT", "index": 11, "name": "NORMALIZED_CODE", "comment": null}, "NORMALIZED_DESCRIPTION": {"type": "TEXT", "index": 12, "name": "NORMALIZED_DESCRIPTION", "comment": null}, "RESULT": {"type": "TEXT", "index": 13, "name": "RESULT", "comment": null}, "SOURCE_UNITS": {"type": "TEXT", "index": 14, "name": "SOURCE_UNITS", "comment": null}, "NORMALIZED_UNITS": {"type": "TEXT", "index": 15, "name": "NORMALIZED_UNITS", "comment": null}, "SOURCE_REFERENCE_RANGE_LOW": {"type": "TEXT", "index": 16, "name": "SOURCE_REFERENCE_RANGE_LOW", "comment": null}, "SOURCE_REFERENCE_RANGE_HIGH": {"type": "TEXT", "index": 17, "name": "SOURCE_REFERENCE_RANGE_HIGH", "comment": null}, "NORMALIZED_REFERENCE_RANGE_LOW": {"type": "TEXT", "index": 18, "name": "NORMALIZED_REFERENCE_RANGE_LOW", "comment": null}, "NORMALIZED_REFERENCE_RANGE_HIGH": {"type": "TEXT", "index": 19, "name": "NORMALIZED_REFERENCE_RANGE_HIGH", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 20, "name": "DATA_SOURCE", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.input_layer.observation"}, "model.input_layer.pharmacy_claim": {"metadata": {"type": "VIEW", "schema": "INPUT_LAYER", "name": "PHARMACY_CLAIM", "database": "TUVA", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"CLAIM_ID": {"type": "TEXT", "index": 1, "name": "CLAIM_ID", "comment": null}, "CLAIM_LINE_NUMBER": {"type": "NUMBER", "index": 2, "name": "CLAIM_LINE_NUMBER", "comment": null}, "PATIENT_ID": {"type": "TEXT", "index": 3, "name": "PATIENT_ID", "comment": null}, "MEMBER_ID": {"type": "TEXT", "index": 4, "name": "MEMBER_ID", "comment": null}, "PAYER": {"type": "TEXT", "index": 5, "name": "PAYER", "comment": null}, "PLAN": {"type": "TEXT", "index": 6, "name": "PLAN", "comment": null}, "PRESCRIBING_PROVIDER_NPI": {"type": "TEXT", "index": 7, "name": "PRESCRIBING_PROVIDER_NPI", "comment": null}, "DISPENSING_PROVIDER_NPI": {"type": "TEXT", "index": 8, "name": "DISPENSING_PROVIDER_NPI", "comment": null}, "DISPENSING_DATE": {"type": "DATE", "index": 9, "name": "DISPENSING_DATE", "comment": null}, "NDC_CODE": {"type": "TEXT", "index": 10, "name": "NDC_CODE", "comment": null}, "QUANTITY": {"type": "NUMBER", "index": 11, "name": "QUANTITY", "comment": null}, "DAYS_SUPPLY": {"type": "NUMBER", "index": 12, "name": "DAYS_SUPPLY", "comment": null}, "REFILLS": {"type": "NUMBER", "index": 13, "name": "REFILLS", "comment": null}, "PAID_DATE": {"type": "DATE", "index": 14, "name": "PAID_DATE", "comment": null}, "PAID_AMOUNT": {"type": "FLOAT", "index": 15, "name": "PAID_AMOUNT", "comment": null}, "ALLOWED_AMOUNT": {"type": "FLOAT", "index": 16, "name": "ALLOWED_AMOUNT", "comment": null}, "COINSURANCE_AMOUNT": {"type": "NUMBER", "index": 17, "name": "COINSURANCE_AMOUNT", "comment": null}, "COPAYMENT_AMOUNT": {"type": "NUMBER", "index": 18, "name": "COPAYMENT_AMOUNT", "comment": null}, "DEDUCTIBLE_AMOUNT": {"type": "NUMBER", "index": 19, "name": "DEDUCTIBLE_AMOUNT", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 20, "name": "DATA_SOURCE", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.input_layer.pharmacy_claim"}, "model.input_layer.procedure": {"metadata": {"type": "VIEW", "schema": "INPUT_LAYER", "name": "PROCEDURE", "database": "TUVA", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"PROCEDURE_ID": {"type": "TEXT", "index": 1, "name": "PROCEDURE_ID", "comment": null}, "PATIENT_ID": {"type": "TEXT", "index": 2, "name": "PATIENT_ID", "comment": null}, "ENCOUNTER_ID": {"type": "TEXT", "index": 3, "name": "ENCOUNTER_ID", "comment": null}, "CLAIM_ID": {"type": "TEXT", "index": 4, "name": "CLAIM_ID", "comment": null}, "PROCEDURE_DATE": {"type": "DATE", "index": 5, "name": "PROCEDURE_DATE", "comment": null}, "SOURCE_CODE_TYPE": {"type": "TEXT", "index": 6, "name": "SOURCE_CODE_TYPE", "comment": null}, "SOURCE_CODE": {"type": "TEXT", "index": 7, "name": "SOURCE_CODE", "comment": null}, "SOURCE_DESCRIPTION": {"type": "TEXT", "index": 8, "name": "SOURCE_DESCRIPTION", "comment": null}, "NORMALIZED_CODE_TYPE": {"type": "TEXT", "index": 9, "name": "NORMALIZED_CODE_TYPE", "comment": null}, "NORMALIZED_CODE": {"type": "TEXT", "index": 10, "name": "NORMALIZED_CODE", "comment": null}, "NORMALIZED_DESCRIPTION": {"type": "TEXT", "index": 11, "name": "NORMALIZED_DESCRIPTION", "comment": null}, "MODIFIER_1": {"type": "TEXT", "index": 12, "name": "MODIFIER_1", "comment": null}, "MODIFIER_2": {"type": "TEXT", "index": 13, "name": "MODIFIER_2", "comment": null}, "MODIFIER_3": {"type": "TEXT", "index": 14, "name": "MODIFIER_3", "comment": null}, "MODIFIER_4": {"type": "TEXT", "index": 15, "name": "MODIFIER_4", "comment": null}, "MODIFIER_5": {"type": "TEXT", "index": 16, "name": "MODIFIER_5", "comment": null}, "PRACTITIONER_ID": {"type": "TEXT", "index": 17, "name": "PRACTITIONER_ID", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 18, "name": "DATA_SOURCE", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.input_layer.procedure"}, "model.input_layer.eligibility": {"metadata": {"type": "VIEW", "schema": "INPUT_LAYER", "name": "ELIGIBILITY", "database": "TUVA", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"PATIENT_ID": {"type": "TEXT", "index": 1, "name": "PATIENT_ID", "comment": null}, "MEMBER_ID": {"type": "TEXT", "index": 2, "name": "MEMBER_ID", "comment": null}, "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}, "PLAN": {"type": "TEXT", "index": 12, "name": "PLAN", "comment": null}, "ORIGINAL_REASON_ENTITLEMENT_CODE": {"type": "TEXT", "index": 13, "name": "ORIGINAL_REASON_ENTITLEMENT_CODE", "comment": null}, "DUAL_STATUS_CODE": {"type": "TEXT", "index": 14, "name": "DUAL_STATUS_CODE", "comment": null}, "MEDICARE_STATUS_CODE": {"type": "TEXT", "index": 15, "name": "MEDICARE_STATUS_CODE", "comment": null}, "FIRST_NAME": {"type": "TEXT", "index": 16, "name": "FIRST_NAME", "comment": null}, "LAST_NAME": {"type": "TEXT", "index": 17, "name": "LAST_NAME", "comment": null}, "ADDRESS": {"type": "TEXT", "index": 18, "name": "ADDRESS", "comment": null}, "CITY": {"type": "TEXT", "index": 19, "name": "CITY", "comment": null}, "STATE": {"type": "TEXT", "index": 20, "name": "STATE", "comment": null}, "ZIP_CODE": {"type": "TEXT", "index": 21, "name": "ZIP_CODE", "comment": null}, "PHONE": {"type": "TEXT", "index": 22, "name": "PHONE", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 23, "name": "DATA_SOURCE", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.input_layer.eligibility"}, "model.input_layer.medication": {"metadata": {"type": "VIEW", "schema": "INPUT_LAYER", "name": "MEDICATION", "database": "TUVA", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"MEDICATION_ID": {"type": "TEXT", "index": 1, "name": "MEDICATION_ID", "comment": null}, "PATIENT_ID": {"type": "TEXT", "index": 2, "name": "PATIENT_ID", "comment": null}, "ENCOUNTER_ID": {"type": "TEXT", "index": 3, "name": "ENCOUNTER_ID", "comment": null}, "DISPENSING_DATE": {"type": "DATE", "index": 4, "name": "DISPENSING_DATE", "comment": null}, "PRESCRIBING_DATE": {"type": "DATE", "index": 5, "name": "PRESCRIBING_DATE", "comment": null}, "SOURCE_CODE_TYPE": {"type": "TEXT", "index": 6, "name": "SOURCE_CODE_TYPE", "comment": null}, "SOURCE_CODE": {"type": "TEXT", "index": 7, "name": "SOURCE_CODE", "comment": null}, "SOURCE_DESCRIPTION": {"type": "TEXT", "index": 8, "name": "SOURCE_DESCRIPTION", "comment": null}, "NDC_CODE": {"type": "TEXT", "index": 9, "name": "NDC_CODE", "comment": null}, "NDC_DESCRIPTION": {"type": "TEXT", "index": 10, "name": "NDC_DESCRIPTION", "comment": null}, "RXNORM_CODE": {"type": "TEXT", "index": 11, "name": "RXNORM_CODE", "comment": null}, "RXNORM_DESCRIPTION": {"type": "TEXT", "index": 12, "name": "RXNORM_DESCRIPTION", "comment": null}, "ATC_CODE": {"type": "TEXT", "index": 13, "name": "ATC_CODE", "comment": null}, "ATC_DESCRIPTION": {"type": "TEXT", "index": 14, "name": "ATC_DESCRIPTION", "comment": null}, "ROUTE": {"type": "TEXT", "index": 15, "name": "ROUTE", "comment": null}, "STRENGTH": {"type": "TEXT", "index": 16, "name": "STRENGTH", "comment": null}, "QUANTITY": {"type": "NUMBER", "index": 17, "name": "QUANTITY", "comment": null}, "QUANTITY_UNIT": {"type": "TEXT", "index": 18, "name": "QUANTITY_UNIT", "comment": null}, "DAYS_SUPPLY": {"type": "NUMBER", "index": 19, "name": "DAYS_SUPPLY", "comment": null}, "PRACTITIONER_ID": {"type": "TEXT", "index": 20, "name": "PRACTITIONER_ID", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 21, "name": "DATA_SOURCE", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.input_layer.medication"}, "seed.the_tuva_project.terminology__icd_10_pcs": {"metadata": {"type": "BASE TABLE", "schema": "TERMINOLOGY", "name": "ICD_10_PCS", "database": "DEVFORREST", "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-12-13 23:01UTC", "include": true, "description": "The timestamp for last update/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.cms_hcc__int_members": {"metadata": {"type": "BASE TABLE", "schema": "CMS_HCC", "name": "_INT_MEMBERS", "database": "DEVFORREST", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"PATIENT_ID": {"type": "TEXT", "index": 1, "name": "PATIENT_ID", "comment": null}, "ENROLLMENT_STATUS": {"type": "TEXT", "index": 2, "name": "ENROLLMENT_STATUS", "comment": null}, "GENDER": {"type": "TEXT", "index": 3, "name": "GENDER", "comment": null}, "AGE_GROUP": {"type": "TEXT", "index": 4, "name": "AGE_GROUP", "comment": null}, "MEDICAID_STATUS": {"type": "TEXT", "index": 5, "name": "MEDICAID_STATUS", "comment": null}, "DUAL_STATUS": {"type": "TEXT", "index": 6, "name": "DUAL_STATUS", "comment": null}, "OREC": {"type": "TEXT", "index": 7, "name": "OREC", "comment": null}, "INSTITUTIONAL_STATUS": {"type": "TEXT", "index": 8, "name": "INSTITUTIONAL_STATUS", "comment": null}, "ENROLLMENT_STATUS_DEFAULT": {"type": "BOOLEAN", "index": 9, "name": "ENROLLMENT_STATUS_DEFAULT", "comment": null}, "MEDICAID_DUAL_STATUS_DEFAULT": {"type": "BOOLEAN", "index": 10, "name": "MEDICAID_DUAL_STATUS_DEFAULT", "comment": null}, "OREC_DEFAULT": {"type": "BOOLEAN", "index": 11, "name": "OREC_DEFAULT", "comment": null}, "INSTITUTIONAL_STATUS_DEFAULT": {"type": "BOOLEAN", "index": 12, "name": "INSTITUTIONAL_STATUS_DEFAULT", "comment": null}, "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-11-16 16:18UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.cms_hcc__int_members"}, "seed.the_tuva_project.terminology__admit_type": {"metadata": {"type": "BASE TABLE", "schema": "TERMINOLOGY", "name": "ADMIT_TYPE", "database": "DEVFORREST", "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-12-13 23:01UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.the_tuva_project.terminology__admit_type"}, "seed.the_tuva_project.readmissions__icd_10_cm_to_ccs": {"metadata": {"type": "BASE TABLE", "schema": "READMISSIONS", "name": "_VALUE_SET_ICD_10_CM_TO_CCS", "database": "DEVFORREST", "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-12-13 23:01UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.the_tuva_project.readmissions__icd_10_cm_to_ccs"}, "seed.input_layer.eligibility_seed": {"metadata": {"type": "BASE TABLE", "schema": "_TUVA_SYNTHETIC", "name": "ELIGIBILITY_SEED", "database": "DEVFORREST", "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}, "ORIGINAL_REASON_ENTITLEMENT_CODE": {"type": "TEXT", "index": 12, "name": "ORIGINAL_REASON_ENTITLEMENT_CODE", "comment": null}, "DUAL_STATUS_CODE": {"type": "TEXT", "index": 13, "name": "DUAL_STATUS_CODE", "comment": null}, "MEDICARE_STATUS_CODE": {"type": "TEXT", "index": 14, "name": "MEDICARE_STATUS_CODE", "comment": null}, "FIRST_NAME": {"type": "TEXT", "index": 15, "name": "FIRST_NAME", "comment": null}, "LAST_NAME": {"type": "TEXT", "index": 16, "name": "LAST_NAME", "comment": null}, "ADDRESS": {"type": "TEXT", "index": 17, "name": "ADDRESS", "comment": null}, "CITY": {"type": "TEXT", "index": 18, "name": "CITY", "comment": null}, "STATE": {"type": "TEXT", "index": 19, "name": "STATE", "comment": null}, "ZIP_CODE": {"type": "TEXT", "index": 20, "name": "ZIP_CODE", "comment": null}, "PHONE": {"type": "TEXT", "index": 21, "name": "PHONE", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 22, "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-12-13 23:00UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.input_layer.eligibility_seed"}, "model.the_tuva_project.cms_hcc__int_eligible_conditions": {"metadata": {"type": "BASE TABLE", "schema": "CMS_HCC", "name": "_INT_ELIGIBLE_CONDITIONS", "database": "DEVFORREST", "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-11-16 16:19UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "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.cms_hcc__patient_risk_scores": {"metadata": {"type": "BASE TABLE", "schema": "CMS_HCC", "name": "PATIENT_RISK_SCORES", "database": "DEVFORREST", "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-11-16 16:19UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "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.service_category__inpatient_psychiatric_professional": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_INPATIENT_PSYCHIATRIC_PROFESSIONAL", "database": "DEVFORREST", "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": 7.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-11-16 16:18UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "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.quality_measures__int_nqf2372__performance_period": {"metadata": {"type": "VIEW", "schema": "QUALITY_MEASURES", "name": "_INT_NQF2372__PERFORMANCE_PERIOD", "database": "DEVFORREST", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"MEASURE_ID": {"type": "TEXT", "index": 1, "name": "MEASURE_ID", "comment": null}, "MEASURE_NAME": {"type": "TEXT", "index": 2, "name": "MEASURE_NAME", "comment": null}, "MEASURE_VERSION": {"type": "TEXT", "index": 3, "name": "MEASURE_VERSION", "comment": null}, "PERFORMANCE_PERIOD_END": {"type": "DATE", "index": 4, "name": "PERFORMANCE_PERIOD_END", "comment": null}, "PERFORMANCE_PERIOD_BEGIN": {"type": "DATE", "index": 5, "name": "PERFORMANCE_PERIOD_BEGIN", "comment": null}, "PERFORMANCE_PERIOD_LOOKBACK": {"type": "DATE", "index": 6, "name": "PERFORMANCE_PERIOD_LOOKBACK", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.quality_measures__int_nqf2372__performance_period"}, "model.the_tuva_project.core__condition": {"metadata": {"type": "BASE TABLE", "schema": "CORE", "name": "CONDITION", "database": "DEVFORREST", "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": 213011.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 5851136.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-11-16 16:19UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.core__condition"}, "model.the_tuva_project.quality_measures__int_nqf0034_exclude_advanced_illness": {"metadata": {"type": "BASE TABLE", "schema": "QUALITY_MEASURES", "name": "_INT_NQF0034_EXCLUDE_ADVANCED_ILLNESS", "database": "DEVFORREST", "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-11-16 16:19UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.quality_measures__int_nqf0034_exclude_advanced_illness"}, "model.the_tuva_project.data_profiling__pharmacy_claim_duplicates": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_PHARMACY_CLAIM_DUPLICATES", "database": "DEVFORREST", "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-11-16 16:18UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "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__int_disabled_interaction_factors": {"metadata": {"type": "BASE TABLE", "schema": "CMS_HCC", "name": "_INT_DISABLED_INTERACTION_FACTORS", "database": "DEVFORREST", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"PATIENT_ID": {"type": "TEXT", "index": 1, "name": "PATIENT_ID", "comment": null}, "DESCRIPTION": {"type": "TEXT", "index": 2, "name": "DESCRIPTION", "comment": null}, "COEFFICIENT": {"type": "NUMBER", "index": 3, "name": "COEFFICIENT", "comment": null}, "FACTOR_TYPE": {"type": "TEXT", "index": 4, "name": "FACTOR_TYPE", "comment": null}, "MODEL_VERSION": {"type": "TEXT", "index": 5, "name": "MODEL_VERSION", "comment": null}, "PAYMENT_YEAR": {"type": "NUMBER", "index": 6, "name": "PAYMENT_YEAR", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 7, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-11-16 16:19UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "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"}, "seed.the_tuva_project.cms_hcc__demographic_factors": {"metadata": {"type": "BASE TABLE", "schema": "CMS_HCC", "name": "_VALUE_SET_DEMOGRAPHIC_FACTORS", "database": "DEVFORREST", "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-12-13 23:00UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.the_tuva_project.cms_hcc__demographic_factors"}, "seed.the_tuva_project.ed_classification__categories": {"metadata": {"type": "BASE TABLE", "schema": "ED_CLASSIFICATION", "name": "_VALUE_SET_CATEGORIES", "database": "DEVFORREST", "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-12-13 23:00UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.the_tuva_project.ed_classification__categories"}, "model.the_tuva_project.quality_measures__int_nqf2372_exclusions": {"metadata": {"type": "BASE TABLE", "schema": "QUALITY_MEASURES", "name": "_INT_NQF2372_EXCLUSIONS", "database": "DEVFORREST", "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-11-16 16:19UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "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.financial_pmpm__service_category_1_paid_pivot": {"metadata": {"type": "BASE TABLE", "schema": "FINANCIAL_PMPM", "name": "_INT_SERVICE_CATEGORY_1_PAID_PIVOT", "database": "DEVFORREST", "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": 19525.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 375808.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-11-16 16:19UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.financial_pmpm__service_category_1_paid_pivot"}, "model.the_tuva_project.financial_pmpm__member_months": {"metadata": {"type": "BASE TABLE", "schema": "FINANCIAL_PMPM", "name": "MEMBER_MONTHS", "database": "DEVFORREST", "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": 31184.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 61440.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-11-16 16:18UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.financial_pmpm__member_months"}, "seed.the_tuva_project.terminology__icd_10_cm": {"metadata": {"type": "BASE TABLE", "schema": "TERMINOLOGY", "name": "ICD_10_CM", "database": "DEVFORREST", "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-12-13 23:01UTC", "include": true, "description": "The timestamp for last update/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.emergency_department__int_last_claim_values": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_EMERGENCY_DEPARTMENT_LAST_CLAIM_VALUES", "database": "DEVFORREST", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"ENCOUNTER_ID": {"type": "TEXT", "index": 1, "name": "ENCOUNTER_ID", "comment": null}, "CLAIM_START": {"type": "DATE", "index": 2, "name": "CLAIM_START", "comment": null}, "DISCHARGE_DISPOSITION_CODE": {"type": "TEXT", "index": 3, "name": "DISCHARGE_DISPOSITION_CODE", "comment": null}, "CLAIM_ROW": {"type": "NUMBER", "index": 4, "name": "CLAIM_ROW", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 536.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 6144.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-11-16 16:19UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.emergency_department__int_last_claim_values"}, "model.the_tuva_project.service_category__skilled_nursing_institutional": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_SKILLED_NURSING_INSTITUTIONAL", "database": "DEVFORREST", "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": 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-11-16 16:18UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.service_category__skilled_nursing_institutional"}, "model.the_tuva_project.core__stg_claims_procedure": {"metadata": {"type": "VIEW", "schema": "CORE", "name": "_STG_CLAIMS_PROCEDURE", "database": "DEVFORREST", "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"}, "seed.the_tuva_project.cms_hcc__disease_hierarchy": {"metadata": {"type": "BASE TABLE", "schema": "CMS_HCC", "name": "_VALUE_SET_DISEASE_HIERARCHY", "database": "DEVFORREST", "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-12-13 23:00UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.the_tuva_project.cms_hcc__disease_hierarchy"}, "model.the_tuva_project.core__encounter": {"metadata": {"type": "BASE TABLE", "schema": "CORE", "name": "ENCOUNTER", "database": "DEVFORREST", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"ENCOUNTER_ID": {"type": "TEXT", "index": 1, "name": "ENCOUNTER_ID", "comment": null}, "PATIENT_ID": {"type": "TEXT", "index": 2, "name": "PATIENT_ID", "comment": null}, "ENCOUNTER_TYPE": {"type": "TEXT", "index": 3, "name": "ENCOUNTER_TYPE", "comment": null}, "ENCOUNTER_START_DATE": {"type": "DATE", "index": 4, "name": "ENCOUNTER_START_DATE", "comment": null}, "ENCOUNTER_END_DATE": {"type": "DATE", "index": 5, "name": "ENCOUNTER_END_DATE", "comment": null}, "LENGTH_OF_STAY": {"type": "NUMBER", "index": 6, "name": "LENGTH_OF_STAY", "comment": null}, "ADMIT_SOURCE_CODE": {"type": "TEXT", "index": 7, "name": "ADMIT_SOURCE_CODE", "comment": null}, "ADMIT_SOURCE_DESCRIPTION": {"type": "TEXT", "index": 8, "name": "ADMIT_SOURCE_DESCRIPTION", "comment": null}, "ADMIT_TYPE_CODE": {"type": "TEXT", "index": 9, "name": "ADMIT_TYPE_CODE", "comment": null}, "ADMIT_TYPE_DESCRIPTION": {"type": "TEXT", "index": 10, "name": "ADMIT_TYPE_DESCRIPTION", "comment": null}, "DISCHARGE_DISPOSITION_CODE": {"type": "TEXT", "index": 11, "name": "DISCHARGE_DISPOSITION_CODE", "comment": null}, "DISCHARGE_DISPOSITION_DESCRIPTION": {"type": "TEXT", "index": 12, "name": "DISCHARGE_DISPOSITION_DESCRIPTION", "comment": null}, "ATTENDING_PROVIDER_ID": {"type": "TEXT", "index": 13, "name": "ATTENDING_PROVIDER_ID", "comment": null}, "FACILITY_NPI": {"type": "TEXT", "index": 14, "name": "FACILITY_NPI", "comment": null}, "PRIMARY_DIAGNOSIS_CODE_TYPE": {"type": "TEXT", "index": 15, "name": "PRIMARY_DIAGNOSIS_CODE_TYPE", "comment": null}, "PRIMARY_DIAGNOSIS_CODE": {"type": "TEXT", "index": 16, "name": "PRIMARY_DIAGNOSIS_CODE", "comment": null}, "PRIMARY_DIAGNOSIS_DESCRIPTION": {"type": "TEXT", "index": 17, "name": "PRIMARY_DIAGNOSIS_DESCRIPTION", "comment": null}, "MS_DRG_CODE": {"type": "TEXT", "index": 18, "name": "MS_DRG_CODE", "comment": null}, "MS_DRG_DESCRIPTION": {"type": "TEXT", "index": 19, "name": "MS_DRG_DESCRIPTION", "comment": null}, "APR_DRG_CODE": {"type": "TEXT", "index": 20, "name": "APR_DRG_CODE", "comment": null}, "APR_DRG_DESCRIPTION": {"type": "TEXT", "index": 21, "name": "APR_DRG_DESCRIPTION", "comment": null}, "PAID_AMOUNT": {"type": "NUMBER", "index": 22, "name": "PAID_AMOUNT", "comment": null}, "ALLOWED_AMOUNT": {"type": "NUMBER", "index": 23, "name": "ALLOWED_AMOUNT", "comment": null}, "CHARGE_AMOUNT": {"type": "NUMBER", "index": 24, "name": "CHARGE_AMOUNT", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 25, "name": "DATA_SOURCE", "comment": null}, "TUVA_LAST_RUN": {"type": "TIMESTAMP_NTZ", "index": 26, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-12-13 23:01UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.core__encounter"}, "model.the_tuva_project.chronic_conditions__cms_chronic_conditions_wide": {"metadata": {"type": "BASE TABLE", "schema": "CHRONIC_CONDITIONS", "name": "CMS_CHRONIC_CONDITIONS_WIDE", "database": "DEVFORREST", "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": 1000.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 193536.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-11-16 16:19UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.chronic_conditions__cms_chronic_conditions_wide"}, "model.the_tuva_project.service_category__outpatient_hospital_or_clinic_institutional": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_OUTPATIENT_HOSPITAL_OR_CLINIC_INSTITUTIONAL", "database": "DEVFORREST", "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": 6239.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 32768.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-11-16 16:18UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "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.data_profiling__medical_claim_denominators": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_MEDICAL_CLAIM_DENOMINATORS", "database": "DEVFORREST", "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": 2048.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-11-16 16:18UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "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.the_tuva_project.terminology__calendar": {"metadata": {"type": "BASE TABLE", "schema": "TERMINOLOGY", "name": "CALENDAR", "database": "DEVFORREST", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"FULL_DATE": {"type": "DATE", "index": 1, "name": "FULL_DATE", "comment": null}, "YEAR": {"type": "NUMBER", "index": 2, "name": "YEAR", "comment": null}, "MONTH": {"type": "NUMBER", "index": 3, "name": "MONTH", "comment": null}, "DAY": {"type": "NUMBER", "index": 4, "name": "DAY", "comment": null}, "MONTH_NAME": {"type": "TEXT", "index": 5, "name": "MONTH_NAME", "comment": null}, "DAY_OF_WEEK_NUMBER": {"type": "NUMBER", "index": 6, "name": "DAY_OF_WEEK_NUMBER", "comment": null}, "DAY_OF_WEEK_NAME": {"type": "TEXT", "index": 7, "name": "DAY_OF_WEEK_NAME", "comment": null}, "WEEK_OF_YEAR": {"type": "NUMBER", "index": 8, "name": "WEEK_OF_YEAR", "comment": null}, "DAY_OF_YEAR": {"type": "NUMBER", "index": 9, "name": "DAY_OF_YEAR", "comment": null}, "YEAR_MONTH": {"type": "TEXT", "index": 10, "name": "YEAR_MONTH", "comment": null}, "FIRST_DAY_OF_MONTH": {"type": "DATE", "index": 11, "name": "FIRST_DAY_OF_MONTH", "comment": null}, "LAST_DAY_OF_MONTH": {"type": "DATE", "index": 12, "name": "LAST_DAY_OF_MONTH", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 80000.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 882176.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-12-13 23:01UTC", "include": true, "description": "The timestamp for last update/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"}, "seed.the_tuva_project.terminology__present_on_admission": {"metadata": {"type": "BASE TABLE", "schema": "TERMINOLOGY", "name": "PRESENT_ON_ADMISSION", "database": "DEVFORREST", "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-12-13 23:01UTC", "include": true, "description": "The timestamp for last update/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"}, "seed.the_tuva_project.terminology__hcpcs_level_2": {"metadata": {"type": "BASE TABLE", "schema": "TERMINOLOGY", "name": "HCPCS_LEVEL_2", "database": "DEVFORREST", "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-12-13 23:01UTC", "include": true, "description": "The timestamp for last update/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.service_category__dq_input_layer_results": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_DQ_INPUT_LAYER_RESULTS", "database": "DEVFORREST", "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": 1.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 1536.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-11-16 16:18UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "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.ccsr__dxccsr_v2023_1_body_systems": {"metadata": {"type": "BASE TABLE", "schema": "CCSR", "name": "_VALUE_SET_DXCCSR_V2023_1_BODY_SYSTEMS", "database": "DEVFORREST", "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-12-13 23:00UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.the_tuva_project.ccsr__dxccsr_v2023_1_body_systems"}, "model.the_tuva_project.service_category__dialysis_professional": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_DIALYSIS_PROFESSIONAL", "database": "DEVFORREST", "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": 2.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-11-16 16:18UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "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__eligibility_invalid_values": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_ELIGIBILITY_INVALID_VALUES", "database": "DEVFORREST", "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": 191.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-11-16 16:18UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "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.quality_measures__int_nqf0034_exclude_dementia": {"metadata": {"type": "BASE TABLE", "schema": "QUALITY_MEASURES", "name": "_INT_NQF0034_EXCLUDE_DEMENTIA", "database": "DEVFORREST", "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-11-16 16:19UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.quality_measures__int_nqf0034_exclude_dementia"}, "model.the_tuva_project.quality_measures__summary_wide": {"metadata": {"type": "BASE TABLE", "schema": "QUALITY_MEASURES", "name": "SUMMARY_WIDE", "database": "DEVFORREST", "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": 2000.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-11-16 16:19UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.quality_measures__summary_wide"}, "model.the_tuva_project.service_category__inpatient_rehab_professional": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_INPATIENT_REHAB_PROFESSIONAL", "database": "DEVFORREST", "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": 52.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-11-16 16:18UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.service_category__inpatient_rehab_professional"}, "model.the_tuva_project.ccsr__singular_condition_category": {"metadata": {"type": "BASE TABLE", "schema": "CCSR", "name": "SINGULAR_CONDITION_CATEGORY", "database": "DEVFORREST", "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": 71729.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 2767360.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-11-16 16:19UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.ccsr__singular_condition_category"}, "seed.the_tuva_project.terminology__mdc": {"metadata": {"type": "BASE TABLE", "schema": "TERMINOLOGY", "name": "MDC", "database": "DEVFORREST", "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-12-13 23:01UTC", "include": true, "description": "The timestamp for last update/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.data_profiling__pharmacy_claim_missing_values": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_PHARMACY_CLAIM_MISSING_VALUES", "database": "DEVFORREST", "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": 20835.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 593408.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-11-16 16:18UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "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.cms_hcc__int_hcc_count_factors": {"metadata": {"type": "BASE TABLE", "schema": "CMS_HCC", "name": "_INT_HCC_COUNT_FACTORS", "database": "DEVFORREST", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"PATIENT_ID": {"type": "TEXT", "index": 1, "name": "PATIENT_ID", "comment": null}, "DESCRIPTION": {"type": "TEXT", "index": 2, "name": "DESCRIPTION", "comment": null}, "COEFFICIENT": {"type": "NUMBER", "index": 3, "name": "COEFFICIENT", "comment": null}, "FACTOR_TYPE": {"type": "TEXT", "index": 4, "name": "FACTOR_TYPE", "comment": null}, "MODEL_VERSION": {"type": "TEXT", "index": 5, "name": "MODEL_VERSION", "comment": null}, "PAYMENT_YEAR": {"type": "NUMBER", "index": 6, "name": "PAYMENT_YEAR", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 7, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-11-16 16:19UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "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.acute_inpatient__summary": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "ACUTE_INPATIENT_SUMMARY", "database": "DEVFORREST", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"ENCOUNTER_ID": {"type": "TEXT", "index": 1, "name": "ENCOUNTER_ID", "comment": null}, "ENCOUNTER_START_DATE": {"type": "DATE", "index": 2, "name": "ENCOUNTER_START_DATE", "comment": null}, "ENCOUNTER_END_DATE": {"type": "DATE", "index": 3, "name": "ENCOUNTER_END_DATE", "comment": null}, "PATIENT_ID": {"type": "TEXT", "index": 4, "name": "PATIENT_ID", "comment": null}, "ADMIT_AGE": {"type": "NUMBER", "index": 5, "name": "ADMIT_AGE", "comment": null}, "GENDER": {"type": "TEXT", "index": 6, "name": "GENDER", "comment": null}, "RACE": {"type": "TEXT", "index": 7, "name": "RACE", "comment": null}, "PRIMARY_DIAGNOSIS_CODE_TYPE": {"type": "TEXT", "index": 8, "name": "PRIMARY_DIAGNOSIS_CODE_TYPE", "comment": null}, "PRIMARY_DIAGNOSIS_CODE": {"type": "TEXT", "index": 9, "name": "PRIMARY_DIAGNOSIS_CODE", "comment": null}, "PRIMARY_DIAGNOSIS_DESCRIPTION": {"type": "TEXT", "index": 10, "name": "PRIMARY_DIAGNOSIS_DESCRIPTION", "comment": null}, "FACILITY_NPI": {"type": "TEXT", "index": 11, "name": "FACILITY_NPI", "comment": null}, "PROVIDER_FIRST_NAME": {"type": "TEXT", "index": 12, "name": "PROVIDER_FIRST_NAME", "comment": null}, "PROVIDER_LAST_NAME": {"type": "TEXT", "index": 13, "name": "PROVIDER_LAST_NAME", "comment": null}, "MS_DRG_CODE": {"type": "TEXT", "index": 14, "name": "MS_DRG_CODE", "comment": null}, "MS_DRG_DESCRIPTION": {"type": "TEXT", "index": 15, "name": "MS_DRG_DESCRIPTION", "comment": null}, "MEDICAL_SURGICAL": {"type": "TEXT", "index": 16, "name": "MEDICAL_SURGICAL", "comment": null}, "APR_DRG_CODE": {"type": "TEXT", "index": 17, "name": "APR_DRG_CODE", "comment": null}, "APR_DRG_DESCRIPTION": {"type": "TEXT", "index": 18, "name": "APR_DRG_DESCRIPTION", "comment": null}, "ADMIT_SOURCE_CODE": {"type": "TEXT", "index": 19, "name": "ADMIT_SOURCE_CODE", "comment": null}, "ADMIT_SOURCE_DESCRIPTION": {"type": "TEXT", "index": 20, "name": "ADMIT_SOURCE_DESCRIPTION", "comment": null}, "ADMIT_TYPE_CODE": {"type": "TEXT", "index": 21, "name": "ADMIT_TYPE_CODE", "comment": null}, "ADMIT_TYPE_DESCRIPTION": {"type": "TEXT", "index": 22, "name": "ADMIT_TYPE_DESCRIPTION", "comment": null}, "DISCHARGE_DISPOSITION_CODE": {"type": "TEXT", "index": 23, "name": "DISCHARGE_DISPOSITION_CODE", "comment": null}, "DISCHARGE_DISPOSITION_DESCRIPTION": {"type": "TEXT", "index": 24, "name": "DISCHARGE_DISPOSITION_DESCRIPTION", "comment": null}, "TOTAL_PAID_AMOUNT": {"type": "FLOAT", "index": 25, "name": "TOTAL_PAID_AMOUNT", "comment": null}, "TOTAL_ALLOWED_AMOUNT": {"type": "FLOAT", "index": 26, "name": "TOTAL_ALLOWED_AMOUNT", "comment": null}, "TOTAL_CHARGE_AMOUNT": {"type": "FLOAT", "index": 27, "name": "TOTAL_CHARGE_AMOUNT", "comment": null}, "LENGTH_OF_STAY": {"type": "NUMBER", "index": 28, "name": "LENGTH_OF_STAY", "comment": null}, "MORTALITY_FLAG": {"type": "NUMBER", "index": 29, "name": "MORTALITY_FLAG", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 30, "name": "DATA_SOURCE", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 31, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 223.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 108032.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-11-16 16:19UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "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.core__lab_result": {"metadata": {"type": "BASE TABLE", "schema": "CORE", "name": "LAB_RESULT", "database": "DEVFORREST", "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-12-13 23:01UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.core__lab_result"}, "model.the_tuva_project.cms_hcc__int_hcc_hierarchy": {"metadata": {"type": "BASE TABLE", "schema": "CMS_HCC", "name": "_INT_HCC_HIERARCHY", "database": "DEVFORREST", "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-11-16 16:19UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.cms_hcc__int_hcc_hierarchy"}, "seed.the_tuva_project.terminology__apr_drg": {"metadata": {"type": "BASE TABLE", "schema": "TERMINOLOGY", "name": "APR_DRG", "database": "DEVFORREST", "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-12-13 23:01UTC", "include": true, "description": "The timestamp for last update/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.chronic_conditions__cms_chronic_conditions_hierarchy": {"metadata": {"type": "BASE TABLE", "schema": "CHRONIC_CONDITIONS", "name": "_VALUE_SET_CMS_CHRONIC_CONDITIONS_HIERARCHY", "database": "DEVFORREST", "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-12-13 23:00UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.the_tuva_project.chronic_conditions__cms_chronic_conditions_hierarchy"}, "model.the_tuva_project.service_category__office_visit_professional": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_OFFICE_VISIT_PROFESSIONAL", "database": "DEVFORREST", "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": 61864.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 214016.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-11-16 16:18UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "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.insights__orphan_claim_by_claim_type": {"metadata": {"type": "BASE TABLE", "schema": "INSIGHTS", "name": "ORPHAN_CLAIM_BY_CLAIM_TYPE", "database": "DEVFORREST", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"CLAIM_CATEGORY": {"type": "TEXT", "index": 1, "name": "CLAIM_CATEGORY", "comment": null}, "DISTINCT_CLAIM_COUNT": {"type": "NUMBER", "index": 2, "name": "DISTINCT_CLAIM_COUNT", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 2.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-11-16 16:19UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.insights__orphan_claim_by_claim_type"}, "seed.the_tuva_project.terminology__provider": {"metadata": {"type": "BASE TABLE", "schema": "TERMINOLOGY", "name": "PROVIDER", "database": "DEVFORREST", "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": 8070845.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 248564736.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-12-13 23:01UTC", "include": true, "description": "The timestamp for last update/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": "DEVFORREST", "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-12-13 23:00UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.the_tuva_project.ccsr__dxccsr_v2023_1_cleaned_map"}, "seed.the_tuva_project.cms_hcc__disease_factors": {"metadata": {"type": "BASE TABLE", "schema": "CMS_HCC", "name": "_VALUE_SET_DISEASE_FACTORS", "database": "DEVFORREST", "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-12-13 23:00UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.the_tuva_project.cms_hcc__disease_factors"}, "model.the_tuva_project.quality_measures__int_nqf0034_exclusions": {"metadata": {"type": "BASE TABLE", "schema": "QUALITY_MEASURES", "name": "_INT_NQF0034_EXCLUSIONS", "database": "DEVFORREST", "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-11-16 16:19UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.quality_measures__int_nqf0034_exclusions"}, "model.the_tuva_project.data_profiling__test_detail": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "TEST_DETAIL", "database": "DEVFORREST", "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": 226265.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 1138176.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-11-16 16:19UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "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.quality_measures__measures": {"metadata": {"type": "BASE TABLE", "schema": "QUALITY_MEASURES", "name": "_VALUE_SET_MEASURES", "database": "DEVFORREST", "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": 2.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-12-13 23:01UTC", "include": true, "description": "The timestamp for last update/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"}, "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": "DEVFORREST", "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": 197441.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 681472.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-11-16 16:18UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "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.readmissions__index_time_requirement": {"metadata": {"type": "VIEW", "schema": "READMISSIONS", "name": "_INT_INDEX_TIME_REQUIREMENT", "database": "DEVFORREST", "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_exclude_hospice": {"metadata": {"type": "BASE TABLE", "schema": "QUALITY_MEASURES", "name": "_INT_NQF2372_EXCLUDE_HOSPICE", "database": "DEVFORREST", "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-11-16 16:19UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.quality_measures__int_nqf2372_exclude_hospice"}, "model.the_tuva_project.data_profiling__professional_header_fail_details": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_PROFESSIONAL_HEADER_FAIL_DETAILS", "database": "DEVFORREST", "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-11-16 16:18UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "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__institutional_encounter_id": {"metadata": {"type": "VIEW", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_ACUTE_INPATIENT_INSTITUTIONAL_ENCOUNTER_ID", "database": "DEVFORREST", "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.core__observation": {"metadata": {"type": "BASE TABLE", "schema": "CORE", "name": "OBSERVATION", "database": "DEVFORREST", "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-12-13 23:01UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "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.service_category__combined_institutional": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_COMBINED_INSTITUTIONAL", "database": "DEVFORREST", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"CLAIM_ID": {"type": "TEXT", "index": 1, "name": "CLAIM_ID", "comment": null}, "SERVICE_CATEGORY_2": {"type": "TEXT", "index": 2, "name": "SERVICE_CATEGORY_2", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 8092.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 56320.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-11-16 16:19UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.service_category__combined_institutional"}, "model.the_tuva_project.quality_measures__int_nqf0034__performance_period": {"metadata": {"type": "VIEW", "schema": "QUALITY_MEASURES", "name": "_INT_NQF0034__PERFORMANCE_PERIOD", "database": "DEVFORREST", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"PERFORMANCE_PERIOD_BEGIN": {"type": "DATE", "index": 1, "name": "PERFORMANCE_PERIOD_BEGIN", "comment": null}, "PERFORMANCE_PERIOD_END": {"type": "DATE", "index": 2, "name": "PERFORMANCE_PERIOD_END", "comment": null}, "PERFORMANCE_PERIOD_BEGIN_1YP": {"type": "DATE", "index": 3, "name": "PERFORMANCE_PERIOD_BEGIN_1YP", "comment": null}, "PERFORMANCE_PERIOD_BEGIN_2YP": {"type": "DATE", "index": 4, "name": "PERFORMANCE_PERIOD_BEGIN_2YP", "comment": null}, "PERFORMANCE_PERIOD_BEGIN_4YP": {"type": "DATE", "index": 5, "name": "PERFORMANCE_PERIOD_BEGIN_4YP", "comment": null}, "PERFORMANCE_PERIOD_BEGIN_9YP": {"type": "DATE", "index": 6, "name": "PERFORMANCE_PERIOD_BEGIN_9YP", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.quality_measures__int_nqf0034__performance_period"}, "model.the_tuva_project.cms_hcc__int_hcc_mapping": {"metadata": {"type": "BASE TABLE", "schema": "CMS_HCC", "name": "_INT_HCC_MAPPING", "database": "DEVFORREST", "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-11-16 16:19UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.cms_hcc__int_hcc_mapping"}, "model.the_tuva_project.core__stg_clinical_procedure": {"metadata": {"type": "VIEW", "schema": "CORE", "name": "_STG_CLINICAL_PROCEDURE", "database": "DEVFORREST", "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__medical_claim_inst_missing_values": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_MEDICAL_CLAIM_INST_MISSING_VALUES", "database": "DEVFORREST", "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": 38652.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 239616.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-11-16 16:18UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "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.readmissions__procedure_ccs": {"metadata": {"type": "VIEW", "schema": "READMISSIONS", "name": "_INT_PROCEDURE_CCS", "database": "DEVFORREST", "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.cms_hcc__int_all_conditions": {"metadata": {"type": "BASE TABLE", "schema": "CMS_HCC", "name": "_INT_ALL_CONDITIONS", "database": "DEVFORREST", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"PATIENT_ID": {"type": "TEXT", "index": 1, "name": "PATIENT_ID", "comment": null}, "RECORDED_DATE": {"type": "DATE", "index": 2, "name": "RECORDED_DATE", "comment": null}, "CONDITION_TYPE": {"type": "TEXT", "index": 3, "name": "CONDITION_TYPE", "comment": null}, "ICD_10_CM_CODE": {"type": "TEXT", "index": 4, "name": "ICD_10_CM_CODE", "comment": null}, "HCC_CODE": {"type": "TEXT", "index": 5, "name": "HCC_CODE", "comment": null}, "HCC_DESCRIPTION": {"type": "TEXT", "index": 6, "name": "HCC_DESCRIPTION", "comment": null}, "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": 203644.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 1733632.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-11-16 16:19UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "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_all_conditions"}, "seed.the_tuva_project.terminology__other_provider_taxonomy": {"metadata": {"type": "BASE TABLE", "schema": "TERMINOLOGY", "name": "OTHER_PROVIDER_TAXONOMY", "database": "DEVFORREST", "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": 9413513.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 68268544.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-12-13 23:01UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.the_tuva_project.terminology__other_provider_taxonomy"}, "seed.the_tuva_project.quality_measures__concepts": {"metadata": {"type": "BASE TABLE", "schema": "QUALITY_MEASURES", "name": "_VALUE_SET_CONCEPTS", "database": "DEVFORREST", "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": 73.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-12-13 23:00UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.the_tuva_project.quality_measures__concepts"}, "model.the_tuva_project.service_category__urgent_care_institutional": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_URGENT_CARE_INSTITUTIONAL", "database": "DEVFORREST", "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-11-16 16:18UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.service_category__urgent_care_institutional"}, "model.the_tuva_project.service_category__home_health_institutional": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_HOME_HEALTH_INSTITUTIONAL", "database": "DEVFORREST", "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": 29.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-11-16 16:18UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.service_category__home_health_institutional"}, "model.the_tuva_project.quality_measures__int_nqf0034_exclude_institutional_snp": {"metadata": {"type": "BASE TABLE", "schema": "QUALITY_MEASURES", "name": "_INT_NQF0034_EXCLUDE_INSTITUTIONAL_SNP", "database": "DEVFORREST", "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-11-16 16:19UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.quality_measures__int_nqf0034_exclude_institutional_snp"}, "model.the_tuva_project.data_profiling__institutional_header_fail_details": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_INSTITUTIONAL_HEADER_FAIL_DETAILS", "database": "DEVFORREST", "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-11-16 16:18UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.data_profiling__institutional_header_fail_details"}, "seed.the_tuva_project.data_profiling__test_catalog": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_VALUE_SET_TEST_CATALOG", "database": "DEVFORREST", "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-12-13 23:00UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.the_tuva_project.data_profiling__test_catalog"}, "model.the_tuva_project.core__procedure": {"metadata": {"type": "BASE TABLE", "schema": "CORE", "name": "PROCEDURE", "database": "DEVFORREST", "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": 159.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 56832.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-11-16 16:19UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "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__practitioner": {"metadata": {"type": "BASE TABLE", "schema": "CORE", "name": "PRACTITIONER", "database": "DEVFORREST", "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": 44643.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 1162240.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-11-16 16:19UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "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.core__stg_clinical_observation": {"metadata": {"type": "VIEW", "schema": "CORE", "name": "_STG_CLINICAL_OBSERVATION", "database": "DEVFORREST", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"OBSERVATION_ID": {"type": "TEXT", "index": 1, "name": "OBSERVATION_ID", "comment": null}, "PATIENT_ID": {"type": "TEXT", "index": 2, "name": "PATIENT_ID", "comment": null}, "ENCOUNTER_ID": {"type": "TEXT", "index": 3, "name": "ENCOUNTER_ID", "comment": null}, "PANEL_ID": {"type": "TEXT", "index": 4, "name": "PANEL_ID", "comment": null}, "OBSERVATION_DATE": {"type": "DATE", "index": 5, "name": "OBSERVATION_DATE", "comment": null}, "OBSERVATION_TYPE": {"type": "TEXT", "index": 6, "name": "OBSERVATION_TYPE", "comment": null}, "SOURCE_CODE_TYPE": {"type": "TEXT", "index": 7, "name": "SOURCE_CODE_TYPE", "comment": null}, "SOURCE_CODE": {"type": "TEXT", "index": 8, "name": "SOURCE_CODE", "comment": null}, "SOURCE_DESCRIPTION": {"type": "TEXT", "index": 9, "name": "SOURCE_DESCRIPTION", "comment": null}, "NORMALIZED_CODE_TYPE": {"type": "TEXT", "index": 10, "name": "NORMALIZED_CODE_TYPE", "comment": null}, "NORMALIZED_CODE": {"type": "TEXT", "index": 11, "name": "NORMALIZED_CODE", "comment": null}, "NORMALIZED_DESCRIPTION": {"type": "TEXT", "index": 12, "name": "NORMALIZED_DESCRIPTION", "comment": null}, "RESULT": {"type": "TEXT", "index": 13, "name": "RESULT", "comment": null}, "SOURCE_UNITS": {"type": "TEXT", "index": 14, "name": "SOURCE_UNITS", "comment": null}, "NORMALIZED_UNITS": {"type": "TEXT", "index": 15, "name": "NORMALIZED_UNITS", "comment": null}, "SOURCE_REFERENCE_RANGE_LOW": {"type": "TEXT", "index": 16, "name": "SOURCE_REFERENCE_RANGE_LOW", "comment": null}, "SOURCE_REFERENCE_RANGE_HIGH": {"type": "TEXT", "index": 17, "name": "SOURCE_REFERENCE_RANGE_HIGH", "comment": null}, "NORMALIZED_REFERENCE_RANGE_LOW": {"type": "TEXT", "index": 18, "name": "NORMALIZED_REFERENCE_RANGE_LOW", "comment": null}, "NORMALIZED_REFERENCE_RANGE_HIGH": {"type": "TEXT", "index": 19, "name": "NORMALIZED_REFERENCE_RANGE_HIGH", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 20, "name": "DATA_SOURCE", "comment": null}, "TUVA_LAST_RUN": {"type": "TIMESTAMP_NTZ", "index": 21, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.core__stg_clinical_observation"}, "model.the_tuva_project.quality_measures__int_nqf0034_exclude_colectomy_cancer": {"metadata": {"type": "BASE TABLE", "schema": "QUALITY_MEASURES", "name": "_INT_NQF0034_EXCLUDE_COLECTOMY_CANCER", "database": "DEVFORREST", "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": 70.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-11-16 16:19UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.quality_measures__int_nqf0034_exclude_colectomy_cancer"}, "model.the_tuva_project.quality_measures__int_nqf2372_exclude_mastectomy": {"metadata": {"type": "BASE TABLE", "schema": "QUALITY_MEASURES", "name": "_INT_NQF2372_EXCLUDE_MASTECTOMY", "database": "DEVFORREST", "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-11-16 16:19UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "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"}, "seed.the_tuva_project.readmissions__specialty_cohort": {"metadata": {"type": "BASE TABLE", "schema": "READMISSIONS", "name": "_VALUE_SET_SPECIALTY_COHORT", "database": "DEVFORREST", "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-12-13 23:01UTC", "include": true, "description": "The timestamp for last update/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"}, "model.the_tuva_project.service_category__acute_inpatient_institutional": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_ACUTE_INPATIENT_INSTITUTIONAL", "database": "DEVFORREST", "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": 223.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-11-16 16:18UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "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.financial_pmpm__patient_spend_with_service_categories": {"metadata": {"type": "BASE TABLE", "schema": "FINANCIAL_PMPM", "name": "_INT_PATIENT_SPEND_WITH_SERVICE_CATEGORIES", "database": "DEVFORREST", "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": 35708.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 648704.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-11-16 16:19UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "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.data_profiling__test_result_stage_eligibility": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_TEST_RESULT_STAGE_ELIGIBILITY", "database": "DEVFORREST", "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": 11.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-11-16 16:19UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "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__ansi_fips_state": {"metadata": {"type": "BASE TABLE", "schema": "TERMINOLOGY", "name": "ANSI_FIPS_STATE", "database": "DEVFORREST", "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-12-13 23:01UTC", "include": true, "description": "The timestamp for last update/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.service_category__outpatient_psychiatric_institutional": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_OUTPATIENT_PSYCHIATRIC_INSTITUTIONAL", "database": "DEVFORREST", "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-11-16 16:18UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.service_category__outpatient_psychiatric_institutional"}, "model.the_tuva_project.acute_inpatient__encounter_id": {"metadata": {"type": "VIEW", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_ACUTE_INPATIENT_ENCOUNTER_ID", "database": "DEVFORREST", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"PATIENT_ID": {"type": "TEXT", "index": 1, "name": "PATIENT_ID", "comment": null}, "CLAIM_ID": {"type": "TEXT", "index": 2, "name": "CLAIM_ID", "comment": null}, "CLAIM_LINE_NUMBER": {"type": "NUMBER", "index": 3, "name": "CLAIM_LINE_NUMBER", "comment": null}, "ENCOUNTER_ID": {"type": "TEXT", "index": 4, "name": "ENCOUNTER_ID", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 5, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.acute_inpatient__encounter_id"}, "seed.the_tuva_project.cms_hcc__disease_interaction_factors": {"metadata": {"type": "BASE TABLE", "schema": "CMS_HCC", "name": "_VALUE_SET_DISEASE_INTERACTION_FACTORS", "database": "DEVFORREST", "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-12-13 23:00UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.the_tuva_project.cms_hcc__disease_interaction_factors"}, "model.the_tuva_project.data_profiling__medical_claim_duplicates": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_MEDICAL_CLAIM_DUPLICATES", "database": "DEVFORREST", "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-11-16 16:18UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "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.data_profiling__summary": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "DATA_PROFILING_SUMMARY", "database": "DEVFORREST", "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-11-16 16:19UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "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.terminology__gender": {"metadata": {"type": "BASE TABLE", "schema": "TERMINOLOGY", "name": "GENDER", "database": "DEVFORREST", "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-12-13 23:01UTC", "include": true, "description": "The timestamp for last update/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.core__medical_claim": {"metadata": {"type": "BASE TABLE", "schema": "CORE", "name": "MEDICAL_CLAIM", "database": "DEVFORREST", "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": 167995.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 7631872.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-11-16 16:19UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.core__medical_claim"}, "model.the_tuva_project.service_category__outpatient_hospital_or_clinic_professional": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_OUTPATIENT_HOSPITAL_OR_CLINIC_PROFESSIONAL", "database": "DEVFORREST", "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": 11252.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 54272.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-11-16 16:18UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "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__race": {"metadata": {"type": "BASE TABLE", "schema": "TERMINOLOGY", "name": "RACE", "database": "DEVFORREST", "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-12-13 23:01UTC", "include": true, "description": "The timestamp for last update/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.ccsr__procedure_category_map": {"metadata": {"type": "BASE TABLE", "schema": "CCSR", "name": "PROCEDURE_CATEGORY_MAP", "database": "DEVFORREST", "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-12-13 23:01UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "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.emergency_department__int_professional_encounter_id": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_EMERGENCY_DEPARTMENT_PROFESSIONAL_ENCOUNTER_ID", "database": "DEVFORREST", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"PATIENT_ID": {"type": "TEXT", "index": 1, "name": "PATIENT_ID", "comment": null}, "CLAIM_ID": {"type": "TEXT", "index": 2, "name": "CLAIM_ID", "comment": null}, "CLAIM_LINE_NUMBER": {"type": "NUMBER", "index": 3, "name": "CLAIM_LINE_NUMBER", "comment": null}, "START_DATE": {"type": "DATE", "index": 4, "name": "START_DATE", "comment": null}, "END_DATE": {"type": "DATE", "index": 5, "name": "END_DATE", "comment": null}, "ENCOUNTER_ID": {"type": "TEXT", "index": 6, "name": "ENCOUNTER_ID", "comment": null}, "ORPHAN_CLAIM_FLAG": {"type": "NUMBER", "index": 7, "name": "ORPHAN_CLAIM_FLAG", "comment": null}, "ENCOUNTER_COUNT": {"type": "NUMBER", "index": 8, "name": "ENCOUNTER_COUNT", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 9, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 5174.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 65536.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-11-16 16:19UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.emergency_department__int_professional_encounter_id"}, "seed.the_tuva_project.terminology__revenue_center": {"metadata": {"type": "BASE TABLE", "schema": "TERMINOLOGY", "name": "REVENUE_CENTER", "database": "DEVFORREST", "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-12-13 23:01UTC", "include": true, "description": "The timestamp for last update/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.financial_pmpm__service_category_2_allowed_pivot": {"metadata": {"type": "BASE TABLE", "schema": "FINANCIAL_PMPM", "name": "_INT_SERVICE_CATEGORY_2_ALLOWED_PIVOT", "database": "DEVFORREST", "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": 19525.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 492544.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-11-16 16:19UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "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.data_profiling__eligibility_missing_values": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_ELIGIBILITY_MISSING_VALUES", "database": "DEVFORREST", "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": 7798.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 27136.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-11-16 16:18UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "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.readmissions__planned_encounter": {"metadata": {"type": "VIEW", "schema": "READMISSIONS", "name": "_INT_PLANNED_ENCOUNTER", "database": "DEVFORREST", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"ENCOUNTER_ID": {"type": "TEXT", "index": 1, "name": "ENCOUNTER_ID", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 2, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.readmissions__planned_encounter"}, "seed.the_tuva_project.cms_hcc__enrollment_interaction_factors": {"metadata": {"type": "BASE TABLE", "schema": "CMS_HCC", "name": "_VALUE_SET_ENROLLMENT_INTERACTION_FACTORS", "database": "DEVFORREST", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"MODEL_VERSION": {"type": "TEXT", "index": 1, "name": "MODEL_VERSION", "comment": null}, "FACTOR_TYPE": {"type": "TEXT", "index": 2, "name": "FACTOR_TYPE", "comment": null}, "GENDER": {"type": "TEXT", "index": 3, "name": "GENDER", "comment": null}, "ENROLLMENT_STATUS": {"type": "TEXT", "index": 4, "name": "ENROLLMENT_STATUS", "comment": null}, "MEDICAID_STATUS": {"type": "TEXT", "index": 5, "name": "MEDICAID_STATUS", "comment": null}, "DUAL_STATUS": {"type": "TEXT", "index": 6, "name": "DUAL_STATUS", "comment": null}, "INSTITUTIONAL_STATUS": {"type": "TEXT", "index": 7, "name": "INSTITUTIONAL_STATUS", "comment": null}, "DESCRIPTION": {"type": "TEXT", "index": 8, "name": "DESCRIPTION", "comment": null}, "COEFFICIENT": {"type": "FLOAT", "index": 9, "name": "COEFFICIENT", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 7.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-12-13 23:00UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.the_tuva_project.cms_hcc__enrollment_interaction_factors"}, "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": "DEVFORREST", "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": 158516.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 476672.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-11-16 16:18UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "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"}, "seed.the_tuva_project.terminology__medicare_status": {"metadata": {"type": "BASE TABLE", "schema": "TERMINOLOGY", "name": "MEDICARE_STATUS", "database": "DEVFORREST", "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-12-13 23:01UTC", "include": true, "description": "The timestamp for last update/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.service_category__service_category_grouper": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "SERVICE_CATEGORY_GROUPER", "database": "DEVFORREST", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"CLAIM_ID": {"type": "TEXT", "index": 1, "name": "CLAIM_ID", "comment": null}, "CLAIM_LINE_NUMBER": {"type": "NUMBER", "index": 2, "name": "CLAIM_LINE_NUMBER", "comment": null}, "CLAIM_TYPE": {"type": "TEXT", "index": 3, "name": "CLAIM_TYPE", "comment": null}, "SERVICE_CATEGORY_1": {"type": "TEXT", "index": 4, "name": "SERVICE_CATEGORY_1", "comment": null}, "SERVICE_CATEGORY_2": {"type": "TEXT", "index": 5, "name": "SERVICE_CATEGORY_2", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 167995.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 1985536.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-11-16 16:19UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.service_category__service_category_grouper"}, "model.the_tuva_project.service_category__hospice_professional": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_HOSPICE_PROFESSIONAL", "database": "DEVFORREST", "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-11-16 16:18UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "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.readmissions__encounter_specialty_cohort": {"metadata": {"type": "VIEW", "schema": "READMISSIONS", "name": "_INT_ENCOUNTER_SPECIALTY_COHORT", "database": "DEVFORREST", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"ENCOUNTER_ID": {"type": "TEXT", "index": 1, "name": "ENCOUNTER_ID", "comment": null}, "SPECIALTY_COHORT": {"type": "TEXT", "index": 2, "name": "SPECIALTY_COHORT", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 3, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.readmissions__encounter_specialty_cohort"}, "model.the_tuva_project.cms_hcc__patient_hcc_history": {"metadata": {"type": "BASE TABLE", "schema": "CMS_HCC", "name": "PATIENT_HCC_HISTORY", "database": "DEVFORREST", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"PATIENT_ID": {"type": "TEXT", "index": 1, "name": "PATIENT_ID", "comment": null}, "RECORDED_DATE": {"type": "DATE", "index": 2, "name": "RECORDED_DATE", "comment": null}, "CONDITION_TYPE": {"type": "TEXT", "index": 3, "name": "CONDITION_TYPE", "comment": null}, "ICD_10_CM_CODE": {"type": "TEXT", "index": 4, "name": "ICD_10_CM_CODE", "comment": null}, "HCC_CODE": {"type": "TEXT", "index": 5, "name": "HCC_CODE", "comment": null}, "HCC_DESCRIPTION": {"type": "TEXT", "index": 6, "name": "HCC_DESCRIPTION", "comment": null}, "FIRST_RECORDED": {"type": "DATE", "index": 7, "name": "FIRST_RECORDED", "comment": null}, "LAST_RECORDED": {"type": "DATE", "index": 8, "name": "LAST_RECORDED", "comment": null}, "PAYMENT_YEAR_RECORDED": {"type": "BOOLEAN", "index": 9, "name": "PAYMENT_YEAR_RECORDED", "comment": null}, "MODEL_VERSION": {"type": "TEXT", "index": 10, "name": "MODEL_VERSION", "comment": null}, "PAYMENT_YEAR": {"type": "NUMBER", "index": 11, "name": "PAYMENT_YEAR", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 12, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 203644.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 1657344.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-11-16 16:19UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "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_hcc_history"}, "seed.the_tuva_project.terminology__admit_source": {"metadata": {"type": "BASE TABLE", "schema": "TERMINOLOGY", "name": "ADMIT_SOURCE", "database": "DEVFORREST", "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-12-13 23:01UTC", "include": true, "description": "The timestamp for last update/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.service_category__skilled_nursing_professional": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_SKILLED_NURSING_PROFESSIONAL", "database": "DEVFORREST", "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": 2043.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-11-16 16:18UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "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.readmissions__exclusion": {"metadata": {"type": "VIEW", "schema": "READMISSIONS", "name": "_INT_EXCLUSION", "database": "DEVFORREST", "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.emergency_department__int_first_claim_values": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_EMERGENCY_DEPARTMENT_FIRST_CLAIM_VALUES", "database": "DEVFORREST", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"ENCOUNTER_ID": {"type": "TEXT", "index": 1, "name": "ENCOUNTER_ID", "comment": null}, "CLAIM_START": {"type": "DATE", "index": 2, "name": "CLAIM_START", "comment": null}, "DIAGNOSIS_CODE_1": {"type": "TEXT", "index": 3, "name": "DIAGNOSIS_CODE_1", "comment": null}, "DIAGNOSIS_CODE_TYPE": {"type": "TEXT", "index": 4, "name": "DIAGNOSIS_CODE_TYPE", "comment": null}, "ADMIT_SOURCE_CODE": {"type": "TEXT", "index": 5, "name": "ADMIT_SOURCE_CODE", "comment": null}, "ADMIT_TYPE_CODE": {"type": "TEXT", "index": 6, "name": "ADMIT_TYPE_CODE", "comment": null}, "FACILITY_NPI": {"type": "TEXT", "index": 7, "name": "FACILITY_NPI", "comment": null}, "MS_DRG_CODE": {"type": "TEXT", "index": 8, "name": "MS_DRG_CODE", "comment": null}, "APR_DRG_CODE": {"type": "TEXT", "index": 9, "name": "APR_DRG_CODE", "comment": null}, "CLAIM_ROW": {"type": "NUMBER", "index": 10, "name": "CLAIM_ROW", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 536.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-11-16 16:19UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.emergency_department__int_first_claim_values"}, "model.the_tuva_project.financial_pmpm__pmpm": {"metadata": {"type": "BASE TABLE", "schema": "FINANCIAL_PMPM", "name": "PMPM", "database": "DEVFORREST", "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": 36.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 26624.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-11-16 16:19UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "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__emergency_department_institutional": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_EMERGENCY_DEPARTMENT_INSTITUTIONAL", "database": "DEVFORREST", "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": 536.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-11-16 16:18UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "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.quality_measures__int_nqf0034__frailty": {"metadata": {"type": "VIEW", "schema": "QUALITY_MEASURES", "name": "_INT_NQF0034__FRAILTY", "database": "DEVFORREST", "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}, "CONCEPT_NAME": {"type": "TEXT", "index": 3, "name": "CONCEPT_NAME", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.quality_measures__int_nqf0034__frailty"}, "model.the_tuva_project.quality_measures__int_nqf2372_exclude_institutional": {"metadata": {"type": "BASE TABLE", "schema": "QUALITY_MEASURES", "name": "_INT_NQF2372_EXCLUDE_INSTITUTIONAL", "database": "DEVFORREST", "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-11-16 16:19UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "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.service_category__duplicate_bill_types": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_DUPLICATE_BILL_TYPES", "database": "DEVFORREST", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"CLAIM_ID": {"type": "TEXT", "index": 1, "name": "CLAIM_ID", "comment": null}, "CNT": {"type": "NUMBER", "index": 2, "name": "CNT", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-11-16 16:18UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.service_category__duplicate_bill_types"}, "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": "DEVFORREST", "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-12-13 23:01UTC", "include": true, "description": "The timestamp for last update/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.data_profiling__eligibility_plausibility": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_ELIGIBILITY_PLAUSIBILITY", "database": "DEVFORREST", "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-11-16 16:18UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "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__location": {"metadata": {"type": "BASE TABLE", "schema": "CORE", "name": "LOCATION", "database": "DEVFORREST", "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": 5564.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 361984.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-11-16 16:19UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "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.data_profiling__eligibility_denominators": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_ELIGIBILITY_DENOMINATORS", "database": "DEVFORREST", "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": 7.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-11-16 16:18UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "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.data_profiling__institutional_header_failures": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_INSTITUTIONAL_HEADER_FAILURES", "database": "DEVFORREST", "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-11-16 16:18UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "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.insights__trend_count_claim_by_claim_type": {"metadata": {"type": "BASE TABLE", "schema": "INSIGHTS", "name": "TREND_COUNT_CLAIM_BY_CLAIM_TYPE", "database": "DEVFORREST", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"YEAR_MONTH": {"type": "TEXT", "index": 1, "name": "YEAR_MONTH", "comment": null}, "CLAIM_TYPE": {"type": "TEXT", "index": 2, "name": "CLAIM_TYPE", "comment": null}, "DISTINCT_CLAIM_COUNT": {"type": "NUMBER", "index": 3, "name": "DISTINCT_CLAIM_COUNT", "comment": null}, "DISTINCT_CLAIM_COUNT_CHANGE": {"type": "NUMBER", "index": 4, "name": "DISTINCT_CLAIM_COUNT_CHANGE", "comment": null}, "DISTINCT_CLAIM_PERCENTAGE_CHANGE": {"type": "NUMBER", "index": 5, "name": "DISTINCT_CLAIM_PERCENTAGE_CHANGE", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 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-11-16 16:19UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.insights__trend_count_claim_by_claim_type"}, "seed.the_tuva_project.terminology__fips_county": {"metadata": {"type": "BASE TABLE", "schema": "TERMINOLOGY", "name": "FIPS_COUNTY", "database": "DEVFORREST", "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-12-13 23:01UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.the_tuva_project.terminology__fips_county"}, "model.the_tuva_project.chronic_conditions__cms_chronic_conditions_long": {"metadata": {"type": "BASE TABLE", "schema": "CHRONIC_CONDITIONS", "name": "CMS_CHRONIC_CONDITIONS_LONG", "database": "DEVFORREST", "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": 75380.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 1330688.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-11-16 16:19UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "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.core__stg_claims_practitioner": {"metadata": {"type": "VIEW", "schema": "CORE", "name": "_STG_CLAIMS_PRACTITIONER", "database": "DEVFORREST", "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.ccsr__long_procedure_category": {"metadata": {"type": "BASE TABLE", "schema": "CCSR", "name": "LONG_PROCEDURE_CATEGORY", "database": "DEVFORREST", "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": 152.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 46080.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-11-16 16:19UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "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__stg_claims_condition": {"metadata": {"type": "VIEW", "schema": "CORE", "name": "_STG_CLAIMS_CONDITION", "database": "DEVFORREST", "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.readmissions__always_planned_ccs_procedure_category": {"metadata": {"type": "BASE TABLE", "schema": "READMISSIONS", "name": "_VALUE_SET_ALWAYS_PLANNED_CCS_PROCEDURE_CATEGORY", "database": "DEVFORREST", "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-12-13 23:01UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.the_tuva_project.readmissions__always_planned_ccs_procedure_category"}, "seed.the_tuva_project.readmissions__acute_diagnosis_ccs": {"metadata": {"type": "BASE TABLE", "schema": "READMISSIONS", "name": "_VALUE_SET_ACUTE_DIAGNOSIS_CCS", "database": "DEVFORREST", "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-12-13 23:01UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.the_tuva_project.readmissions__acute_diagnosis_ccs"}, "model.the_tuva_project.readmissions__index_discharge_requirement": {"metadata": {"type": "VIEW", "schema": "READMISSIONS", "name": "_INT_INDEX_DISCHARGE_REQUIREMENT", "database": "DEVFORREST", "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__encounter_type": {"metadata": {"type": "BASE TABLE", "schema": "TERMINOLOGY", "name": "ENCOUNTER_TYPE", "database": "DEVFORREST", "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-12-13 23:01UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.the_tuva_project.terminology__encounter_type"}, "model.the_tuva_project.core__stg_clinical_condition": {"metadata": {"type": "VIEW", "schema": "CORE", "name": "_STG_CLINICAL_CONDITION", "database": "DEVFORREST", "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__claim_type_mapping_failures": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_CLAIM_TYPE_MAPPING_FAILURES", "database": "DEVFORREST", "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-11-16 16:18UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "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.chronic_conditions__cms_chronic_conditions_hiv_aids": {"metadata": {"type": "BASE TABLE", "schema": "CHRONIC_CONDITIONS", "name": "_INT_CMS_CHRONIC_CONDITION_HIV_AIDS", "database": "DEVFORREST", "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": 27.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 24576.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-11-16 16:19UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "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.service_category__lab_professional": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_LAB_PROFESSIONAL", "database": "DEVFORREST", "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": 37277.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 122368.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-11-16 16:18UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "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.core__stg_clinical_lab_result": {"metadata": {"type": "VIEW", "schema": "CORE", "name": "_STG_CLINICAL_LAB_RESULT", "database": "DEVFORREST", "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.insights__sum_amount_by_claim_type": {"metadata": {"type": "BASE TABLE", "schema": "INSIGHTS", "name": "SUM_AMOUNT_BY_CLAIM_TYPE", "database": "DEVFORREST", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"CLAIM_TYPE": {"type": "TEXT", "index": 1, "name": "CLAIM_TYPE", "comment": null}, "TOTAL_PAID_AMOUNT": {"type": "NUMBER", "index": 2, "name": "TOTAL_PAID_AMOUNT", "comment": null}, "TOTAL_ALLOWED_AMOUNT": {"type": "NUMBER", "index": 3, "name": "TOTAL_ALLOWED_AMOUNT", "comment": null}, "TOTAL_CHARGE_AMOUNT": {"type": "NUMBER", "index": 4, "name": "TOTAL_CHARGE_AMOUNT", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 3.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-11-16 16:19UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.insights__sum_amount_by_claim_type"}, "seed.the_tuva_project.terminology__medicare_dual_eligibility": {"metadata": {"type": "BASE TABLE", "schema": "TERMINOLOGY", "name": "MEDICARE_DUAL_ELIGIBILITY", "database": "DEVFORREST", "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-12-13 23:01UTC", "include": true, "description": "The timestamp for last update/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"}, "seed.the_tuva_project.terminology__place_of_service": {"metadata": {"type": "BASE TABLE", "schema": "TERMINOLOGY", "name": "PLACE_OF_SERVICE", "database": "DEVFORREST", "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-12-13 23:01UTC", "include": true, "description": "The timestamp for last update/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.data_profiling__test_result": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "TEST_RESULT", "database": "DEVFORREST", "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": 33.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-11-16 16:19UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.data_profiling__test_result"}, "model.the_tuva_project.data_profiling__medical_claim_invalid_values": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_MEDICAL_CLAIM_INVALID_VALUES", "database": "DEVFORREST", "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": 273.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 5632.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-11-16 16:18UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.data_profiling__medical_claim_invalid_values"}, "model.the_tuva_project.quality_measures__int_nqf0034_long": {"metadata": {"type": "BASE TABLE", "schema": "QUALITY_MEASURES", "name": "_INT_NQF0034_LONG", "database": "DEVFORREST", "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": 1000.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 7680.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-11-16 16:19UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.quality_measures__int_nqf0034_long"}, "model.the_tuva_project.core__stg_claims_eligibility": {"metadata": {"type": "VIEW", "schema": "CORE", "name": "_STG_CLAIMS_ELIGIBILITY", "database": "DEVFORREST", "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}, "BIRTH_DATE": {"type": "DATE", "index": 3, "name": "BIRTH_DATE", "comment": null}, "DEATH_DATE": {"type": "DATE", "index": 4, "name": "DEATH_DATE", "comment": null}, "ENROLLMENT_START_DATE": {"type": "DATE", "index": 5, "name": "ENROLLMENT_START_DATE", "comment": null}, "ENROLLMENT_END_DATE": {"type": "DATE", "index": 6, "name": "ENROLLMENT_END_DATE", "comment": null}, "PAYER": {"type": "TEXT", "index": 7, "name": "PAYER", "comment": null}, "PAYER_TYPE": {"type": "TEXT", "index": 8, "name": "PAYER_TYPE", "comment": null}, "ORIGINAL_REASON_ENTITLEMENT_CODE": {"type": "TEXT", "index": 9, "name": "ORIGINAL_REASON_ENTITLEMENT_CODE", "comment": null}, "DUAL_STATUS_CODE": {"type": "TEXT", "index": 10, "name": "DUAL_STATUS_CODE", "comment": null}, "MEDICARE_STATUS_CODE": {"type": "TEXT", "index": 11, "name": "MEDICARE_STATUS_CODE", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 12, "name": "DATA_SOURCE", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 13, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.core__stg_claims_eligibility"}, "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": "DEVFORREST", "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": 19525.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 495616.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-11-16 16:19UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.financial_pmpm__service_category_2_paid_pivot"}, "model.the_tuva_project.quality_measures__int_nqf0034_numerator": {"metadata": {"type": "BASE TABLE", "schema": "QUALITY_MEASURES", "name": "_INT_NQF0034_NUMERATOR", "database": "DEVFORREST", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"PATIENT_ID": {"type": "TEXT", "index": 1, "name": "PATIENT_ID", "comment": null}, "EVIDENCE_DATE": {"type": "DATE", "index": 2, "name": "EVIDENCE_DATE", "comment": null}, "EVIDENCE": {"type": "TEXT", "index": 3, "name": "EVIDENCE", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-11-16 16:19UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.quality_measures__int_nqf0034_numerator"}, "seed.the_tuva_project.cms_hcc__cpt_hcpcs": {"metadata": {"type": "BASE TABLE", "schema": "CMS_HCC", "name": "_VALUE_SET_CPT_HCPCS", "database": "DEVFORREST", "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-12-13 23:00UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.the_tuva_project.cms_hcc__cpt_hcpcs"}, "model.the_tuva_project.acute_inpatient__last_claim_values": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_ACUTE_INPATIENT_LAST_CLAIM_VALUES", "database": "DEVFORREST", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"ENCOUNTER_ID": {"type": "TEXT", "index": 1, "name": "ENCOUNTER_ID", "comment": null}, "CLAIM_START": {"type": "DATE", "index": 2, "name": "CLAIM_START", "comment": null}, "DISCHARGE_DISPOSITION_CODE": {"type": "TEXT", "index": 3, "name": "DISCHARGE_DISPOSITION_CODE", "comment": null}, "CLAIM_ROW": {"type": "NUMBER", "index": 4, "name": "CLAIM_ROW", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 223.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-11-16 16:19UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.acute_inpatient__last_claim_values"}, "model.the_tuva_project.service_category__hospice_institutional": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_HOSPICE_INSTITUTIONAL", "database": "DEVFORREST", "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": 20.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-11-16 16:18UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "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.acute_inpatient__encounter_data_for_medical_claims": {"metadata": {"type": "VIEW", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_ENCOUNTER_DATA_FOR_MEDICAL_CLAIMS", "database": "DEVFORREST", "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__urgent_care_professional": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_URGENT_CARE_PROFESSIONAL", "database": "DEVFORREST", "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": 265.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-11-16 16:18UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.service_category__urgent_care_professional"}, "model.the_tuva_project.cms_hcc__int_enrollment_interaction_factors": {"metadata": {"type": "BASE TABLE", "schema": "CMS_HCC", "name": "_INT_ENROLLMENT_INTERACTION_FACTORS", "database": "DEVFORREST", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"PATIENT_ID": {"type": "TEXT", "index": 1, "name": "PATIENT_ID", "comment": null}, "DESCRIPTION": {"type": "TEXT", "index": 2, "name": "DESCRIPTION", "comment": null}, "COEFFICIENT": {"type": "NUMBER", "index": 3, "name": "COEFFICIENT", "comment": null}, "FACTOR_TYPE": {"type": "TEXT", "index": 4, "name": "FACTOR_TYPE", "comment": null}, "MODEL_VERSION": {"type": "TEXT", "index": 5, "name": "MODEL_VERSION", "comment": null}, "PAYMENT_YEAR": {"type": "NUMBER", "index": 6, "name": "PAYMENT_YEAR", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 7, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-11-16 16:19UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "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.acute_inpatient__data_quality_summary": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_ACUTE_INPATIENT_DATA_QUALITY_SUMMARY", "database": "DEVFORREST", "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-11-16 16:19UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "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.emergency_department__int_institutional_claims": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_EMERGENCY_DEPARTMENT_INSTITUTIONAL_CLAIMS", "database": "DEVFORREST", "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": 536.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 25088.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-11-16 16:19UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.emergency_department__int_institutional_claims"}, "model.the_tuva_project.cms_hcc__int_disease_factors": {"metadata": {"type": "BASE TABLE", "schema": "CMS_HCC", "name": "_INT_DISEASE_FACTORS", "database": "DEVFORREST", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"PATIENT_ID": {"type": "TEXT", "index": 1, "name": "PATIENT_ID", "comment": null}, "HCC_CODE": {"type": "TEXT", "index": 2, "name": "HCC_CODE", "comment": null}, "HCC_DESCRIPTION": {"type": "TEXT", "index": 3, "name": "HCC_DESCRIPTION", "comment": null}, "COEFFICIENT": {"type": "NUMBER", "index": 4, "name": "COEFFICIENT", "comment": null}, "FACTOR_TYPE": {"type": "TEXT", "index": 5, "name": "FACTOR_TYPE", "comment": null}, "MODEL_VERSION": {"type": "TEXT", "index": 6, "name": "MODEL_VERSION", "comment": null}, "PAYMENT_YEAR": {"type": "NUMBER", "index": 7, "name": "PAYMENT_YEAR", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 8, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-11-16 16:19UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "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.quality_measures__int_nqf2372_exclude_palliative": {"metadata": {"type": "BASE TABLE", "schema": "QUALITY_MEASURES", "name": "_INT_NQF2372_EXCLUDE_PALLIATIVE", "database": "DEVFORREST", "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-11-16 16:19UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "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.ed_classification__icd_10_cm_to_ccs": {"metadata": {"type": "BASE TABLE", "schema": "ED_CLASSIFICATION", "name": "_VALUE_SET_ICD_10_CM_TO_CCS", "database": "DEVFORREST", "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-12-13 23:00UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.the_tuva_project.ed_classification__icd_10_cm_to_ccs"}, "model.the_tuva_project.data_profiling__eligibility_duplicates": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_ELIGIBILITY_DUPLICATES", "database": "DEVFORREST", "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-11-16 16:18UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "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.chronic_conditions__tuva_chronic_conditions_hierarchy": {"metadata": {"type": "BASE TABLE", "schema": "CHRONIC_CONDITIONS", "name": "_VALUE_SET_TUVA_CHRONIC_CONDITIONS_HIERARCHY", "database": "DEVFORREST", "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-12-13 23:00UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.the_tuva_project.chronic_conditions__tuva_chronic_conditions_hierarchy"}, "seed.the_tuva_project.terminology__discharge_disposition": {"metadata": {"type": "BASE TABLE", "schema": "TERMINOLOGY", "name": "DISCHARGE_DISPOSITION", "database": "DEVFORREST", "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-12-13 23:01UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.the_tuva_project.terminology__discharge_disposition"}, "model.the_tuva_project.acute_inpatient__first_claim_values": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_ACUTE_INPATIENT_FIRST_CLAIM_VALUES", "database": "DEVFORREST", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"ENCOUNTER_ID": {"type": "TEXT", "index": 1, "name": "ENCOUNTER_ID", "comment": null}, "CLAIM_START": {"type": "DATE", "index": 2, "name": "CLAIM_START", "comment": null}, "DIAGNOSIS_CODE_1": {"type": "TEXT", "index": 3, "name": "DIAGNOSIS_CODE_1", "comment": null}, "DIAGNOSIS_CODE_TYPE": {"type": "TEXT", "index": 4, "name": "DIAGNOSIS_CODE_TYPE", "comment": null}, "ADMIT_SOURCE_CODE": {"type": "TEXT", "index": 5, "name": "ADMIT_SOURCE_CODE", "comment": null}, "ADMIT_TYPE_CODE": {"type": "TEXT", "index": 6, "name": "ADMIT_TYPE_CODE", "comment": null}, "FACILITY_NPI": {"type": "TEXT", "index": 7, "name": "FACILITY_NPI", "comment": null}, "MS_DRG_CODE": {"type": "TEXT", "index": 8, "name": "MS_DRG_CODE", "comment": null}, "APR_DRG_CODE": {"type": "TEXT", "index": 9, "name": "APR_DRG_CODE", "comment": null}, "CLAIM_ROW": {"type": "NUMBER", "index": 10, "name": "CLAIM_ROW", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 223.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-11-16 16:19UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.acute_inpatient__first_claim_values"}, "model.the_tuva_project.quality_measures__int_nqf2372_long": {"metadata": {"type": "BASE TABLE", "schema": "QUALITY_MEASURES", "name": "_INT_NQF2372_LONG", "database": "DEVFORREST", "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": 1000.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 7168.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-11-16 16:19UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "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.acute_inpatient__institutional_claims": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_ACUTE_INPATIENT_INSTITUTIONAL_CLAIMS", "database": "DEVFORREST", "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": 223.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 18944.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-11-16 16:19UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "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.ed_classification__int_map_primary_dx": {"metadata": {"type": "BASE TABLE", "schema": "ED_CLASSIFICATION", "name": "_INT_BY_PROVIDER_PARENT_ORGANIZATION", "database": "DEVFORREST", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"ENCOUNTER_ID": {"type": "TEXT", "index": 1, "name": "ENCOUNTER_ID", "comment": null}, "ENCOUNTER_TYPE": {"type": "TEXT", "index": 2, "name": "ENCOUNTER_TYPE", "comment": null}, "PATIENT_ID": {"type": "TEXT", "index": 3, "name": "PATIENT_ID", "comment": null}, "ENCOUNTER_END_DATE": {"type": "DATE", "index": 4, "name": "ENCOUNTER_END_DATE", "comment": null}, "FACILITY_NPI": {"type": "TEXT", "index": 5, "name": "FACILITY_NPI", "comment": null}, "PRIMARY_DIAGNOSIS_CODE_TYPE": {"type": "TEXT", "index": 6, "name": "PRIMARY_DIAGNOSIS_CODE_TYPE", "comment": null}, "PRIMARY_DIAGNOSIS_CODE": {"type": "TEXT", "index": 7, "name": "PRIMARY_DIAGNOSIS_CODE", "comment": null}, "PRIMARY_DIAGNOSIS_DESCRIPTION": {"type": "TEXT", "index": 8, "name": "PRIMARY_DIAGNOSIS_DESCRIPTION", "comment": null}, "PAID_AMOUNT": {"type": "NUMBER", "index": 9, "name": "PAID_AMOUNT", "comment": null}, "ALLOWED_AMOUNT": {"type": "NUMBER", "index": 10, "name": "ALLOWED_AMOUNT", "comment": null}, "CHARGE_AMOUNT": {"type": "NUMBER", "index": 11, "name": "CHARGE_AMOUNT", "comment": null}, "EDCNNPA": {"type": "FLOAT", "index": 12, "name": "EDCNNPA", "comment": null}, "EDCNPA": {"type": "FLOAT", "index": 13, "name": "EDCNPA", "comment": null}, "EPCT": {"type": "FLOAT", "index": 14, "name": "EPCT", "comment": null}, "NONER": {"type": "FLOAT", "index": 15, "name": "NONER", "comment": null}, "INJURY": {"type": "NUMBER", "index": 16, "name": "INJURY", "comment": null}, "PSYCH": {"type": "NUMBER", "index": 17, "name": "PSYCH", "comment": null}, "ALCOHOL": {"type": "NUMBER", "index": 18, "name": "ALCOHOL", "comment": null}, "DRUG": {"type": "NUMBER", "index": 19, "name": "DRUG", "comment": null}, "ED_CLASSIFICATION_CAPTURE": {"type": "NUMBER", "index": 20, "name": "ED_CLASSIFICATION_CAPTURE", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-12-13 23:01UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.ed_classification__int_map_primary_dx"}, "model.the_tuva_project.data_profiling__test_result_stage_pharmacy_claim": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_TEST_RESULT_STAGE_PHARMACY_CLAIM", "database": "DEVFORREST", "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": 5.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 3072.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-11-16 16:19UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "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": "DEVFORREST", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"ENCOUNTER_ID": {"type": "TEXT", "index": 1, "name": "ENCOUNTER_ID", "comment": null}, "PATIENT_ID": {"type": "TEXT", "index": 2, "name": "PATIENT_ID", "comment": null}, "ENCOUNTER_TYPE": {"type": "TEXT", "index": 3, "name": "ENCOUNTER_TYPE", "comment": null}, "ENCOUNTER_START_DATE": {"type": "DATE", "index": 4, "name": "ENCOUNTER_START_DATE", "comment": null}, "ENCOUNTER_END_DATE": {"type": "DATE", "index": 5, "name": "ENCOUNTER_END_DATE", "comment": null}, "LENGTH_OF_STAY": {"type": "NUMBER", "index": 6, "name": "LENGTH_OF_STAY", "comment": null}, "ADMIT_SOURCE_CODE": {"type": "TEXT", "index": 7, "name": "ADMIT_SOURCE_CODE", "comment": null}, "ADMIT_SOURCE_DESCRIPTION": {"type": "TEXT", "index": 8, "name": "ADMIT_SOURCE_DESCRIPTION", "comment": null}, "ADMIT_TYPE_CODE": {"type": "TEXT", "index": 9, "name": "ADMIT_TYPE_CODE", "comment": null}, "ADMIT_TYPE_DESCRIPTION": {"type": "TEXT", "index": 10, "name": "ADMIT_TYPE_DESCRIPTION", "comment": null}, "DISCHARGE_DISPOSITION_CODE": {"type": "TEXT", "index": 11, "name": "DISCHARGE_DISPOSITION_CODE", "comment": null}, "DISCHARGE_DISPOSITION_DESCRIPTION": {"type": "TEXT", "index": 12, "name": "DISCHARGE_DISPOSITION_DESCRIPTION", "comment": null}, "ATTENDING_PROVIDER_ID": {"type": "TEXT", "index": 13, "name": "ATTENDING_PROVIDER_ID", "comment": null}, "FACILITY_NPI": {"type": "TEXT", "index": 14, "name": "FACILITY_NPI", "comment": null}, "PRIMARY_DIAGNOSIS_CODE_TYPE": {"type": "TEXT", "index": 15, "name": "PRIMARY_DIAGNOSIS_CODE_TYPE", "comment": null}, "PRIMARY_DIAGNOSIS_CODE": {"type": "TEXT", "index": 16, "name": "PRIMARY_DIAGNOSIS_CODE", "comment": null}, "PRIMARY_DIAGNOSIS_DESCRIPTION": {"type": "TEXT", "index": 17, "name": "PRIMARY_DIAGNOSIS_DESCRIPTION", "comment": null}, "MS_DRG_CODE": {"type": "TEXT", "index": 18, "name": "MS_DRG_CODE", "comment": null}, "MS_DRG_DESCRIPTION": {"type": "TEXT", "index": 19, "name": "MS_DRG_DESCRIPTION", "comment": null}, "APR_DRG_CODE": {"type": "TEXT", "index": 20, "name": "APR_DRG_CODE", "comment": null}, "APR_DRG_DESCRIPTION": {"type": "TEXT", "index": 21, "name": "APR_DRG_DESCRIPTION", "comment": null}, "PAID_AMOUNT": {"type": "NUMBER", "index": 22, "name": "PAID_AMOUNT", "comment": null}, "ALLOWED_AMOUNT": {"type": "NUMBER", "index": 23, "name": "ALLOWED_AMOUNT", "comment": null}, "CHARGE_AMOUNT": {"type": "NUMBER", "index": 24, "name": "CHARGE_AMOUNT", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 25, "name": "DATA_SOURCE", "comment": null}, "TUVA_LAST_RUN": {"type": "TIMESTAMP_NTZ", "index": 26, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.core__stg_claims_encounter"}, "model.the_tuva_project.insights__trend_sum_amount_by_service_category": {"metadata": {"type": "BASE TABLE", "schema": "INSIGHTS", "name": "TREND_SUM_AMOUNT_BY_SERVICE_CATEGORY", "database": "DEVFORREST", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"YEAR_MONTH": {"type": "TEXT", "index": 1, "name": "YEAR_MONTH", "comment": null}, "SERVICE_CATEGORY_TYPE": {"type": "TEXT", "index": 2, "name": "SERVICE_CATEGORY_TYPE", "comment": null}, "SERVICE_CATEGORY": {"type": "TEXT", "index": 3, "name": "SERVICE_CATEGORY", "comment": null}, "TOTAL_PAID_AMOUNT": {"type": "NUMBER", "index": 4, "name": "TOTAL_PAID_AMOUNT", "comment": null}, "TOTAL_PAID_AMOUNT_CHANGE": {"type": "NUMBER", "index": 5, "name": "TOTAL_PAID_AMOUNT_CHANGE", "comment": null}, "TOTAL_PAID_AMOUNT_PERCENT_CHANGE": {"type": "NUMBER", "index": 6, "name": "TOTAL_PAID_AMOUNT_PERCENT_CHANGE", "comment": null}, "TOTAL_ALLOWED_AMOUNT": {"type": "NUMBER", "index": 7, "name": "TOTAL_ALLOWED_AMOUNT", "comment": null}, "TOTAL_ALLOWED_AMOUNT_CHANGE": {"type": "NUMBER", "index": 8, "name": "TOTAL_ALLOWED_AMOUNT_CHANGE", "comment": null}, "TOTAL_ALLOWED_AMOUNT_PERCENT_CHANGE": {"type": "NUMBER", "index": 9, "name": "TOTAL_ALLOWED_AMOUNT_PERCENT_CHANGE", "comment": null}, "TOTAL_CHARGE_AMOUNT": {"type": "NUMBER", "index": 10, "name": "TOTAL_CHARGE_AMOUNT", "comment": null}, "TOTAL_CHARGE_AMOUNT_CHANGE": {"type": "NUMBER", "index": 11, "name": "TOTAL_CHARGE_AMOUNT_CHANGE", "comment": null}, "TOTAL_CHARGE_AMOUNT_PERCENT_CHANGE": {"type": "NUMBER", "index": 12, "name": "TOTAL_CHARGE_AMOUNT_PERCENT_CHANGE", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 721.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-11-16 16:19UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.insights__trend_sum_amount_by_service_category"}, "model.the_tuva_project.cms_hcc__patient_risk_factors": {"metadata": {"type": "BASE TABLE", "schema": "CMS_HCC", "name": "PATIENT_RISK_FACTORS", "database": "DEVFORREST", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"PATIENT_ID": {"type": "TEXT", "index": 1, "name": "PATIENT_ID", "comment": null}, "ENROLLMENT_STATUS_DEFAULT": {"type": "BOOLEAN", "index": 2, "name": "ENROLLMENT_STATUS_DEFAULT", "comment": null}, "MEDICAID_DUAL_STATUS_DEFAULT": {"type": "BOOLEAN", "index": 3, "name": "MEDICAID_DUAL_STATUS_DEFAULT", "comment": null}, "OREC_DEFAULT": {"type": "BOOLEAN", "index": 4, "name": "OREC_DEFAULT", "comment": null}, "INSTITUTIONAL_STATUS_DEFAULT": {"type": "BOOLEAN", "index": 5, "name": "INSTITUTIONAL_STATUS_DEFAULT", "comment": null}, "FACTOR_TYPE": {"type": "TEXT", "index": 6, "name": "FACTOR_TYPE", "comment": null}, "RISK_FACTOR_DESCRIPTION": {"type": "TEXT", "index": 7, "name": "RISK_FACTOR_DESCRIPTION", "comment": null}, "COEFFICIENT": {"type": "NUMBER", "index": 8, "name": "COEFFICIENT", "comment": null}, "MODEL_VERSION": {"type": "TEXT", "index": 9, "name": "MODEL_VERSION", "comment": null}, "PAYMENT_YEAR": {"type": "NUMBER", "index": 10, "name": "PAYMENT_YEAR", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 11, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-11-16 16:19UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "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.cms_hcc__payment_hcc_count_factors": {"metadata": {"type": "BASE TABLE", "schema": "CMS_HCC", "name": "_VALUE_SET_PAYMENT_HCC_COUNT_FACTORS", "database": "DEVFORREST", "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-12-13 23:00UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.the_tuva_project.cms_hcc__payment_hcc_count_factors"}, "model.the_tuva_project.core__stg_claims_patient": {"metadata": {"type": "VIEW", "schema": "CORE", "name": "_STG_CLAIMS_PATIENT", "database": "DEVFORREST", "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_claims_patient"}, "model.the_tuva_project.service_category__acute_inpatient_professional": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_ACUTE_INPATIENT_PROFESSIONAL", "database": "DEVFORREST", "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": 7528.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 37888.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-11-16 16:18UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "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.quality_measures__summary_counts": {"metadata": {"type": "BASE TABLE", "schema": "QUALITY_MEASURES", "name": "SUMMARY_COUNTS", "database": "DEVFORREST", "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": 1.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-11-16 16:19UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "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"}, "seed.the_tuva_project.terminology__icd_9_cm": {"metadata": {"type": "BASE TABLE", "schema": "TERMINOLOGY", "name": "ICD_9_CM", "database": "DEVFORREST", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"ICD_9_CM": {"type": "TEXT", "index": 1, "name": "ICD_9_CM", "comment": null}, "LONG_DESCRIPTION": {"type": "TEXT", "index": 2, "name": "LONG_DESCRIPTION", "comment": null}, "SHORT_DESCRIPTION": {"type": "TEXT", "index": 3, "name": "SHORT_DESCRIPTION", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 14567.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 390144.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-12-13 23:01UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.the_tuva_project.terminology__icd_9_cm"}, "model.the_tuva_project.service_category__emergency_department_professional": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_EMERGENCY_DEPARTMENT_PROFESSIONAL", "database": "DEVFORREST", "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": 5174.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 27648.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-11-16 16:18UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "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.service_category__service_categories": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_VALUE_SET_SERVICE_CATEGORIES", "database": "DEVFORREST", "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-12-13 23:01UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.the_tuva_project.service_category__service_categories"}, "model.the_tuva_project.readmissions__index_admission": {"metadata": {"type": "VIEW", "schema": "READMISSIONS", "name": "_INT_INDEX_ADMISSION", "database": "DEVFORREST", "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.financial_pmpm__pmpm_prep": {"metadata": {"type": "BASE TABLE", "schema": "FINANCIAL_PMPM", "name": "PMPM_PREP", "database": "DEVFORREST", "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": 31184.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 2478080.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-11-16 16:19UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "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.data_profiling__test_detail_stage_eligibility": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_TEST_DETAIL_STAGE_ELIGIBILITY", "database": "DEVFORREST", "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": 7989.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 39936.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-11-16 16:18UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.data_profiling__test_detail_stage_eligibility"}, "seed.the_tuva_project.terminology__ethnicity": {"metadata": {"type": "BASE TABLE", "schema": "TERMINOLOGY", "name": "ETHNICITY", "database": "DEVFORREST", "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-12-13 23:01UTC", "include": true, "description": "The timestamp for last update/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"}, "model.the_tuva_project.data_profiling__medical_claim_plausibility": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_MEDICAL_CLAIM_PLAUSIBILITY", "database": "DEVFORREST", "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-11-16 16:18UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "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.insights__count_claim_by_service_category": {"metadata": {"type": "BASE TABLE", "schema": "INSIGHTS", "name": "COUNT_CLAIM_BY_SERVICE_CATEGORY", "database": "DEVFORREST", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"SERVICE_CATEGORY_TYPE": {"type": "TEXT", "index": 1, "name": "SERVICE_CATEGORY_TYPE", "comment": null}, "SERVICE_CATEGORY": {"type": "TEXT", "index": 2, "name": "SERVICE_CATEGORY", "comment": null}, "DISTINCT_CLAIM_COUNT": {"type": "NUMBER", "index": 3, "name": "DISTINCT_CLAIM_COUNT", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 24.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 6656.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-11-16 16:19UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.insights__count_claim_by_service_category"}, "seed.the_tuva_project.ccsr__prccsr_v2023_1_cleaned_map": {"metadata": {"type": "BASE TABLE", "schema": "CCSR", "name": "_VALUE_SET_PRCCSR_V2023_1_CLEANED_MAP", "database": "DEVFORREST", "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-12-13 23:00UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.the_tuva_project.ccsr__prccsr_v2023_1_cleaned_map"}, "model.the_tuva_project.core__stg_clinical_location": {"metadata": {"type": "VIEW", "schema": "CORE", "name": "_STG_CLINICAL_LOCATION", "database": "DEVFORREST", "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.terminology__ms_drg": {"metadata": {"type": "BASE TABLE", "schema": "TERMINOLOGY", "name": "MS_DRG", "database": "DEVFORREST", "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-12-13 23:01UTC", "include": true, "description": "The timestamp for last update/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_practitioner": {"metadata": {"type": "VIEW", "schema": "CORE", "name": "_STG_CLINICAL_PRACTITIONER", "database": "DEVFORREST", "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.acute_inpatient__claims_with_encounter_data": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_ACUTE_INPATIENT_CLAIMS_WITH_ENCOUNTER_DATA", "database": "DEVFORREST", "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": 2839.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 27136.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-11-16 16:19UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "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.service_category__dq_multiple_service_categories_professional": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_DQ_MULTIPLE_SERVICE_CATEGORIES_PROFESSIONAL", "database": "DEVFORREST", "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-11-16 16:19UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.service_category__dq_multiple_service_categories_professional"}, "model.the_tuva_project.service_category__ambulance_professional": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_AMBULANCE_PROFESSIONAL", "database": "DEVFORREST", "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": 1963.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-11-16 16:18UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "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.readmissions__encounter_augmented": {"metadata": {"type": "BASE TABLE", "schema": "READMISSIONS", "name": "ENCOUNTER_AUGMENTED", "database": "DEVFORREST", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"ENCOUNTER_ID": {"type": "TEXT", "index": 1, "name": "ENCOUNTER_ID", "comment": null}, "PATIENT_ID": {"type": "TEXT", "index": 2, "name": "PATIENT_ID", "comment": null}, "ADMIT_DATE": {"type": "DATE", "index": 3, "name": "ADMIT_DATE", "comment": null}, "DISCHARGE_DATE": {"type": "DATE", "index": 4, "name": "DISCHARGE_DATE", "comment": null}, "DISCHARGE_DISPOSITION_CODE": {"type": "TEXT", "index": 5, "name": "DISCHARGE_DISPOSITION_CODE", "comment": null}, "FACILITY_NPI": {"type": "TEXT", "index": 6, "name": "FACILITY_NPI", "comment": null}, "MS_DRG_CODE": {"type": "TEXT", "index": 7, "name": "MS_DRG_CODE", "comment": null}, "PAID_AMOUNT": {"type": "NUMBER", "index": 8, "name": "PAID_AMOUNT", "comment": null}, "LENGTH_OF_STAY": {"type": "NUMBER", "index": 9, "name": "LENGTH_OF_STAY", "comment": null}, "INDEX_ADMISSION_FLAG": {"type": "NUMBER", "index": 10, "name": "INDEX_ADMISSION_FLAG", "comment": null}, "PLANNED_FLAG": {"type": "NUMBER", "index": 11, "name": "PLANNED_FLAG", "comment": null}, "SPECIALTY_COHORT": {"type": "TEXT", "index": 12, "name": "SPECIALTY_COHORT", "comment": null}, "DIED_FLAG": {"type": "NUMBER", "index": 13, "name": "DIED_FLAG", "comment": null}, "DIAGNOSIS_CCS": {"type": "TEXT", "index": 14, "name": "DIAGNOSIS_CCS", "comment": null}, "DISQUALIFIED_ENCOUNTER_FLAG": {"type": "NUMBER", "index": 15, "name": "DISQUALIFIED_ENCOUNTER_FLAG", "comment": null}, "MISSING_ADMIT_DATE_FLAG": {"type": "NUMBER", "index": 16, "name": "MISSING_ADMIT_DATE_FLAG", "comment": null}, "MISSING_DISCHARGE_DATE_FLAG": {"type": "NUMBER", "index": 17, "name": "MISSING_DISCHARGE_DATE_FLAG", "comment": null}, "ADMIT_AFTER_DISCHARGE_FLAG": {"type": "NUMBER", "index": 18, "name": "ADMIT_AFTER_DISCHARGE_FLAG", "comment": null}, "MISSING_DISCHARGE_DISPOSITION_CODE_FLAG": {"type": "NUMBER", "index": 19, "name": "MISSING_DISCHARGE_DISPOSITION_CODE_FLAG", "comment": null}, "INVALID_DISCHARGE_DISPOSITION_CODE_FLAG": {"type": "NUMBER", "index": 20, "name": "INVALID_DISCHARGE_DISPOSITION_CODE_FLAG", "comment": null}, "MISSING_PRIMARY_DIAGNOSIS_FLAG": {"type": "NUMBER", "index": 21, "name": "MISSING_PRIMARY_DIAGNOSIS_FLAG", "comment": null}, "INVALID_PRIMARY_DIAGNOSIS_CODE_FLAG": {"type": "NUMBER", "index": 22, "name": "INVALID_PRIMARY_DIAGNOSIS_CODE_FLAG", "comment": null}, "NO_DIAGNOSIS_CCS_FLAG": {"type": "NUMBER", "index": 23, "name": "NO_DIAGNOSIS_CCS_FLAG", "comment": null}, "OVERLAPS_WITH_ANOTHER_ENCOUNTER_FLAG": {"type": "NUMBER", "index": 24, "name": "OVERLAPS_WITH_ANOTHER_ENCOUNTER_FLAG", "comment": null}, "MISSING_MS_DRG_FLAG": {"type": "NUMBER", "index": 25, "name": "MISSING_MS_DRG_FLAG", "comment": null}, "INVALID_MS_DRG_FLAG": {"type": "NUMBER", "index": 26, "name": "INVALID_MS_DRG_FLAG", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 27, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 223.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 74752.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-11-16 16:19UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.readmissions__encounter_augmented"}, "seed.the_tuva_project.terminology__icd_9_pcs": {"metadata": {"type": "BASE TABLE", "schema": "TERMINOLOGY", "name": "ICD_9_PCS", "database": "DEVFORREST", "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-12-13 23:01UTC", "include": true, "description": "The timestamp for last update/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"}, "seed.input_layer.pharmacy_claim_seed": {"metadata": {"type": "BASE TABLE", "schema": "_TUVA_SYNTHETIC", "name": "PHARMACY_CLAIM_SEED", "database": "DEVFORREST", "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-12-13 23:00UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.input_layer.pharmacy_claim_seed"}, "model.the_tuva_project.acute_inpatient__professional_encounter_id": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_ACUTE_INPATIENT_PROFESSIONAL_ENCOUNTER_ID", "database": "DEVFORREST", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"PATIENT_ID": {"type": "TEXT", "index": 1, "name": "PATIENT_ID", "comment": null}, "CLAIM_ID": {"type": "TEXT", "index": 2, "name": "CLAIM_ID", "comment": null}, "CLAIM_LINE_NUMBER": {"type": "NUMBER", "index": 3, "name": "CLAIM_LINE_NUMBER", "comment": null}, "START_DATE": {"type": "DATE", "index": 4, "name": "START_DATE", "comment": null}, "END_DATE": {"type": "DATE", "index": 5, "name": "END_DATE", "comment": null}, "ENCOUNTER_ID": {"type": "TEXT", "index": 6, "name": "ENCOUNTER_ID", "comment": null}, "ORPHAN_CLAIM_FLAG": {"type": "NUMBER", "index": 7, "name": "ORPHAN_CLAIM_FLAG", "comment": null}, "ENCOUNTER_COUNT": {"type": "NUMBER", "index": 8, "name": "ENCOUNTER_COUNT", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 9, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 7528.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 93696.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-11-16 16:19UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "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__eligibility": {"metadata": {"type": "BASE TABLE", "schema": "CORE", "name": "ELIGIBILITY", "database": "DEVFORREST", "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}, "BIRTH_DATE": {"type": "DATE", "index": 3, "name": "BIRTH_DATE", "comment": null}, "DEATH_DATE": {"type": "DATE", "index": 4, "name": "DEATH_DATE", "comment": null}, "ENROLLMENT_START_DATE": {"type": "DATE", "index": 5, "name": "ENROLLMENT_START_DATE", "comment": null}, "ENROLLMENT_END_DATE": {"type": "DATE", "index": 6, "name": "ENROLLMENT_END_DATE", "comment": null}, "PAYER": {"type": "TEXT", "index": 7, "name": "PAYER", "comment": null}, "PAYER_TYPE": {"type": "TEXT", "index": 8, "name": "PAYER_TYPE", "comment": null}, "ORIGINAL_REASON_ENTITLEMENT_CODE": {"type": "TEXT", "index": 9, "name": "ORIGINAL_REASON_ENTITLEMENT_CODE", "comment": null}, "DUAL_STATUS_CODE": {"type": "TEXT", "index": 10, "name": "DUAL_STATUS_CODE", "comment": null}, "MEDICARE_STATUS_CODE": {"type": "TEXT", "index": 11, "name": "MEDICARE_STATUS_CODE", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 12, "name": "DATA_SOURCE", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 13, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 2309.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 24576.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-11-16 16:18UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "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.emergency_department__int_institutional_encounter_id": {"metadata": {"type": "VIEW", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_EMERGENCY_DEPARTMENT_INSTITUTIONAL_ENCOUNTER_ID", "database": "DEVFORREST", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"PATIENT_ID": {"type": "TEXT", "index": 1, "name": "PATIENT_ID", "comment": null}, "CLAIM_ID": {"type": "TEXT", "index": 2, "name": "CLAIM_ID", "comment": null}, "START_DATE": {"type": "DATE", "index": 3, "name": "START_DATE", "comment": null}, "END_DATE": {"type": "DATE", "index": 4, "name": "END_DATE", "comment": null}, "DISCHARGE_DISPOSITION_CODE": {"type": "TEXT", "index": 5, "name": "DISCHARGE_DISPOSITION_CODE", "comment": null}, "FACILITY_NPI": {"type": "TEXT", "index": 6, "name": "FACILITY_NPI", "comment": null}, "ROW_NUM": {"type": "NUMBER", "index": 7, "name": "ROW_NUM", "comment": null}, "CLOSE_FLAG": {"type": "NUMBER", "index": 8, "name": "CLOSE_FLAG", "comment": null}, "MIN_CLOSING_ROW": {"type": "NUMBER", "index": 9, "name": "MIN_CLOSING_ROW", "comment": null}, "ENCOUNTER_ID": {"type": "TEXT", "index": 10, "name": "ENCOUNTER_ID", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 11, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.emergency_department__int_institutional_encounter_id"}, "model.the_tuva_project.core__stg_clinical_medication": {"metadata": {"type": "VIEW", "schema": "CORE", "name": "_STG_CLINICAL_MEDICATION", "database": "DEVFORREST", "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.readmissions__encounter_with_ccs": {"metadata": {"type": "VIEW", "schema": "READMISSIONS", "name": "_INT_ENCOUNTER_WITH_CCS", "database": "DEVFORREST", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"ENCOUNTER_ID": {"type": "TEXT", "index": 1, "name": "ENCOUNTER_ID", "comment": null}, "PATIENT_ID": {"type": "TEXT", "index": 2, "name": "PATIENT_ID", "comment": null}, "ADMIT_DATE": {"type": "DATE", "index": 3, "name": "ADMIT_DATE", "comment": null}, "DISCHARGE_DATE": {"type": "DATE", "index": 4, "name": "DISCHARGE_DATE", "comment": null}, "DISCHARGE_DISPOSITION_CODE": {"type": "TEXT", "index": 5, "name": "DISCHARGE_DISPOSITION_CODE", "comment": null}, "FACILITY_NPI": {"type": "TEXT", "index": 6, "name": "FACILITY_NPI", "comment": null}, "MS_DRG_CODE": {"type": "TEXT", "index": 7, "name": "MS_DRG_CODE", "comment": null}, "PAID_AMOUNT": {"type": "NUMBER", "index": 8, "name": "PAID_AMOUNT", "comment": null}, "PRIMARY_DIAGNOSIS_CODE": {"type": "TEXT", "index": 9, "name": "PRIMARY_DIAGNOSIS_CODE", "comment": null}, "VALID_PRIMARY_DIAGNOSIS_CODE_FLAG": {"type": "NUMBER", "index": 10, "name": "VALID_PRIMARY_DIAGNOSIS_CODE_FLAG", "comment": null}, "CCS_DIAGNOSIS_CATEGORY": {"type": "TEXT", "index": 11, "name": "CCS_DIAGNOSIS_CATEGORY", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 12, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.readmissions__encounter_with_ccs"}, "model.the_tuva_project.core__medication": {"metadata": {"type": "BASE TABLE", "schema": "CORE", "name": "MEDICATION", "database": "DEVFORREST", "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-12-13 23:01UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.core__medication"}, "model.the_tuva_project.data_profiling__professional_header_failures": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_PROFESSIONAL_HEADER_FAILURES", "database": "DEVFORREST", "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-11-16 16:18UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "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_claims_location": {"metadata": {"type": "VIEW", "schema": "CORE", "name": "_STG_CLAIMS_LOCATION", "database": "DEVFORREST", "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"}, "model.the_tuva_project.core__stg_clinical_patient": {"metadata": {"type": "VIEW", "schema": "CORE", "name": "_STG_CLINICAL_PATIENT", "database": "DEVFORREST", "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.readmissions__encounter_overlap": {"metadata": {"type": "VIEW", "schema": "READMISSIONS", "name": "_INT_ENCOUNTER_OVERLAP", "database": "DEVFORREST", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"PATIENT_ID": {"type": "TEXT", "index": 1, "name": "PATIENT_ID", "comment": null}, "ENCOUNTER_ID_A": {"type": "TEXT", "index": 2, "name": "ENCOUNTER_ID_A", "comment": null}, "ENCOUNTER_ID_B": {"type": "TEXT", "index": 3, "name": "ENCOUNTER_ID_B", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 4, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.readmissions__encounter_overlap"}, "model.the_tuva_project.service_category__outpatient_psychiatric_professional": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_OUTPATIENT_PSYCHIATRIC_PROFESSIONAL", "database": "DEVFORREST", "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": 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-11-16 16:18UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "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.readmissions__encounter": {"metadata": {"type": "VIEW", "schema": "READMISSIONS", "name": "_INT_ENCOUNTER", "database": "DEVFORREST", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"ENCOUNTER_ID": {"type": "TEXT", "index": 1, "name": "ENCOUNTER_ID", "comment": null}, "PATIENT_ID": {"type": "TEXT", "index": 2, "name": "PATIENT_ID", "comment": null}, "ADMIT_DATE": {"type": "DATE", "index": 3, "name": "ADMIT_DATE", "comment": null}, "DISCHARGE_DATE": {"type": "DATE", "index": 4, "name": "DISCHARGE_DATE", "comment": null}, "DISCHARGE_DISPOSITION_CODE": {"type": "TEXT", "index": 5, "name": "DISCHARGE_DISPOSITION_CODE", "comment": null}, "FACILITY_NPI": {"type": "TEXT", "index": 6, "name": "FACILITY_NPI", "comment": null}, "MS_DRG_CODE": {"type": "TEXT", "index": 7, "name": "MS_DRG_CODE", "comment": null}, "PAID_AMOUNT": {"type": "NUMBER", "index": 8, "name": "PAID_AMOUNT", "comment": null}, "PRIMARY_DIAGNOSIS_CODE": {"type": "TEXT", "index": 9, "name": "PRIMARY_DIAGNOSIS_CODE", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 10, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.readmissions__encounter"}, "model.the_tuva_project.insights__sum_amount_by_service_category": {"metadata": {"type": "BASE TABLE", "schema": "INSIGHTS", "name": "SUM_AMOUNT_BY_SERVICE_CATEGORY", "database": "DEVFORREST", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"SERVICE_CATEGORY_TYPE": {"type": "TEXT", "index": 1, "name": "SERVICE_CATEGORY_TYPE", "comment": null}, "SERVICE_CATEGORY_1": {"type": "TEXT", "index": 2, "name": "SERVICE_CATEGORY_1", "comment": null}, "TOTAL_PAID_AMOUNT": {"type": "NUMBER", "index": 3, "name": "TOTAL_PAID_AMOUNT", "comment": null}, "TOTAL_ALLOWED_AMOUNT": {"type": "NUMBER", "index": 4, "name": "TOTAL_ALLOWED_AMOUNT", "comment": null}, "TOTAL_CHARGE_AMOUNT": {"type": "NUMBER", "index": 5, "name": "TOTAL_CHARGE_AMOUNT", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 24.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 10240.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-11-16 16:19UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.insights__sum_amount_by_service_category"}, "model.the_tuva_project.quality_measures__summary_long": {"metadata": {"type": "BASE TABLE", "schema": "QUALITY_MEASURES", "name": "SUMMARY_LONG", "database": "DEVFORREST", "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": 2000.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 11776.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-11-16 16:19UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.quality_measures__summary_long"}, "model.the_tuva_project.core__patient": {"metadata": {"type": "BASE TABLE", "schema": "CORE", "name": "PATIENT", "database": "DEVFORREST", "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": {"row_count": {"id": "row_count", "label": "Row Count", "value": 1000.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 16896.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-11-16 16:18UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "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.quality_measures__int_nqf2372_exclude_advanced_illness": {"metadata": {"type": "BASE TABLE", "schema": "QUALITY_MEASURES", "name": "_INT_NQF2372_EXCLUDE_ADVANCED_ILLNESS", "database": "DEVFORREST", "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-11-16 16:19UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "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.emergency_department__int_encounter_id": {"metadata": {"type": "VIEW", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_EMERGENCY_DEPARTMENT_ENCOUNTER_ID", "database": "DEVFORREST", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"PATIENT_ID": {"type": "TEXT", "index": 1, "name": "PATIENT_ID", "comment": null}, "CLAIM_ID": {"type": "TEXT", "index": 2, "name": "CLAIM_ID", "comment": null}, "CLAIM_LINE_NUMBER": {"type": "NUMBER", "index": 3, "name": "CLAIM_LINE_NUMBER", "comment": null}, "ENCOUNTER_ID": {"type": "TEXT", "index": 4, "name": "ENCOUNTER_ID", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 5, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.emergency_department__int_encounter_id"}, "model.the_tuva_project.service_category__dialysis_institutional": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_DIALYSIS_INSTITUTIONAL", "database": "DEVFORREST", "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-11-16 16:18UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.service_category__dialysis_institutional"}, "seed.the_tuva_project.terminology__payer_type": {"metadata": {"type": "BASE TABLE", "schema": "TERMINOLOGY", "name": "PAYER_TYPE", "database": "DEVFORREST", "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-12-13 23:01UTC", "include": true, "description": "The timestamp for last update/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.chronic_conditions__tuva_chronic_conditions_long": {"metadata": {"type": "BASE TABLE", "schema": "CHRONIC_CONDITIONS", "name": "TUVA_CHRONIC_CONDITIONS_LONG", "database": "DEVFORREST", "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": 6785.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 110592.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-11-16 16:19UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_long"}, "seed.the_tuva_project.terminology__claim_type": {"metadata": {"type": "BASE TABLE", "schema": "TERMINOLOGY", "name": "CLAIM_TYPE", "database": "DEVFORREST", "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-12-13 23:01UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.the_tuva_project.terminology__claim_type"}, "model.the_tuva_project.emergency_department__summary": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "EMERGENCY_DEPARTMENT_SUMMARY", "database": "DEVFORREST", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"ENCOUNTER_ID": {"type": "TEXT", "index": 1, "name": "ENCOUNTER_ID", "comment": null}, "ENCOUNTER_START_DATE": {"type": "DATE", "index": 2, "name": "ENCOUNTER_START_DATE", "comment": null}, "ENCOUNTER_END_DATE": {"type": "DATE", "index": 3, "name": "ENCOUNTER_END_DATE", "comment": null}, "PATIENT_ID": {"type": "TEXT", "index": 4, "name": "PATIENT_ID", "comment": null}, "ADMIT_AGE": {"type": "NUMBER", "index": 5, "name": "ADMIT_AGE", "comment": null}, "GENDER": {"type": "TEXT", "index": 6, "name": "GENDER", "comment": null}, "RACE": {"type": "TEXT", "index": 7, "name": "RACE", "comment": null}, "PRIMARY_DIAGNOSIS_CODE_TYPE": {"type": "TEXT", "index": 8, "name": "PRIMARY_DIAGNOSIS_CODE_TYPE", "comment": null}, "PRIMARY_DIAGNOSIS_CODE": {"type": "TEXT", "index": 9, "name": "PRIMARY_DIAGNOSIS_CODE", "comment": null}, "PRIMARY_DIAGNOSIS_DESCRIPTION": {"type": "TEXT", "index": 10, "name": "PRIMARY_DIAGNOSIS_DESCRIPTION", "comment": null}, "FACILITY_NPI": {"type": "TEXT", "index": 11, "name": "FACILITY_NPI", "comment": null}, "PROVIDER_FIRST_NAME": {"type": "TEXT", "index": 12, "name": "PROVIDER_FIRST_NAME", "comment": null}, "PROVIDER_LAST_NAME": {"type": "TEXT", "index": 13, "name": "PROVIDER_LAST_NAME", "comment": null}, "MS_DRG_CODE": {"type": "TEXT", "index": 14, "name": "MS_DRG_CODE", "comment": null}, "MS_DRG_DESCRIPTION": {"type": "TEXT", "index": 15, "name": "MS_DRG_DESCRIPTION", "comment": null}, "MEDICAL_SURGICAL": {"type": "TEXT", "index": 16, "name": "MEDICAL_SURGICAL", "comment": null}, "APR_DRG_CODE": {"type": "TEXT", "index": 17, "name": "APR_DRG_CODE", "comment": null}, "APR_DRG_DESCRIPTION": {"type": "TEXT", "index": 18, "name": "APR_DRG_DESCRIPTION", "comment": null}, "ADMIT_SOURCE_CODE": {"type": "TEXT", "index": 19, "name": "ADMIT_SOURCE_CODE", "comment": null}, "ADMIT_SOURCE_DESCRIPTION": {"type": "TEXT", "index": 20, "name": "ADMIT_SOURCE_DESCRIPTION", "comment": null}, "ADMIT_TYPE_CODE": {"type": "TEXT", "index": 21, "name": "ADMIT_TYPE_CODE", "comment": null}, "ADMIT_TYPE_DESCRIPTION": {"type": "TEXT", "index": 22, "name": "ADMIT_TYPE_DESCRIPTION", "comment": null}, "DISCHARGE_DISPOSITION_CODE": {"type": "TEXT", "index": 23, "name": "DISCHARGE_DISPOSITION_CODE", "comment": null}, "DISCHARGE_DISPOSITION_DESCRIPTION": {"type": "TEXT", "index": 24, "name": "DISCHARGE_DISPOSITION_DESCRIPTION", "comment": null}, "TOTAL_PAID_AMOUNT": {"type": "FLOAT", "index": 25, "name": "TOTAL_PAID_AMOUNT", "comment": null}, "TOTAL_ALLOWED_AMOUNT": {"type": "FLOAT", "index": 26, "name": "TOTAL_ALLOWED_AMOUNT", "comment": null}, "TOTAL_CHARGE_AMOUNT": {"type": "FLOAT", "index": 27, "name": "TOTAL_CHARGE_AMOUNT", "comment": null}, "LENGTH_OF_STAY": {"type": "NUMBER", "index": 28, "name": "LENGTH_OF_STAY", "comment": null}, "MORTALITY_FLAG": {"type": "NUMBER", "index": 29, "name": "MORTALITY_FLAG", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 30, "name": "DATA_SOURCE", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 31, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 536.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 123392.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-11-16 16:19UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.emergency_department__summary"}, "model.the_tuva_project.ed_classification__int_filter_encounter_with_classification": {"metadata": {"type": "BASE TABLE", "schema": "ED_CLASSIFICATION", "name": "_INT_FILTER_ENCOUNTER_WITH_CLASSIFICATION", "database": "DEVFORREST", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"ENCOUNTER_ID": {"type": "TEXT", "index": 1, "name": "ENCOUNTER_ID", "comment": null}, "ENCOUNTER_TYPE": {"type": "TEXT", "index": 2, "name": "ENCOUNTER_TYPE", "comment": null}, "PATIENT_ID": {"type": "TEXT", "index": 3, "name": "PATIENT_ID", "comment": null}, "ENCOUNTER_END_DATE": {"type": "DATE", "index": 4, "name": "ENCOUNTER_END_DATE", "comment": null}, "FACILITY_NPI": {"type": "TEXT", "index": 5, "name": "FACILITY_NPI", "comment": null}, "PRIMARY_DIAGNOSIS_CODE_TYPE": {"type": "TEXT", "index": 6, "name": "PRIMARY_DIAGNOSIS_CODE_TYPE", "comment": null}, "PRIMARY_DIAGNOSIS_CODE": {"type": "TEXT", "index": 7, "name": "PRIMARY_DIAGNOSIS_CODE", "comment": null}, "PRIMARY_DIAGNOSIS_DESCRIPTION": {"type": "TEXT", "index": 8, "name": "PRIMARY_DIAGNOSIS_DESCRIPTION", "comment": null}, "PAID_AMOUNT": {"type": "NUMBER", "index": 9, "name": "PAID_AMOUNT", "comment": null}, "ALLOWED_AMOUNT": {"type": "NUMBER", "index": 10, "name": "ALLOWED_AMOUNT", "comment": null}, "CHARGE_AMOUNT": {"type": "NUMBER", "index": 11, "name": "CHARGE_AMOUNT", "comment": null}, "EDCNNPA": {"type": "FLOAT", "index": 12, "name": "EDCNNPA", "comment": null}, "EDCNPA": {"type": "FLOAT", "index": 13, "name": "EDCNPA", "comment": null}, "EPCT": {"type": "FLOAT", "index": 14, "name": "EPCT", "comment": null}, "NONER": {"type": "FLOAT", "index": 15, "name": "NONER", "comment": null}, "INJURY": {"type": "NUMBER", "index": 16, "name": "INJURY", "comment": null}, "PSYCH": {"type": "NUMBER", "index": 17, "name": "PSYCH", "comment": null}, "ALCOHOL": {"type": "NUMBER", "index": 18, "name": "ALCOHOL", "comment": null}, "DRUG": {"type": "NUMBER", "index": 19, "name": "DRUG", "comment": null}, "ED_CLASSIFICATION_CAPTURE": {"type": "NUMBER", "index": 20, "name": "ED_CLASSIFICATION_CAPTURE", "comment": null}, "CLASSIFICATION": {"type": "TEXT", "index": 21, "name": "CLASSIFICATION", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-12-13 23:01UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.ed_classification__int_filter_encounter_with_classification"}, "model.the_tuva_project.core__stg_claims_pharmacy_claim": {"metadata": {"type": "VIEW", "schema": "CORE", "name": "_STG_CLAIMS_PHARMACY_CLAIM", "database": "DEVFORREST", "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__outpatient_rehab_professional": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_OUTPATIENT_REHAB_PROFESSIONAL", "database": "DEVFORREST", "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-11-16 16:18UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "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.service_category__combined_professional": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_COMBINED_PROFESSIONAL", "database": "DEVFORREST", "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": 132997.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 654848.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-11-16 16:19UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "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.insights__trend_sum_amount_by_claim_type": {"metadata": {"type": "BASE TABLE", "schema": "INSIGHTS", "name": "TREND_SUM_AMOUNT_BY_CLAIM_TYPE", "database": "DEVFORREST", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"YEAR_MONTH": {"type": "TEXT", "index": 1, "name": "YEAR_MONTH", "comment": null}, "CLAIM_TYPE": {"type": "TEXT", "index": 2, "name": "CLAIM_TYPE", "comment": null}, "TOTAL_PAID_AMOUNT": {"type": "NUMBER", "index": 3, "name": "TOTAL_PAID_AMOUNT", "comment": null}, "TOTAL_PAID_AMOUNT_CHANGE": {"type": "NUMBER", "index": 4, "name": "TOTAL_PAID_AMOUNT_CHANGE", "comment": null}, "TOTAL_PAID_AMOUNT_PERCENT_CHANGE": {"type": "NUMBER", "index": 5, "name": "TOTAL_PAID_AMOUNT_PERCENT_CHANGE", "comment": null}, "TOTAL_ALLOWED_AMOUNT": {"type": "NUMBER", "index": 6, "name": "TOTAL_ALLOWED_AMOUNT", "comment": null}, "TOTAL_ALLOWED_AMOUNT_CHANGE": {"type": "NUMBER", "index": 7, "name": "TOTAL_ALLOWED_AMOUNT_CHANGE", "comment": null}, "TOTAL_ALLOWED_AMOUNT_PERCENT_CHANGE": {"type": "NUMBER", "index": 8, "name": "TOTAL_ALLOWED_AMOUNT_PERCENT_CHANGE", "comment": null}, "TOTAL_CHARGE_AMOUNT": {"type": "NUMBER", "index": 9, "name": "TOTAL_CHARGE_AMOUNT", "comment": null}, "TOTAL_CHARGE_AMOUNT_CHANGE": {"type": "NUMBER", "index": 10, "name": "TOTAL_CHARGE_AMOUNT_CHANGE", "comment": null}, "TOTAL_CHARGE_AMOUNT_PERCENT_CHANGE": {"type": "NUMBER", "index": 11, "name": "TOTAL_CHARGE_AMOUNT_PERCENT_CHANGE", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 124.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 10240.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-11-16 16:19UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.insights__trend_sum_amount_by_claim_type"}, "seed.the_tuva_project.terminology__bill_type": {"metadata": {"type": "BASE TABLE", "schema": "TERMINOLOGY", "name": "BILL_TYPE", "database": "DEVFORREST", "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-12-13 23:01UTC", "include": true, "description": "The timestamp for last update/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.cms_hcc__int_disease_interaction_factors": {"metadata": {"type": "BASE TABLE", "schema": "CMS_HCC", "name": "_INT_DISEASE_INTERACTION_FACTORS", "database": "DEVFORREST", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"PATIENT_ID": {"type": "TEXT", "index": 1, "name": "PATIENT_ID", "comment": null}, "HCC_CODE_1": {"type": "TEXT", "index": 2, "name": "HCC_CODE_1", "comment": null}, "HCC_CODE_2": {"type": "TEXT", "index": 3, "name": "HCC_CODE_2", "comment": null}, "DESCRIPTION": {"type": "TEXT", "index": 4, "name": "DESCRIPTION", "comment": null}, "COEFFICIENT": {"type": "NUMBER", "index": 5, "name": "COEFFICIENT", "comment": null}, "FACTOR_TYPE": {"type": "TEXT", "index": 6, "name": "FACTOR_TYPE", "comment": null}, "MODEL_VERSION": {"type": "TEXT", "index": 7, "name": "MODEL_VERSION", "comment": null}, "PAYMENT_YEAR": {"type": "NUMBER", "index": 8, "name": "PAYMENT_YEAR", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 9, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-11-16 16:19UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "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.readmissions__potentially_planned_ccs_procedure_category": {"metadata": {"type": "BASE TABLE", "schema": "READMISSIONS", "name": "_VALUE_SET_POTENTIALLY_PLANNED_CCS_PROCEDURE_CATEGORY", "database": "DEVFORREST", "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-12-13 23:01UTC", "include": true, "description": "The timestamp for last update/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"}, "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": "DEVFORREST", "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-12-13 23:01UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.the_tuva_project.readmissions__acute_diagnosis_icd_10_cm"}, "model.the_tuva_project.readmissions__readmission_summary": {"metadata": {"type": "BASE TABLE", "schema": "READMISSIONS", "name": "READMISSION_SUMMARY", "database": "DEVFORREST", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"ENCOUNTER_ID": {"type": "TEXT", "index": 1, "name": "ENCOUNTER_ID", "comment": null}, "PATIENT_ID": {"type": "TEXT", "index": 2, "name": "PATIENT_ID", "comment": null}, "ADMIT_DATE": {"type": "DATE", "index": 3, "name": "ADMIT_DATE", "comment": null}, "DISCHARGE_DATE": {"type": "DATE", "index": 4, "name": "DISCHARGE_DATE", "comment": null}, "DISCHARGE_DISPOSITION_CODE": {"type": "TEXT", "index": 5, "name": "DISCHARGE_DISPOSITION_CODE", "comment": null}, "FACILITY_NPI": {"type": "TEXT", "index": 6, "name": "FACILITY_NPI", "comment": null}, "MS_DRG_CODE": {"type": "TEXT", "index": 7, "name": "MS_DRG_CODE", "comment": null}, "PAID_AMOUNT": {"type": "NUMBER", "index": 8, "name": "PAID_AMOUNT", "comment": null}, "LENGTH_OF_STAY": {"type": "NUMBER", "index": 9, "name": "LENGTH_OF_STAY", "comment": null}, "INDEX_ADMISSION_FLAG": {"type": "NUMBER", "index": 10, "name": "INDEX_ADMISSION_FLAG", "comment": null}, "PLANNED_FLAG": {"type": "NUMBER", "index": 11, "name": "PLANNED_FLAG", "comment": null}, "SPECIALTY_COHORT": {"type": "TEXT", "index": 12, "name": "SPECIALTY_COHORT", "comment": null}, "DIED_FLAG": {"type": "NUMBER", "index": 13, "name": "DIED_FLAG", "comment": null}, "DIAGNOSIS_CCS": {"type": "TEXT", "index": 14, "name": "DIAGNOSIS_CCS", "comment": null}, "HAD_READMISSION_FLAG": {"type": "NUMBER", "index": 15, "name": "HAD_READMISSION_FLAG", "comment": null}, "DAYS_TO_READMIT": {"type": "NUMBER", "index": 16, "name": "DAYS_TO_READMIT", "comment": null}, "READMIT_30_FLAG": {"type": "NUMBER", "index": 17, "name": "READMIT_30_FLAG", "comment": null}, "UNPLANNED_READMIT_30_FLAG": {"type": "NUMBER", "index": 18, "name": "UNPLANNED_READMIT_30_FLAG", "comment": null}, "READMISSION_ENCOUNTER_ID": {"type": "TEXT", "index": 19, "name": "READMISSION_ENCOUNTER_ID", "comment": null}, "READMISSION_ADMIT_DATE": {"type": "DATE", "index": 20, "name": "READMISSION_ADMIT_DATE", "comment": null}, "READMISSION_DISCHARGE_DATE": {"type": "DATE", "index": 21, "name": "READMISSION_DISCHARGE_DATE", "comment": null}, "READMISSION_DISCHARGE_DISPOSITION_CODE": {"type": "TEXT", "index": 22, "name": "READMISSION_DISCHARGE_DISPOSITION_CODE", "comment": null}, "READMISSION_FACILITY": {"type": "TEXT", "index": 23, "name": "READMISSION_FACILITY", "comment": null}, "READMISSION_MS_DRG": {"type": "TEXT", "index": 24, "name": "READMISSION_MS_DRG", "comment": null}, "READMISSION_LENGTH_OF_STAY": {"type": "NUMBER", "index": 25, "name": "READMISSION_LENGTH_OF_STAY", "comment": null}, "READMISSION_INDEX_ADMISSION_FLAG": {"type": "NUMBER", "index": 26, "name": "READMISSION_INDEX_ADMISSION_FLAG", "comment": null}, "READMISSION_PLANNED_FLAG": {"type": "NUMBER", "index": 27, "name": "READMISSION_PLANNED_FLAG", "comment": null}, "READMISSION_SPECIALTY_COHORT": {"type": "TEXT", "index": 28, "name": "READMISSION_SPECIALTY_COHORT", "comment": null}, "READMISSION_DIED_FLAG": {"type": "NUMBER", "index": 29, "name": "READMISSION_DIED_FLAG", "comment": null}, "READMISSION_DIAGNOSIS_CCS": {"type": "TEXT", "index": 30, "name": "READMISSION_DIAGNOSIS_CCS", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 31, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 137.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 90624.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-11-16 16:19UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "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"}, "seed.the_tuva_project.ed_classification__johnston_icd10": {"metadata": {"type": "BASE TABLE", "schema": "ED_CLASSIFICATION", "name": "_VALUE_SET_JOHNSTON_ICD10", "database": "DEVFORREST", "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-12-13 23:01UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.the_tuva_project.ed_classification__johnston_icd10"}, "model.the_tuva_project.chronic_conditions__cms_chronic_conditions_all": {"metadata": {"type": "BASE TABLE", "schema": "CHRONIC_CONDITIONS", "name": "_INT_CMS_CHRONIC_CONDITION_ALL", "database": "DEVFORREST", "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": 75230.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 1325568.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-11-16 16:19UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "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.terminology__code_type": {"metadata": {"type": "BASE TABLE", "schema": "TERMINOLOGY", "name": "CODE_TYPE", "database": "DEVFORREST", "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-12-13 23:01UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.the_tuva_project.terminology__code_type"}, "seed.the_tuva_project.quality_measures__value_sets": {"metadata": {"type": "BASE TABLE", "schema": "QUALITY_MEASURES", "name": "_VALUE_SET_CODES", "database": "DEVFORREST", "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": 4518.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 49152.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-12-13 23:01UTC", "include": true, "description": "The timestamp for last update/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.data_profiling__test_detail_stage_pharmacy_claim": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_TEST_DETAIL_STAGE_PHARMACY_CLAIM", "database": "DEVFORREST", "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": 20835.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 591872.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-11-16 16:18UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "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.data_profiling__test_result_stage_medical_claim": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_TEST_RESULT_STAGE_MEDICAL_CLAIM", "database": "DEVFORREST", "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": 17.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-11-16 16:19UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.data_profiling__test_result_stage_medical_claim"}, "model.the_tuva_project.insights__count_claim_by_date_column": {"metadata": {"type": "BASE TABLE", "schema": "INSIGHTS", "name": "COUNT_CLAIM_BY_DATE_COLUMN", "database": "DEVFORREST", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"YEAR_MONTH": {"type": "NUMBER", "index": 1, "name": "YEAR_MONTH", "comment": null}, "MEMBER_MONTHS": {"type": "NUMBER", "index": 2, "name": "MEMBER_MONTHS", "comment": null}, "CLAIM_START_DATE": {"type": "NUMBER", "index": 3, "name": "CLAIM_START_DATE", "comment": null}, "CLAIM_END_DATE": {"type": "NUMBER", "index": 4, "name": "CLAIM_END_DATE", "comment": null}, "ADMISSION_DATE": {"type": "NUMBER", "index": 5, "name": "ADMISSION_DATE", "comment": null}, "DISCHARGE_DATE": {"type": "NUMBER", "index": 6, "name": "DISCHARGE_DATE", "comment": null}, "MEDICAL_PAID_DATE": {"type": "NUMBER", "index": 7, "name": "MEDICAL_PAID_DATE", "comment": null}, "DISPENSING_DATE": {"type": "NUMBER", "index": 8, "name": "DISPENSING_DATE", "comment": null}, "PHARMACY_PAID_DATE": {"type": "NUMBER", "index": 9, "name": "PHARMACY_PAID_DATE", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 48.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 14336.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-11-16 16:19UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.insights__count_claim_by_date_column"}, "model.the_tuva_project.service_category__dq_input_layer_tests": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_DQ_INPUT_LAYER_TESTS", "database": "DEVFORREST", "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": 1397.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 9216.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-11-16 16:18UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "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.quality_measures__int_nqf0034_exclude_hospice_palliative": {"metadata": {"type": "BASE TABLE", "schema": "QUALITY_MEASURES", "name": "_INT_NQF0034_EXCLUDE_HOSPICE_PALLIATIVE", "database": "DEVFORREST", "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-11-16 16:19UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.quality_measures__int_nqf0034_exclude_hospice_palliative"}, "model.the_tuva_project.core__stg_claims_medical_claim": {"metadata": {"type": "VIEW", "schema": "CORE", "name": "_STG_CLAIMS_MEDICAL_CLAIM", "database": "DEVFORREST", "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.ccsr__dx_vertical_pivot": {"metadata": {"type": "BASE TABLE", "schema": "CCSR", "name": "DX_VERTICAL_PIVOT", "database": "DEVFORREST", "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-12-13 23:01UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.ccsr__dx_vertical_pivot"}, "seed.the_tuva_project.readmissions__exclusion_ccs_diagnosis_category": {"metadata": {"type": "BASE TABLE", "schema": "READMISSIONS", "name": "_VALUE_SET_EXCLUSION_CCS_DIAGNOSIS_CATEGORY", "database": "DEVFORREST", "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-12-13 23:01UTC", "include": true, "description": "The timestamp for last update/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.ed_classification__summary": {"metadata": {"type": "BASE TABLE", "schema": "ED_CLASSIFICATION", "name": "SUMMARY", "database": "DEVFORREST", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"ENCOUNTER_ID": {"type": "TEXT", "index": 1, "name": "ENCOUNTER_ID", "comment": null}, "ED_CLASSIFICATION_DESCRIPTION": {"type": "TEXT", "index": 2, "name": "ED_CLASSIFICATION_DESCRIPTION", "comment": null}, "ED_CLASSIFICATION_ORDER": {"type": "NUMBER", "index": 3, "name": "ED_CLASSIFICATION_ORDER", "comment": null}, "PATIENT_ID": {"type": "TEXT", "index": 4, "name": "PATIENT_ID", "comment": null}, "ENCOUNTER_END_DATE": {"type": "DATE", "index": 5, "name": "ENCOUNTER_END_DATE", "comment": null}, "YEAR_MONTH": {"type": "TEXT", "index": 6, "name": "YEAR_MONTH", "comment": null}, "PRIMARY_DIAGNOSIS_CODE": {"type": "TEXT", "index": 7, "name": "PRIMARY_DIAGNOSIS_CODE", "comment": null}, "PRIMARY_DIAGNOSIS_DESCRIPTION": {"type": "TEXT", "index": 8, "name": "PRIMARY_DIAGNOSIS_DESCRIPTION", "comment": null}, "PRIMARY_CCSR_CODE": {"type": "TEXT", "index": 9, "name": "PRIMARY_CCSR_CODE", "comment": null}, "PRIMARY_CCSR_DESCRIPTION": {"type": "TEXT", "index": 10, "name": "PRIMARY_CCSR_DESCRIPTION", "comment": null}, "PAID_AMOUNT": {"type": "NUMBER", "index": 11, "name": "PAID_AMOUNT", "comment": null}, "ALLOWED_AMOUNT": {"type": "NUMBER", "index": 12, "name": "ALLOWED_AMOUNT", "comment": null}, "CHARGE_AMOUNT": {"type": "NUMBER", "index": 13, "name": "CHARGE_AMOUNT", "comment": null}, "FACILITY_NPI": {"type": "TEXT", "index": 14, "name": "FACILITY_NPI", "comment": null}, "FACILITY_NAME": {"type": "TEXT", "index": 15, "name": "FACILITY_NAME", "comment": null}, "FACILITY_STATE": {"type": "TEXT", "index": 16, "name": "FACILITY_STATE", "comment": null}, "FACILITY_CITY": {"type": "TEXT", "index": 17, "name": "FACILITY_CITY", "comment": null}, "FACILITY_ZIP_CODE": {"type": "TEXT", "index": 18, "name": "FACILITY_ZIP_CODE", "comment": null}, "FACILITY_LATITUDE": {"type": "TEXT", "index": 19, "name": "FACILITY_LATITUDE", "comment": null}, "FACILITY_LONGITUDE": {"type": "TEXT", "index": 20, "name": "FACILITY_LONGITUDE", "comment": null}, "PATIENT_SEX": {"type": "TEXT", "index": 21, "name": "PATIENT_SEX", "comment": null}, "PATIENT_AGE": {"type": "NUMBER", "index": 22, "name": "PATIENT_AGE", "comment": null}, "PATIENT_ZIP_CODE": {"type": "TEXT", "index": 23, "name": "PATIENT_ZIP_CODE", "comment": null}, "PATIENT_LATITUDE": {"type": "FLOAT", "index": 24, "name": "PATIENT_LATITUDE", "comment": null}, "PATIENT_LONGITUDE": {"type": "FLOAT", "index": 25, "name": "PATIENT_LONGITUDE", "comment": null}, "PATIENT_RACE": {"type": "TEXT", "index": 26, "name": "PATIENT_RACE", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 493.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 109568.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-11-16 16:19UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.ed_classification__summary"}, "model.the_tuva_project.cms_hcc__int_demographic_factors": {"metadata": {"type": "BASE TABLE", "schema": "CMS_HCC", "name": "_INT_DEMOGRAPHIC_FACTORS", "database": "DEVFORREST", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"PATIENT_ID": {"type": "TEXT", "index": 1, "name": "PATIENT_ID", "comment": null}, "ENROLLMENT_STATUS": {"type": "TEXT", "index": 2, "name": "ENROLLMENT_STATUS", "comment": null}, "GENDER": {"type": "TEXT", "index": 3, "name": "GENDER", "comment": null}, "AGE_GROUP": {"type": "TEXT", "index": 4, "name": "AGE_GROUP", "comment": null}, "MEDICAID_STATUS": {"type": "TEXT", "index": 5, "name": "MEDICAID_STATUS", "comment": null}, "DUAL_STATUS": {"type": "TEXT", "index": 6, "name": "DUAL_STATUS", "comment": null}, "OREC": {"type": "TEXT", "index": 7, "name": "OREC", "comment": null}, "INSTITUTIONAL_STATUS": {"type": "TEXT", "index": 8, "name": "INSTITUTIONAL_STATUS", "comment": null}, "ENROLLMENT_STATUS_DEFAULT": {"type": "BOOLEAN", "index": 9, "name": "ENROLLMENT_STATUS_DEFAULT", "comment": null}, "MEDICAID_DUAL_STATUS_DEFAULT": {"type": "BOOLEAN", "index": 10, "name": "MEDICAID_DUAL_STATUS_DEFAULT", "comment": null}, "OREC_DEFAULT": {"type": "BOOLEAN", "index": 11, "name": "OREC_DEFAULT", "comment": null}, "INSTITUTIONAL_STATUS_DEFAULT": {"type": "BOOLEAN", "index": 12, "name": "INSTITUTIONAL_STATUS_DEFAULT", "comment": null}, "COEFFICIENT": {"type": "NUMBER", "index": 13, "name": "COEFFICIENT", "comment": null}, "FACTOR_TYPE": {"type": "TEXT", "index": 14, "name": "FACTOR_TYPE", "comment": null}, "MODEL_VERSION": {"type": "TEXT", "index": 15, "name": "MODEL_VERSION", "comment": null}, "PAYMENT_YEAR": {"type": "NUMBER", "index": 16, "name": "PAYMENT_YEAR", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 17, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-11-16 16:18UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "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.core__pharmacy_claim": {"metadata": {"type": "BASE TABLE", "schema": "CORE", "name": "PHARMACY_CLAIM", "database": "DEVFORREST", "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": 6522.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 219136.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-11-16 16:18UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "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__use_case": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "USE_CASE", "database": "DEVFORREST", "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": 13.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-11-16 16:19UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "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.ed_classification__johnston_icd9": {"metadata": {"type": "BASE TABLE", "schema": "ED_CLASSIFICATION", "name": "_VALUE_SET_JOHNSTON_ICD9", "database": "DEVFORREST", "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-12-13 23:01UTC", "include": true, "description": "The timestamp for last update/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.insights__trend_count_claim_by_service_category": {"metadata": {"type": "BASE TABLE", "schema": "INSIGHTS", "name": "TREND_COUNT_CLAIM_BY_SERVICE_CATEGORY", "database": "DEVFORREST", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"YEAR_MONTH": {"type": "TEXT", "index": 1, "name": "YEAR_MONTH", "comment": null}, "SERVICE_CATEGORY": {"type": "TEXT", "index": 2, "name": "SERVICE_CATEGORY", "comment": null}, "DISTINCT_CLAIM_COUNT": {"type": "NUMBER", "index": 3, "name": "DISTINCT_CLAIM_COUNT", "comment": null}, "DISTINCT_CLAIM_COUNT_CHANGE": {"type": "NUMBER", "index": 4, "name": "DISTINCT_CLAIM_COUNT_CHANGE", "comment": null}, "DISTINCT_CLAIM_PERCENTAGE_CHANGE": {"type": "NUMBER", "index": 5, "name": "DISTINCT_CLAIM_PERCENTAGE_CHANGE", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 721.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-11-16 16:19UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.insights__trend_count_claim_by_service_category"}, "model.the_tuva_project.emergency_department__int_encounter_start_and_end_dates": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_EMERGENCY_DEPARTMENT_ENCOUNTER_START_AND_END_DATES", "database": "DEVFORREST", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"PATIENT_ID": {"type": "TEXT", "index": 1, "name": "PATIENT_ID", "comment": null}, "ENCOUNTER_ID": {"type": "TEXT", "index": 2, "name": "ENCOUNTER_ID", "comment": null}, "ENCOUNTER_START_DATE": {"type": "DATE", "index": 3, "name": "ENCOUNTER_START_DATE", "comment": null}, "ENCOUNTER_END_DATE": {"type": "DATE", "index": 4, "name": "ENCOUNTER_END_DATE", "comment": null}, "DETERMINED_ENCOUNTER_START_DATE": {"type": "DATE", "index": 5, "name": "DETERMINED_ENCOUNTER_START_DATE", "comment": null}, "DETERMINED_ENCOUNTER_END_DATE": {"type": "DATE", "index": 6, "name": "DETERMINED_ENCOUNTER_END_DATE", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 7, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 536.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 10752.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-11-16 16:19UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.emergency_department__int_encounter_start_and_end_dates"}, "model.the_tuva_project.chronic_conditions__cms_chronic_conditions_oud": {"metadata": {"type": "BASE TABLE", "schema": "CHRONIC_CONDITIONS", "name": "_INT_CMS_CHRONIC_CONDITION_OUD", "database": "DEVFORREST", "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": 123.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 27136.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-11-16 16:19UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "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.financial_pmpm__service_category_1_allowed_pivot": {"metadata": {"type": "BASE TABLE", "schema": "FINANCIAL_PMPM", "name": "_INT_SERVICE_CATEGORY_1_ALLOWED_PIVOT", "database": "DEVFORREST", "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": 19525.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 375808.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-11-16 16:19UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "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__medicare_orec": {"metadata": {"type": "BASE TABLE", "schema": "TERMINOLOGY", "name": "MEDICARE_OREC", "database": "DEVFORREST", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"ORIGINAL_REASON_ENTITLEMENT_CODE": {"type": "TEXT", "index": 1, "name": "ORIGINAL_REASON_ENTITLEMENT_CODE", "comment": null}, "ORIGINAL_REASON_ENTITLEMENT_DESCRIPTION": {"type": "TEXT", "index": 2, "name": "ORIGINAL_REASON_ENTITLEMENT_DESCRIPTION", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 4.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 1536.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-12-13 23:01UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.the_tuva_project.terminology__medicare_orec"}, "model.the_tuva_project.service_category__home_health_professional": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_HOME_HEALTH_PROFESSIONAL", "database": "DEVFORREST", "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": 2045.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 10752.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-11-16 16:18UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.service_category__home_health_professional"}, "seed.the_tuva_project.readmissions__icd_10_pcs_to_ccs": {"metadata": {"type": "BASE TABLE", "schema": "READMISSIONS", "name": "_VALUE_SET_ICD_10_PCS_TO_CCS", "database": "DEVFORREST", "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-12-13 23:01UTC", "include": true, "description": "The timestamp for last update/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.data_profiling__claim_type_unmapped": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_CLAIM_TYPE_UNMAPPED", "database": "DEVFORREST", "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-11-16 16:18UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "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__stg_clinical_encounter": {"metadata": {"type": "VIEW", "schema": "CORE", "name": "_STG_CLINICAL_ENCOUNTER", "database": "DEVFORREST", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"ENCOUNTER_ID": {"type": "TEXT", "index": 1, "name": "ENCOUNTER_ID", "comment": null}, "PATIENT_ID": {"type": "TEXT", "index": 2, "name": "PATIENT_ID", "comment": null}, "ENCOUNTER_TYPE": {"type": "TEXT", "index": 3, "name": "ENCOUNTER_TYPE", "comment": null}, "ENCOUNTER_START_DATE": {"type": "DATE", "index": 4, "name": "ENCOUNTER_START_DATE", "comment": null}, "ENCOUNTER_END_DATE": {"type": "DATE", "index": 5, "name": "ENCOUNTER_END_DATE", "comment": null}, "LENGTH_OF_STAY": {"type": "NUMBER", "index": 6, "name": "LENGTH_OF_STAY", "comment": null}, "ADMIT_SOURCE_CODE": {"type": "TEXT", "index": 7, "name": "ADMIT_SOURCE_CODE", "comment": null}, "ADMIT_SOURCE_DESCRIPTION": {"type": "TEXT", "index": 8, "name": "ADMIT_SOURCE_DESCRIPTION", "comment": null}, "ADMIT_TYPE_CODE": {"type": "TEXT", "index": 9, "name": "ADMIT_TYPE_CODE", "comment": null}, "ADMIT_TYPE_DESCRIPTION": {"type": "TEXT", "index": 10, "name": "ADMIT_TYPE_DESCRIPTION", "comment": null}, "DISCHARGE_DISPOSITION_CODE": {"type": "TEXT", "index": 11, "name": "DISCHARGE_DISPOSITION_CODE", "comment": null}, "DISCHARGE_DISPOSITION_DESCRIPTION": {"type": "TEXT", "index": 12, "name": "DISCHARGE_DISPOSITION_DESCRIPTION", "comment": null}, "ATTENDING_PROVIDER_ID": {"type": "TEXT", "index": 13, "name": "ATTENDING_PROVIDER_ID", "comment": null}, "FACILITY_NPI": {"type": "TEXT", "index": 14, "name": "FACILITY_NPI", "comment": null}, "PRIMARY_DIAGNOSIS_CODE_TYPE": {"type": "TEXT", "index": 15, "name": "PRIMARY_DIAGNOSIS_CODE_TYPE", "comment": null}, "PRIMARY_DIAGNOSIS_CODE": {"type": "TEXT", "index": 16, "name": "PRIMARY_DIAGNOSIS_CODE", "comment": null}, "PRIMARY_DIAGNOSIS_DESCRIPTION": {"type": "TEXT", "index": 17, "name": "PRIMARY_DIAGNOSIS_DESCRIPTION", "comment": null}, "MS_DRG_CODE": {"type": "TEXT", "index": 18, "name": "MS_DRG_CODE", "comment": null}, "MS_DRG_DESCRIPTION": {"type": "TEXT", "index": 19, "name": "MS_DRG_DESCRIPTION", "comment": null}, "APR_DRG_CODE": {"type": "TEXT", "index": 20, "name": "APR_DRG_CODE", "comment": null}, "APR_DRG_DESCRIPTION": {"type": "TEXT", "index": 21, "name": "APR_DRG_DESCRIPTION", "comment": null}, "PAID_AMOUNT": {"type": "NUMBER", "index": 22, "name": "PAID_AMOUNT", "comment": null}, "ALLOWED_AMOUNT": {"type": "NUMBER", "index": 23, "name": "ALLOWED_AMOUNT", "comment": null}, "CHARGE_AMOUNT": {"type": "NUMBER", "index": 24, "name": "CHARGE_AMOUNT", "comment": null}, "DATA_SOURCE": {"type": "TEXT", "index": 25, "name": "DATA_SOURCE", "comment": null}, "TUVA_LAST_RUN": {"type": "TIMESTAMP_NTZ", "index": 26, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.core__stg_clinical_encounter"}, "model.the_tuva_project.service_category__dme_professional": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_DME_PROFESSIONAL", "database": "DEVFORREST", "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": 891.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 7168.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-11-16 16:18UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "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.ccsr__long_condition_category": {"metadata": {"type": "BASE TABLE", "schema": "CCSR", "name": "LONG_CONDITION_CATEGORY", "database": "DEVFORREST", "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": 229084.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 12087808.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-11-16 16:19UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "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__lab_institutional": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_LAB_INSTITUTIONAL", "database": "DEVFORREST", "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": 1037.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 7168.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-11-16 16:18UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "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.insights__count_claim_by_claim_type": {"metadata": {"type": "BASE TABLE", "schema": "INSIGHTS", "name": "COUNT_CLAIM_BY_CLAIM_TYPE", "database": "DEVFORREST", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"CLAIM_TYPE": {"type": "TEXT", "index": 1, "name": "CLAIM_TYPE", "comment": null}, "DISTINCT_CLAIM_COUNT": {"type": "NUMBER", "index": 2, "name": "DISTINCT_CLAIM_COUNT", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 3.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-11-16 16:19UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.insights__count_claim_by_claim_type"}, "model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_wide": {"metadata": {"type": "BASE TABLE", "schema": "CHRONIC_CONDITIONS", "name": "TUVA_CHRONIC_CONDITIONS_WIDE", "database": "DEVFORREST", "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": 1000.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 107008.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-11-16 16:19UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "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_denominator": {"metadata": {"type": "BASE TABLE", "schema": "QUALITY_MEASURES", "name": "_INT_NQF2372_DENOMINATOR", "database": "DEVFORREST", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"PATIENT_ID": {"type": "TEXT", "index": 1, "name": "PATIENT_ID", "comment": null}, "AGE": {"type": "NUMBER", "index": 2, "name": "AGE", "comment": null}, "PERFORMANCE_PERIOD_BEGIN": {"type": "DATE", "index": 3, "name": "PERFORMANCE_PERIOD_BEGIN", "comment": null}, "PERFORMANCE_PERIOD_END": {"type": "DATE", "index": 4, "name": "PERFORMANCE_PERIOD_END", "comment": null}, "PERFORMANCE_PERIOD_LOOKBACK": {"type": "DATE", "index": 5, "name": "PERFORMANCE_PERIOD_LOOKBACK", "comment": null}, "MEASURE_ID": {"type": "TEXT", "index": 6, "name": "MEASURE_ID", "comment": null}, "MEASURE_NAME": {"type": "TEXT", "index": 7, "name": "MEASURE_NAME", "comment": null}, "MEASURE_VERSION": {"type": "TEXT", "index": 8, "name": "MEASURE_VERSION", "comment": null}, "DENOMINATOR_FLAG": {"type": "NUMBER", "index": 9, "name": "DENOMINATOR_FLAG", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 10, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-11-16 16:19UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "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.readmissions__surgery_gynecology_cohort": {"metadata": {"type": "BASE TABLE", "schema": "READMISSIONS", "name": "_VALUE_SET_SURGERY_GYNECOLOGY_COHORT", "database": "DEVFORREST", "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-12-13 23:01UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.the_tuva_project.readmissions__surgery_gynecology_cohort"}, "model.the_tuva_project.service_category__ambulatory_surgery_professional": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_AMBULATORY_SURGERY_PROFESSIONAL", "database": "DEVFORREST", "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": 2624.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 14848.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-11-16 16:18UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "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.acute_inpatient__encounter_start_and_end_dates": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_INT_ACUTE_INPATIENT_ENCOUNTER_START_AND_END_DATES", "database": "DEVFORREST", "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": 223.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-11-16 16:19UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.acute_inpatient__encounter_start_and_end_dates"}, "seed.the_tuva_project.terminology__ssa_fips_state": {"metadata": {"type": "BASE TABLE", "schema": "TERMINOLOGY", "name": "SSA_FIPS_STATE", "database": "DEVFORREST", "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-12-13 23:01UTC", "include": true, "description": "The timestamp for last update/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.quality_measures__int_nqf2372_exclude_dementia": {"metadata": {"type": "BASE TABLE", "schema": "QUALITY_MEASURES", "name": "_INT_NQF2372_EXCLUDE_DEMENTIA", "database": "DEVFORREST", "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-11-16 16:19UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "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"}, "seed.the_tuva_project.cms_hcc__disabled_interaction_factors": {"metadata": {"type": "BASE TABLE", "schema": "CMS_HCC", "name": "_VALUE_SET_DISABLED_INTERACTION_FACTORS", "database": "DEVFORREST", "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-12-13 23:00UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.the_tuva_project.cms_hcc__disabled_interaction_factors"}, "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": "DEVFORREST", "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-12-13 23:01UTC", "include": true, "description": "The timestamp for last update/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": "DEVFORREST", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"ENCOUNTER_ID": {"type": "TEXT", "index": 1, "name": "ENCOUNTER_ID", "comment": null}, "DIAGNOSIS_CCS": {"type": "TEXT", "index": 2, "name": "DIAGNOSIS_CCS", "comment": null}, "DISQUALIFIED_ENCOUNTER_FLAG": {"type": "NUMBER", "index": 3, "name": "DISQUALIFIED_ENCOUNTER_FLAG", "comment": null}, "MISSING_ADMIT_DATE_FLAG": {"type": "NUMBER", "index": 4, "name": "MISSING_ADMIT_DATE_FLAG", "comment": null}, "MISSING_DISCHARGE_DATE_FLAG": {"type": "NUMBER", "index": 5, "name": "MISSING_DISCHARGE_DATE_FLAG", "comment": null}, "ADMIT_AFTER_DISCHARGE_FLAG": {"type": "NUMBER", "index": 6, "name": "ADMIT_AFTER_DISCHARGE_FLAG", "comment": null}, "MISSING_DISCHARGE_DISPOSITION_CODE_FLAG": {"type": "NUMBER", "index": 7, "name": "MISSING_DISCHARGE_DISPOSITION_CODE_FLAG", "comment": null}, "INVALID_DISCHARGE_DISPOSITION_CODE_FLAG": {"type": "NUMBER", "index": 8, "name": "INVALID_DISCHARGE_DISPOSITION_CODE_FLAG", "comment": null}, "MISSING_PRIMARY_DIAGNOSIS_FLAG": {"type": "NUMBER", "index": 9, "name": "MISSING_PRIMARY_DIAGNOSIS_FLAG", "comment": null}, "INVALID_PRIMARY_DIAGNOSIS_CODE_FLAG": {"type": "NUMBER", "index": 10, "name": "INVALID_PRIMARY_DIAGNOSIS_CODE_FLAG", "comment": null}, "NO_DIAGNOSIS_CCS_FLAG": {"type": "NUMBER", "index": 11, "name": "NO_DIAGNOSIS_CCS_FLAG", "comment": null}, "OVERLAPS_WITH_ANOTHER_ENCOUNTER_FLAG": {"type": "NUMBER", "index": 12, "name": "OVERLAPS_WITH_ANOTHER_ENCOUNTER_FLAG", "comment": null}, "MISSING_MS_DRG_FLAG": {"type": "NUMBER", "index": 13, "name": "MISSING_MS_DRG_FLAG", "comment": null}, "INVALID_MS_DRG_FLAG": {"type": "NUMBER", "index": 14, "name": "INVALID_MS_DRG_FLAG", "comment": null}, "TUVA_LAST_RUN": {"type": "TEXT", "index": 15, "name": "TUVA_LAST_RUN", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.readmissions__encounter_data_quality"}, "model.the_tuva_project.readmissions__readmission_crude": {"metadata": {"type": "VIEW", "schema": "READMISSIONS", "name": "_INT_READMISSION_CRUDE", "database": "DEVFORREST", "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"}, "seed.the_tuva_project.terminology__loinc_deprecated_mapping": {"metadata": {"type": "BASE TABLE", "schema": "TERMINOLOGY", "name": "LOINC_DEPRECATED_MAPPING", "database": "DEVFORREST", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"LOINC": {"type": "TEXT", "index": 1, "name": "LOINC", "comment": null}, "MAP_TO": {"type": "TEXT", "index": 2, "name": "MAP_TO", "comment": null}, "COMMENT": {"type": "TEXT", "index": 3, "name": "COMMENT", "comment": null}, "FINAL_MAP_TO": {"type": "TEXT", "index": 4, "name": "FINAL_MAP_TO", "comment": null}, "ALL_COMMENTS": {"type": "TEXT", "index": 5, "name": "ALL_COMMENTS", "comment": null}, "DEPTH": {"type": "TEXT", "index": 6, "name": "DEPTH", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 4613.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 97280.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-12-13 23:01UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.the_tuva_project.terminology__loinc_deprecated_mapping"}, "seed.the_tuva_project.cms_hcc__adjustment_rates": {"metadata": {"type": "BASE TABLE", "schema": "CMS_HCC", "name": "_VALUE_SET_ADJUSTMENT_RATES", "database": "DEVFORREST", "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-12-13 23:00UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.the_tuva_project.cms_hcc__adjustment_rates"}, "seed.the_tuva_project.terminology__loinc": {"metadata": {"type": "BASE TABLE", "schema": "TERMINOLOGY", "name": "LOINC", "database": "DEVFORREST", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"LOINC": {"type": "TEXT", "index": 1, "name": "LOINC", "comment": null}, "SHORT_NAME": {"type": "TEXT", "index": 2, "name": "SHORT_NAME", "comment": null}, "LONG_COMMON_NAME": {"type": "TEXT", "index": 3, "name": "LONG_COMMON_NAME", "comment": null}, "COMPONENT": {"type": "TEXT", "index": 4, "name": "COMPONENT", "comment": null}, "PROPERTY": {"type": "TEXT", "index": 5, "name": "PROPERTY", "comment": null}, "TIME_ASPECT": {"type": "TEXT", "index": 6, "name": "TIME_ASPECT", "comment": null}, "SYSTEM": {"type": "TEXT", "index": 7, "name": "SYSTEM", "comment": null}, "SCALE_TYPE": {"type": "TEXT", "index": 8, "name": "SCALE_TYPE", "comment": null}, "METHOD_TYPE": {"type": "TEXT", "index": 9, "name": "METHOD_TYPE", "comment": null}, "CLASS_CODE": {"type": "TEXT", "index": 10, "name": "CLASS_CODE", "comment": null}, "CLASS_DESCRIPTION": {"type": "TEXT", "index": 11, "name": "CLASS_DESCRIPTION", "comment": null}, "CLASS_TYPE_CODE": {"type": "TEXT", "index": 12, "name": "CLASS_TYPE_CODE", "comment": null}, "CLASS_TYPE_DESCRIPTION": {"type": "TEXT", "index": 13, "name": "CLASS_TYPE_DESCRIPTION", "comment": null}, "EXTERNAL_COPYRIGHT_NOTICE": {"type": "TEXT", "index": 14, "name": "EXTERNAL_COPYRIGHT_NOTICE", "comment": null}, "STATUS": {"type": "TEXT", "index": 15, "name": "STATUS", "comment": null}, "VERSION_FIRST_RELEASED": {"type": "TEXT", "index": 16, "name": "VERSION_FIRST_RELEASED", "comment": null}, "VERSION_LAST_CHANGED": {"type": "TEXT", "index": 17, "name": "VERSION_LAST_CHANGED", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 101632.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 4118528.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-12-13 23:01UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.the_tuva_project.terminology__loinc"}, "model.the_tuva_project.quality_measures__int_nqf2372_numerator": {"metadata": {"type": "BASE TABLE", "schema": "QUALITY_MEASURES", "name": "_INT_NQF2372_NUMERATOR", "database": "DEVFORREST", "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-11-16 16:19UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.quality_measures__int_nqf2372_numerator"}, "seed.the_tuva_project.readmissions__always_planned_ccs_diagnosis_category": {"metadata": {"type": "BASE TABLE", "schema": "READMISSIONS", "name": "_VALUE_SET_ALWAYS_PLANNED_CCS_DIAGNOSIS_CATEGORY", "database": "DEVFORREST", "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-12-13 23:01UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.the_tuva_project.readmissions__always_planned_ccs_diagnosis_category"}, "model.the_tuva_project.quality_measures__int_nqf2372__frailty": {"metadata": {"type": "VIEW", "schema": "QUALITY_MEASURES", "name": "_INT_NQF2372__FRAILTY", "database": "DEVFORREST", "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}, "EXCLUSION_DATE": {"type": "DATE", "index": 4, "name": "EXCLUSION_DATE", "comment": null}, "EXCLUSION_REASON": {"type": "TEXT", "index": 5, "name": "EXCLUSION_REASON", "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.quality_measures__int_nqf2372__frailty"}, "model.the_tuva_project.quality_measures__int_nqf0034_denominator": {"metadata": {"type": "BASE TABLE", "schema": "QUALITY_MEASURES", "name": "_INT_NQF0034_DENOMINATOR", "database": "DEVFORREST", "comment": null, "owner": "ACCOUNTADMIN"}, "columns": {"PATIENT_ID": {"type": "TEXT", "index": 1, "name": "PATIENT_ID", "comment": null}, "MIN_AGE": {"type": "NUMBER", "index": 2, "name": "MIN_AGE", "comment": null}, "MAX_AGE": {"type": "NUMBER", "index": 3, "name": "MAX_AGE", "comment": null}, "QUALIFYING_TYPES": {"type": "TEXT", "index": 4, "name": "QUALIFYING_TYPES", "comment": null}}, "stats": {"row_count": {"id": "row_count", "label": "Row Count", "value": 0.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 0.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-11-16 16:19UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.quality_measures__int_nqf0034_denominator"}, "model.the_tuva_project.service_category__dq_multiple_service_categories_institutional": {"metadata": {"type": "BASE TABLE", "schema": "CLAIMS_PREPROCESSING", "name": "_DQ_MULTIPLE_SERVICE_CATEGORIES_INSTITUTIONAL", "database": "DEVFORREST", "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": 1.0, "include": true, "description": "An approximate count of rows in this table"}, "bytes": {"id": "bytes", "label": "Approximate Size", "value": 1536.0, "include": true, "description": "Approximate size of the table as reported by Snowflake"}, "last_modified": {"id": "last_modified", "label": "Last Modified", "value": "2023-11-16 16:19UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.the_tuva_project.service_category__dq_multiple_service_categories_institutional"}, "seed.input_layer.medical_claim_seed": {"metadata": {"type": "BASE TABLE", "schema": "_TUVA_SYNTHETIC", "name": "MEDICAL_CLAIM_SEED", "database": "DEVFORREST", "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-12-13 23:00UTC", "include": true, "description": "The timestamp for last update/change"}, "has_stats": {"id": "has_stats", "label": "Has Stats?", "value": true, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.input_layer.medical_claim_seed"}}, "sources": {}, "errors": null} \ No newline at end of file diff --git a/docs/manifest.json b/docs/manifest.json index 245a184b4..ae8e8934d 100644 --- a/docs/manifest.json +++ b/docs/manifest.json @@ -1 +1 @@ -{"metadata": {"dbt_schema_version": "https://schemas.getdbt.com/dbt/manifest/v7.json", "dbt_version": "1.3.1", "generated_at": "2023-11-29T23:39:06.348990Z", "invocation_id": "eb56e47d-e1e4-48f9-a904-10f11c7adbbb", "env": {}, "project_id": "c67fdb5d91230d67641e7c60c81d655e", "user_id": "e0288d5c-4d76-41ed-afd7-080af8fdeee9", "send_anonymous_usage_stats": true, "adapter_type": "snowflake"}, "nodes": {"model.input_layer.procedure": {"resource_type": "model", "depends_on": {"macros": ["macro.dbt.type_string"], "nodes": []}, "config": {"enabled": true, "alias": null, "schema": "input_layer", "database": "tuva", "tags": [], "meta": {}, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "bind": false, "post-hook": [], "pre-hook": []}, "database": "tuva", "schema": "input_layer", "fqn": ["input_layer", "procedure"], "unique_id": "model.input_layer.procedure", "raw_code": "select\n cast(null as {{ dbt.type_string() }} ) as procedure_id\n , cast(null as {{ dbt.type_string() }} ) as patient_id\n , cast(null as {{ dbt.type_string() }} ) as encounter_id\n , cast(null as {{ dbt.type_string() }} ) as claim_id\n , cast(null as date) as procedure_date\n , cast(null as {{ dbt.type_string() }} ) as source_code_type\n , cast(null as {{ dbt.type_string() }} ) as source_code\n , cast(null as {{ dbt.type_string() }} ) as source_description\n , cast(null as {{ dbt.type_string() }} ) as normalized_code_type\n , cast(null as {{ dbt.type_string() }} ) as normalized_code\n , cast(null as {{ dbt.type_string() }} ) as normalized_description\n , cast(null as {{ dbt.type_string() }} ) as modifier_1\n , cast(null as {{ dbt.type_string() }} ) as modifier_2\n , cast(null as {{ dbt.type_string() }} ) as modifier_3\n , cast(null as {{ dbt.type_string() }} ) as modifier_4\n , cast(null as {{ dbt.type_string() }} ) as modifier_5\n , cast(null as {{ dbt.type_string() }} ) as practitioner_id\n , cast(null as {{ dbt.type_string() }} ) as data_source\nlimit 0", "language": "sql", "package_name": "input_layer", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/docs_generate", "path": "procedure.sql", "original_file_path": "models/procedure.sql", "name": "procedure", "alias": "procedure", "checksum": {"name": "sha256", "checksum": "c92d7d6e8cdee32f1e4bc59cc1f1c496ee1c60a1798c38bd4f9a839fb2717ff3"}, "tags": [], "refs": [], "sources": [], "metrics": [], "description": "The procedure table contains information on procedures that were performed on patients in the dataset.\n", "columns": {"procedure_id": {"name": "procedure_id", "description": "The unique identifier for the performed procedure.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "patient_id": {"name": "patient_id", "description": "Unique identifier for each person across all datasets.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "encounter_id": {"name": "encounter_id", "description": "The encounter_id for the encounter where this procedure was performed.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "claim_id": {"name": "claim_id", "description": "The claim on which the procedure was recorded.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "procedure_date": {"name": "procedure_date", "description": "Date when the procedure was performed.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "source_code_type": {"name": "source_code_type", "description": "Type of procedure code for the procedure in the source system.\n", "meta": {"terminology": "/terminology/tuva-concepts/code-type"}, "data_type": null, "quote": null, "tags": []}, "source_code": {"name": "source_code", "description": "The procedure code in the source system.", "meta": {"terminology": "/terminology/conditions-and-procedures/icd-10-pcs"}, "data_type": null, "quote": null, "tags": []}, "source_description": {"name": "source_description", "description": "Description of the procedure code.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "normalized_code_type": {"name": "normalized_code_type", "description": "Normalized type of procedure code for the procedure.", "meta": {"terminology": "/terminology/tuva-concepts/code-type"}, "data_type": null, "quote": null, "tags": []}, "normalized_code": {"name": "normalized_code", "description": "The normalized procedure code.", "meta": {"terminology": "/terminology/conditions-and-procedures/icd-10-pcs"}, "data_type": null, "quote": null, "tags": []}, "normalized_description": {"name": "normalized_description", "description": "Description of the procedure code.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "modifier_1": {"name": "modifier_1", "description": "First modifier for the procedure code.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "modifier_2": {"name": "modifier_2", "description": "Second modifier for the procedure code.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "modifier_3": {"name": "modifier_3", "description": "Third modifier for the procedure code.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "modifier_4": {"name": "modifier_4", "description": "Fourth modifier for the procedure code.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "modifier_5": {"name": "modifier_5", "description": "Fifth modifier for the procedure code.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "practitioner_id": {"name": "practitioner_id", "description": "ID of the provider who performed the procedure.", "meta": {"terminology": "/terminology/providers/provider"}, "data_type": null, "quote": null, "tags": []}, "data_source": {"name": "data_source", "description": "User-configured field that indicates the data source (e.g. typically named after the payer and state \"BCBS Tennessee\").", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "input_layer://models/_models.yml", "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"bind": false, "database": "tuva", "schema": "input_layer"}, "created_at": 1701215339.538809}, "model.input_layer.practitioner": {"resource_type": "model", "depends_on": {"macros": ["macro.dbt.type_string"], "nodes": []}, "config": {"enabled": true, "alias": null, "schema": "input_layer", "database": "tuva", "tags": [], "meta": {}, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "bind": false, "post-hook": [], "pre-hook": []}, "database": "tuva", "schema": "input_layer", "fqn": ["input_layer", "practitioner"], "unique_id": "model.input_layer.practitioner", "raw_code": "select\n cast(null as {{ dbt.type_string() }} ) as practitioner_id\n , cast(null as {{ dbt.type_string() }} ) as npi\n , cast(null as {{ dbt.type_string() }} ) as first_name\n , cast(null as {{ dbt.type_string() }} ) as last_name\n , cast(null as {{ dbt.type_string() }} ) as practice_affiliation\n , cast(null as {{ dbt.type_string() }} ) as specialty\n , cast(null as {{ dbt.type_string() }} ) as sub_specialty\n , cast(null as {{ dbt.type_string() }} ) as data_source\nlimit 0", "language": "sql", "package_name": "input_layer", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/docs_generate", "path": "practitioner.sql", "original_file_path": "models/practitioner.sql", "name": "practitioner", "alias": "practitioner", "checksum": {"name": "sha256", "checksum": "c0f8dcb63bbd8a89602af7d1991f7a22cbeb897b7a4fc5f53e138a9296f178b5"}, "tags": [], "refs": [], "sources": [], "metrics": [], "description": "The practitioner table contains information on the providers in the dataset e.g. physicians, physicians assistants, etc.\n", "columns": {"practitioner_id": {"name": "practitioner_id", "description": "Unique ID for the provider.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "npi": {"name": "npi", "description": "NPI for the provider.", "meta": {"terminology": "/terminology/providers/provider"}, "data_type": null, "quote": null, "tags": []}, "first_name": {"name": "first_name", "description": "First name of the provider.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "last_name": {"name": "last_name", "description": "Last name of the provider.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "practice_affiliation": {"name": "practice_affiliation", "description": "Practice affiliation of the provider.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "specialty": {"name": "specialty", "description": "Specialty of the provider.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "sub_specialty": {"name": "sub_specialty", "description": "Sub specialty of the provider.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "data_source": {"name": "data_source", "description": "User-configured field that indicates the data source (e.g. typically named after the payer and state \"BCBS Tennessee\").\n", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "input_layer://models/_models.yml", "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"bind": false, "database": "tuva", "schema": "input_layer"}, "created_at": 1701215339.534484}, "model.input_layer.encounter": {"resource_type": "model", "depends_on": {"macros": ["macro.dbt.type_string", "macro.dbt.type_int", "macro.dbt.type_numeric"], "nodes": []}, "config": {"enabled": true, "alias": null, "schema": "input_layer", "database": "tuva", "tags": [], "meta": {}, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "bind": false, "post-hook": [], "pre-hook": []}, "database": "tuva", "schema": "input_layer", "fqn": ["input_layer", "encounter"], "unique_id": "model.input_layer.encounter", "raw_code": "select \n cast(null as {{ dbt.type_string() }} ) as encounter_id\n , cast(null as {{ dbt.type_string() }} ) as patient_id\n , cast(null as {{ dbt.type_string() }} ) as encounter_type\n , cast(null as date) as encounter_start_date\n , cast(null as date) as encounter_end_date\n , cast(null as {{ dbt.type_int() }} ) as length_of_stay\n , cast(null as {{ dbt.type_string() }} ) as admit_source_code\n , cast(null as {{ dbt.type_string() }} ) as admit_source_description\n , cast(null as {{ dbt.type_string() }} ) as admit_type_code\n , cast(null as {{ dbt.type_string() }} ) as admit_type_description\n , cast(null as {{ dbt.type_string() }} ) as discharge_disposition_code\n , cast(null as {{ dbt.type_string() }} ) as discharge_disposition_description\n , cast(null as {{ dbt.type_string() }} ) as attending_provider_id\n , cast(null as {{ dbt.type_string() }} ) as facility_npi\n , cast(null as {{ dbt.type_string() }} ) as primary_diagnosis_code_type\n , cast(null as {{ dbt.type_string() }} ) as primary_diagnosis_code\n , cast(null as {{ dbt.type_string() }} ) as primary_diagnosis_description\n , cast(null as {{ dbt.type_string() }} ) as ms_drg_code\n , cast(null as {{ dbt.type_string() }} ) as ms_drg_description\n , cast(null as {{ dbt.type_string() }} ) as apr_drg_code\n , cast(null as {{ dbt.type_string() }} ) as apr_drg_description\n , cast(null as {{ dbt.type_numeric() }} ) as paid_amount\n , cast(null as {{ dbt.type_numeric() }} ) as allowed_amount\n , cast(null as {{ dbt.type_numeric() }} ) as charge_amount\n , cast(null as {{ dbt.type_string() }} ) as data_source\nlimit 0", "language": "sql", "package_name": "input_layer", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/docs_generate", "path": "encounter.sql", "original_file_path": "models/encounter.sql", "name": "encounter", "alias": "encounter", "checksum": {"name": "sha256", "checksum": "7d020e526e3f5694de500ea5e9f81717c18b2becabfc1dff236b0ffd40adb12f"}, "tags": [], "refs": [], "sources": [], "metrics": [], "description": "The encounter table contains information about patients visits (i.e. encounters). This includes acute inpatient, emergency department, office visits, SNF stays, etc.\n", "columns": {"encounter_id": {"name": "encounter_id", "description": "Unique identifier for each encounter.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "patient_id": {"name": "patient_id", "description": "Unique identifier for a patient.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "encounter_type": {"name": "encounter_type", "description": "Indicates the type of encounter e.g. acute inpatient, emergency department, etc.\n", "meta": {"terminology": "/terminology/tuva-concepts/encounter-type"}, "data_type": null, "quote": null, "tags": []}, "encounter_start_date": {"name": "encounter_start_date", "description": "Date when the encounter started.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "encounter_end_date": {"name": "encounter_end_date", "description": "Date when the encounter ended.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "length_of_stay": {"name": "length_of_stay", "description": "Length of the encounter calculated as encounter_end_date - encounter_start_date.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "admit_source_code": {"name": "admit_source_code", "description": "Admission source code for the encounter.", "meta": {"terminology": "/terminology/administrative-codes/admit-source"}, "data_type": null, "quote": null, "tags": []}, "admit_source_description": {"name": "admit_source_description", "description": "Description of the admit_source_code for the encounter.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "admit_type_code": {"name": "admit_type_code", "description": "Admission type code for the encounter.", "meta": {"terminology": "/terminology/administrative-codes/admit-type"}, "data_type": null, "quote": null, "tags": []}, "admit_type_description": {"name": "admit_type_description", "description": "Description of the admit_type_code for the encounter.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "discharge_disposition_code": {"name": "discharge_disposition_code", "description": "Discharge disposition code for the encounter.", "meta": {"terminology": "/terminology/administrative-codes/discharge-disposition"}, "data_type": null, "quote": null, "tags": []}, "discharge_disposition_description": {"name": "discharge_disposition_description", "description": "Description of the discharge_disposition_code for the encounter.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "attending_provider_id": {"name": "attending_provider_id", "description": "attending provider for the encounter.", "meta": {"terminology": "/terminology/providers/provider"}, "data_type": null, "quote": null, "tags": []}, "facility_npi": {"name": "facility_npi", "description": "Facility NPI for the encounter (typically represents the facility where services were performed).\n", "meta": {"terminology": "/terminology/providers/provider"}, "data_type": null, "quote": null, "tags": []}, "primary_diagnosis_code_type": {"name": "primary_diagnosis_code_type", "description": "The type of condition code reported in the source system e.g. ICD-10-CM.\n", "meta": {"terminology": "/terminology/tuva-concepts/code-type"}, "data_type": null, "quote": null, "tags": []}, "primary_diagnosis_code": {"name": "primary_diagnosis_code", "description": "Primary diagnosis code for the encounter. If from claims the primary diagnosis code comes from the institutional claim.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "primary_diagnosis_description": {"name": "primary_diagnosis_description", "description": "Description of the primary diagnosis code.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "ms_drg_code": {"name": "ms_drg_code", "description": "MS-DRG code for the encounter.", "meta": {"terminology": "/terminology/conditions-and-procedures/ms-drg"}, "data_type": null, "quote": null, "tags": []}, "ms_drg_description": {"name": "ms_drg_description", "description": "Description of the ms_drg_code.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "apr_drg_code": {"name": "apr_drg_code", "description": "APR-DRG code for the encounter.", "meta": {"terminology": "/terminology/conditions-and-procedures/apr-drg"}, "data_type": null, "quote": null, "tags": []}, "apr_drg_description": {"name": "apr_drg_description", "description": "Description of the APR-DRG code.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "paid_amount": {"name": "paid_amount", "description": "The total amount paid for the encounter by the insurer.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "allowed_amount": {"name": "allowed_amount", "description": "The total amount allowed (includes amount paid by the insurer and patient) on the encounter.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "charge_amount": {"name": "charge_amount", "description": "The total amount charged on the encounter by the provider.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "data_source": {"name": "data_source", "description": "User-configured field that indicates the data source (e.g. typically named after the payer and state \"BCBS Tennessee\").\n", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "input_layer://models/_models.yml", "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"bind": false, "database": "tuva", "schema": "input_layer"}, "created_at": 1701215339.513456}, "model.input_layer.eligibility": {"resource_type": "model", "depends_on": {"macros": [], "nodes": ["seed.input_layer.eligibility_seed"]}, "config": {"enabled": true, "alias": null, "schema": "input_layer", "database": "tuva", "tags": [], "meta": {}, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "bind": false, "post-hook": [], "pre-hook": []}, "database": "tuva", "schema": "input_layer", "fqn": ["input_layer", "eligibility"], "unique_id": "model.input_layer.eligibility", "raw_code": "select\n patient_id\n , member_id\n , gender\n , race\n , birth_date\n , death_date\n , death_flag\n , enrollment_start_date\n , enrollment_end_date\n , payer\n , payer_type\n , plan\n , original_reason_entitlement_code\n , dual_status_code\n , medicare_status_code\n , first_name\n , last_name\n , address\n , city\n , state\n , zip_code\n , phone\n , data_source\nfrom {{ ref('eligibility_seed') }}", "language": "sql", "package_name": "input_layer", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/docs_generate", "path": "eligibility.sql", "original_file_path": "models/eligibility.sql", "name": "eligibility", "alias": "eligibility", "checksum": {"name": "sha256", "checksum": "982cfede679c0d134abc59c71a1c0aabffb2e5b01f2d84c122c717872f30cfc9"}, "tags": [], "refs": [["eligibility_seed"]], "sources": [], "metrics": [], "description": "The eligibility table includes information about a patient's health insurance coverage and demographics (note: we use the word patient as a synonym for member). Every claims dataset should include some sort of eligibility data, otherwise it's impossible to calculate member months, which are needed to calculate measures like PMPM.\n", "columns": {"patient_id": {"name": "patient_id", "description": "Unique identifier for each patient in the dataset.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "member_id": {"name": "member_id", "description": "Identifier that links a patient to a particular insurance product or health plan. A patient can have more than one member_id because they can have more than one insurance product/plan.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "gender": {"name": "gender", "description": "Biological sex of the patient.", "meta": {"terminology": "/terminology/demographics/gender"}, "data_type": null, "quote": null, "tags": []}, "race": {"name": "race", "description": "Race of the patient.", "meta": {"terminology": "/terminology/demographics/race"}, "data_type": null, "quote": null, "tags": []}, "birth_date": {"name": "birth_date", "description": "Date the patient was born.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "death_date": {"name": "death_date", "description": "Date the patient died.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "death_flag": {"name": "death_flag", "description": "Indicates whether the patient has died.", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "enrollment_start_date": {"name": "enrollment_start_date", "description": "Date the patient's insurance eligibility began.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "enrollment_end_date": {"name": "enrollment_end_date", "description": "Date the patient's insurance eligibility ended.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "payer": {"name": "payer", "description": "Name of the payer (i.e. health insurer) providing coverage.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "payer_type": {"name": "payer_type", "description": "Type of payer (e.g. commercial, medicare, medicaid, etc.).", "meta": {"terminology": "/terminology/tuva-concepts/payer-type"}, "data_type": null, "quote": null, "tags": []}, "plan": {"name": "plan", "description": "Name of the plan (i.e. sub contract) providing coverage.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "original_reason_entitlement_code": {"name": "original_reason_entitlement_code", "description": "Original reason for Medicare entitlement code.", "meta": {"terminology": "/terminology/administrative-codes/medicare-orec"}, "data_type": null, "quote": null, "tags": []}, "dual_status_code": {"name": "dual_status_code", "description": "Indicates whether the patient is dually eligible for Medicare and Medicaid.\n", "meta": {"terminology": "/terminology/administrative-codes/medicare-dual-eligibility"}, "data_type": null, "quote": null, "tags": []}, "medicare_status_code": {"name": "medicare_status_code", "description": "Indicates how the patient became eligible for Medicare.", "meta": {"terminology": "/terminology/administrative-codes/medicare-status"}, "data_type": null, "quote": null, "tags": []}, "first_name": {"name": "first_name", "description": "Patient's first name.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "last_name": {"name": "last_name", "description": "Patient's last name.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "address": {"name": "address", "description": "Patient's street address.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "city": {"name": "city", "description": "Patient's city of address.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "state": {"name": "state", "description": "State the patient lives in (most recent known address)", "meta": {}, "data_type": null, "quote": null, "tags": []}, "zip_code": {"name": "zip_code", "description": "Zip code the patient lives in (most recent known address).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "phone": {"name": "phone", "description": "Patient's phone number.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "data_source": {"name": "data_source", "description": "User-configured field that indicates the data source (e.g. typically named after the payer and state \"BCBS Tennessee\").\n", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "input_layer://models/_models.yml", "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"bind": false, "database": "tuva", "schema": "input_layer"}, "created_at": 1701215339.465268}, "model.input_layer.medical_claim": {"resource_type": "model", "depends_on": {"macros": [], "nodes": ["seed.input_layer.medical_claim_seed"]}, "config": {"enabled": true, "alias": null, "schema": "input_layer", "database": "tuva", "tags": [], "meta": {}, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "bind": false, "post-hook": [], "pre-hook": []}, "database": "tuva", "schema": "input_layer", "fqn": ["input_layer", "medical_claim"], "unique_id": "model.input_layer.medical_claim", "raw_code": "select\n claim_id\n , claim_line_number\n , claim_type\n , patient_id\n , member_id\n , payer\n , plan\n , claim_start_date\n , claim_end_date\n , claim_line_start_date\n , claim_line_end_date\n , admission_date\n , discharge_date\n , admit_source_code\n , admit_type_code\n , discharge_disposition_code\n , place_of_service_code\n , bill_type_code\n , ms_drg_code\n , apr_drg_code\n , revenue_center_code\n , service_unit_quantity\n , hcpcs_code\n , hcpcs_modifier_1\n , hcpcs_modifier_2\n , hcpcs_modifier_3\n , hcpcs_modifier_4\n , hcpcs_modifier_5\n , rendering_npi\n , billing_npi\n , facility_npi\n , paid_date\n , paid_amount\n , allowed_amount\n , charge_amount\n , coinsurance_amount\n , copayment_amount\n , deductible_amount\n , total_cost_amount\n , diagnosis_code_type\n , diagnosis_code_1\n , diagnosis_code_2\n , diagnosis_code_3\n , diagnosis_code_4\n , diagnosis_code_5\n , diagnosis_code_6\n , diagnosis_code_7\n , diagnosis_code_8\n , diagnosis_code_9\n , diagnosis_code_10\n , diagnosis_code_11\n , diagnosis_code_12\n , diagnosis_code_13\n , diagnosis_code_14\n , diagnosis_code_15\n , diagnosis_code_16\n , diagnosis_code_17\n , diagnosis_code_18\n , diagnosis_code_19\n , diagnosis_code_20\n , diagnosis_code_21\n , diagnosis_code_22\n , diagnosis_code_23\n , diagnosis_code_24\n , diagnosis_code_25\n , diagnosis_poa_1\n , diagnosis_poa_2\n , diagnosis_poa_3\n , diagnosis_poa_4\n , diagnosis_poa_5\n , diagnosis_poa_6\n , diagnosis_poa_7\n , diagnosis_poa_8\n , diagnosis_poa_9\n , diagnosis_poa_10\n , diagnosis_poa_11\n , diagnosis_poa_12\n , diagnosis_poa_13\n , diagnosis_poa_14\n , diagnosis_poa_15\n , diagnosis_poa_16\n , diagnosis_poa_17\n , diagnosis_poa_18\n , diagnosis_poa_19\n , diagnosis_poa_20\n , diagnosis_poa_21\n , diagnosis_poa_22\n , diagnosis_poa_23\n , diagnosis_poa_24\n , diagnosis_poa_25\n , procedure_code_type\n , procedure_code_1\n , procedure_code_2\n , procedure_code_3\n , procedure_code_4\n , procedure_code_5\n , procedure_code_6\n , procedure_code_7\n , procedure_code_8\n , procedure_code_9\n , procedure_code_10\n , procedure_code_11\n , procedure_code_12\n , procedure_code_13\n , procedure_code_14\n , procedure_code_15\n , procedure_code_16\n , procedure_code_17\n , procedure_code_18\n , procedure_code_19\n , procedure_code_20\n , procedure_code_21\n , procedure_code_22\n , procedure_code_23\n , procedure_code_24\n , procedure_code_25\n , procedure_date_1\n , procedure_date_2\n , procedure_date_3\n , procedure_date_4\n , procedure_date_5\n , procedure_date_6\n , procedure_date_7\n , procedure_date_8\n , procedure_date_9\n , procedure_date_10\n , procedure_date_11\n , procedure_date_12\n , procedure_date_13\n , procedure_date_14\n , procedure_date_15\n , procedure_date_16\n , procedure_date_17\n , procedure_date_18\n , procedure_date_19\n , procedure_date_20\n , procedure_date_21\n , procedure_date_22\n , procedure_date_23\n , procedure_date_24\n , procedure_date_25\n , data_source\nfrom {{ ref('medical_claim_seed') }}", "language": "sql", "package_name": "input_layer", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/docs_generate", "path": "medical_claim.sql", "original_file_path": "models/medical_claim.sql", "name": "medical_claim", "alias": "medical_claim", "checksum": {"name": "sha256", "checksum": "189006551e2aa9380319cb756893be2e208dcdc18183369dba7415bc90b4b0e0"}, "tags": [], "refs": [["medical_claim_seed"]], "sources": [], "metrics": [], "description": "The medical_claim table contains information on healthcare services and supplies provided to patients, billed by providers, and paid for by health insurers. It includes information on the provider who rendered the service, the amount paid for the service by the health insurer, and the underlying reason for the service (i.e. diagnosis).\n", "columns": {"claim_id": {"name": "claim_id", "description": "Unique identifier for each claim.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "claim_line_number": {"name": "claim_line_number", "description": "Indicates the line number for the particular line of the claim.\n", "meta": {}, "data_type": "integer", "quote": null, "tags": []}, "claim_type": {"name": "claim_type", "description": "Indicates whether the claim is professional (CMS-1500), institutional (UB-04), dental, or vision.\n", "meta": {"terminology": "/terminology/tuva-concepts/claim-type"}, "data_type": null, "quote": null, "tags": []}, "patient_id": {"name": "patient_id", "description": "Unique identifier for each patient in the dataset.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "member_id": {"name": "member_id", "description": "Identifier that links a patient to a particular insurance product or health plan. A patient can have more than one member_id because they can have more than one insurance product/plan.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "payer": {"name": "payer", "description": "Name of the payer (i.e. health insurer) providing coverage.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "plan": {"name": "plan", "description": "Name of the plan", "meta": {}, "data_type": null, "quote": null, "tags": []}, "claim_start_date": {"name": "claim_start_date", "description": "Start date for the claim.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "claim_end_date": {"name": "claim_end_date", "description": "End date for the claim.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "claim_line_start_date": {"name": "claim_line_start_date", "description": "Start date for the claim line.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "claim_line_end_date": {"name": "claim_line_end_date", "description": "End date for the claim line.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "admission_date": {"name": "admission_date", "description": "Admission date for the claim (inpatient claims only).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "discharge_date": {"name": "discharge_date", "description": "Discharge date for the claim (inpatient claims only).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "admit_source_code": {"name": "admit_source_code", "description": "Indicates where the patient was before the healthcare encounter (inpatient claims only).\n", "meta": {"terminology": "/terminology/administrative-codes/admit-source"}, "data_type": null, "quote": null, "tags": []}, "admit_type_code": {"name": "admit_type_code", "description": "Indicates the type of admission (inpatient claims only).", "meta": {"terminology": "/terminology/administrative-codes/admit-type"}, "data_type": null, "quote": null, "tags": []}, "discharge_disposition_code": {"name": "discharge_disposition_code", "description": "Indicates the type of setting the patient was discharged to (institutional inpatient claims only).\n", "meta": {"terminology": "/terminology/administrative-codes/discharge-disposition"}, "data_type": null, "quote": null, "tags": []}, "place_of_service_code": {"name": "place_of_service_code", "description": "Place of service for the claim (professional claims only).", "meta": {"terminology": "/terminology/administrative-codes/place-of-service"}, "data_type": null, "quote": null, "tags": []}, "bill_type_code": {"name": "bill_type_code", "description": "Bill type code for the claim (institutional claims only).", "meta": {"terminology": "/terminology/administrative-codes/bill-type"}, "data_type": null, "quote": null, "tags": []}, "ms_drg_code": {"name": "ms_drg_code", "description": "MS-DRG for the claim (inpatient claims only).", "meta": {"terminology": "/terminology/conditions-and-procedures/ms-drg"}, "data_type": null, "quote": null, "tags": []}, "apr_drg_code": {"name": "apr_drg_code", "description": "APR-DRG for the claim (inpatient claims only).", "meta": {"terminology": "/terminology/conditions-and-procedures/apr-drg"}, "data_type": null, "quote": null, "tags": []}, "revenue_center_code": {"name": "revenue_center_code", "description": "Revenue center code for the claim line (institutional only and typically multiple codes per claim).\n", "meta": {"terminology": "/terminology/administrative-codes/revenue-center"}, "data_type": null, "quote": null, "tags": []}, "service_unit_quantity": {"name": "service_unit_quantity", "description": "The number of units for the particular revenue center code.", "meta": {}, "data_type": "integer", "quote": null, "tags": []}, "hcpcs_code": {"name": "hcpcs_code", "description": "HCPCS level 1 or level 2 code for the claim line.", "meta": {"terminology": "/terminology/conditions-and-procedures/hcpcs-level-2"}, "data_type": null, "quote": null, "tags": []}, "hcpcs_modifier_1": {"name": "hcpcs_modifier_1", "description": "1st modifier for HCPCS code.", "meta": {"terminology": "/terminology/conditions-and-procedures/hcpcs-level-2"}, "data_type": null, "quote": null, "tags": []}, "hcpcs_modifier_2": {"name": "hcpcs_modifier_2", "description": "2nd modifier for HCPCS code.", "meta": {"terminology": "/terminology/conditions-and-procedures/hcpcs-level-2"}, "data_type": null, "quote": null, "tags": []}, "hcpcs_modifier_3": {"name": "hcpcs_modifier_3", "description": "3rd modifier for HCPCS code.", "meta": {"terminology": "/terminology/conditions-and-procedures/hcpcs-level-2"}, "data_type": null, "quote": null, "tags": []}, "hcpcs_modifier_4": {"name": "hcpcs_modifier_4", "description": "4th modifier for HCPCS code.", "meta": {"terminology": "/terminology/conditions-and-procedures/hcpcs-level-2"}, "data_type": null, "quote": null, "tags": []}, "hcpcs_modifier_5": {"name": "hcpcs_modifier_5", "description": "5th modifier for HCPCS code.", "meta": {"terminology": "/terminology/conditions-and-procedures/hcpcs-level-2"}, "data_type": null, "quote": null, "tags": []}, "rendering_npi": {"name": "rendering_npi", "description": "Rendering NPI for the claim (typically represents the physician or entity providing services).\n", "meta": {"terminology": "/terminology/providers/provider"}, "data_type": null, "quote": null, "tags": []}, "billing_npi": {"name": "billing_npi", "description": "Billing NPI for the claim (typically represents organization billing the claim).\n", "meta": {"terminology": "/terminology/providers/provider"}, "data_type": null, "quote": null, "tags": []}, "facility_npi": {"name": "facility_npi", "description": "Facility NPI for the claim (typically represents the facility where services were performed).\n", "meta": {"terminology": "/terminology/providers/provider"}, "data_type": null, "quote": null, "tags": []}, "paid_date": {"name": "paid_date", "description": "The date the claim was paid.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "paid_amount": {"name": "paid_amount", "description": "The total amount paid on the claim by the insurer.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "allowed_amount": {"name": "allowed_amount", "description": "The total amount allowed (includes amount paid by the insurer and patient) on the claim.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "charge_amount": {"name": "charge_amount", "description": "The total amount charged on the claim by the provider.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "coinsurance_amount": {"name": "coinsurance_amount", "description": "The total coinsurance charged on the claim by the provider.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "copayment_amount": {"name": "copayment_amount", "description": "The total copayment charged on the claim by the provider.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "deductible_amount": {"name": "deductible_amount", "description": "The total amount charged on the claim by the provider.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "total_cost_amount": {"name": "total_cost_amount", "description": "The total amount paid on the claim by different parties.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "diagnosis_code_type": {"name": "diagnosis_code_type", "description": "Indicates the type of diagnosis code (e.g. ICD-10-CM).", "meta": {"terminology": "/terminology/tuva-concepts/code-type"}, "data_type": null, "quote": null, "tags": []}, "diagnosis_code_1": {"name": "diagnosis_code_1", "description": "1st ICD (9 or 10) CM diagnosis code on the claim.", "meta": {"terminology": "/terminology/conditions-and-procedures/icd-10-cm"}, "data_type": null, "quote": null, "tags": []}, "diagnosis_code_2": {"name": "diagnosis_code_2", "description": "2nd ICD (9 or 10) CM diagnosis code on the claim.", "meta": {"terminology": "/terminology/conditions-and-procedures/icd-10-cm"}, "data_type": null, "quote": null, "tags": []}, "diagnosis_code_3": {"name": "diagnosis_code_3", "description": "3rd ICD (9 or 10) CM diagnosis code on the claim.", "meta": {"terminology": "/terminology/conditions-and-procedures/icd-10-cm"}, "data_type": null, "quote": null, "tags": []}, "diagnosis_code_4": {"name": "diagnosis_code_4", "description": "4th ICD (9 or 10) CM diagnosis code on the claim.", "meta": {"terminology": "/terminology/conditions-and-procedures/icd-10-cm"}, "data_type": null, "quote": null, "tags": []}, "diagnosis_code_5": {"name": "diagnosis_code_5", "description": "5th ICD (9 or 10) CM diagnosis code on the claim.", "meta": {"terminology": "/terminology/conditions-and-procedures/icd-10-cm"}, "data_type": null, "quote": null, "tags": []}, "diagnosis_code_6": {"name": "diagnosis_code_6", "description": "6th ICD (9 or 10) CM diagnosis code on the claim.", "meta": {"terminology": "/terminology/conditions-and-procedures/icd-10-cm"}, "data_type": null, "quote": null, "tags": []}, "diagnosis_code_7": {"name": "diagnosis_code_7", "description": "7th ICD (9 or 10) CM diagnosis code on the claim.", "meta": {"terminology": "/terminology/conditions-and-procedures/icd-10-cm"}, "data_type": null, "quote": null, "tags": []}, "diagnosis_code_8": {"name": "diagnosis_code_8", "description": "8th ICD (9 or 10) CM diagnosis code on the claim.", "meta": {"terminology": "/terminology/conditions-and-procedures/icd-10-cm"}, "data_type": null, "quote": null, "tags": []}, "diagnosis_code_9": {"name": "diagnosis_code_9", "description": "9th ICD (9 or 10) CM diagnosis code on the claim.", "meta": {"terminology": "/terminology/conditions-and-procedures/icd-10-cm"}, "data_type": null, "quote": null, "tags": []}, "diagnosis_code_10": {"name": "diagnosis_code_10", "description": "10th ICD (9 or 10) CM diagnosis code on the claim.", "meta": {"terminology": "/terminology/conditions-and-procedures/icd-10-cm"}, "data_type": null, "quote": null, "tags": []}, "diagnosis_code_11": {"name": "diagnosis_code_11", "description": "11th ICD (9 or 10) CM diagnosis code on the claim.", "meta": {"terminology": "/terminology/conditions-and-procedures/icd-10-cm"}, "data_type": null, "quote": null, "tags": []}, "diagnosis_code_12": {"name": "diagnosis_code_12", "description": "12th ICD (9 or 10) CM diagnosis code on the claim.", "meta": {"terminology": "/terminology/conditions-and-procedures/icd-10-cm"}, "data_type": null, "quote": null, "tags": []}, "diagnosis_code_13": {"name": "diagnosis_code_13", "description": "13th ICD (9 or 10) CM diagnosis code on the claim.", "meta": {"terminology": "/terminology/conditions-and-procedures/icd-10-cm"}, "data_type": null, "quote": null, "tags": []}, "diagnosis_code_14": {"name": "diagnosis_code_14", "description": "14th ICD (9 or 10) CM diagnosis code on the claim.", "meta": {"terminology": "/terminology/conditions-and-procedures/icd-10-cm"}, "data_type": null, "quote": null, "tags": []}, "diagnosis_code_15": {"name": "diagnosis_code_15", "description": "15th ICD (9 or 10) CM diagnosis code on the claim.", "meta": {"terminology": "/terminology/conditions-and-procedures/icd-10-cm"}, "data_type": null, "quote": null, "tags": []}, "diagnosis_code_16": {"name": "diagnosis_code_16", "description": "16th ICD (9 or 10) CM diagnosis code on the claim.", "meta": {"terminology": "/terminology/conditions-and-procedures/icd-10-cm"}, "data_type": null, "quote": null, "tags": []}, "diagnosis_code_17": {"name": "diagnosis_code_17", "description": "17th ICD (9 or 10) CM diagnosis code on the claim.", "meta": {"terminology": "/terminology/conditions-and-procedures/icd-10-cm"}, "data_type": null, "quote": null, "tags": []}, "diagnosis_code_18": {"name": "diagnosis_code_18", "description": "18th ICD (9 or 10) CM diagnosis code on the claim.", "meta": {"terminology": "/terminology/conditions-and-procedures/icd-10-cm"}, "data_type": null, "quote": null, "tags": []}, "diagnosis_code_19": {"name": "diagnosis_code_19", "description": "19th ICD (9 or 10) CM diagnosis code on the claim.", "meta": {"terminology": "/terminology/conditions-and-procedures/icd-10-cm"}, "data_type": null, "quote": null, "tags": []}, "diagnosis_code_20": {"name": "diagnosis_code_20", "description": "20th ICD (9 or 10) CM diagnosis code on the claim.", "meta": {"terminology": "/terminology/conditions-and-procedures/icd-10-cm"}, "data_type": null, "quote": null, "tags": []}, "diagnosis_code_21": {"name": "diagnosis_code_21", "description": "21st ICD (9 or 10) CM diagnosis code on the claim.", "meta": {"terminology": "/terminology/conditions-and-procedures/icd-10-cm"}, "data_type": null, "quote": null, "tags": []}, "diagnosis_code_22": {"name": "diagnosis_code_22", "description": "22nd ICD (9 or 10) CM diagnosis code on the claim.", "meta": {"terminology": "/terminology/conditions-and-procedures/icd-10-cm"}, "data_type": null, "quote": null, "tags": []}, "diagnosis_code_23": {"name": "diagnosis_code_23", "description": "23rd ICD (9 or 10) CM diagnosis code on the claim.", "meta": {"terminology": "/terminology/conditions-and-procedures/icd-10-cm"}, "data_type": null, "quote": null, "tags": []}, "diagnosis_code_24": {"name": "diagnosis_code_24", "description": "24th ICD (9 or 10) CM diagnosis code on the claim.", "meta": {"terminology": "/terminology/conditions-and-procedures/icd-10-cm"}, "data_type": null, "quote": null, "tags": []}, "diagnosis_code_25": {"name": "diagnosis_code_25", "description": "25th ICD (9 or 10) CM diagnosis code on the claim.", "meta": {"terminology": "/terminology/conditions-and-procedures/icd-10-cm"}, "data_type": null, "quote": null, "tags": []}, "diagnosis_poa_1": {"name": "diagnosis_poa_1", "description": "Present on admission code for the 1st diagnosis on the claim.\n", "meta": {"terminology": "/terminology/administrative-codes/present-on-admission"}, "data_type": null, "quote": null, "tags": []}, "diagnosis_poa_2": {"name": "diagnosis_poa_2", "description": "Present on admission code for the 2nd diagnosis on the claim.\n", "meta": {"terminology": "/terminology/administrative-codes/present-on-admission"}, "data_type": null, "quote": null, "tags": []}, "diagnosis_poa_3": {"name": "diagnosis_poa_3", "description": "Present on admission code for the 3rd diagnosis on the claim.\n", "meta": {"terminology": "/terminology/administrative-codes/present-on-admission"}, "data_type": null, "quote": null, "tags": []}, "diagnosis_poa_4": {"name": "diagnosis_poa_4", "description": "Present on admission code for the 4th diagnosis on the claim.\n", "meta": {"terminology": "/terminology/administrative-codes/present-on-admission"}, "data_type": null, "quote": null, "tags": []}, "diagnosis_poa_5": {"name": "diagnosis_poa_5", "description": "Present on admission code for the 5th diagnosis on the claim.\n", "meta": {"terminology": "/terminology/administrative-codes/present-on-admission"}, "data_type": null, "quote": null, "tags": []}, "diagnosis_poa_6": {"name": "diagnosis_poa_6", "description": "Present on admission code for the 6th diagnosis on the claim.\n", "meta": {"terminology": "/terminology/administrative-codes/present-on-admission"}, "data_type": null, "quote": null, "tags": []}, "diagnosis_poa_7": {"name": "diagnosis_poa_7", "description": "Present on admission code for the 7th diagnosis on the claim.\n", "meta": {"terminology": "/terminology/administrative-codes/present-on-admission"}, "data_type": null, "quote": null, "tags": []}, "diagnosis_poa_8": {"name": "diagnosis_poa_8", "description": "Present on admission code for the 8th diagnosis on the claim.\n", "meta": {"terminology": "/terminology/administrative-codes/present-on-admission"}, "data_type": null, "quote": null, "tags": []}, "diagnosis_poa_9": {"name": "diagnosis_poa_9", "description": "Present on admission code for the 9th diagnosis on the claim.\n", "meta": {"terminology": "/terminology/administrative-codes/present-on-admission"}, "data_type": null, "quote": null, "tags": []}, "diagnosis_poa_10": {"name": "diagnosis_poa_10", "description": "Present on admission code for the 10th diagnosis on the claim.\n", "meta": {"terminology": "/terminology/administrative-codes/present-on-admission"}, "data_type": null, "quote": null, "tags": []}, "diagnosis_poa_11": {"name": "diagnosis_poa_11", "description": "Present on admission code for the 11th diagnosis on the claim.\n", "meta": {"terminology": "/terminology/administrative-codes/present-on-admission"}, "data_type": null, "quote": null, "tags": []}, "diagnosis_poa_12": {"name": "diagnosis_poa_12", "description": "Present on admission code for the 12th diagnosis on the claim.\n", "meta": {"terminology": "/terminology/administrative-codes/present-on-admission"}, "data_type": null, "quote": null, "tags": []}, "diagnosis_poa_13": {"name": "diagnosis_poa_13", "description": "Present on admission code for the 13th diagnosis on the claim.\n", "meta": {"terminology": "/terminology/administrative-codes/present-on-admission"}, "data_type": null, "quote": null, "tags": []}, "diagnosis_poa_14": {"name": "diagnosis_poa_14", "description": "Present on admission code for the 14th diagnosis on the claim.\n", "meta": {"terminology": "/terminology/administrative-codes/present-on-admission"}, "data_type": null, "quote": null, "tags": []}, "diagnosis_poa_15": {"name": "diagnosis_poa_15", "description": "Present on admission code for the 15th diagnosis on the claim.\n", "meta": {"terminology": "/terminology/administrative-codes/present-on-admission"}, "data_type": null, "quote": null, "tags": []}, "diagnosis_poa_16": {"name": "diagnosis_poa_16", "description": "Present on admission code for the 16th diagnosis on the claim.\n", "meta": {"terminology": "/terminology/administrative-codes/present-on-admission"}, "data_type": null, "quote": null, "tags": []}, "diagnosis_poa_17": {"name": "diagnosis_poa_17", "description": "Present on admission code for the 17th diagnosis on the claim.\n", "meta": {"terminology": "/terminology/administrative-codes/present-on-admission"}, "data_type": null, "quote": null, "tags": []}, "diagnosis_poa_18": {"name": "diagnosis_poa_18", "description": "Present on admission code for the 18th diagnosis on the claim.\n", "meta": {"terminology": "/terminology/administrative-codes/present-on-admission"}, "data_type": null, "quote": null, "tags": []}, "diagnosis_poa_19": {"name": "diagnosis_poa_19", "description": "Present on admission code for the 19th diagnosis on the claim.\n", "meta": {"terminology": "/terminology/administrative-codes/present-on-admission"}, "data_type": null, "quote": null, "tags": []}, "diagnosis_poa_20": {"name": "diagnosis_poa_20", "description": "Present on admission code for the 20th diagnosis on the claim.\n", "meta": {"terminology": "/terminology/administrative-codes/present-on-admission"}, "data_type": null, "quote": null, "tags": []}, "diagnosis_poa_21": {"name": "diagnosis_poa_21", "description": "Present on admission code for the 21st diagnosis on the claim.\n", "meta": {"terminology": "/terminology/administrative-codes/present-on-admission"}, "data_type": null, "quote": null, "tags": []}, "diagnosis_poa_22": {"name": "diagnosis_poa_22", "description": "Present on admission code for the 22nd diagnosis on the claim.\n", "meta": {"terminology": "/terminology/administrative-codes/present-on-admission"}, "data_type": null, "quote": null, "tags": []}, "diagnosis_poa_23": {"name": "diagnosis_poa_23", "description": "Present on admission code for the 23rd diagnosis on the claim.\n", "meta": {"terminology": "/terminology/administrative-codes/present-on-admission"}, "data_type": null, "quote": null, "tags": []}, "diagnosis_poa_24": {"name": "diagnosis_poa_24", "description": "Present on admission code for the 24th diagnosis on the claim.\n", "meta": {"terminology": "/terminology/administrative-codes/present-on-admission"}, "data_type": null, "quote": null, "tags": []}, "diagnosis_poa_25": {"name": "diagnosis_poa_25", "description": "Present on admission code for the 25th diagnosis on the claim.\n", "meta": {"terminology": "/terminology/administrative-codes/present-on-admission"}, "data_type": null, "quote": null, "tags": []}, "procedure_code_type": {"name": "procedure_code_type", "description": "Indicates the type of procedure code (e.g. ICD-10-PCS).", "meta": {"terminology": "/terminology/tuva-concepts/code-type"}, "data_type": null, "quote": null, "tags": []}, "procedure_code_1": {"name": "procedure_code_1", "description": "1st ICD (9 or 10) procedure code on the claim.", "meta": {"terminology": "/terminology/conditions-and-procedures/icd-10-pcs"}, "data_type": null, "quote": null, "tags": []}, "procedure_code_2": {"name": "procedure_code_2", "description": "2nd ICD (9 or 10) procedure code on the claim.", "meta": {"terminology": "/terminology/conditions-and-procedures/icd-10-pcs"}, "data_type": null, "quote": null, "tags": []}, "procedure_code_3": {"name": "procedure_code_3", "description": "3rd ICD (9 or 10) procedure code on the claim.", "meta": {"terminology": "/terminology/conditions-and-procedures/icd-10-pcs"}, "data_type": null, "quote": null, "tags": []}, "procedure_code_4": {"name": "procedure_code_4", "description": "4th ICD (9 or 10) procedure code on the claim.", "meta": {"terminology": "/terminology/conditions-and-procedures/icd-10-pcs"}, "data_type": null, "quote": null, "tags": []}, "procedure_code_5": {"name": "procedure_code_5", "description": "5th ICD (9 or 10) procedure code on the claim.", "meta": {"terminology": "/terminology/conditions-and-procedures/icd-10-pcs"}, "data_type": null, "quote": null, "tags": []}, "procedure_code_6": {"name": "procedure_code_6", "description": "6th ICD (9 or 10) procedure code on the claim.", "meta": {"terminology": "/terminology/conditions-and-procedures/icd-10-pcs"}, "data_type": null, "quote": null, "tags": []}, "procedure_code_7": {"name": "procedure_code_7", "description": "7th ICD (9 or 10) procedure code on the claim.", "meta": {"terminology": "/terminology/conditions-and-procedures/icd-10-pcs"}, "data_type": null, "quote": null, "tags": []}, "procedure_code_8": {"name": "procedure_code_8", "description": "8th ICD (9 or 10) procedure code on the claim.", "meta": {"terminology": "/terminology/conditions-and-procedures/icd-10-pcs"}, "data_type": null, "quote": null, "tags": []}, "procedure_code_9": {"name": "procedure_code_9", "description": "9th ICD (9 or 10) procedure code on the claim.", "meta": {"terminology": "/terminology/conditions-and-procedures/icd-10-pcs"}, "data_type": null, "quote": null, "tags": []}, "procedure_code_10": {"name": "procedure_code_10", "description": "10th ICD (9 or 10) procedure code on the claim.", "meta": {"terminology": "/terminology/conditions-and-procedures/icd-10-pcs"}, "data_type": null, "quote": null, "tags": []}, "procedure_code_11": {"name": "procedure_code_11", "description": "11th ICD (9 or 10) procedure code on the claim.", "meta": {"terminology": "/terminology/conditions-and-procedures/icd-10-pcs"}, "data_type": null, "quote": null, "tags": []}, "procedure_code_12": {"name": "procedure_code_12", "description": "12th ICD (9 or 10) procedure code on the claim.", "meta": {"terminology": "/terminology/conditions-and-procedures/icd-10-pcs"}, "data_type": null, "quote": null, "tags": []}, "procedure_code_13": {"name": "procedure_code_13", "description": "13th ICD (9 or 10) procedure code on the claim.", "meta": {"terminology": "/terminology/conditions-and-procedures/icd-10-pcs"}, "data_type": null, "quote": null, "tags": []}, "procedure_code_14": {"name": "procedure_code_14", "description": "14th ICD (9 or 10) procedure code on the claim.", "meta": {"terminology": "/terminology/conditions-and-procedures/icd-10-pcs"}, "data_type": null, "quote": null, "tags": []}, "procedure_code_15": {"name": "procedure_code_15", "description": "15th ICD (9 or 10) procedure code on the claim.", "meta": {"terminology": "/terminology/conditions-and-procedures/icd-10-pcs"}, "data_type": null, "quote": null, "tags": []}, "procedure_code_16": {"name": "procedure_code_16", "description": "16th ICD (9 or 10) procedure code on the claim.", "meta": {"terminology": "/terminology/conditions-and-procedures/icd-10-pcs"}, "data_type": null, "quote": null, "tags": []}, "procedure_code_17": {"name": "procedure_code_17", "description": "17th ICD (9 or 10) procedure code on the claim.", "meta": {"terminology": "/terminology/conditions-and-procedures/icd-10-pcs"}, "data_type": null, "quote": null, "tags": []}, "procedure_code_18": {"name": "procedure_code_18", "description": "18th ICD (9 or 10) procedure code on the claim.", "meta": {"terminology": "/terminology/conditions-and-procedures/icd-10-pcs"}, "data_type": null, "quote": null, "tags": []}, "procedure_code_19": {"name": "procedure_code_19", "description": "19th ICD (9 or 10) procedure code on the claim.", "meta": {"terminology": "/terminology/conditions-and-procedures/icd-10-pcs"}, "data_type": null, "quote": null, "tags": []}, "procedure_code_20": {"name": "procedure_code_20", "description": "20th ICD (9 or 10) procedure code on the claim.", "meta": {"terminology": "/terminology/conditions-and-procedures/icd-10-pcs"}, "data_type": null, "quote": null, "tags": []}, "procedure_code_21": {"name": "procedure_code_21", "description": "21st ICD (9 or 10) procedure code on the claim.", "meta": {"terminology": "/terminology/conditions-and-procedures/icd-10-pcs"}, "data_type": null, "quote": null, "tags": []}, "procedure_code_22": {"name": "procedure_code_22", "description": "22nd ICD (9 or 10) procedure code on the claim.", "meta": {"terminology": "/terminology/conditions-and-procedures/icd-10-pcs"}, "data_type": null, "quote": null, "tags": []}, "procedure_code_23": {"name": "procedure_code_23", "description": "23rd ICD (9 or 10) procedure code on the claim.", "meta": {"terminology": "/terminology/conditions-and-procedures/icd-10-pcs"}, "data_type": null, "quote": null, "tags": []}, "procedure_code_24": {"name": "procedure_code_24", "description": "24th ICD (9 or 10) procedure code on the claim.", "meta": {"terminology": "/terminology/conditions-and-procedures/icd-10-pcs"}, "data_type": null, "quote": null, "tags": []}, "procedure_code_25": {"name": "procedure_code_25", "description": "25th ICD (9 or 10) procedure code on the claim.", "meta": {"terminology": "/terminology/conditions-and-procedures/icd-10-pcs"}, "data_type": null, "quote": null, "tags": []}, "procedure_date_1": {"name": "procedure_date_1", "description": "Date of the 1st procedure on the claim.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "procedure_date_2": {"name": "procedure_date_2", "description": "Date of the 2nd procedure on the claim.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "procedure_date_3": {"name": "procedure_date_3", "description": "Date of the 3rd procedure on the claim.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "procedure_date_4": {"name": "procedure_date_4", "description": "Date of the 4th procedure on the claim.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "procedure_date_5": {"name": "procedure_date_5", "description": "Date of the 5th procedure on the claim.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "procedure_date_6": {"name": "procedure_date_6", "description": "Date of the 6th procedure on the claim.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "procedure_date_7": {"name": "procedure_date_7", "description": "Date of the 7th procedure on the claim.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "procedure_date_8": {"name": "procedure_date_8", "description": "Date of the 8th procedure on the claim.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "procedure_date_9": {"name": "procedure_date_9", "description": "Date of the 9th procedure on the claim.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "procedure_date_10": {"name": "procedure_date_10", "description": "Date of the 10th procedure on the claim.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "procedure_date_11": {"name": "procedure_date_11", "description": "Date of the 11th procedure on the claim.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "procedure_date_12": {"name": "procedure_date_12", "description": "Date of the 12th procedure on the claim.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "procedure_date_13": {"name": "procedure_date_13", "description": "Date of the 13th procedure on the claim.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "procedure_date_14": {"name": "procedure_date_14", "description": "Date of the 14th procedure on the claim.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "procedure_date_15": {"name": "procedure_date_15", "description": "Date of the 15th procedure on the claim.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "procedure_date_16": {"name": "procedure_date_16", "description": "Date of the 16th procedure on the claim.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "procedure_date_17": {"name": "procedure_date_17", "description": "Date of the 17th procedure on the claim.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "procedure_date_18": {"name": "procedure_date_18", "description": "Date of the 18th procedure on the claim.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "procedure_date_19": {"name": "procedure_date_19", "description": "Date of the 19th procedure on the claim.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "procedure_date_20": {"name": "procedure_date_20", "description": "Date of the 20th procedure on the claim.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "procedure_date_21": {"name": "procedure_date_21", "description": "Date of the 21st procedure on the claim.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "procedure_date_22": {"name": "procedure_date_22", "description": "Date of the 22nd procedure on the claim.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "procedure_date_23": {"name": "procedure_date_23", "description": "Date of the 23rd procedure on the claim.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "procedure_date_24": {"name": "procedure_date_24", "description": "Date of the 24th procedure on the claim.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "procedure_date_25": {"name": "procedure_date_25", "description": "Date of the 25th procedure on the claim.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "data_source": {"name": "data_source", "description": "User-configured field that indicates the data source (e.g. typically named after the payer and state \"BCBS Tennessee\").\n", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "input_layer://models/_models.yml", "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"bind": false, "database": "tuva", "schema": "input_layer"}, "created_at": 1701215339.498378}, "model.input_layer.pharmacy_claim": {"resource_type": "model", "depends_on": {"macros": [], "nodes": ["seed.input_layer.pharmacy_claim_seed"]}, "config": {"enabled": true, "alias": null, "schema": "input_layer", "database": "tuva", "tags": [], "meta": {}, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "bind": false, "post-hook": [], "pre-hook": []}, "database": "tuva", "schema": "input_layer", "fqn": ["input_layer", "pharmacy_claim"], "unique_id": "model.input_layer.pharmacy_claim", "raw_code": "select\n claim_id\n , claim_line_number\n , patient_id\n , member_id\n , payer\n , plan\n , prescribing_provider_npi\n , dispensing_provider_npi\n , dispensing_date\n , ndc_code\n , quantity\n , days_supply\n , refills\n , paid_date\n , paid_amount\n , allowed_amount\n , coinsurance_amount\n , copayment_amount\n , deductible_amount\n , data_source\nfrom {{ ref('pharmacy_claim_seed') }}", "language": "sql", "package_name": "input_layer", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/docs_generate", "path": "pharmacy_claim.sql", "original_file_path": "models/pharmacy_claim.sql", "name": "pharmacy_claim", "alias": "pharmacy_claim", "checksum": {"name": "sha256", "checksum": "9e6cd57222be5c6a03901fd513cdbdcd178e09f109de7c58b7afe513ae5c80ac"}, "tags": [], "refs": [["pharmacy_claim_seed"]], "sources": [], "metrics": [], "description": "The pharmacy_claim table includes information about retail and specialty drug prescriptions that have been filled by a patient, billed by a pharmacy, and paid by an insurer.\n", "columns": {"claim_id": {"name": "claim_id", "description": "Unique identifier for each claim.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "claim_line_number": {"name": "claim_line_number", "description": "Indicates the line number for the particular line of the claim.\n", "meta": {}, "data_type": "integer", "quote": null, "tags": []}, "patient_id": {"name": "patient_id", "description": "Unique identifier for each patient in the dataset.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "member_id": {"name": "member_id", "description": "Identifier that links a patient to a particular insurance product or health plan. A patient can have more than one member_id because they can have more than one insurance product/plan.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "payer": {"name": "payer", "description": "Name of the payer (i.e. health insurer) providing coverage.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "plan": {"name": "plan", "description": "Name of the plan", "meta": {}, "data_type": null, "quote": null, "tags": []}, "prescribing_provider_npi": {"name": "prescribing_provider_npi", "description": "NPI for the provider that wrote the prescription (e.g. priamry care physician).\n", "meta": {"terminology": "/terminology/providers/provider"}, "data_type": null, "quote": null, "tags": []}, "dispensing_provider_npi": {"name": "dispensing_provider_npi", "description": "NPI for the provider that dispensed the prescription (e.g. pharmacy).\n", "meta": {"terminology": "/terminology/providers/provider"}, "data_type": null, "quote": null, "tags": []}, "dispensing_date": {"name": "dispensing_date", "description": "Date the prescription was filled.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "ndc_code": {"name": "ndc_code", "description": "National drug code on the claim.", "meta": {"terminology": "/terminology/medications/ndc"}, "data_type": null, "quote": null, "tags": []}, "quantity": {"name": "quantity", "description": "Number of doses.", "meta": {}, "data_type": "integer", "quote": null, "tags": []}, "days_supply": {"name": "days_supply", "description": "Number of days supply.", "meta": {}, "data_type": "integer", "quote": null, "tags": []}, "refills": {"name": "refills", "description": "Number of refills for the prescription.", "meta": {}, "data_type": "integer", "quote": null, "tags": []}, "paid_date": {"name": "paid_date", "description": "Date the claim was paid.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "paid_amount": {"name": "paid_amount", "description": "Amount paid by the health insurer for the claim.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "allowed_amount": {"name": "allowed_amount", "description": "Contractual amount allowed to be paid by the payer + patient.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "coinsurance_amount": {"name": "coinsurance_amount", "description": "The total coinsurance charged on the claim by the provider.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "copayment_amount": {"name": "copayment_amount", "description": "The total copayment charged on the claim by the provider.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "deductible_amount": {"name": "deductible_amount", "description": "The total amount charged on the claim by the provider.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "data_source": {"name": "data_source", "description": "User-configured field that indicates the data source (e.g. typically named after the payer and state \"BCBS Tennessee\").\n", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "input_layer://models/_models.yml", "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"bind": false, "database": "tuva", "schema": "input_layer"}, "created_at": 1701215339.503119}, "model.input_layer.location": {"resource_type": "model", "depends_on": {"macros": ["macro.dbt.type_string", "macro.dbt.type_float"], "nodes": []}, "config": {"enabled": true, "alias": null, "schema": "input_layer", "database": "tuva", "tags": [], "meta": {}, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "bind": false, "post-hook": [], "pre-hook": []}, "database": "tuva", "schema": "input_layer", "fqn": ["input_layer", "location"], "unique_id": "model.input_layer.location", "raw_code": "select\n cast(null as {{ dbt.type_string() }} ) as location_id\n , cast(null as {{ dbt.type_string() }} ) as npi\n , cast(null as {{ dbt.type_string() }} ) as name\n , cast(null as {{ dbt.type_string() }} ) as facility_type\n , cast(null as {{ dbt.type_string() }} ) as parent_organization\n , cast(null as {{ dbt.type_string() }} ) as address\n , cast(null as {{ dbt.type_string() }} ) as city\n , cast(null as {{ dbt.type_string() }} ) as state\n , cast(null as {{ dbt.type_string() }} ) as zip_code\n , cast(null as {{ dbt.type_float() }} ) as latitude\n , cast(null as {{ dbt.type_float() }} ) as longitude\n , cast(null as {{ dbt.type_string() }} ) as data_source\nlimit 0", "language": "sql", "package_name": "input_layer", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/docs_generate", "path": "location.sql", "original_file_path": "models/location.sql", "name": "location", "alias": "location", "checksum": {"name": "sha256", "checksum": "ba8647dc0bcb914db16e0a9e250a0dc8137e68ce45ab3239a634be2e52a4ac5c"}, "tags": [], "refs": [], "sources": [], "metrics": [], "description": "The location table contains information on practice and facility locations where patients receive medical care.\n", "columns": {"location_id": {"name": "location_id", "description": "Unique identifier for each location.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "npi": {"name": "npi", "description": "The national provider identifier associated with the location e.g. facility_npi.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "name": {"name": "name", "description": "The name of the location.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "facility_type": {"name": "facility_type", "description": "The type of facility e.g. acute care hospital.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "parent_organization": {"name": "parent_organization", "description": "The parent organization associated with the facility.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "address": {"name": "address", "description": "The street address of the location.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "city": {"name": "city", "description": "The city of the location.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "state": {"name": "state", "description": "The state of the location.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "zip_code": {"name": "zip_code", "description": "The zip code of the location.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "latitude": {"name": "latitude", "description": "The latitude of the location.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "longitude": {"name": "longitude", "description": "The longitude of the location.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "data_source": {"name": "data_source", "description": "Custom description of the source system e.g. Epic.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "input_layer://models/_models.yml", "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"bind": false, "database": "tuva", "schema": "input_layer"}, "created_at": 1701215339.520928}, "model.input_layer.patient": {"resource_type": "model", "depends_on": {"macros": ["macro.dbt.type_string", "macro.dbt.type_int", "macro.dbt.type_float"], "nodes": []}, "config": {"enabled": true, "alias": null, "schema": "input_layer", "database": "tuva", "tags": [], "meta": {}, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "bind": false, "post-hook": [], "pre-hook": []}, "database": "tuva", "schema": "input_layer", "fqn": ["input_layer", "patient"], "unique_id": "model.input_layer.patient", "raw_code": "select\n cast(null as {{ dbt.type_string() }} ) as patient_id\n , cast(null as {{ dbt.type_string() }} ) as first_name\n , cast(null as {{ dbt.type_string() }} ) as last_name\n , cast(null as {{ dbt.type_string() }} ) as sex\n , cast(null as {{ dbt.type_string() }} ) as race\n , cast(null as date) as birth_date\n , cast(null as date) as death_date\n , cast(null as {{ dbt.type_int() }} ) as death_flag\n , cast(null as {{ dbt.type_string() }} ) as address\n , cast(null as {{ dbt.type_string() }} ) as city\n , cast(null as {{ dbt.type_string() }} ) as state\n , cast(null as {{ dbt.type_string() }} ) as zip_code\n , cast(null as {{ dbt.type_string() }} ) as county\n , cast(null as {{ dbt.type_float() }} ) as latitude\n , cast(null as {{ dbt.type_float() }} ) as longitude\n , cast(null as {{ dbt.type_string() }} ) as data_source\nlimit 0", "language": "sql", "package_name": "input_layer", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/docs_generate", "path": "patient.sql", "original_file_path": "models/patient.sql", "name": "patient", "alias": "patient", "checksum": {"name": "sha256", "checksum": "ac6c7c9003e3ba687d20f4de3f3a049c14e446671a31c7d69f89970ffe599e3c"}, "tags": [], "refs": [], "sources": [], "metrics": [], "description": "The patient table contains demographic and geographic information on patients.\n", "columns": {"patient_id": {"name": "patient_id", "description": "Unique identifier for each person across all datasets.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "first_name": {"name": "first_name", "description": "The first name of the patient.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "last_name": {"name": "last_name", "description": "The last name of the patient.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "sex": {"name": "sex", "description": "The gender of the patient.", "meta": {"terminology": "/terminology/demographics/gender"}, "data_type": null, "quote": null, "tags": []}, "race": {"name": "race", "description": "The race of the patient.", "meta": {"terminology": "/terminology/demographics/race"}, "data_type": null, "quote": null, "tags": []}, "birth_date": {"name": "birth_date", "description": "The birth date of the patient.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "death_date": {"name": "death_date", "description": "The death date of the patient if there is one.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "death_flag": {"name": "death_flag", "description": "A flag indicating if the patient has died.", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "address": {"name": "address", "description": "The address of the patient.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "city": {"name": "city", "description": "The city where the patient lives.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "state": {"name": "state", "description": "The state where the patient lives.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "zip_code": {"name": "zip_code", "description": "The zip code for the patient.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "county": {"name": "county", "description": "The county for the patient.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "latitude": {"name": "latitude", "description": "The latitude for the patient.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "longitude": {"name": "longitude", "description": "The longitude for the patient.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "data_source": {"name": "data_source", "description": "User-configured field that indicates the data source (e.g. typically named after the payer and state \"BCBS Tennessee\").\n", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "input_layer://models/_models.yml", "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"bind": false, "database": "tuva", "schema": "input_layer"}, "created_at": 1701215339.532119}, "model.input_layer.condition": {"resource_type": "model", "depends_on": {"macros": ["macro.dbt.type_string", "macro.dbt.type_int"], "nodes": []}, "config": {"enabled": true, "alias": null, "schema": "input_layer", "database": "tuva", "tags": [], "meta": {}, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "bind": false, "post-hook": [], "pre-hook": []}, "database": "tuva", "schema": "input_layer", "fqn": ["input_layer", "condition"], "unique_id": "model.input_layer.condition", "raw_code": "select\n cast(null as {{ dbt.type_string() }} ) as condition_id\n , cast(null as {{ dbt.type_string() }} ) as patient_id\n , cast(null as {{ dbt.type_string() }} ) as encounter_id\n , cast(null as {{ dbt.type_string() }} ) as claim_id\n , cast(null as date) as recorded_date\n , cast(null as date) as onset_date\n , cast(null as date) as resolved_date\n , cast(null as {{ dbt.type_string() }} ) as status\n , cast(null as {{ dbt.type_string() }} ) as condition_type\n , cast(null as {{ dbt.type_string() }} ) as source_code_type\n , cast(null as {{ dbt.type_string() }} ) as source_code\n , cast(null as {{ dbt.type_string() }} ) as source_description\n , cast(null as {{ dbt.type_string() }} ) as normalized_code_type\n , cast(null as {{ dbt.type_string() }} ) as normalized_code\n , cast(null as {{ dbt.type_string() }} ) as normalized_description\n , cast(null as {{ dbt.type_int() }} ) as condition_rank\n , cast(null as {{ dbt.type_string() }} ) as present_on_admit_code\n , cast(null as {{ dbt.type_string() }} ) as present_on_admit_description\n , cast(null as {{ dbt.type_string() }} ) as data_source\nlimit 0", "language": "sql", "package_name": "input_layer", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/docs_generate", "path": "condition.sql", "original_file_path": "models/condition.sql", "name": "condition", "alias": "condition", "checksum": {"name": "sha256", "checksum": "9e67f9077ebefb43b868ea2c8fe3ff38a588ae4fe6cc5690614789f2df29fe6a"}, "tags": [], "refs": [], "sources": [], "metrics": [], "description": "The condition table contains information related to medical conditions patients have, including problems, admitting diagnosis codes, and billable diagnosis codes.\n", "columns": {"condition_id": {"name": "condition_id", "description": "Unique identifier for each condition in the table.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "patient_id": {"name": "patient_id", "description": "Unique identifier for each patient in the dataset.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "encounter_id": {"name": "encounter_id", "description": "Unique identifier for each encounter.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "claim_id": {"name": "claim_id", "description": "Unique identifier for each claim.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "recorded_date": {"name": "recorded_date", "description": "Date when the condition was recorded.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "onset_date": {"name": "onset_date", "description": "Date when the condition first occurred.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "resolved_date": {"name": "resolved_date", "description": "Date when the condition was resolved.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "status": {"name": "status", "description": "Status of the condition.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "condition_type": {"name": "condition_type", "description": "The type of condition i.e. problem, admitting, or billing.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "source_code_type": {"name": "source_code_type", "description": "The type of condition code reported in the source system e.g. ICD-10-CM.\n", "meta": {"terminology": "/terminology/tuva-concepts/code-type"}, "data_type": null, "quote": null, "tags": []}, "source_code": {"name": "source_code", "description": "The condition code in the source system e.g. the ICD-10 code.\n", "meta": {"terminology": "/terminology/conditions-and-procedures/icd-10-cm"}, "data_type": null, "quote": null, "tags": []}, "source_description": {"name": "source_description", "description": "Description of the condition code in the source system.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "normalized_code_type": {"name": "normalized_code_type", "description": "The normalized type of condition code.", "meta": {"terminology": "/terminology/tuva-concepts/code-type"}, "data_type": null, "quote": null, "tags": []}, "normalized_code": {"name": "normalized_code", "description": "The normalized condition code.", "meta": {"terminology": "/terminology/conditions-and-procedures/icd-10-cm"}, "data_type": null, "quote": null, "tags": []}, "normalized_description": {"name": "normalized_description", "description": "Normalized description of the condition code.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "condition_rank": {"name": "condition_rank", "description": "The numerical ranking of a diagnosis code in a claim. Principle diagnosis code is given a ranking of 1. Claims data typically has a strict ranking of conditions whereas medical records will often not have this information or the information won't be accurate.\n", "meta": {}, "data_type": "integer", "quote": null, "tags": []}, "present_on_admit_code": {"name": "present_on_admit_code", "description": "The present_on_admit_code related to the condition.", "meta": {"terminology": "/terminology/administrative-codes/present-on-admission"}, "data_type": null, "quote": null, "tags": []}, "present_on_admit_description": {"name": "present_on_admit_description", "description": "The description of the present_on_admit_code for the condition.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "data_source": {"name": "data_source", "description": "User-configured field that indicates the data source (e.g. typically named after the payer and state \"BCBS Tennessee\").\n", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "input_layer://models/_models.yml", "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"bind": false, "database": "tuva", "schema": "input_layer"}, "created_at": 1701215339.5077288}, "model.input_layer.medication": {"resource_type": "model", "depends_on": {"macros": ["macro.dbt.type_string", "macro.dbt.type_int"], "nodes": []}, "config": {"enabled": true, "alias": null, "schema": "input_layer", "database": "tuva", "tags": [], "meta": {}, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "bind": false, "post-hook": [], "pre-hook": []}, "database": "tuva", "schema": "input_layer", "fqn": ["input_layer", "medication"], "unique_id": "model.input_layer.medication", "raw_code": "select \n cast(null as {{ dbt.type_string() }} ) as medication_id\n , cast(null as {{ dbt.type_string() }} ) as patient_id\n , cast(null as {{ dbt.type_string() }} ) as encounter_id\n , cast(null as date) as dispensing_date\n , cast(null as date) as prescribing_date\n , cast(null as {{ dbt.type_string() }} ) as source_code_type\n , cast(null as {{ dbt.type_string() }} ) as source_code\n , cast(null as {{ dbt.type_string() }} ) as source_description\n , cast(null as {{ dbt.type_string() }} ) as ndc_code\n , cast(null as {{ dbt.type_string() }} ) as ndc_description\n , cast(null as {{ dbt.type_string() }} ) as rxnorm_code\n , cast(null as {{ dbt.type_string() }} ) as rxnorm_description\n , cast(null as {{ dbt.type_string() }} ) as atc_code\n , cast(null as {{ dbt.type_string() }} ) as atc_description\n , cast(null as {{ dbt.type_string() }} ) as route\n , cast(null as {{ dbt.type_string() }} ) as strength\n , cast(null as {{ dbt.type_int() }} ) as quantity\n , cast(null as {{ dbt.type_string() }} ) as quantity_unit\n , cast(null as {{ dbt.type_int() }} ) as days_supply\n , cast(null as {{ dbt.type_string() }} ) as practitioner_id\n , cast(null as {{ dbt.type_string() }} ) as data_source\nlimit 0", "language": "sql", "package_name": "input_layer", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/docs_generate", "path": "medication.sql", "original_file_path": "models/medication.sql", "name": "medication", "alias": "medication", "checksum": {"name": "sha256", "checksum": "1e22d2c43fdffbfca36c3f69b287c7a45a81d97366aa8ffe3314f1e3f02c0a4a"}, "tags": [], "refs": [], "sources": [], "metrics": [], "description": "The medication table contains information on medications ordered and/or administered during a patient encounter.\n", "columns": {"medication_id": {"name": "medication_id", "description": "Unique identifier for each medication in the table.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "patient_id": {"name": "patient_id", "description": "Unique identifier for each patient in the dataset.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "encounter_id": {"name": "encounter_id", "description": "Unique identifier for each encounter in the dataset.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "dispensing_date": {"name": "dispensing_date", "description": "Date the medication was dispensed.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "prescribing_date": {"name": "prescribing_date", "description": "Date the medication was prescribed.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "source_code_type": {"name": "source_code_type", "description": "The source code type of the medication.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "source_code": {"name": "source_code", "description": "The source code for the medication.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "source_description": {"name": "source_description", "description": "The source description of the medication.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "ndc_code": {"name": "ndc_code", "description": "National drug code associated with the medication.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "ndc_description": {"name": "ndc_description", "description": "Description for the NDC.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "rxnorm_code": {"name": "rxnorm_code", "description": "RxNorm code associated with the medication.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "rxnorm_description": {"name": "rxnorm_description", "description": "Description for the RxNorm code.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "atc_code": {"name": "atc_code", "description": "ATC code for the medication.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "atc_description": {"name": "atc_description", "description": "Description for the ATC code.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "route": {"name": "route", "description": "The route used to administer the medication.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "strength": {"name": "strength", "description": "The strength of the medication.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "quantity": {"name": "quantity", "description": "The quantity of the medication.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "quantity_unit": {"name": "quantity_unit", "description": "The units for the quantity.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "days_supply": {"name": "days_supply", "description": "The number of days supply included.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "practitioner_id": {"name": "practitioner_id", "description": "Unique identifier for the practitioner who ordered the medication.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "data_source": {"name": "data_source", "description": "Custom description of the source system e.g. Epic.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "input_layer://models/_models.yml", "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"bind": false, "database": "tuva", "schema": "input_layer"}, "created_at": 1701215339.524847}, "model.input_layer.lab_result": {"resource_type": "model", "depends_on": {"macros": ["macro.dbt.type_string", "macro.dbt.type_int"], "nodes": []}, "config": {"enabled": true, "alias": null, "schema": "input_layer", "database": "tuva", "tags": [], "meta": {}, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "bind": false, "post-hook": [], "pre-hook": []}, "database": "tuva", "schema": "input_layer", "fqn": ["input_layer", "lab_result"], "unique_id": "model.input_layer.lab_result", "raw_code": "select\n cast(null as {{ dbt.type_string() }} ) as lab_result_id\n , cast(null as {{ dbt.type_string() }} ) as patient_id\n , cast(null as {{ dbt.type_string() }} ) as encounter_id\n , cast(null as {{ dbt.type_string() }} ) as accession_number\n , cast(null as {{ dbt.type_string() }} ) as source_code_type\n , cast(null as {{ dbt.type_string() }} ) as source_code\n , cast(null as {{ dbt.type_string() }} ) as source_description\n , cast(null as {{ dbt.type_string() }} ) as source_component\n , cast(null as {{ dbt.type_string() }} ) as normalized_code_type\n , cast(null as {{ dbt.type_string() }} ) as normalized_code\n , cast(null as {{ dbt.type_string() }} ) as normalized_description\n , cast(null as {{ dbt.type_string() }} ) as normalized_component\n , cast(null as {{ dbt.type_string() }} ) as status\n , cast(null as {{ dbt.type_string() }} ) as result\n , cast(null as date) as result_date\n , cast(null as date) as collection_date\n , cast(null as {{ dbt.type_string() }} ) as source_units\n , cast(null as {{ dbt.type_string() }} ) as normalized_units\n , cast(null as {{ dbt.type_string() }} ) as source_reference_range_low\n , cast(null as {{ dbt.type_string() }} ) as source_reference_range_high\n , cast(null as {{ dbt.type_string() }} ) as normalized_reference_range_low\n , cast(null as {{ dbt.type_string() }} ) as normalized_reference_range_high\n , cast(null as {{ dbt.type_int() }} ) as source_abnormal_flag\n , cast(null as {{ dbt.type_int() }} ) as normalized_abnormal_flag\n , cast(null as {{ dbt.type_string() }} ) as specimen\n , cast(null as {{ dbt.type_string() }} ) as ordering_practitioner_id\n , cast(null as {{ dbt.type_string() }} ) as data_source\nlimit 0", "language": "sql", "package_name": "input_layer", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/docs_generate", "path": "lab_result.sql", "original_file_path": "models/lab_result.sql", "name": "lab_result", "alias": "lab_result", "checksum": {"name": "sha256", "checksum": "2b70e3d7b8e2e7476af0eab32f835956d4a63d678b9cf9caa394030cb98da36f"}, "tags": [], "refs": [], "sources": [], "metrics": [], "description": "The lab result table contains information about lab test results, including the LOINC code and description, units, reference range, and result.\n", "columns": {"lab_result_id": {"name": "lab_result_id", "description": "Unique identifier for the lab test.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "patient_id": {"name": "patient_id", "description": "Unique identifier for each patient.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "encounter_id": {"name": "encounter_id", "description": "Unique identifier for each encounter. Included in this table if the lab test can be linked to an encounter.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "accession_number": {"name": "accession_number", "description": "The lab order number from the source system.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "source_code_type": {"name": "source_code_type", "description": "The code type from the source system.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "source_code": {"name": "source_code", "description": "The code for the lab from the source system.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "source_description": {"name": "source_description", "description": "The description for the lab test from the source system.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "source_component": {"name": "source_component", "description": "The description for the component of the test from the source system.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "normalized_code_type": {"name": "normalized_code_type", "description": "The normalized code type.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "normalized_code": {"name": "normalized_code", "description": "The normalized code e.g. LOINC.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "normalized_description": {"name": "normalized_description", "description": "The normalized description for the code.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "normalized_component": {"name": "normalized_component", "description": "The normalized component.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "status": {"name": "status", "description": "The status of the lab test.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "result": {"name": "result", "description": "The result of the lab test.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "result_date": {"name": "result_date", "description": "Date of the test result.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "collection_date": {"name": "collection_date", "description": "Date the test was collected.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "source_units": {"name": "source_units", "description": "Source units of the lab test.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "normalized_units": {"name": "normalized_units", "description": "Normalized units of the lab test.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "source_reference_range_low": {"name": "source_reference_range_low", "description": "The low end of the reference range from the source system.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "source_reference_range_high": {"name": "source_reference_range_high", "description": "The high end of the reference range from the source system.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "normalized_reference_range_low": {"name": "normalized_reference_range_low", "description": "The normalized low end of the reference range.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "normalized_reference_range_high": {"name": "normalized_reference_range_high", "description": "The normalized high end of the reference range.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "source_abnormal_flag": {"name": "source_abnormal_flag", "description": "Indicates whether the result is abnormal or normal.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "normalized_abnormal_flag": {"name": "normalized_abnormal_flag", "description": "Normalized abnormal flag.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "specimen": {"name": "specimen", "description": "The type of specimen e.g. blood, plasma, urine.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "ordering_practitioner_id": {"name": "ordering_practitioner_id", "description": "Unique identifier for the practitioner who ordered the lab test.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "data_source": {"name": "data_source", "description": "Custom description of the source system e.g. Epic.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "input_layer://models/_models.yml", "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"bind": false, "database": "tuva", "schema": "input_layer"}, "created_at": 1701215339.51821}, "seed.input_layer.eligibility_seed": {"resource_type": "seed", "depends_on": {"macros": [], "nodes": []}, "config": {"enabled": true, "alias": null, "schema": "_tuva_synthetic", "database": null, "tags": [], "meta": {}, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"patient_id": "varchar(255)", "member_id": "varchar(255)", "gender": "varchar(255)", "race": "varchar(255)", "birth_date": "date", "death_date": "date", "death_flag": "integer", "enrollment_start_date": "date", "enrollment_end_date": "date", "payer": "varchar(255)", "payer_type": "varchar(255)", "plan": "varchar(255)", "original_reason_entitlement_code": "varchar(255)", "dual_status_code": "varchar(255)", "medicare_status_code": "varchar(255)", "first_name": "varchar(255)", "last_name": "varchar(255)", "address": "varchar(255)", "city": "varchar(255)", "state": "varchar(255)", "zip_code": "varchar(255)", "phone": "varchar(255)", "data_source": "varchar(255)"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "quote_columns": null, "post-hook": [], "pre-hook": []}, "database": "dev_sarah", "schema": "_tuva_synthetic", "fqn": ["input_layer", "eligibility_seed"], "unique_id": "seed.input_layer.eligibility_seed", "raw_code": "", "language": "sql", "package_name": "input_layer", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/docs_generate", "path": "eligibility_seed.csv", "original_file_path": "../seeds/eligibility_seed.csv", "name": "eligibility_seed", "alias": "eligibility_seed", "checksum": {"name": "sha256", "checksum": "0f576b654df2062fa4770c70b5ee48bbf37333a5d8362500909ba7c280cbad63"}, "tags": [], "refs": [], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "input_layer://../seeds/_seeds.yml", "compiled_path": null, "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)", "plan": "varchar(255)", "original_reason_entitlement_code": "varchar(255)", "dual_status_code": "varchar(255)", "medicare_status_code": "varchar(255)", "first_name": "varchar(255)", "last_name": "varchar(255)", "address": "varchar(255)", "city": "varchar(255)", "state": "varchar(255)", "zip_code": "varchar(255)", "phone": "varchar(255)", "data_source": "varchar(255)"}}, "created_at": 1701215339.5481348}, "seed.input_layer.medical_claim_seed": {"resource_type": "seed", "depends_on": {"macros": [], "nodes": []}, "config": {"enabled": true, "alias": null, "schema": "_tuva_synthetic", "database": null, "tags": [], "meta": {}, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"claim_id": "varchar(255)", "claim_line_number": "integer", "claim_type": "varchar(255)", "patient_id": "varchar(255)", "member_id": "varchar(255)", "payer": "varchar(255)", "plan": "varchar(255)", "claim_start_date": "date", "claim_end_date": "date", "claim_line_start_date": "date", "claim_line_end_date": "date", "admission_date": "date", "discharge_date": "date", "admit_source_code": "varchar(255)", "admit_type_code": "varchar(255)", "discharge_disposition_code": "varchar(255)", "place_of_service_code": "varchar(255)", "bill_type_code": "varchar(255)", "ms_drg_code": "varchar(255)", "apr_drg_code": "varchar(255)", "revenue_center_code": "varchar(255)", "service_unit_quantity": "integer", "hcpcs_code": "varchar(255)", "hcpcs_modifier_1": "varchar(255)", "hcpcs_modifier_2": "varchar(255)", "hcpcs_modifier_3": "varchar(255)", "hcpcs_modifier_4": "varchar(255)", "hcpcs_modifier_5": "varchar(255)", "rendering_npi": "varchar(255)", "billing_npi": "varchar(255)", "facility_npi": "varchar(255)", "paid_date": "date", "paid_amount": "float", "allowed_amount": "float", "charge_amount": "float", "coinsurance_amount": "float", "copayment_amount": "float", "deductible_amount": "float", "total_cost_amount": "float", "diagnosis_code_type": "varchar(255)", "diagnosis_code_1": "varchar(255)", "diagnosis_code_2": "varchar(255)", "diagnosis_code_3": "varchar(255)", "diagnosis_code_4": "varchar(255)", "diagnosis_code_5": "varchar(255)", "diagnosis_code_6": "varchar(255)", "diagnosis_code_7": "varchar(255)", "diagnosis_code_8": "varchar(255)", "diagnosis_code_9": "varchar(255)", "diagnosis_code_10": "varchar(255)", "diagnosis_code_11": "varchar(255)", "diagnosis_code_12": "varchar(255)", "diagnosis_code_13": "varchar(255)", "diagnosis_code_14": "varchar(255)", "diagnosis_code_15": "varchar(255)", "diagnosis_code_16": "varchar(255)", "diagnosis_code_17": "varchar(255)", "diagnosis_code_18": "varchar(255)", "diagnosis_code_19": "varchar(255)", "diagnosis_code_20": "varchar(255)", "diagnosis_code_21": "varchar(255)", "diagnosis_code_22": "varchar(255)", "diagnosis_code_23": "varchar(255)", "diagnosis_code_24": "varchar(255)", "diagnosis_code_25": "varchar(255)", "diagnosis_poa_1": "varchar(255)", "diagnosis_poa_2": "varchar(255)", "diagnosis_poa_3": "varchar(255)", "diagnosis_poa_4": "varchar(255)", "diagnosis_poa_5": "varchar(255)", "diagnosis_poa_6": "varchar(255)", "diagnosis_poa_7": "varchar(255)", "diagnosis_poa_8": "varchar(255)", "diagnosis_poa_9": "varchar(255)", "diagnosis_poa_10": "varchar(255)", "diagnosis_poa_11": "varchar(255)", "diagnosis_poa_12": "varchar(255)", "diagnosis_poa_13": "varchar(255)", "diagnosis_poa_14": "varchar(255)", "diagnosis_poa_15": "varchar(255)", "diagnosis_poa_16": "varchar(255)", "diagnosis_poa_17": "varchar(255)", "diagnosis_poa_18": "varchar(255)", "diagnosis_poa_19": "varchar(255)", "diagnosis_poa_20": "varchar(255)", "diagnosis_poa_21": "varchar(255)", "diagnosis_poa_22": "varchar(255)", "diagnosis_poa_23": "varchar(255)", "diagnosis_poa_24": "varchar(255)", "diagnosis_poa_25": "varchar(255)", "procedure_code_type": "varchar(255)", "procedure_code_1": "varchar(255)", "procedure_code_2": "varchar(255)", "procedure_code_3": "varchar(255)", "procedure_code_4": "varchar(255)", "procedure_code_5": "varchar(255)", "procedure_code_6": "varchar(255)", "procedure_code_7": "varchar(255)", "procedure_code_8": "varchar(255)", "procedure_code_9": "varchar(255)", "procedure_code_10": "varchar(255)", "procedure_code_11": "varchar(255)", "procedure_code_12": "varchar(255)", "procedure_code_13": "varchar(255)", "procedure_code_14": "varchar(255)", "procedure_code_15": "varchar(255)", "procedure_code_16": "varchar(255)", "procedure_code_17": "varchar(255)", "procedure_code_18": "varchar(255)", "procedure_code_19": "varchar(255)", "procedure_code_20": "varchar(255)", "procedure_code_21": "varchar(255)", "procedure_code_22": "varchar(255)", "procedure_code_23": "varchar(255)", "procedure_code_24": "varchar(255)", "procedure_code_25": "varchar(255)", "procedure_date_1": "date", "procedure_date_2": "date", "procedure_date_3": "date", "procedure_date_4": "date", "procedure_date_5": "date", "procedure_date_6": "date", "procedure_date_7": "date", "procedure_date_8": "date", "procedure_date_9": "date", "procedure_date_10": "date", "procedure_date_11": "date", "procedure_date_12": "date", "procedure_date_13": "date", "procedure_date_14": "date", "procedure_date_15": "date", "procedure_date_16": "date", "procedure_date_17": "date", "procedure_date_18": "date", "procedure_date_19": "date", "procedure_date_20": "date", "procedure_date_21": "date", "procedure_date_22": "date", "procedure_date_23": "date", "procedure_date_24": "date", "procedure_date_25": "date", "data_source": "varchar(255)"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "quote_columns": null, "post-hook": [], "pre-hook": []}, "database": "dev_sarah", "schema": "_tuva_synthetic", "fqn": ["input_layer", "medical_claim_seed"], "unique_id": "seed.input_layer.medical_claim_seed", "raw_code": "", "language": "sql", "package_name": "input_layer", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/docs_generate", "path": "medical_claim_seed.csv", "original_file_path": "../seeds/medical_claim_seed.csv", "name": "medical_claim_seed", "alias": "medical_claim_seed", "checksum": {"name": "sha256", "checksum": "253b54a7889f13cab9f6803280cd07105cfcf637cfa1253fe4b7158222ce0d51"}, "tags": [], "refs": [], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "input_layer://../seeds/_seeds.yml", "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"schema": "_tuva_synthetic", "enabled": true, "column_types": {"claim_id": "varchar(255)", "claim_line_number": "integer", "claim_type": "varchar(255)", "patient_id": "varchar(255)", "member_id": "varchar(255)", "payer": "varchar(255)", "plan": "varchar(255)", "claim_start_date": "date", "claim_end_date": "date", "claim_line_start_date": "date", "claim_line_end_date": "date", "admission_date": "date", "discharge_date": "date", "admit_source_code": "varchar(255)", "admit_type_code": "varchar(255)", "discharge_disposition_code": "varchar(255)", "place_of_service_code": "varchar(255)", "bill_type_code": "varchar(255)", "ms_drg_code": "varchar(255)", "apr_drg_code": "varchar(255)", "revenue_center_code": "varchar(255)", "service_unit_quantity": "integer", "hcpcs_code": "varchar(255)", "hcpcs_modifier_1": "varchar(255)", "hcpcs_modifier_2": "varchar(255)", "hcpcs_modifier_3": "varchar(255)", "hcpcs_modifier_4": "varchar(255)", "hcpcs_modifier_5": "varchar(255)", "rendering_npi": "varchar(255)", "billing_npi": "varchar(255)", "facility_npi": "varchar(255)", "paid_date": "date", "paid_amount": "float", "allowed_amount": "float", "charge_amount": "float", "coinsurance_amount": "float", "copayment_amount": "float", "deductible_amount": "float", "total_cost_amount": "float", "diagnosis_code_type": "varchar(255)", "diagnosis_code_1": "varchar(255)", "diagnosis_code_2": "varchar(255)", "diagnosis_code_3": "varchar(255)", "diagnosis_code_4": "varchar(255)", "diagnosis_code_5": "varchar(255)", "diagnosis_code_6": "varchar(255)", "diagnosis_code_7": "varchar(255)", "diagnosis_code_8": "varchar(255)", "diagnosis_code_9": "varchar(255)", "diagnosis_code_10": "varchar(255)", "diagnosis_code_11": "varchar(255)", "diagnosis_code_12": "varchar(255)", "diagnosis_code_13": "varchar(255)", "diagnosis_code_14": "varchar(255)", "diagnosis_code_15": "varchar(255)", "diagnosis_code_16": "varchar(255)", "diagnosis_code_17": "varchar(255)", "diagnosis_code_18": "varchar(255)", "diagnosis_code_19": "varchar(255)", "diagnosis_code_20": "varchar(255)", "diagnosis_code_21": "varchar(255)", "diagnosis_code_22": "varchar(255)", "diagnosis_code_23": "varchar(255)", "diagnosis_code_24": "varchar(255)", "diagnosis_code_25": "varchar(255)", "diagnosis_poa_1": "varchar(255)", "diagnosis_poa_2": "varchar(255)", "diagnosis_poa_3": "varchar(255)", "diagnosis_poa_4": "varchar(255)", "diagnosis_poa_5": "varchar(255)", "diagnosis_poa_6": "varchar(255)", "diagnosis_poa_7": "varchar(255)", "diagnosis_poa_8": "varchar(255)", "diagnosis_poa_9": "varchar(255)", "diagnosis_poa_10": "varchar(255)", "diagnosis_poa_11": "varchar(255)", "diagnosis_poa_12": "varchar(255)", "diagnosis_poa_13": "varchar(255)", "diagnosis_poa_14": "varchar(255)", "diagnosis_poa_15": "varchar(255)", "diagnosis_poa_16": "varchar(255)", "diagnosis_poa_17": "varchar(255)", "diagnosis_poa_18": "varchar(255)", "diagnosis_poa_19": "varchar(255)", "diagnosis_poa_20": "varchar(255)", "diagnosis_poa_21": "varchar(255)", "diagnosis_poa_22": "varchar(255)", "diagnosis_poa_23": "varchar(255)", "diagnosis_poa_24": "varchar(255)", "diagnosis_poa_25": "varchar(255)", "procedure_code_type": "varchar(255)", "procedure_code_1": "varchar(255)", "procedure_code_2": "varchar(255)", "procedure_code_3": "varchar(255)", "procedure_code_4": "varchar(255)", "procedure_code_5": "varchar(255)", "procedure_code_6": "varchar(255)", "procedure_code_7": "varchar(255)", "procedure_code_8": "varchar(255)", "procedure_code_9": "varchar(255)", "procedure_code_10": "varchar(255)", "procedure_code_11": "varchar(255)", "procedure_code_12": "varchar(255)", "procedure_code_13": "varchar(255)", "procedure_code_14": "varchar(255)", "procedure_code_15": "varchar(255)", "procedure_code_16": "varchar(255)", "procedure_code_17": "varchar(255)", "procedure_code_18": "varchar(255)", "procedure_code_19": "varchar(255)", "procedure_code_20": "varchar(255)", "procedure_code_21": "varchar(255)", "procedure_code_22": "varchar(255)", "procedure_code_23": "varchar(255)", "procedure_code_24": "varchar(255)", "procedure_code_25": "varchar(255)", "procedure_date_1": "date", "procedure_date_2": "date", "procedure_date_3": "date", "procedure_date_4": "date", "procedure_date_5": "date", "procedure_date_6": "date", "procedure_date_7": "date", "procedure_date_8": "date", "procedure_date_9": "date", "procedure_date_10": "date", "procedure_date_11": "date", "procedure_date_12": "date", "procedure_date_13": "date", "procedure_date_14": "date", "procedure_date_15": "date", "procedure_date_16": "date", "procedure_date_17": "date", "procedure_date_18": "date", "procedure_date_19": "date", "procedure_date_20": "date", "procedure_date_21": "date", "procedure_date_22": "date", "procedure_date_23": "date", "procedure_date_24": "date", "procedure_date_25": "date", "data_source": "varchar(255)"}}, "created_at": 1701215339.5914721}, "seed.input_layer.pharmacy_claim_seed": {"resource_type": "seed", "depends_on": {"macros": [], "nodes": []}, "config": {"enabled": true, "alias": null, "schema": "_tuva_synthetic", "database": null, "tags": [], "meta": {}, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"claim_id": "varchar(255)", "claim_line_number": "integer", "patient_id": "varchar(255)", "member_id": "varchar(255)", "payer": "varchar(255)", "plan": "varchar(255)", "prescribing_provider_npi": "varchar(255)", "dispensing_provider_npi": "varchar(255)", "dispensing_date": "date", "ndc_code": "varchar(255)", "quantity": "integer", "days_supply": "integer", "refills": "integer", "paid_date": "date", "paid_amount": "float", "allowed_amount": "float", "data_source": "varchar(255)"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "quote_columns": null, "post-hook": [], "pre-hook": []}, "database": "dev_sarah", "schema": "_tuva_synthetic", "fqn": ["input_layer", "pharmacy_claim_seed"], "unique_id": "seed.input_layer.pharmacy_claim_seed", "raw_code": "", "language": "sql", "package_name": "input_layer", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/docs_generate", "path": "pharmacy_claim_seed.csv", "original_file_path": "../seeds/pharmacy_claim_seed.csv", "name": "pharmacy_claim_seed", "alias": "pharmacy_claim_seed", "checksum": {"name": "sha256", "checksum": "66096b86d7bd198c82e3c67c5546791e094b980d06ab9379d00e3b58c054dfd0"}, "tags": [], "refs": [], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "input_layer://../seeds/_seeds.yml", "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"schema": "_tuva_synthetic", "enabled": true, "column_types": {"claim_id": "varchar(255)", "claim_line_number": "integer", "patient_id": "varchar(255)", "member_id": "varchar(255)", "payer": "varchar(255)", "plan": "varchar(255)", "prescribing_provider_npi": "varchar(255)", "dispensing_provider_npi": "varchar(255)", "dispensing_date": "date", "ndc_code": "varchar(255)", "quantity": "integer", "days_supply": "integer", "refills": "integer", "paid_date": "date", "paid_amount": "float", "allowed_amount": "float", "data_source": "varchar(255)"}}, "created_at": 1701215339.597666}, "model.the_tuva_project.insights__count_claim_by_claim_type": {"resource_type": "model", "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.core__medical_claim", "model.the_tuva_project.core__pharmacy_claim"]}, "config": {"enabled": true, "alias": "count_claim_by_claim_type", "schema": "insights", "database": null, "tags": ["insights"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "bind": false, "columns": [{"name": "claim_type", "description": "Indicates whether the claim is professional (CMS-1500), institutional (UB-04), dental, vision, or pharmacy."}, {"name": "distinct_claim_count", "description": "Count of distinct claims."}], "post-hook": [], "pre-hook": []}, "database": "dev_sarah", "schema": "insights", "fqn": ["the_tuva_project", "insights", "final", "insights__count_claim_by_claim_type"], "unique_id": "model.the_tuva_project.insights__count_claim_by_claim_type", "raw_code": "{{ config(\r\n enabled = var('insights_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r\n )\r\n}}\r\n\r\n\r\nselect \r\n claim_type\r\n , count(distinct claim_id) as distinct_claim_count\r\nfrom {{ ref('core__medical_claim') }}\r\ngroup by claim_type\r\nunion all\r\nselect \r\n 'pharmacy'\r\n , count(distinct claim_id) as distinct_claim_count\r\nfrom {{ ref('core__pharmacy_claim') }}", "language": "sql", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/the_tuva_project", "path": "insights/final/insights__count_claim_by_claim_type.sql", "original_file_path": "models/insights/final/insights__count_claim_by_claim_type.sql", "name": "insights__count_claim_by_claim_type", "alias": "count_claim_by_claim_type", "checksum": {"name": "sha256", "checksum": "aac53ff2bb99be715d6cad672ed44d502f2bf6ff0c6db695caa45600408b1b1f"}, "tags": ["insights"], "refs": [["core__medical_claim"], ["core__pharmacy_claim"]], "sources": [], "metrics": [], "description": "Count of distinct claims by claim type.", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://models/insights/insights_models.yml", "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"schema": "insights", "alias": "count_claim_by_claim_type", "tags": ["insights"], "materialized": "table", "columns": [{"name": "claim_type", "description": "Indicates whether the claim is professional (CMS-1500), institutional (UB-04), dental, vision, or pharmacy."}, {"name": "distinct_claim_count", "description": "Count of distinct claims."}], "enabled": true, "bind": false}, "created_at": 1701215339.6027362}, "model.the_tuva_project.insights__count_claim_by_service_category": {"resource_type": "model", "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.core__medical_claim", "model.the_tuva_project.core__medical_claim"]}, "config": {"enabled": true, "alias": "count_claim_by_service_category", "schema": "insights", "database": null, "tags": ["insights"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "bind": false, "columns": [{"name": "service_category_type", "description": "The broader service category a claim belongs to."}, {"name": "service_category", "description": "The more specific service category a claim belongs to."}, {"name": "distinct_claim_count", "description": "Count of distinct claims."}], "post-hook": [], "pre-hook": []}, "database": "dev_sarah", "schema": "insights", "fqn": ["the_tuva_project", "insights", "final", "insights__count_claim_by_service_category"], "unique_id": "model.the_tuva_project.insights__count_claim_by_service_category", "raw_code": "{{ config(\r\n enabled = var('insights_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r\n )\r\n}}\r\n\r\nselect \r\n 'service_category_1' as service_category_type\r\n , service_category_1 as service_category\r\n , count(distinct claim_id) as distinct_claim_count\r\nfrom {{ ref('core__medical_claim') }}\r\ngroup by service_category_1\r\n\r\nunion all\r\n\r\nselect \r\n 'service_category_2' as service_category_type\r\n , service_category_2 as service_category\r\n , count(distinct claim_id) as distinct_claim_count\r\nfrom {{ ref('core__medical_claim') }}\r\ngroup by service_category_2", "language": "sql", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/the_tuva_project", "path": "insights/final/insights__count_claim_by_service_category.sql", "original_file_path": "models/insights/final/insights__count_claim_by_service_category.sql", "name": "insights__count_claim_by_service_category", "alias": "count_claim_by_service_category", "checksum": {"name": "sha256", "checksum": "a609ab061fbf9f188e5f00f37160f10b8037dac58cb6f9aeb7791d235f3907ae"}, "tags": ["insights"], "refs": [["core__medical_claim"], ["core__medical_claim"]], "sources": [], "metrics": [], "description": "Count of distinct claims by service category.", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://models/insights/insights_models.yml", "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"schema": "insights", "alias": "count_claim_by_service_category", "tags": ["insights"], "materialized": "table", "columns": [{"name": "service_category_type", "description": "The broader service category a claim belongs to."}, {"name": "service_category", "description": "The more specific service category a claim belongs to."}, {"name": "distinct_claim_count", "description": "Count of distinct claims."}], "enabled": true, "bind": false}, "created_at": 1701215339.609445}, "model.the_tuva_project.insights__trend_count_claim_by_claim_type": {"resource_type": "model", "depends_on": {"macros": ["macro.the_tuva_project.date_part", "macro.dbt.type_string"], "nodes": ["model.the_tuva_project.core__medical_claim"]}, "config": {"enabled": true, "alias": "trend_count_claim_by_claim_type", "schema": "insights", "database": null, "tags": ["insights"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "bind": false, "columns": [{"name": "year_month", "description": "Year and month of the claim end date."}, {"name": "claim_type", "description": "Indicates whether the claim is professional (CMS-1500), institutional (UB-04), dental, or vision."}, {"name": "distinct_claim_count", "description": "Count of distinct claims."}, {"name": "distinct_claim_count_change", "description": "Change in distinct claim count from the previous year month."}, {"name": "distinct_claim_percentage_change", "description": "Percent in distinct claim count change from the previous year month."}], "post-hook": [], "pre-hook": []}, "database": "dev_sarah", "schema": "insights", "fqn": ["the_tuva_project", "insights", "final", "insights__trend_count_claim_by_claim_type"], "unique_id": "model.the_tuva_project.insights__trend_count_claim_by_claim_type", "raw_code": "{{ config(\r\n enabled = var('insights_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r\n )\r\n}}\r\n\r\nwith trend_by_claim_type as(\r\n select\r\n cast({{ date_part(\"year\", \"claim_end_date\") }} as {{ dbt.type_string() }}) || right('0'||cast({{ date_part(\"month\", \"claim_end_date\") }} as {{ dbt.type_string() }}),2) as year_month\r\n , claim_type\r\n , count(distinct claim_id) as distinct_claim_count\r\n from {{ ref('core__medical_claim') }}\r\n group by \r\n year_month\r\n , claim_type\r\n)\r\n, trend_with_previous_count as(\r\n select \r\n year_month\r\n , claim_type\r\n , distinct_claim_count\r\n , lag(distinct_claim_count) over (partition by claim_type order by year_month) as previous_distinct_claim_count\r\n from trend_by_claim_type\r\n)\r\n\r\nselect\r\n year_month\r\n , claim_type\r\n , distinct_claim_count\r\n , distinct_claim_count - previous_distinct_claim_count as distinct_claim_count_change\r\n , case\r\n when distinct_claim_count <> 0 then ((distinct_claim_count-previous_distinct_claim_count) / distinct_claim_count) * 100 \r\n else distinct_claim_count\r\n end as distinct_claim_percentage_change\r\nfrom trend_with_previous_count", "language": "sql", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/the_tuva_project", "path": "insights/final/insights__trend_count_claim_by_claim_type.sql", "original_file_path": "models/insights/final/insights__trend_count_claim_by_claim_type.sql", "name": "insights__trend_count_claim_by_claim_type", "alias": "trend_count_claim_by_claim_type", "checksum": {"name": "sha256", "checksum": "840c120c80c7edd82f4b970067c62781f8f517a7fde240f3dbfe0ed69f4b7ab4"}, "tags": ["insights"], "refs": [["core__medical_claim"]], "sources": [], "metrics": [], "description": "Monthly trend of distinct claims by claim type", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://models/insights/insights_models.yml", "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"schema": "insights", "alias": "trend_count_claim_by_claim_type", "tags": ["insights"], "materialized": "table", "columns": [{"name": "year_month", "description": "Year and month of the claim end date."}, {"name": "claim_type", "description": "Indicates whether the claim is professional (CMS-1500), institutional (UB-04), dental, or vision."}, {"name": "distinct_claim_count", "description": "Count of distinct claims."}, {"name": "distinct_claim_count_change", "description": "Change in distinct claim count from the previous year month."}, {"name": "distinct_claim_percentage_change", "description": "Percent in distinct claim count change from the previous year month."}], "enabled": true, "bind": false}, "created_at": 1701215339.6206021}, "model.the_tuva_project.insights__trend_sum_amount_by_claim_type": {"resource_type": "model", "depends_on": {"macros": ["macro.the_tuva_project.date_part", "macro.dbt.type_string"], "nodes": ["model.the_tuva_project.core__medical_claim", "model.the_tuva_project.core__pharmacy_claim"]}, "config": {"enabled": true, "alias": "trend_sum_amount_by_claim_type", "schema": "insights", "database": null, "tags": ["insights"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "bind": false, "columns": [{"name": "year_month", "description": "Year and month of the claim end date"}, {"name": "claim_type", "description": "Indicates whether the claim is professional (CMS-1500), institutional (UB-04), dental, vision, or pharmacy."}, {"name": "total_paid_amount", "description": "Sum of paid_amount."}, {"name": "total_paid_amount_change", "description": "Change in paid_amount from the previous month."}, {"name": "total_paid_amount_percent_change", "description": "Percent change in paid_amount from the previous month."}, {"name": "total_allowed_amount", "description": "Sum of allowed_amount."}, {"name": "total_allowed_amount_change", "description": "Change in allowed_amount from the previous month."}, {"name": "total_allowed_amount_percent_change", "description": "Percent change in allowed_amount from the previous month."}, {"name": "total_charge_amount", "description": "Sum of charge_amount."}, {"name": "total_charge_amount_change", "description": "Change in charge_amount from the previous month."}, {"name": "total_charge_amount_percent_change", "description": "Percent change in charge_amount from the previous month."}], "post-hook": [], "pre-hook": []}, "database": "dev_sarah", "schema": "insights", "fqn": ["the_tuva_project", "insights", "final", "insights__trend_sum_amount_by_claim_type"], "unique_id": "model.the_tuva_project.insights__trend_sum_amount_by_claim_type", "raw_code": "{{ config(\r\n enabled = var('insights_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r\n )\r\n}}\r\n\r\nwith trend_by_medical_claim_type as(\r\n select\r\n cast({{ date_part(\"year\", \"claim_end_date\") }} as {{ dbt.type_string() }}) || right('0'||cast({{ date_part(\"month\", \"claim_end_date\") }} as {{ dbt.type_string() }}),2) as year_month\r\n , claim_type\r\n , sum(paid_amount) as total_paid_amount\r\n , sum(allowed_amount) as total_allowed_amount\r\n , sum(charge_amount) as total_charge_amount\r\n from {{ ref('core__medical_claim') }}\r\n group by \r\n year_month\r\n , claim_type\r\n)\r\n, trend_by_pharmacy_claim_type as(\r\n select\r\n cast({{ date_part(\"year\", \"dispensing_date\") }} as {{ dbt.type_string() }}) || right('0'||cast({{ date_part(\"month\", \"dispensing_date\") }} as {{ dbt.type_string() }}),2) as year_month\r\n , cast('pharmacy' as {{ dbt.type_string() }}) as claim_type\r\n , sum(paid_amount) as total_paid_amount\r\n , sum(allowed_amount) as total_allowed_amount\r\n , 0 as total_charge_amount\r\n from {{ ref('core__pharmacy_claim') }}\r\n group by \r\n year_month\r\n)\r\n, trend_with_previous_medical_sum as(\r\n select \r\n year_month\r\n , claim_type\r\n , total_paid_amount\r\n , lag(total_paid_amount) over (partition by claim_type order by year_month) as previous_total_paid_amount\r\n , total_allowed_amount\r\n , lag(total_allowed_amount) over (partition by claim_type order by year_month) as previous_total_allowed_amount\r\n , total_charge_amount\r\n , lag(total_charge_amount) over (partition by claim_type order by year_month) as previous_total_charge_amount\r\n from trend_by_medical_claim_type\r\n)\r\n, trend_with_previous_pharmacy_sum as(\r\n select \r\n year_month\r\n , claim_type\r\n , total_paid_amount\r\n , lag(total_paid_amount) over (partition by claim_type order by year_month) as previous_total_paid_amount\r\n , total_allowed_amount\r\n , lag(total_allowed_amount) over (partition by claim_type order by year_month) as previous_total_allowed_amount\r\n , total_charge_amount\r\n , lag(total_charge_amount) over (partition by claim_type order by year_month) as previous_total_charge_amount\r\n from trend_by_pharmacy_claim_type\r\n)\r\nselect\r\n year_month\r\n , claim_type\r\n , total_paid_amount\r\n , total_paid_amount - previous_total_paid_amount as total_paid_amount_change\r\n , case \r\n when total_paid_amount <> 0 then ((total_paid_amount - previous_total_paid_amount)/total_paid_amount)*100\r\n else total_paid_amount\r\n end as total_paid_amount_percent_change\r\n , total_allowed_amount\r\n , total_allowed_amount - previous_total_allowed_amount as total_allowed_amount_change\r\n , case \r\n when total_allowed_amount <> 0 then ((total_allowed_amount - previous_total_allowed_amount)/total_allowed_amount)*100\r\n else total_allowed_amount\r\n end as total_allowed_amount_percent_change\r\n , total_charge_amount\r\n , total_charge_amount - previous_total_charge_amount as total_charge_amount_change\r\n , case \r\n when total_charge_amount <> 0 then ((total_charge_amount - previous_total_charge_amount)/total_charge_amount)*100\r\n else total_charge_amount\r\n end as total_charge_amount_percent_change\r\nfrom trend_with_previous_medical_sum\r\n\r\nunion all \r\n\r\nselect\r\n year_month\r\n , claim_type\r\n , total_paid_amount\r\n , total_paid_amount - previous_total_paid_amount as total_paid_amount_change\r\n , case \r\n when total_paid_amount <> 0 then ((total_paid_amount - previous_total_paid_amount)/total_paid_amount)*100\r\n else total_paid_amount\r\n end as total_paid_amount_percent_change\r\n , total_allowed_amount\r\n , total_allowed_amount - previous_total_allowed_amount as total_allowed_amount_change\r\n , case \r\n when total_allowed_amount <> 0 then ((total_allowed_amount - previous_total_allowed_amount)/total_allowed_amount)*100\r\n else total_allowed_amount\r\n end as total_allowed_amount_percent_change\r\n , total_charge_amount\r\n , total_charge_amount - previous_total_charge_amount as total_charge_amount_change\r\n , case \r\n when total_charge_amount <> 0 then ((total_charge_amount - previous_total_charge_amount)/total_charge_amount)*100\r\n else total_charge_amount\r\n end as total_charge_amount_percent_change\r\nfrom trend_with_previous_pharmacy_sum", "language": "sql", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/the_tuva_project", "path": "insights/final/insights__trend_sum_amount_by_claim_type.sql", "original_file_path": "models/insights/final/insights__trend_sum_amount_by_claim_type.sql", "name": "insights__trend_sum_amount_by_claim_type", "alias": "trend_sum_amount_by_claim_type", "checksum": {"name": "sha256", "checksum": "4e464a22d2d898b7d5fd096f3bd16bb3c57a887875544aef1e01c17ebd857ec6"}, "tags": ["insights"], "refs": [["core__medical_claim"], ["core__pharmacy_claim"]], "sources": [], "metrics": [], "description": "Monthly trend of paid_amount, alllowed_amount, and charge_amount by claim type", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://models/insights/insights_models.yml", "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"schema": "insights", "alias": "trend_sum_amount_by_claim_type", "tags": ["insights"], "materialized": "table", "columns": [{"name": "year_month", "description": "Year and month of the claim end date"}, {"name": "claim_type", "description": "Indicates whether the claim is professional (CMS-1500), institutional (UB-04), dental, vision, or pharmacy."}, {"name": "total_paid_amount", "description": "Sum of paid_amount."}, {"name": "total_paid_amount_change", "description": "Change in paid_amount from the previous month."}, {"name": "total_paid_amount_percent_change", "description": "Percent change in paid_amount from the previous month."}, {"name": "total_allowed_amount", "description": "Sum of allowed_amount."}, {"name": "total_allowed_amount_change", "description": "Change in allowed_amount from the previous month."}, {"name": "total_allowed_amount_percent_change", "description": "Percent change in allowed_amount from the previous month."}, {"name": "total_charge_amount", "description": "Sum of charge_amount."}, {"name": "total_charge_amount_change", "description": "Change in charge_amount from the previous month."}, {"name": "total_charge_amount_percent_change", "description": "Percent change in charge_amount from the previous month."}], "enabled": true, "bind": false}, "created_at": 1701215339.6281312}, "model.the_tuva_project.insights__orphan_claim_by_claim_type": {"resource_type": "model", "depends_on": {"macros": ["macro.the_tuva_project.date_part", "macro.dbt.type_string"], "nodes": ["model.the_tuva_project.core__medical_claim", "model.the_tuva_project.core__pharmacy_claim", "model.the_tuva_project.financial_pmpm__member_months", "model.the_tuva_project.financial_pmpm__member_months"]}, "config": {"enabled": true, "alias": "orphan_claim_by_claim_type", "schema": "insights", "database": null, "tags": ["insights"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "bind": false, "columns": [{"name": "claim_category", "description": "The broader claim type a claim belongs to e.g. medical or pharmacy."}, {"name": "distinct_claim_count", "description": "Count of distinct claims."}], "post-hook": [], "pre-hook": []}, "database": "dev_sarah", "schema": "insights", "fqn": ["the_tuva_project", "insights", "final", "insights__orphan_claim_by_claim_type"], "unique_id": "model.the_tuva_project.insights__orphan_claim_by_claim_type", "raw_code": "{{ config(\r\n enabled = var('insights_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r\n )\r\n}}\r\n\r\nwith medical_claim_orphan as(\r\nselect\r\n 'medical_claim' as claim_category\r\n , claim_id\r\n , patient_id\r\n , cast({{ date_part(\"year\", \"claim_end_date\") }} as {{ dbt.type_string() }}) || right('0'||cast({{ date_part(\"month\", \"claim_end_date\") }} as {{ dbt.type_string() }}),2) as year_month\r\nfrom {{ ref('core__medical_claim') }}\r\n)\r\n\r\n, pharmacy_claim_orphan as(\r\nselect\r\n 'pharmacy_claim' as claim_category\r\n , claim_id\r\n , patient_id\r\n , cast({{ date_part(\"year\", \"dispensing_date\") }} as {{ dbt.type_string() }}) || right('0'||cast({{ date_part(\"month\", \"dispensing_date\") }} as {{ dbt.type_string() }}),2) as year_month\r\nfrom {{ ref('core__pharmacy_claim') }}\r\n)\r\n, union_orphans as(\r\n select \r\n med.* \r\n from medical_claim_orphan med\r\n left join {{ ref('financial_pmpm__member_months') }} months\r\n on med.patient_id = months.patient_id\r\n and med.year_month = months.year_month\r\n where months.patient_id is null\r\n\r\n union all\r\n\r\n select \r\n med.* \r\n from pharmacy_claim_orphan med\r\n left join {{ ref('financial_pmpm__member_months') }} months\r\n on med.patient_id = months.patient_id\r\n and med.year_month = months.year_month\r\n where months.patient_id is null\r\n)\r\n\r\nselect\r\n claim_category\r\n , count(distinct claim_id) as distinct_claim_count\r\nfrom union_orphans\r\ngroup by claim_category", "language": "sql", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/the_tuva_project", "path": "insights/final/insights__orphan_claim_by_claim_type.sql", "original_file_path": "models/insights/final/insights__orphan_claim_by_claim_type.sql", "name": "insights__orphan_claim_by_claim_type", "alias": "orphan_claim_by_claim_type", "checksum": {"name": "sha256", "checksum": "fc94f0c9fcdd42adfdb72bc8a8d971a77a148619d31beb093850f9c46d9f5f6c"}, "tags": ["insights"], "refs": [["core__medical_claim"], ["core__pharmacy_claim"], ["financial_pmpm__member_months"], ["financial_pmpm__member_months"]], "sources": [], "metrics": [], "description": "Count of medical and pharmacy claims without a corresponding eligibilty record.", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://models/insights/insights_models.yml", "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"schema": "insights", "alias": "orphan_claim_by_claim_type", "tags": ["insights"], "materialized": "table", "columns": [{"name": "claim_category", "description": "The broader claim type a claim belongs to e.g. medical or pharmacy."}, {"name": "distinct_claim_count", "description": "Count of distinct claims."}], "enabled": true, "bind": false}, "created_at": 1701215339.611678}, "model.the_tuva_project.insights__count_claim_by_date_column": {"resource_type": "model", "depends_on": {"macros": ["macro.the_tuva_project.date_part", "macro.dbt.type_string", "macro.dbt.type_int"], "nodes": ["model.the_tuva_project.core__medical_claim", "model.the_tuva_project.core__medical_claim", "model.the_tuva_project.core__medical_claim", "model.the_tuva_project.core__medical_claim", "model.the_tuva_project.core__medical_claim", "model.the_tuva_project.core__pharmacy_claim", "model.the_tuva_project.core__pharmacy_claim", "model.the_tuva_project.financial_pmpm__member_months", "seed.the_tuva_project.terminology__calendar"]}, "config": {"enabled": true, "alias": "count_claim_by_date_column", "schema": "insights", "database": null, "tags": ["insights"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "bind": false, "columns": [{"name": "year_month", "description": "Year and month of the claim end date or the member enrollment."}, {"name": "member_months", "description": "Count of unique member months."}, {"name": "claim_start_date", "description": "Count of unique medical claims."}, {"name": "claim_end_date", "description": "Count of unique medical claims."}, {"name": "admission_date", "description": "Count of unique medical claims."}, {"name": "discharge_date", "description": "Count of unique medical claims."}, {"name": "medical_paid_date", "description": "Count of unique medical claims."}, {"name": "dispensing_date", "description": "Count of unique pharmacy claims."}, {"name": "pharmacy_paid_date", "description": "Count of unique pharmacy claims."}], "post-hook": [], "pre-hook": []}, "database": "dev_sarah", "schema": "insights", "fqn": ["the_tuva_project", "insights", "final", "insights__count_claim_by_date_column"], "unique_id": "model.the_tuva_project.insights__count_claim_by_date_column", "raw_code": "{{ config(\r\n enabled = var('insights_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r\n )\r\n}}\r\n\r\nwith date_stage as(\r\n\r\n select\r\n 'claim_start_date' as date_field\r\n , cast({{ date_part(\"year\", \"claim_start_date\") }} as {{ dbt.type_string() }}) || right('0'||cast({{ date_part(\"month\", \"claim_start_date\") }} as {{ dbt.type_string() }}),2) as year_month\r\n , count(distinct claim_id) as distinct_count\r\n from {{ ref('core__medical_claim') }}\r\n group by \r\n year_month\r\n\r\n union all\r\n\r\n select\r\n 'claim_end_date' as date_field\r\n , cast({{ date_part(\"year\", \"claim_end_date\") }} as {{ dbt.type_string() }}) || right('0'||cast({{ date_part(\"month\", \"claim_end_date\") }} as {{ dbt.type_string() }}),2) as year_month\r\n , count(distinct claim_id) as distinct_count\r\n from {{ ref('core__medical_claim') }}\r\n group by \r\n year_month\r\n union all\r\n\r\n select\r\n 'admission_date' as date_field\r\n , cast({{ date_part(\"year\", \"admission_date\") }} as {{ dbt.type_string() }}) || right('0'||cast({{ date_part(\"month\", \"admission_date\") }} as {{ dbt.type_string() }}),2) as year_month\r\n , count(distinct claim_id) as distinct_count\r\n from {{ ref('core__medical_claim') }}\r\n group by \r\n year_month\r\n\r\n union all\r\n\r\n select\r\n 'discharge_date' as date_field\r\n , cast({{ date_part(\"year\", \"discharge_date\") }} as {{ dbt.type_string() }}) || right('0'||cast({{ date_part(\"month\", \"discharge_date\") }} as {{ dbt.type_string() }}),2) as year_month\r\n , count(distinct claim_id) as distinct_count\r\n from {{ ref('core__medical_claim') }}\r\n group by \r\n year_month\r\n\r\n union all\r\n\r\n select\r\n 'medical paid_date' as date_field\r\n , cast({{ date_part(\"year\", \"paid_date\") }} as {{ dbt.type_string() }}) || right('0'||cast({{ date_part(\"month\", \"paid_date\") }} as {{ dbt.type_string() }}),2) as year_month\r\n , count(distinct claim_id) as distinct_count\r\n from {{ ref('core__medical_claim') }}\r\n group by \r\n year_month\r\n\r\n union all\r\n\r\n select\r\n 'dispensing_date' as date_field\r\n , cast({{ date_part(\"year\", \"dispensing_date\") }} as {{ dbt.type_string() }}) || right('0'||cast({{ date_part(\"month\", \"dispensing_date\") }} as {{ dbt.type_string() }}),2) as year_month\r\n , count(distinct claim_id) as distinct_count\r\n from {{ ref('core__pharmacy_claim') }}\r\n group by \r\n year_month\r\n\r\n union all\r\n\r\n select\r\n 'pharmacy paid_date' as date_field\r\n , cast({{ date_part(\"year\", \"paid_date\") }} as {{ dbt.type_string() }}) || right('0'||cast({{ date_part(\"month\", \"paid_date\") }} as {{ dbt.type_string() }}),2) as year_month\r\n , count(distinct claim_id) as distinct_count\r\n from {{ ref('core__pharmacy_claim') }}\r\n group by \r\n year_month\r\n\r\n union all \r\n\r\n select\r\n 'member_months' as date_field\r\n , year_month\r\n , count(*) as distinct_count\r\n from {{ ref('financial_pmpm__member_months') }}\r\n group by\r\n year_month\r\n)\r\n\r\n\r\n, all_date_range as (\r\n select distinct \r\n replace(cal.year_month,'-','') as year_month\r\n from {{ ref('terminology__calendar') }} cal\r\n where (cal.year_month >= (select min(year_month) from date_stage)\r\n and cal.year_month <= (select max(year_month) from date_stage))\r\n \r\n)\r\n\r\nselect\r\n cast(all_date.year_month as {{ dbt.type_int() }} ) as year_month\r\n , member_months.distinct_count as member_months\r\n , claim_start.distinct_count as claim_start_date\r\n , claim_end.distinct_count as claim_end_date\r\n , admission_date.distinct_count as admission_date\r\n , discharge_date.distinct_count as discharge_date\r\n , med_paid_date.distinct_count as medical_paid_date\r\n , dispensing_date.distinct_count as dispensing_date\r\n , pharm_paid_date.distinct_count as pharmacy_paid_date\r\nfrom all_date_range all_date\r\nleft join date_stage member_months\r\n on all_date.year_month = member_months.year_month\r\n and member_months.date_field = 'member_months'\r\nleft join date_stage claim_start\r\n on all_date.year_month = claim_start.year_month\r\n and claim_start.date_field = 'claim_start_date'\r\nleft join date_stage claim_end\r\n on all_date.year_month = claim_end.year_month\r\n and claim_end.date_field = 'claim_end_date'\r\nleft join date_stage admission_date\r\n on all_date.year_month = admission_date.year_month\r\n and admission_date.date_field = 'admission_date'\r\nleft join date_stage discharge_date\r\n on all_date.year_month = discharge_date.year_month\r\n and discharge_date.date_field = 'discharge_date'\r\nleft join date_stage med_paid_date\r\n on all_date.year_month = med_paid_date.year_month\r\n and med_paid_date.date_field = 'medical paid_date'\r\nleft join date_stage dispensing_date\r\n on all_date.year_month = dispensing_date.year_month\r\n and dispensing_date.date_field = 'dispensing_date'\r\nleft join date_stage pharm_paid_date\r\n on all_date.year_month = pharm_paid_date.year_month\r\n and pharm_paid_date.date_field = 'pharmacy paid_date'", "language": "sql", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/the_tuva_project", "path": "insights/final/insights__count_claim_by_date_column.sql", "original_file_path": "models/insights/final/insights__count_claim_by_date_column.sql", "name": "insights__count_claim_by_date_column", "alias": "count_claim_by_date_column", "checksum": {"name": "sha256", "checksum": "f0cb82ac880516df2b77723c56e7e494b935730b8a41cf97b206a8dbcbbb9bb3"}, "tags": ["insights"], "refs": [["core__medical_claim"], ["core__medical_claim"], ["core__medical_claim"], ["core__medical_claim"], ["core__medical_claim"], ["core__pharmacy_claim"], ["core__pharmacy_claim"], ["financial_pmpm__member_months"], ["terminology__calendar"]], "sources": [], "metrics": [], "description": "Count of distinct claims by multiple dates.", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://models/insights/insights_models.yml", "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"schema": "insights", "alias": "count_claim_by_date_column", "tags": ["insights"], "materialized": "table", "columns": [{"name": "year_month", "description": "Year and month of the claim end date or the member enrollment."}, {"name": "member_months", "description": "Count of unique member months."}, {"name": "claim_start_date", "description": "Count of unique medical claims."}, {"name": "claim_end_date", "description": "Count of unique medical claims."}, {"name": "admission_date", "description": "Count of unique medical claims."}, {"name": "discharge_date", "description": "Count of unique medical claims."}, {"name": "medical_paid_date", "description": "Count of unique medical claims."}, {"name": "dispensing_date", "description": "Count of unique pharmacy claims."}, {"name": "pharmacy_paid_date", "description": "Count of unique pharmacy claims."}], "enabled": true, "bind": false}, "created_at": 1701215339.60681}, "model.the_tuva_project.insights__trend_sum_amount_by_service_category": {"resource_type": "model", "depends_on": {"macros": ["macro.the_tuva_project.date_part", "macro.dbt.type_string"], "nodes": ["model.the_tuva_project.core__medical_claim", "model.the_tuva_project.core__medical_claim"]}, "config": {"enabled": true, "alias": "trend_sum_amount_by_service_category", "schema": "insights", "database": null, "tags": ["insights"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "bind": false, "columns": [{"name": "year_month", "description": "Year and month of the claim end date"}, {"name": "service_category_type", "description": "The broader service category a claim belongs to."}, {"name": "service_category", "description": "The more specific service category a claim belongs to."}, {"name": "total_paid_amount", "description": "Sum of paid_amount."}, {"name": "total_paid_amount_change", "description": "Change in paid_amount from the previous month."}, {"name": "total_paid_amount_percent_change", "description": "Percent change in paid_amount from the previous month."}, {"name": "total_allowed_amount", "description": "Sum of allowed_amount."}, {"name": "total_allowed_amount_change", "description": "Change in allowed_amount from the previous month."}, {"name": "total_allowed_amount_percent_change", "description": "Percent change in allowed_amount from the previous month."}, {"name": "total_charge_amount", "description": "Sum of charge_amount."}, {"name": "total_charge_amount_change", "description": "Change in charge_amount from the previous month."}, {"name": "total_charge_amount_percent_change", "description": "Percent change in charge_amount from the previous month."}], "post-hook": [], "pre-hook": []}, "database": "dev_sarah", "schema": "insights", "fqn": ["the_tuva_project", "insights", "final", "insights__trend_sum_amount_by_service_category"], "unique_id": "model.the_tuva_project.insights__trend_sum_amount_by_service_category", "raw_code": "{{ config(\r\n enabled = var('insights_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r\n )\r\n}}\r\n\r\n\r\nwith trend_by_service_category_1 as(\r\n select\r\n cast({{ date_part(\"year\", \"claim_end_date\") }} as {{ dbt.type_string() }}) || right('0'||cast({{ date_part(\"month\", \"claim_end_date\") }} as {{ dbt.type_string() }}),2) as year_month\r\n , 'service_category_1' as service_category_type\r\n , service_category_1 as service_category\r\n , sum(paid_amount) as total_paid_amount\r\n , sum(allowed_amount) as total_allowed_amount\r\n , sum(charge_amount) as total_charge_amount\r\n from {{ ref('core__medical_claim') }}\r\n group by \r\n year_month\r\n , service_category_1\r\n)\r\n, trend_by_service_category_2 as(\r\n select\r\n cast({{ date_part(\"year\", \"claim_end_date\") }} as {{ dbt.type_string() }}) || right('0'||cast({{ date_part(\"month\", \"claim_end_date\") }} as {{ dbt.type_string() }}),2) as year_month\r\n , 'service_category_2' as service_category_type\r\n , service_category_2 as service_category\r\n , sum(paid_amount) as total_paid_amount\r\n , sum(allowed_amount) as total_allowed_amount\r\n , sum(charge_amount) as total_charge_amount\r\n from {{ ref('core__medical_claim') }}\r\n group by \r\n year_month\r\n , service_category_2\r\n)\r\n, trend_with_previous_service_category_1_sum as(\r\n select \r\n year_month\r\n , service_category_type\r\n , service_category\r\n , total_paid_amount\r\n , lag(total_paid_amount) over (partition by service_category order by year_month) as previous_total_paid_amount\r\n , total_allowed_amount\r\n , lag(total_allowed_amount) over (partition by service_category order by year_month) as previous_total_allowed_amount\r\n , total_charge_amount\r\n , lag(total_charge_amount) over (partition by service_category order by year_month) as previous_total_charge_amount\r\n from trend_by_service_category_1\r\n)\r\n, trend_with_previous_service_category_2_sum as(\r\n select \r\n year_month\r\n , service_category_type\r\n , service_category\r\n , total_paid_amount\r\n , lag(total_paid_amount) over (partition by service_category order by year_month) as previous_total_paid_amount\r\n , total_allowed_amount\r\n , lag(total_allowed_amount) over (partition by service_category order by year_month) as previous_total_allowed_amount\r\n , total_charge_amount\r\n , lag(total_charge_amount) over (partition by service_category order by year_month) as previous_total_charge_amount\r\n from trend_by_service_category_2\r\n)\r\nselect\r\n year_month\r\n , service_category_type\r\n , service_category\r\n , total_paid_amount\r\n , total_paid_amount - previous_total_paid_amount as total_paid_amount_change\r\n , case \r\n when total_paid_amount <> 0 then ((total_paid_amount - previous_total_paid_amount)/total_paid_amount)*100\r\n else total_paid_amount\r\n end as total_paid_amount_percent_change\r\n , total_allowed_amount\r\n , total_allowed_amount - previous_total_allowed_amount as total_allowed_amount_change\r\n , case \r\n when total_allowed_amount <> 0 then ((total_allowed_amount - previous_total_allowed_amount)/total_allowed_amount)*100\r\n else total_allowed_amount\r\n end as total_allowed_amount_percent_change\r\n , total_charge_amount\r\n , total_charge_amount - previous_total_charge_amount as total_charge_amount_change\r\n , case \r\n when total_charge_amount <> 0 then ((total_charge_amount - previous_total_charge_amount)/total_charge_amount)*100\r\n else total_charge_amount\r\n end as total_charge_amount_percent_change\r\nfrom trend_with_previous_service_category_1_sum\r\n\r\nunion all \r\n\r\nselect\r\n year_month\r\n , service_category_type\r\n , service_category\r\n , total_paid_amount\r\n , total_paid_amount - previous_total_paid_amount as total_paid_amount_change\r\n , case \r\n when total_paid_amount <> 0 then ((total_paid_amount - previous_total_paid_amount)/total_paid_amount)*100\r\n else total_paid_amount\r\n end as total_paid_amount_percent_change\r\n , total_allowed_amount\r\n , total_allowed_amount - previous_total_allowed_amount as total_allowed_amount_change\r\n , case \r\n when total_allowed_amount <> 0 then ((total_allowed_amount - previous_total_allowed_amount)/total_allowed_amount)*100\r\n else total_allowed_amount\r\n end as total_allowed_amount_percent_change\r\n , total_charge_amount\r\n , total_charge_amount - previous_total_charge_amount as total_charge_amount_change\r\n , case \r\n when total_charge_amount <> 0 then ((total_charge_amount - previous_total_charge_amount)/total_charge_amount)*100\r\n else total_charge_amount\r\n end as total_charge_amount_percent_change\r\nfrom trend_with_previous_service_category_2_sum", "language": "sql", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/the_tuva_project", "path": "insights/final/insights__trend_sum_amount_by_service_category.sql", "original_file_path": "models/insights/final/insights__trend_sum_amount_by_service_category.sql", "name": "insights__trend_sum_amount_by_service_category", "alias": "trend_sum_amount_by_service_category", "checksum": {"name": "sha256", "checksum": "d1729b1b296fed0f471e170e1314fafbdbcacbab452faed47fb0731e2fc5f1e8"}, "tags": ["insights"], "refs": [["core__medical_claim"], ["core__medical_claim"]], "sources": [], "metrics": [], "description": "Monthly trend of paid_amount, alllowed_amount, and charge_amount by service category", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://models/insights/insights_models.yml", "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"schema": "insights", "alias": "trend_sum_amount_by_service_category", "tags": ["insights"], "materialized": "table", "columns": [{"name": "year_month", "description": "Year and month of the claim end date"}, {"name": "service_category_type", "description": "The broader service category a claim belongs to."}, {"name": "service_category", "description": "The more specific service category a claim belongs to."}, {"name": "total_paid_amount", "description": "Sum of paid_amount."}, {"name": "total_paid_amount_change", "description": "Change in paid_amount from the previous month."}, {"name": "total_paid_amount_percent_change", "description": "Percent change in paid_amount from the previous month."}, {"name": "total_allowed_amount", "description": "Sum of allowed_amount."}, {"name": "total_allowed_amount_change", "description": "Change in allowed_amount from the previous month."}, {"name": "total_allowed_amount_percent_change", "description": "Percent change in allowed_amount from the previous month."}, {"name": "total_charge_amount", "description": "Sum of charge_amount."}, {"name": "total_charge_amount_change", "description": "Change in charge_amount from the previous month."}, {"name": "total_charge_amount_percent_change", "description": "Percent change in charge_amount from the previous month."}], "enabled": true, "bind": false}, "created_at": 1701215339.6329558}, "model.the_tuva_project.insights__sum_amount_by_claim_type": {"resource_type": "model", "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.core__medical_claim", "model.the_tuva_project.core__pharmacy_claim"]}, "config": {"enabled": true, "alias": "sum_amount_by_claim_type", "schema": "insights", "database": null, "tags": ["insights"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "bind": false, "columns": [{"name": "claim_type", "description": "Indicates whether the claim is professional (CMS-1500), institutional (UB-04), dental, vision, or pharmacy."}, {"name": "total_paid_amount", "description": "Sum of paid_amount."}, {"name": "total_allowed_amount", "description": "Sum of allowed_amount."}, {"name": "total_charge_amount", "description": "Sum of charge_amount."}], "post-hook": [], "pre-hook": []}, "database": "dev_sarah", "schema": "insights", "fqn": ["the_tuva_project", "insights", "final", "insights__sum_amount_by_claim_type"], "unique_id": "model.the_tuva_project.insights__sum_amount_by_claim_type", "raw_code": "{{ config(\r\n enabled = var('insights_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r\n )\r\n}}\r\n\r\nselect \r\n claim_type\r\n , sum(paid_amount) as total_paid_amount\r\n , sum(allowed_amount) as total_allowed_amount\r\n , sum(charge_amount) as total_charge_amount\r\nfrom {{ ref('core__medical_claim') }}\r\ngroup by claim_type\r\n\r\nunion all\r\n\r\nselect \r\n 'pharmacy'\r\n , sum(paid_amount) as total_paid_amount\r\n , sum(allowed_amount) as total_allowed_amount\r\n , null as total_charge_amount\r\nfrom {{ ref('core__pharmacy_claim') }}", "language": "sql", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/the_tuva_project", "path": "insights/final/insights__sum_amount_by_claim_type.sql", "original_file_path": "models/insights/final/insights__sum_amount_by_claim_type.sql", "name": "insights__sum_amount_by_claim_type", "alias": "sum_amount_by_claim_type", "checksum": {"name": "sha256", "checksum": "1850231cfaf383fe60720e0636c24cd3a351e593aa2956e28565c008303a171d"}, "tags": ["insights"], "refs": [["core__medical_claim"], ["core__pharmacy_claim"]], "sources": [], "metrics": [], "description": "Sum of paid_amount, allowed_amount, and charge_amount by claim type", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://models/insights/insights_models.yml", "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"schema": "insights", "alias": "sum_amount_by_claim_type", "tags": ["insights"], "materialized": "table", "columns": [{"name": "claim_type", "description": "Indicates whether the claim is professional (CMS-1500), institutional (UB-04), dental, vision, or pharmacy."}, {"name": "total_paid_amount", "description": "Sum of paid_amount."}, {"name": "total_allowed_amount", "description": "Sum of allowed_amount."}, {"name": "total_charge_amount", "description": "Sum of charge_amount."}], "enabled": true, "bind": false}, "created_at": 1701215339.614507}, "model.the_tuva_project.insights__sum_amount_by_service_category": {"resource_type": "model", "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.core__medical_claim", "model.the_tuva_project.core__medical_claim"]}, "config": {"enabled": true, "alias": "sum_amount_by_service_category", "schema": "insights", "database": null, "tags": ["insights"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "bind": false, "columns": [{"name": "service_category_type", "description": "The broader service category a claim belongs to."}, {"name": "service_category", "description": "The more specific service category a claim belongs to."}, {"name": "total_paid_amount", "description": "Sum of paid_amount."}, {"name": "total_allowed_amount", "description": "Sum of allowed_amount."}, {"name": "total_charge_amount", "description": "Sum of charge_amount."}], "post-hook": [], "pre-hook": []}, "database": "dev_sarah", "schema": "insights", "fqn": ["the_tuva_project", "insights", "final", "insights__sum_amount_by_service_category"], "unique_id": "model.the_tuva_project.insights__sum_amount_by_service_category", "raw_code": "{{ config(\r\n enabled = var('insights_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r\n )\r\n}}\r\n\r\nselect\r\n 'service_category_1' as service_category_type\r\n , service_category_1\r\n , sum(paid_amount) as total_paid_amount\r\n , sum(allowed_amount) as total_allowed_amount\r\n , sum(charge_amount) as total_charge_amount\r\nfrom {{ ref('core__medical_claim') }}\r\ngroup by service_category_1\r\n\r\nunion all\r\n\r\nselect\r\n 'service_category_2' as service_category_type\r\n , service_category_2\r\n , sum(paid_amount) as total_paid_amount\r\n , sum(allowed_amount) as total_allowed_amount\r\n , sum(charge_amount) as total_charge_amount\r\nfrom {{ ref('core__medical_claim') }}\r\ngroup by service_category_2", "language": "sql", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/the_tuva_project", "path": "insights/final/insights__sum_amount_by_service_category.sql", "original_file_path": "models/insights/final/insights__sum_amount_by_service_category.sql", "name": "insights__sum_amount_by_service_category", "alias": "sum_amount_by_service_category", "checksum": {"name": "sha256", "checksum": "d6b11197aed8609cfdb1117b04d8c31dabdd622025616b92b2d82264f9436cf8"}, "tags": ["insights"], "refs": [["core__medical_claim"], ["core__medical_claim"]], "sources": [], "metrics": [], "description": "Sum of paid_amount, allowed_amount, and charge_amount by service category", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://models/insights/insights_models.yml", "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"schema": "insights", "alias": "sum_amount_by_service_category", "tags": ["insights"], "materialized": "table", "columns": [{"name": "service_category_type", "description": "The broader service category a claim belongs to."}, {"name": "service_category", "description": "The more specific service category a claim belongs to."}, {"name": "total_paid_amount", "description": "Sum of paid_amount."}, {"name": "total_allowed_amount", "description": "Sum of allowed_amount."}, {"name": "total_charge_amount", "description": "Sum of charge_amount."}], "enabled": true, "bind": false}, "created_at": 1701215339.6175869}, "model.the_tuva_project.insights__trend_count_claim_by_service_category": {"resource_type": "model", "depends_on": {"macros": ["macro.the_tuva_project.date_part", "macro.dbt.type_string"], "nodes": ["model.the_tuva_project.core__medical_claim", "model.the_tuva_project.core__medical_claim"]}, "config": {"enabled": true, "alias": "trend_count_claim_by_service_category", "schema": "insights", "database": null, "tags": ["insights"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "bind": false, "columns": [{"name": "year_month", "description": "Year and month of the claim end date"}, {"name": "service_category", "description": "The more specific service category a claim belongs to."}, {"name": "distinct_claim_count", "description": "Count of distinct claims."}, {"name": "distinct_claim_count_change", "description": "Change in distinct claim count from the previous year month."}, {"name": "distinct_claim_percentage_change", "description": "Percent in distinct claim count change from the previous year month."}], "post-hook": [], "pre-hook": []}, "database": "dev_sarah", "schema": "insights", "fqn": ["the_tuva_project", "insights", "final", "insights__trend_count_claim_by_service_category"], "unique_id": "model.the_tuva_project.insights__trend_count_claim_by_service_category", "raw_code": "{{ config(\r\n enabled = var('insights_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r\n )\r\n}}\r\n\r\nwith trend_by_service_category_1 as (\r\n select \r\n cast({{ date_part(\"year\", \"claim_end_date\") }} as {{ dbt.type_string() }}) || right('0'||cast({{ date_part(\"month\", \"claim_end_date\") }} as {{ dbt.type_string() }}),2) as year_month\r\n , service_category_1\r\n , count(distinct claim_id) as distinct_claim_count\r\n from {{ ref('core__medical_claim') }}\r\n group by \r\n year_month\r\n , service_category_1\r\n)\r\n, trend_by_service_category_2 as (\r\n select \r\n cast({{ date_part(\"year\", \"claim_end_date\") }} as {{ dbt.type_string() }}) || right('0'||cast({{ date_part(\"month\", \"claim_end_date\") }} as {{ dbt.type_string() }}),2) as year_month\r\n , service_category_2\r\n , count(distinct claim_id) as distinct_claim_count\r\n from {{ ref('core__medical_claim') }}\r\n group by \r\n year_month\r\n , service_category_2\r\n)\r\n, previous_service_category_1_claim_count as(\r\n select\r\n year_month\r\n , service_category_1\r\n , distinct_claim_count\r\n , lag(distinct_claim_count) over (partition by service_category_1 order by year_month) as previous_distinct_claim_count\r\n from trend_by_service_category_1\r\n)\r\n, previous_service_category_2_claim_count as(\r\n select\r\n year_month\r\n , service_category_2\r\n , distinct_claim_count\r\n , lag(distinct_claim_count) over (partition by service_category_2 order by year_month) as previous_distinct_claim_count\r\n from trend_by_service_category_2\r\n)\r\nselect \r\n year_month\r\n , service_category_1 as service_category\r\n , distinct_claim_count\r\n , distinct_claim_count-previous_distinct_claim_count as distinct_claim_count_change\r\n , case\r\n when distinct_claim_count <> 0 then ((distinct_claim_count-previous_distinct_claim_count) / distinct_claim_count) * 100 \r\n else distinct_claim_count\r\n end as distinct_claim_percentage_change\r\nfrom previous_service_category_1_claim_count\r\n\r\n union all\r\n\r\n select \r\n year_month\r\n , service_category_2 as service_category\r\n , distinct_claim_count\r\n , distinct_claim_count-previous_distinct_claim_count as distinct_claim_count_change\r\n , case\r\n when distinct_claim_count <> 0 then ((distinct_claim_count-previous_distinct_claim_count) / distinct_claim_count) * 100 \r\n else distinct_claim_count\r\n end as distinct_claim_percentage_change\r\nfrom previous_service_category_2_claim_count", "language": "sql", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/the_tuva_project", "path": "insights/final/insights__trend_count_claim_by_service_category.sql", "original_file_path": "models/insights/final/insights__trend_count_claim_by_service_category.sql", "name": "insights__trend_count_claim_by_service_category", "alias": "trend_count_claim_by_service_category", "checksum": {"name": "sha256", "checksum": "f3ca33dfdd8f451c8c44b16b2b2037d08430e93eb153e92965b8593be400562e"}, "tags": ["insights"], "refs": [["core__medical_claim"], ["core__medical_claim"]], "sources": [], "metrics": [], "description": "Monthly trend of distinct claims by service category", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://models/insights/insights_models.yml", "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"schema": "insights", "alias": "trend_count_claim_by_service_category", "tags": ["insights"], "materialized": "table", "columns": [{"name": "year_month", "description": "Year and month of the claim end date"}, {"name": "service_category", "description": "The more specific service category a claim belongs to."}, {"name": "distinct_claim_count", "description": "Count of distinct claims."}, {"name": "distinct_claim_count_change", "description": "Change in distinct claim count from the previous year month."}, {"name": "distinct_claim_percentage_change", "description": "Percent in distinct claim count change from the previous year month."}], "enabled": true, "bind": false}, "created_at": 1701215339.6235762}, "model.the_tuva_project.ed_classification__stg_patient": {"resource_type": "model", "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.core__patient"]}, "config": {"enabled": true, "alias": null, "schema": "ed_classification", "database": null, "tags": ["ed_classification"], "meta": {}, "materialized": "ephemeral", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "bind": false, "post-hook": [], "pre-hook": []}, "database": "dev_sarah", "schema": "ed_classification", "fqn": ["the_tuva_project", "ed_classification", "staging", "ed_classification__stg_patient"], "unique_id": "model.the_tuva_project.ed_classification__stg_patient", "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 patient_id\r\n , sex\r\n , birth_date\r\n , race\r\n , state\r\n , zip_code\r\n , latitude\r\n , longitude\r\nfrom {{ ref('core__patient') }}", "language": "sql", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/the_tuva_project", "path": "ed_classification/staging/ed_classification__stg_patient.sql", "original_file_path": "models/ed_classification/staging/ed_classification__stg_patient.sql", "name": "ed_classification__stg_patient", "alias": "ed_classification__stg_patient", "checksum": {"name": "sha256", "checksum": "30b001c3fe63f86b5238b8a4e5fce8c14208440e4b7c1946ac88cab63d6ecf34"}, "tags": ["ed_classification"], "refs": [["core__patient"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://models/ed_classification/ed_classification_models.yml", "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"schema": "ed_classification", "tags": "ed_classification", "materialized": "ephemeral", "enabled": true, "bind": false}, "created_at": 1701215339.7743008}, "model.the_tuva_project.ed_classification__stg_encounter": {"resource_type": "model", "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.core__encounter"]}, "config": {"enabled": true, "alias": null, "schema": "ed_classification", "database": null, "tags": ["ed_classification"], "meta": {}, "materialized": "ephemeral", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "bind": false, "post-hook": [], "pre-hook": []}, "database": "dev_sarah", "schema": "ed_classification", "fqn": ["the_tuva_project", "ed_classification", "staging", "ed_classification__stg_encounter"], "unique_id": "model.the_tuva_project.ed_classification__stg_encounter", "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 encounter_id\r\n , encounter_type\r\n , patient_id\r\n , encounter_end_date\r\n , facility_npi\r\n , primary_diagnosis_code_type\r\n , primary_diagnosis_code\r\n , primary_diagnosis_description\r\n , paid_amount\r\n , allowed_amount\r\n , charge_amount\r\nfrom {{ ref('core__encounter') }}", "language": "sql", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/the_tuva_project", "path": "ed_classification/staging/ed_classification__stg_encounter.sql", "original_file_path": "models/ed_classification/staging/ed_classification__stg_encounter.sql", "name": "ed_classification__stg_encounter", "alias": "ed_classification__stg_encounter", "checksum": {"name": "sha256", "checksum": "1fe06aa48203595e38fc761b7637348e5538505e33cf0d53cd02badfbaffed19"}, "tags": ["ed_classification"], "refs": [["core__encounter"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://models/ed_classification/ed_classification_models.yml", "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"schema": "ed_classification", "tags": "ed_classification", "materialized": "ephemeral", "enabled": true, "bind": false}, "created_at": 1701215339.7727659}, "model.the_tuva_project.ed_classification__summary": {"resource_type": "model", "depends_on": {"macros": ["macro.the_tuva_project.date_part", "macro.dbt.type_string", "macro.dbt.datediff"], "nodes": ["model.the_tuva_project.ed_classification__int_filter_encounter_with_classification", "seed.the_tuva_project.ed_classification__categories", "seed.the_tuva_project.terminology__provider", "model.the_tuva_project.ed_classification__stg_patient", "model.the_tuva_project.ccsr__long_condition_category"]}, "config": {"enabled": true, "alias": "summary", "schema": "ed_classification", "database": null, "tags": ["ed_classification"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "bind": false, "post-hook": [], "pre-hook": []}, "database": "dev_sarah", "schema": "ed_classification", "fqn": ["the_tuva_project", "ed_classification", "final", "ed_classification__summary"], "unique_id": "model.the_tuva_project.ed_classification__summary", "raw_code": "{{ config(\n enabled = var('ed_classification_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\n )\n}}\n\n\nselect\n class.encounter_id\n , cat.classification_name as ed_classification_description\n , cat.classification_order as ed_classification_order\n , class.patient_id\n , class.encounter_end_date\n , cast({{ date_part(\"year\", \"class.encounter_end_date\") }} as {{ dbt.type_string() }}) \n || right('0'||cast({{ date_part(\"month\", \"class.encounter_end_date\") }} as {{ dbt.type_string() }}),2) \n as year_month\n , class.primary_diagnosis_code\n , class.primary_diagnosis_description\n , ccsr.ccsr_category as primary_ccsr_code\n , ccsr.ccsr_category_description as primary_ccsr_description\n , class.paid_amount\n , class.allowed_amount\n , class.charge_amount\n , class.facility_npi\n , fac_prov.provider_organization_name as facility_name\n , practice_state as facility_state\n , practice_city as facility_city\n , practice_zip_code as facility_zip_code\n , null as facility_latitude\n , null as facility_longitude\n , pat.sex as patient_sex\n , floor({{ datediff('pat.birth_date', 'current_date', 'hour') }} / 8766.0) as patient_age\n , zip_code as patient_zip_code\n , latitude as patient_latitude\n , longitude as patient_longitude\n , race as patient_race\nfrom {{ ref('ed_classification__int_filter_encounter_with_classification') }} class\ninner join {{ ref('ed_classification__categories') }} cat\n using(classification)\nleft join {{ ref('terminology__provider') }} fac_prov \n on class.facility_npi = fac_prov.npi\nleft join {{ ref('ed_classification__stg_patient') }} pat\n on class.patient_id = pat.patient_id\nleft join {{ ref('ccsr__long_condition_category') }} ccsr\n on class.encounter_id = ccsr.encounter_id\n and class.primary_diagnosis_code = ccsr.normalized_code", "language": "sql", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/the_tuva_project", "path": "ed_classification/final/ed_classification__summary.sql", "original_file_path": "models/ed_classification/final/ed_classification__summary.sql", "name": "ed_classification__summary", "alias": "summary", "checksum": {"name": "sha256", "checksum": "2560a3b2462c8148f0866e9617026479c905da045232db59036c547e92e4fe73"}, "tags": ["ed_classification"], "refs": [["ed_classification__int_filter_encounter_with_classification"], ["ed_classification__categories"], ["terminology__provider"], ["ed_classification__stg_patient"], ["ccsr__long_condition_category"]], "sources": [], "metrics": [], "description": "ED Classification as a cube that can be summarized\n", "columns": {"classification": {"name": "classification", "description": "ED classification categories", "meta": {}, "data_type": null, "quote": null, "tags": []}, "claim_id": {"name": "claim_id", "description": "Unique identifer for each claim", "meta": {}, "data_type": null, "quote": null, "tags": []}, "patient_id": {"name": "patient_id", "description": "Unique identifier for each person across all datasets", "meta": {}, "data_type": null, "quote": null, "tags": []}, "recorded_date": {"name": "recorded_date", "description": "Date on which the condition was recorded", "meta": {}, "data_type": null, "quote": null, "tags": []}, "code": {"name": "code", "description": "The normalized condition code", "meta": {}, "data_type": null, "quote": null, "tags": []}, "description": {"name": "description", "description": "The normalized description of the condition code", "meta": {}, "data_type": null, "quote": null, "tags": []}, "ccs_description_with_covid": {"name": "ccs_description_with_covid", "description": "The condition category with covid", "meta": {}, "data_type": null, "quote": null, "tags": []}, "recorded_date_year": {"name": "recorded_date_year", "description": "The year of the condition recorded date", "meta": {}, "data_type": null, "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, "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, "quote": null, "tags": []}, "service_category_1": {"name": "service_category_1", "description": "The broader service category the claim belongs to", "meta": {}, "data_type": null, "quote": null, "tags": []}, "service_category_2": {"name": "service_category_2", "description": "The more specific service category the claim belongs to", "meta": {}, "data_type": null, "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, "quote": null, "tags": []}, "provider_first_name": {"name": "provider_first_name", "description": "The provider first name", "meta": {}, "data_type": null, "quote": null, "tags": []}, "provider_last_name": {"name": "provider_last_name", "description": "The provider last name", "meta": {}, "data_type": null, "quote": null, "tags": []}, "provider_organization_name": {"name": "provider_organization_name", "description": "The provider organization", "meta": {}, "data_type": null, "quote": null, "tags": []}, "provider_practice_state": {"name": "provider_practice_state", "description": "The provider practice state", "meta": {}, "data_type": null, "quote": null, "tags": []}, "provider_practice_zip_code": {"name": "provider_practice_zip_code", "description": "The provider practice zip code", "meta": {}, "data_type": null, "quote": null, "tags": []}, "patient_gender": {"name": "patient_gender", "description": "The patient gender", "meta": {}, "data_type": null, "quote": null, "tags": []}, "patient_birth_date": {"name": "patient_birth_date", "description": "The patient date of birth", "meta": {}, "data_type": null, "quote": null, "tags": []}, "patient_age": {"name": "patient_age", "description": "The patient age as of now", "meta": {}, "data_type": null, "quote": null, "tags": []}, "patient_race": {"name": "patient_race", "description": "The patient race", "meta": {}, "data_type": null, "quote": null, "tags": []}, "patient_state": {"name": "patient_state", "description": "The patient state", "meta": {}, "data_type": null, "quote": null, "tags": []}, "classification_name": {"name": "classification_name", "description": "Human readable name of the classification", "meta": {}, "data_type": null, "quote": null, "tags": []}, "classification_order": {"name": "classification_order", "description": "The order of the classification", "meta": {}, "data_type": null, "quote": null, "tags": []}, "classification_column": {"name": "classification_column", "description": "A short hand name of the classification", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://models/ed_classification/ed_classification_models.yml", "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"schema": "ed_classification", "alias": "summary", "tags": "ed_classification", "materialized": "table", "enabled": true, "bind": false}, "created_at": 1701215339.767694}, "model.the_tuva_project.ed_classification__int_filter_encounter_with_classification": {"resource_type": "model", "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.ed_classification__int_map_primary_dx"]}, "config": {"enabled": true, "alias": "_int_filter_encounter_with_classification", "schema": "ed_classification", "database": null, "tags": ["ed_classification"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "bind": false, "post-hook": [], "pre-hook": []}, "database": "dev_sarah", "schema": "ed_classification", "fqn": ["the_tuva_project", "ed_classification", "intermediate", "ed_classification__int_filter_encounter_with_classification"], "unique_id": "model.the_tuva_project.ed_classification__int_filter_encounter_with_classification", "raw_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{{ config(\n enabled = var('ed_classification_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\n )\n}}\n\nselect\n a.*\n , case greatest(edcnnpa, edcnpa, epct, noner, injury, psych, alcohol, drug)\n when edcnnpa then 'edcnnpa'\n when edcnpa then 'edcnpa'\n when epct then 'epct'\n when noner then 'noner'\n when injury then 'injury'\n when psych then 'psych'\n when alcohol then 'alcohol'\n when drug then 'drug'\n else 'unclassified'\n end as classification\nfrom {{ ref('ed_classification__int_map_primary_dx') }} a\nwhere ed_classification_capture = 1", "language": "sql", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/the_tuva_project", "path": "ed_classification/intermediate/ed_classification__int_filter_encounter_with_classification.sql", "original_file_path": "models/ed_classification/intermediate/ed_classification__int_filter_encounter_with_classification.sql", "name": "ed_classification__int_filter_encounter_with_classification", "alias": "_int_filter_encounter_with_classification", "checksum": {"name": "sha256", "checksum": "1f56ff3781ed8070414cf5e3e680062bb889a8dcfb8b294e00fdafe0f62220a3"}, "tags": ["ed_classification"], "refs": [["ed_classification__int_map_primary_dx"]], "sources": [], "metrics": [], "description": "Filter out ED visits that were not classified", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://models/ed_classification/ed_classification_models.yml", "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"schema": "ed_classification", "alias": "_int_filter_encounter_with_classification", "tags": "ed_classification", "materialized": "table", "enabled": true, "bind": false}, "created_at": 1701215339.769409}, "model.the_tuva_project.ed_classification__int_map_primary_dx": {"resource_type": "model", "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.ed_classification__stg_encounter", "seed.the_tuva_project.ed_classification__johnston_icd9", "seed.the_tuva_project.ed_classification__johnston_icd10"]}, "config": {"enabled": true, "alias": "_int_by_provider_parent_organization", "schema": "ed_classification", "database": null, "tags": ["ed_classification"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "bind": false, "post-hook": [], "pre-hook": []}, "database": "dev_sarah", "schema": "ed_classification", "fqn": ["the_tuva_project", "ed_classification", "intermediate", "ed_classification__int_map_primary_dx"], "unique_id": "model.the_tuva_project.ed_classification__int_map_primary_dx", "raw_code": "/*\nAll condition discharge diagnosis left join with probabilistic\nindicators of ED classification terminology\n*/\n\n{{ config(\n enabled = var('ed_classification_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\n )\n}}\n{% set colnames = [\"edcnnpa\", \"edcnpa\", \"epct\", \"noner\", \"injury\", \"psych\", \"alcohol\", \"drug\"] %}\n\nwith condition as (\n select * \n from {{ ref('ed_classification__stg_encounter') }}\n where encounter_type = 'emergency department'\n)\n, icd9 as (\n select\n icd9 as code\n {% for colname in colnames %}\n , {{colname}}\n {% endfor %}\n , 1 as ed_classification_capture\n from {{ ref('ed_classification__johnston_icd9') }}\n)\n, icd10 as (\n select\n icd10 as code\n {% for colname in colnames %}\n , {{colname}}\n {% endfor %}\n , 1 as ed_classification_capture\n from {{ ref('ed_classification__johnston_icd10') }}\n)\n\nselect\n a.*\n {% for colname in colnames %}\n , icd10.{{colname}}\n {% endfor %}\n , coalesce(icd10.ed_classification_capture, 0) as ed_classification_capture\nfrom condition a\nleft join icd10\n on a.primary_diagnosis_code = icd10.code \n and a.primary_diagnosis_code_type = 'icd-10-cm'\n\nunion all\n\nselect\n a.*\n {% for colname in colnames %}\n , icd9.{{colname}}\n {% endfor %}\n , coalesce(icd9.ed_classification_capture, 0) ed_classification_capture\nfrom condition a\ninner join icd9\n on a.primary_diagnosis_code = icd9.code \n and a.primary_diagnosis_code_type = 'icd-9-cm'", "language": "sql", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/the_tuva_project", "path": "ed_classification/intermediate/ed_classification__int_map_primary_dx.sql", "original_file_path": "models/ed_classification/intermediate/ed_classification__int_map_primary_dx.sql", "name": "ed_classification__int_map_primary_dx", "alias": "_int_by_provider_parent_organization", "checksum": {"name": "sha256", "checksum": "6aca59febddcf7299b4974d50a98a6620aa5c52aa24609f073b1d339696899ff"}, "tags": ["ed_classification"], "refs": [["ed_classification__stg_encounter"], ["ed_classification__johnston_icd9"], ["ed_classification__johnston_icd10"]], "sources": [], "metrics": [], "description": "Map ED encounter primary dx to classification", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://models/ed_classification/ed_classification_models.yml", "compiled_path": null, "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": 1701215339.771065}, "model.the_tuva_project.readmissions__stg_core__medical_claim": {"resource_type": "model", "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.core__medical_claim"]}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["readmissions"], "meta": {}, "materialized": "ephemeral", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#161a7d"}, "bind": false, "post-hook": [], "pre-hook": []}, "database": "dev_sarah", "schema": "dbt_sarah", "fqn": ["the_tuva_project", "readmissions", "staging", "readmissions__stg_core__medical_claim"], "unique_id": "model.the_tuva_project.readmissions__stg_core__medical_claim", "raw_code": "{{ config(\n enabled = var('readmissions_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\n )\n}}\n\n\nSELECT\n claim_id\n, claim_type\n, encounter_id\n, encounter_type\n, '{{ var('tuva_last_run')}}' as tuva_last_run\nfrom {{ ref('core__medical_claim') }}", "language": "sql", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/the_tuva_project", "path": "readmissions/staging/readmissions__stg_core__medical_claim.sql", "original_file_path": "models/readmissions/staging/readmissions__stg_core__medical_claim.sql", "name": "readmissions__stg_core__medical_claim", "alias": "readmissions__stg_core__medical_claim", "checksum": {"name": "sha256", "checksum": "f125a8c85d28a646380355b4830a9dc03cbf4f5e612cfc017ee22c85b253bfdf"}, "tags": ["readmissions"], "refs": [["core__medical_claim"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#161a7d"}, "patch_path": "the_tuva_project://models/readmissions/readmissions_models.yml", "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"tags": "readmissions", "materialized": "ephemeral", "enabled": true, "bind": false, "docs": {"node_color": "#161a7d"}}, "created_at": 1701215339.822735}, "model.the_tuva_project.readmissions__stg_core__condition": {"resource_type": "model", "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.core__condition"]}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["readmissions"], "meta": {}, "materialized": "ephemeral", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#161a7d"}, "bind": false, "post-hook": [], "pre-hook": []}, "database": "dev_sarah", "schema": "dbt_sarah", "fqn": ["the_tuva_project", "readmissions", "staging", "readmissions__stg_core__condition"], "unique_id": "model.the_tuva_project.readmissions__stg_core__condition", "raw_code": "{{ config(\n enabled = var('readmissions_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\n )\n}}\n\nselect\n encounter_id\n, normalized_code\n, condition_rank\n, normalized_code_type\n, claim_id\n, '{{ var('tuva_last_run')}}' as tuva_last_run\nfrom {{ ref('core__condition') }}", "language": "sql", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/the_tuva_project", "path": "readmissions/staging/readmissions__stg_core__condition.sql", "original_file_path": "models/readmissions/staging/readmissions__stg_core__condition.sql", "name": "readmissions__stg_core__condition", "alias": "readmissions__stg_core__condition", "checksum": {"name": "sha256", "checksum": "dc8d23902790bd2440149cb31765d8f806ceda1502f8c5f8433985c5c4c1e5bf"}, "tags": ["readmissions"], "refs": [["core__condition"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#161a7d"}, "patch_path": "the_tuva_project://models/readmissions/readmissions_models.yml", "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"tags": "readmissions", "materialized": "ephemeral", "enabled": true, "bind": false, "docs": {"node_color": "#161a7d"}}, "created_at": 1701215339.8205729}, "model.the_tuva_project.readmissions__stg_core__encounter": {"resource_type": "model", "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.core__encounter"]}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["readmissions"], "meta": {}, "materialized": "ephemeral", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#161a7d"}, "bind": false, "post-hook": [], "pre-hook": []}, "database": "dev_sarah", "schema": "dbt_sarah", "fqn": ["the_tuva_project", "readmissions", "staging", "readmissions__stg_core__encounter"], "unique_id": "model.the_tuva_project.readmissions__stg_core__encounter", "raw_code": "{{ config(\n enabled = var('readmissions_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\n )\n}}\n\nselect\n encounter_id,\n patient_id,\n encounter_start_date,\n encounter_end_date,\n discharge_disposition_code,\n facility_npi,\n ms_drg_code,\n paid_amount,\n primary_diagnosis_code,\n '{{ var('tuva_last_run')}}' as tuva_last_run\nfrom {{ ref('core__encounter') }}\nwhere encounter_type = 'acute inpatient'", "language": "sql", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/the_tuva_project", "path": "readmissions/staging/readmissions__stg_core__encounter.sql", "original_file_path": "models/readmissions/staging/readmissions__stg_core__encounter.sql", "name": "readmissions__stg_core__encounter", "alias": "readmissions__stg_core__encounter", "checksum": {"name": "sha256", "checksum": "f6df3623ae483cb6083ff743791efa2a4b3f302d8c1774e4a613d5b81e8b688c"}, "tags": ["readmissions"], "refs": [["core__encounter"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#161a7d"}, "patch_path": "the_tuva_project://models/readmissions/readmissions_models.yml", "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"tags": "readmissions", "materialized": "ephemeral", "enabled": true, "bind": false, "docs": {"node_color": "#161a7d"}}, "created_at": 1701215339.821654}, "model.the_tuva_project.readmissions__stg_core__procedure": {"resource_type": "model", "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.core__procedure"]}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["readmissions"], "meta": {}, "materialized": "ephemeral", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#161a7d"}, "bind": false, "post-hook": [], "pre-hook": []}, "database": "dev_sarah", "schema": "dbt_sarah", "fqn": ["the_tuva_project", "readmissions", "staging", "readmissions__stg_core__procedure"], "unique_id": "model.the_tuva_project.readmissions__stg_core__procedure", "raw_code": "{{ config(\n enabled = var('readmissions_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\n )\n}}\n\nselect\n encounter_id\n, normalized_code\n, normalized_code_type\n, '{{ var('tuva_last_run')}}' as tuva_last_run\nfrom {{ ref('core__procedure') }}", "language": "sql", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/the_tuva_project", "path": "readmissions/staging/readmissions__stg_core__procedure.sql", "original_file_path": "models/readmissions/staging/readmissions__stg_core__procedure.sql", "name": "readmissions__stg_core__procedure", "alias": "readmissions__stg_core__procedure", "checksum": {"name": "sha256", "checksum": "96bc95ad35acfa3e28c3e1fa0435372a4bb5c3311d6265f57ece16ce159d57a0"}, "tags": ["readmissions"], "refs": [["core__procedure"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#161a7d"}, "patch_path": "the_tuva_project://models/readmissions/readmissions_models.yml", "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"tags": "readmissions", "materialized": "ephemeral", "enabled": true, "bind": false, "docs": {"node_color": "#161a7d"}}, "created_at": 1701215339.823935}, "model.the_tuva_project.readmissions__encounter_augmented": {"resource_type": "model", "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"]}, "config": {"enabled": true, "alias": "encounter_augmented", "schema": "readmissions", "database": null, "tags": ["readmissions"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#161a7d"}, "bind": false, "post-hook": [], "pre-hook": []}, "database": "dev_sarah", "schema": "readmissions", "fqn": ["the_tuva_project", "readmissions", "final", "readmissions__encounter_augmented"], "unique_id": "model.the_tuva_project.readmissions__encounter_augmented", "raw_code": "{{ config(\n enabled = var('readmissions_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\n )\n}}\n\n-- Here we list all encounters from the stg_encounter model\n-- and we augment them with extra fields\n-- that are relevant for readmission measures\nselect\n aa.encounter_id,\n aa.patient_id,\n aa.admit_date,\n aa.discharge_date,\n aa.discharge_disposition_code,\n aa.facility_npi,\n aa.ms_drg_code,\n aa.paid_amount,\n {{ dbt.datediff(\"aa.admit_date\", \"aa.discharge_date\",\"day\") }} as length_of_stay,\n case\n when bb.encounter_id is not null then 1\n\t else 0\n end as index_admission_flag,\n case\n when cc.encounter_id is not null then 1\n\t else 0\n end as planned_flag,\n dd.specialty_cohort,\n case\n when aa.discharge_disposition_code = '20' then 1\n\t else 0\n end as died_flag,\n ee.diagnosis_ccs,\n ee.disqualified_encounter_flag,\n ee.missing_admit_date_flag,\n ee.missing_discharge_date_flag,\n ee.admit_after_discharge_flag,\n ee.missing_discharge_disposition_code_flag,\n ee.invalid_discharge_disposition_code_flag,\n ee.missing_primary_diagnosis_flag,\n ee.invalid_primary_diagnosis_code_flag,\n ee.no_diagnosis_ccs_flag,\n ee.overlaps_with_another_encounter_flag,\n ee.missing_ms_drg_flag,\n ee.invalid_ms_drg_flag,\n '{{ var('tuva_last_run')}}' as tuva_last_run\nfrom\n {{ ref('readmissions__encounter') }} aa\n left join {{ ref('readmissions__index_admission') }} bb\n on aa.encounter_id = bb.encounter_id\n left join {{ ref('readmissions__planned_encounter') }} cc\n on aa.encounter_id = cc.encounter_id \n left join {{ ref('readmissions__encounter_specialty_cohort') }} dd\n on aa.encounter_id = dd.encounter_id\n left join {{ ref('readmissions__encounter_data_quality') }} ee\n on aa.encounter_id = ee.encounter_id", "language": "sql", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/the_tuva_project", "path": "readmissions/final/readmissions__encounter_augmented.sql", "original_file_path": "models/readmissions/final/readmissions__encounter_augmented.sql", "name": "readmissions__encounter_augmented", "alias": "encounter_augmented", "checksum": {"name": "sha256", "checksum": "a79098a486ec2b1e802acd006bc42e77bff73b455fa9f4f8fb50c74c179a70ba"}, "tags": ["readmissions"], "refs": [["readmissions__encounter"], ["readmissions__index_admission"], ["readmissions__planned_encounter"], ["readmissions__encounter_specialty_cohort"], ["readmissions__encounter_data_quality"]], "sources": [], "metrics": [], "description": "This model includes all encounters from the stg_encounter model, and for each encounter_id we add fields relevant for the encounter.", "columns": {"encounter_id": {"name": "encounter_id", "description": "The unique identifier for the encounter", "meta": {}, "data_type": null, "quote": null, "tags": []}, "patient_id": {"name": "patient_id", "description": "The unique identifier for the patient", "meta": {}, "data_type": null, "quote": null, "tags": []}, "admit_date": {"name": "admit_date", "description": "The date of admission for the inpatient visit", "meta": {}, "data_type": null, "quote": null, "tags": []}, "discharge_date": {"name": "discharge_date", "description": "The date of discharge for the inpatient visit", "meta": {}, "data_type": null, "quote": null, "tags": []}, "discharge_disposition_code": {"name": "discharge_disposition_code", "description": "The valid 2-digit discharge status for the inpatient visit", "meta": {"terminology": "/terminology/administrative-codes/discharge-disposition"}, "data_type": null, "quote": null, "tags": []}, "facility_npi": {"name": "facility_npi", "description": "A name or ID for the facility where the inpatient visit occured", "meta": {"terminology": "/terminology/providers/provider"}, "data_type": null, "quote": null, "tags": []}, "ms_drg_code": {"name": "ms_drg_code", "description": "The MS-DRG associted with the inpatient visit", "meta": {"terminology": "/terminology/conditions-and-procedures/ms-drg"}, "data_type": null, "quote": null, "tags": []}, "total_paid_amount": {"name": "total_paid_amount", "description": "The number of dollars paid on the encounter", "meta": {}, "data_type": null, "quote": null, "tags": []}, "length_of_stay": {"name": "length_of_stay", "description": "Integer representing the length of stay of the inpatient visit in days", "meta": {}, "data_type": "integer", "quote": null, "tags": []}, "index_admission_flag": {"name": "index_admission_flag", "description": "Flag to indicate if the encounter is an index admission", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "planned_flag": {"name": "planned_flag", "description": "Flag to indicate if the encounter was planned", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "specialty_cohort": {"name": "specialty_cohort", "description": "Specialty cohort the encounter belongs to", "meta": {"terminology": "/value-sets/readmissions/specialty-cohort"}, "data_type": null, "quote": null, "tags": []}, "died_flag": {"name": "died_flag", "description": "Flag to indicate of the patient died in this encounter", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "diagnosis_ccs": {"name": "diagnosis_ccs", "description": "CCS code associated with the primary diagnosis for the encounter", "meta": {}, "data_type": null, "quote": null, "tags": []}, "disqualified_encounter_flag": {"name": "disqualified_encounter_flag", "description": "A flag that indicates whether this encounter is disqualified from being used in readmission measures for any critical data quality problem.", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "missing_admit_date_flag": {"name": "missing_admit_date_flag", "description": "A flag that indicates whether the admit date is missing from this encounter.", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "missing_discharge_date_flag": {"name": "missing_discharge_date_flag", "description": "A flag that indicates whether the discharge date is missing from this encounter.", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "admit_after_discharge_flag": {"name": "admit_after_discharge_flag", "description": "A flag that indicates whether the admit date for the encounter is after the discharge date for the encounter.", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "missing_discharge_disposition_code_flag": {"name": "missing_discharge_disposition_code_flag", "description": "A flag that indicates whether the discharge status code is missing for the encounter.", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "invalid_discharge_disposition_code_flag": {"name": "invalid_discharge_disposition_code_flag", "description": "A flag that indicates whether the discharge status code that is present for this encounter is invalid. This flag is 1 only when the discharge status code is present but invalid.", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "missing_primary_diagnosis_flag": {"name": "missing_primary_diagnosis_flag", "description": "A flag that indicates whether there is no primary diagnosis associated with the encounter.", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "multiple_primary_diagnoses_flag": {"name": "multiple_primary_diagnoses_flag", "description": "A flag that indicates whether there are multiple primary diagnoses associated with the encounter.", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "invalid_primary_diagnosis_code_flag": {"name": "invalid_primary_diagnosis_code_flag", "description": "A flag that indicates whether the primary diagnosis present for this encounter is invalid, i.e. a non existing ICD-10-CM code. This flag indicates that a primary diagnosis code is indeed present for the encounter, but it is not a valid ICD-10-CM code.", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "no_diagnosis_ccs_flag": {"name": "no_diagnosis_ccs_flag", "description": "A flag that indicates whether there is no CCS diagnosis category associated with the primary ICD-10-CM diagnosis code for the encounter. This flag indicates that there is a valid primary ICD-10-CM diagnosis code associated with the encounter, but there is no CCS diagnosis category associated with that ICD-10-CM code.", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "overlaps_with_another_encounter_flag": {"name": "overlaps_with_another_encounter_flag", "description": "A flag that indicates whether this encounter's dates overlap with those of another encounter in the dataset", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "missing_ms_drg_flag": {"name": "missing_ms_drg_flag", "description": "A flag that indicates whether this encounter contains a claim with a missing ms-drg code", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "invalid_ms_drg_flag": {"name": "invalid_ms_drg_flag", "description": "A flag that indicates whether this encounter contains a claim with an invalid missing ms-drg code", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The time at with the model was materialized. Generated by `dbt_utils.pretty_time` as the local time of the `dbt run` environment. Timezone is configurable via the `tuva_last_run` var.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": "#161a7d"}, "patch_path": "the_tuva_project://models/readmissions/readmissions_models.yml", "compiled_path": null, "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": 1701215339.782709}, "model.the_tuva_project.readmissions__readmission_summary": {"resource_type": "model", "depends_on": {"macros": ["macro.dbt.datediff"], "nodes": ["model.the_tuva_project.readmissions__encounter_augmented"]}, "config": {"enabled": true, "alias": "readmission_summary", "schema": "readmissions", "database": null, "tags": ["readmissions"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#161a7d"}, "bind": false, "post-hook": [], "pre-hook": []}, "database": "dev_sarah", "schema": "readmissions", "fqn": ["the_tuva_project", "readmissions", "final", "readmissions__readmission_summary"], "unique_id": "model.the_tuva_project.readmissions__readmission_summary", "raw_code": "{{ config(\n enabled = var('readmissions_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\n )\n}}\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 {{ ref('readmissions__encounter_augmented') }}\nwhere disqualified_encounter_flag = 0\n),\n\n\nreadmission_calc as (\nselect\n aa.encounter_id,\n aa.patient_id,\n aa.admit_date,\n aa.discharge_date,\n aa.discharge_disposition_code,\n aa.facility_npi,\n aa.ms_drg_code,\n aa.paid_amount,\n aa.length_of_stay,\n aa.index_admission_flag,\n aa.planned_flag,\n aa.specialty_cohort,\n aa.died_flag,\n aa.diagnosis_ccs,\n case\n when bb.encounter_id is not null then 1\n\t else 0\n end as had_readmission_flag,\n {{ dbt.datediff(\"aa.discharge_date\", \"bb.admit_date\",\"day\") }} as days_to_readmit,\n case\n when ({{ dbt.datediff(\"aa.discharge_date\", \"bb.admit_date\",\"day\") }}) <= 30 then 1\n\t else 0\n end as readmit_30_flag,\n case\n when\n\t (({{ dbt.datediff(\"aa.discharge_date\", \"bb.admit_date\", \"day\") }}) <= 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 '{{ var('tuva_last_run')}}' 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", "language": "sql", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/the_tuva_project", "path": "readmissions/final/readmissions__readmission_summary.sql", "original_file_path": "models/readmissions/final/readmissions__readmission_summary.sql", "name": "readmissions__readmission_summary", "alias": "readmission_summary", "checksum": {"name": "sha256", "checksum": "fb5c1b8f35e0d2d2dc4dd0ddc8a5e9b54e34e48aa906b2f2c6910266023ade09"}, "tags": ["readmissions"], "refs": [["readmissions__encounter_augmented"]], "sources": [], "metrics": [], "description": "This model includes all rows from the encounter_augmented model where disqualified_encounter_flag = 0 (all rows for encounters that are not disqualified for data quality issues). For each of these encounters we add fields to indicate whether it had a readmission and, when a readmission was present, to show relevant fields for the readmission.", "columns": {"encounter_id": {"name": "encounter_id", "description": "The unique identifier for the encounter", "meta": {}, "data_type": null, "quote": null, "tags": []}, "patient_id": {"name": "patient_id", "description": "The unique identifier for the patient", "meta": {}, "data_type": null, "quote": null, "tags": []}, "admit_date": {"name": "admit_date", "description": "The date of admission for the inpatient visit", "meta": {}, "data_type": null, "quote": null, "tags": []}, "discharge_date": {"name": "discharge_date", "description": "The date of discharge for the inpatient visit", "meta": {}, "data_type": null, "quote": null, "tags": []}, "discharge_disposition_code": {"name": "discharge_disposition_code", "description": "The valid 2-digit discharge status for the inpatient visit", "meta": {"terminology": "/terminology/administrative-codes/discharge-disposition"}, "data_type": null, "quote": null, "tags": []}, "facility_npi": {"name": "facility_npi", "description": "A name or ID for the facility where the inpatient visit occured", "meta": {"terminology": "/terminology/providers/provider"}, "data_type": null, "quote": null, "tags": []}, "ms_drg_code": {"name": "ms_drg_code", "description": "The MS-DRG associted with the inpatient visit", "meta": {"terminology": "/terminology/conditions-and-procedures/ms-drg"}, "data_type": null, "quote": null, "tags": []}, "total_paid_amount": {"name": "total_paid_amount", "description": "The amount paid for the visit", "meta": {}, "data_type": null, "quote": null, "tags": []}, "length_of_stay": {"name": "length_of_stay", "description": "Integer representing the length of stay of the inpatient visit in days", "meta": {}, "data_type": "integer", "quote": null, "tags": []}, "index_admission_flag": {"name": "index_admission_flag", "description": "Flag to indicate if the encounter is an index admission", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "planned_flag": {"name": "planned_flag", "description": "Flag to indicate if the encounter was planned", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "specialty_cohort": {"name": "specialty_cohort", "description": "Specialty cohort the encounter belongs to", "meta": {"terminology": "/value-sets/readmissions/specialty-cohort"}, "data_type": null, "quote": null, "tags": []}, "died_flag": {"name": "died_flag", "description": "Flag to indicate of the patient died in this encounter", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "diagnosis_ccs": {"name": "diagnosis_ccs", "description": "CCS code associated with the primary diagnosis for the encounter", "meta": {}, "data_type": null, "quote": null, "tags": []}, "had_readmission_flag": {"name": "had_readmission_flag", "description": "A flag to indicate whether the encounter had a readmission any number of days after discharge", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "days_to_readmit": {"name": "days_to_readmit", "description": "An integer to indicate the number of days to readmission", "meta": {}, "data_type": "integer", "quote": null, "tags": []}, "readmit_30_flag": {"name": "readmit_30_flag", "description": "A flag to indicate whether the encounter had a 30-day readmission", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "unplanned_readmit_30_flag": {"name": "unplanned_readmit_30_flag", "description": "A flag to indicate whether the encounter had an unplanned 30-day readmission", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "readmission_encounter_id": {"name": "readmission_encounter_id", "description": "The unique identifier for the readmission encounter", "meta": {}, "data_type": null, "quote": null, "tags": []}, "readmission_patient_id": {"name": "readmission_patient_id", "description": "The unique identifier for the patient", "meta": {}, "data_type": null, "quote": null, "tags": []}, "readmission_admit_date": {"name": "readmission_admit_date", "description": "The date of admission for the readmission inpatient visit", "meta": {}, "data_type": null, "quote": null, "tags": []}, "readmission_discharge_date": {"name": "readmission_discharge_date", "description": "The date of discharge for the readmission inpatient visit", "meta": {}, "data_type": null, "quote": null, "tags": []}, "readmission_discharge_disposition_code": {"name": "readmission_discharge_disposition_code", "description": "The valid 2-digit discharge status for the readmission inpatient visit", "meta": {"terminology": "/terminology/administrative-codes/discharge-disposition"}, "data_type": null, "quote": null, "tags": []}, "readmission_facility": {"name": "readmission_facility", "description": "A name or ID for the facility where the readmission inpatient visit occured", "meta": {"terminology": "/terminology/providers/provider"}, "data_type": null, "quote": null, "tags": []}, "readmission_ms_drg": {"name": "readmission_ms_drg", "description": "The MS-DRG associted with the readmission inpatient visit", "meta": {"terminology": "/terminology/conditions-and-procedures/ms-drg"}, "data_type": null, "quote": null, "tags": []}, "readmission_length_of_stay": {"name": "readmission_length_of_stay", "description": "Integer representing the length of stay of the readmission inpatient visit in days", "meta": {}, "data_type": "integer", "quote": null, "tags": []}, "readmission_index_admission_flag": {"name": "readmission_index_admission_flag", "description": "Flag to indicate if the readmission encounter is an index admission", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "readmission_planned_flag": {"name": "readmission_planned_flag", "description": "Flag to indicate if the readmission encounter was planned", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "readmission_specialty_cohort": {"name": "readmission_specialty_cohort", "description": "Specialty cohort the readmission encounter belongs to", "meta": {"terminology": "/value-sets/readmissions/specialty-cohort"}, "data_type": null, "quote": null, "tags": []}, "readmission_died_flag": {"name": "readmission_died_flag", "description": "Flag to indicate of the patient died in the readmission encounter", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "readmission_diagnosis_ccs": {"name": "readmission_diagnosis_ccs", "description": "CCS code associated with the primary diagnosis for the readmission encounter", "meta": {}, "data_type": null, "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The time at with the model was materialized. Generated by `dbt_utils.pretty_time` as the local time of the `dbt run` environment. Timezone is configurable via the `tuva_last_run` var.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": "#161a7d"}, "patch_path": "the_tuva_project://models/readmissions/readmissions_models.yml", "compiled_path": null, "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": 1701215339.791261}, "model.the_tuva_project.readmissions__encounter_overlap": {"resource_type": "model", "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.readmissions__encounter"]}, "config": {"enabled": true, "alias": "_int_encounter_overlap", "schema": "readmissions", "database": null, "tags": ["readmissions"], "meta": {}, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#161a7d"}, "bind": false, "post-hook": [], "pre-hook": []}, "database": "dev_sarah", "schema": "readmissions", "fqn": ["the_tuva_project", "readmissions", "intermediate", "readmissions__encounter_overlap"], "unique_id": "model.the_tuva_project.readmissions__encounter_overlap", "raw_code": "{{ config(\n enabled = var('readmissions_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\n )\n}}\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 {{ ref('readmissions__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 *, '{{ var('tuva_last_run')}}' as tuva_last_run\nfrom overlapping_pairs", "language": "sql", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/the_tuva_project", "path": "readmissions/intermediate/readmissions__encounter_overlap.sql", "original_file_path": "models/readmissions/intermediate/readmissions__encounter_overlap.sql", "name": "readmissions__encounter_overlap", "alias": "_int_encounter_overlap", "checksum": {"name": "sha256", "checksum": "651ea44e78a1f22fca5b77920a33ebc79ef209a91593b1e88c79c233e936ece2"}, "tags": ["readmissions"], "refs": [["readmissions__encounter"]], "sources": [], "metrics": [], "description": "This model lists all pairs of encounters that have some date overlap.", "columns": {"patient_id": {"name": "patient_id", "description": "The unique identifier for the patient", "meta": {}, "data_type": null, "quote": null, "tags": []}, "encounter_id_A": {"name": "encounter_id_A", "description": "Unique identifier for one of the overlapping encounters", "meta": {}, "data_type": null, "quote": null, "tags": []}, "encounter_id_B": {"name": "encounter_id_B", "description": "Unique identifier for the other overlapping encounter", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": "#161a7d"}, "patch_path": "the_tuva_project://models/readmissions/readmissions_models.yml", "compiled_path": null, "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": 1701215339.797214}, "model.the_tuva_project.readmissions__encounter_specialty_cohort": {"resource_type": "model", "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.readmissions__procedure_ccs", "seed.the_tuva_project.readmissions__surgery_gynecology_cohort", "seed.the_tuva_project.readmissions__specialty_cohort", "model.the_tuva_project.readmissions__encounter_with_ccs", "seed.the_tuva_project.readmissions__specialty_cohort", "model.the_tuva_project.readmissions__encounter"]}, "config": {"enabled": true, "alias": "_int_encounter_specialty_cohort", "schema": "readmissions", "database": null, "tags": ["readmissions"], "meta": {}, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#161a7d"}, "bind": false, "post-hook": [], "pre-hook": []}, "database": "dev_sarah", "schema": "readmissions", "fqn": ["the_tuva_project", "readmissions", "intermediate", "readmissions__encounter_specialty_cohort"], "unique_id": "model.the_tuva_project.readmissions__encounter_specialty_cohort", "raw_code": "{{ config(\n enabled = var('readmissions_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\n )\n}}\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 {{ ref('readmissions__procedure_ccs') }} proc\n left join {{ ref('readmissions__surgery_gynecology_cohort') }} sgc\n on proc.procedure_code = sgc.icd_10_pcs\n left join {{ ref('readmissions__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 {{ ref('readmissions__encounter_with_ccs') }} diag\n inner join {{ ref('readmissions__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, '{{ var('tuva_last_run')}}' as tuva_last_run\nfrom {{ ref('readmissions__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", "language": "sql", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/the_tuva_project", "path": "readmissions/intermediate/readmissions__encounter_specialty_cohort.sql", "original_file_path": "models/readmissions/intermediate/readmissions__encounter_specialty_cohort.sql", "name": "readmissions__encounter_specialty_cohort", "alias": "_int_encounter_specialty_cohort", "checksum": {"name": "sha256", "checksum": "c638d9f96f2d0b79c636fa988ed0dfca946f86a49cf48685685356c8825a30fb"}, "tags": ["readmissions"], "refs": [["readmissions__procedure_ccs"], ["readmissions__surgery_gynecology_cohort"], ["readmissions__specialty_cohort"], ["readmissions__encounter_with_ccs"], ["readmissions__specialty_cohort"], ["readmissions__encounter"]], "sources": [], "metrics": [], "description": "This model lists the specialty cohort associated with each inpatient encounter. All encounters in the stg_encounter model are present here, and each gets a specialty cohort assigned from the following list of 5 options: Surgery/Gynecology, Medicine, Cardiorespiratory, Cardiovascular, Neurology. Encounters that don't have a specialty cohort get 'Medicine' assigned by default.", "columns": {"encounter_id": {"name": "encounter_id", "description": "The unique identifier for the encounter", "meta": {}, "data_type": null, "quote": null, "tags": []}, "specialty_cohort": {"name": "specialty_cohort", "description": "The specialty cohort associated with the encounter", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": "#161a7d"}, "patch_path": "the_tuva_project://models/readmissions/readmissions_models.yml", "compiled_path": null, "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": 1701215339.799593}, "model.the_tuva_project.readmissions__encounter_data_quality": {"resource_type": "model", "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.readmissions__encounter_overlap", "model.the_tuva_project.readmissions__encounter_overlap", "model.the_tuva_project.readmissions__encounter_with_ccs", "seed.the_tuva_project.terminology__discharge_disposition", "seed.the_tuva_project.terminology__ms_drg"]}, "config": {"enabled": true, "alias": "_int_encounter_data_quality", "schema": "readmissions", "database": null, "tags": ["readmissions"], "meta": {}, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#161a7d"}, "bind": false, "post-hook": [], "pre-hook": []}, "database": "dev_sarah", "schema": "readmissions", "fqn": ["the_tuva_project", "readmissions", "intermediate", "readmissions__encounter_data_quality"], "unique_id": "model.the_tuva_project.readmissions__encounter_data_quality", "raw_code": "{{ config(\n enabled = var('readmissions_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\n )\n}}\n\n-- Here we list all encounters from the stg_encounter table\n-- with data quality flags that may disqualify them from\n-- being used for readmission measures \n\n\n-- Flag several potential data quality issues\n-- with all encounters.\n-- Every encounter_id from the stg_encounter model\n-- will be here. This CTE should have the same\n-- number of rows as the stg_encounter model, i.e.,\n-- there is a one to one correspondence between the\n-- rows in stg_encounter and this CTE.\nwith encounter_data_quality_issues as (\nselect\n aa.encounter_id,\n case\n when aa.admit_date is null then 1\n\telse 0\n end as missing_admit_date_flag,\n case\n when aa.discharge_date is null then 1\n\telse 0\n end as missing_discharge_date_flag,\n case\n when aa.admit_date > aa.discharge_date then 1\n\telse 0\n end as admit_after_discharge_flag,\n case\n when aa.discharge_disposition_code is null then 1\n\telse 0\n end as missing_discharge_disposition_code_flag,\n case\n when\n\t (aa.discharge_disposition_code is not null)\n\t and\n\t (bb.discharge_disposition_code is null) then 1\n\telse 0\n end as invalid_discharge_disposition_code_flag,\n case\n when aa.primary_diagnosis_code is null then 1\n else 0\n end as missing_primary_diagnosis_flag,\n case\n when aa.valid_primary_diagnosis_code_flag = 0 then 1\n\telse 0\n end as invalid_primary_diagnosis_code_flag,\n case\n when aa.ccs_diagnosis_category is null then 1\n\telse 0\n end as no_diagnosis_ccs_flag,\n aa.ccs_diagnosis_category as diagnosis_ccs,\n case\n when aa.encounter_id in (select distinct encounter_id_A\n\t from {{ ref('readmissions__encounter_overlap') }} )\n\t or\n\t aa.encounter_id in (select distinct encounter_id_B\n\t from {{ ref('readmissions__encounter_overlap') }} )\n\tthen 1\n\telse 0\n end as overlaps_with_another_encounter_flag,\n case\n when aa.ms_drg_code is null then 1\n\telse 0\n end as missing_ms_drg_flag,\n case\n when cc.ms_drg_code is null then 1\n\telse 0\n end as invalid_ms_drg_flag\n\nfrom {{ ref('readmissions__encounter_with_ccs') }} aa\n left join {{ ref('terminology__discharge_disposition') }} bb\n on aa.discharge_disposition_code = bb.discharge_disposition_code\n left join {{ ref('terminology__ms_drg') }} cc\n on aa.ms_drg_code = cc.ms_drg_code\n),\n\n\n-- Here we add a disqualified_encounter_flag.\n-- This disqualified_encounter_flag = 1\n-- when any of the critical data quality flags\n-- from the above CTE are equal to 1.\nall_data_quality_flags as (\nselect\n encounter_id,\n diagnosis_ccs,\n case\n when\n\t (missing_admit_date_flag = 1)\n\t or\n\t (missing_discharge_date_flag = 1)\n\t or\n\t (admit_after_discharge_flag = 1)\n\t or\n\t (missing_discharge_disposition_code_flag = 1)\n\t or\n\t (invalid_discharge_disposition_code_flag = 1)\n\t or\n\t (missing_primary_diagnosis_flag = 1)\n\t or\n\t (invalid_primary_diagnosis_code_flag = 1)\n\t or\n\t (no_diagnosis_ccs_flag = 1)\n\t or\n\t (overlaps_with_another_encounter_flag = 1)\n\t or\n\t (missing_ms_drg_flag = 1)\n\t or\n\t (invalid_ms_drg_flag = 1)\n\t then 1\n\telse 0\n end as disqualified_encounter_flag,\n missing_admit_date_flag,\n missing_discharge_date_flag,\n admit_after_discharge_flag,\n missing_discharge_disposition_code_flag,\n invalid_discharge_disposition_code_flag,\n missing_primary_diagnosis_flag,\n invalid_primary_diagnosis_code_flag,\n no_diagnosis_ccs_flag,\n overlaps_with_another_encounter_flag,\n missing_ms_drg_flag,\n invalid_ms_drg_flag\nfrom encounter_data_quality_issues\n) \n\n\n\nselect *, '{{ var('tuva_last_run')}}' as tuva_last_run\nfrom all_data_quality_flags", "language": "sql", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/the_tuva_project", "path": "readmissions/intermediate/readmissions__encounter_data_quality.sql", "original_file_path": "models/readmissions/intermediate/readmissions__encounter_data_quality.sql", "name": "readmissions__encounter_data_quality", "alias": "_int_encounter_data_quality", "checksum": {"name": "sha256", "checksum": "a23df29e685234350283fc7841bb21a20d1c91b566bccfda2262d9c07d7aed68"}, "tags": ["readmissions"], "refs": [["readmissions__encounter_overlap"], ["readmissions__encounter_overlap"], ["readmissions__encounter_with_ccs"], ["terminology__discharge_disposition"], ["terminology__ms_drg"]], "sources": [], "metrics": [], "description": "This model has the same number of rows as the stg_encounter model. Here we have one row for every unique encounter in the stg_encounter model, and for each encounter we have a flag (disqualified_encounter_flag) to indicte if the encounter is disqualified from being useful for readmission measures. We also have other flags to indicate which specific data quality issues this encounter has that may disqualify it from being used in readmission measures.", "columns": {"encounter_id": {"name": "encounter_id", "description": "The unique identifier for the encounter", "meta": {}, "data_type": null, "quote": null, "tags": []}, "diagnosis_ccs": {"name": "diagnosis_ccs", "description": "The CCS diagnosis category associated with the primary diagnosis of this encounter", "meta": {}, "data_type": null, "quote": null, "tags": []}, "disqualified_encounter_flag": {"name": "disqualified_encounter_flag", "description": "A flag that indicates whether this encounter is disqualified from being used in readmission measures for any critical data quality problem.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "missing_admit_date_flag": {"name": "missing_admit_date_flag", "description": "A flag that indicates whether the admit date is missing from this encounter.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "missing_discharge_date_flag": {"name": "missing_discharge_date_flag", "description": "A flag that indicates whether the discharge date is missing from this encounter.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "admit_after_discharge_flag": {"name": "admit_after_discharge_flag", "description": "A flag that indicates whether the admit date for the encounter is after the discharge date for the encounter.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "missing_discharge_status_code_flag": {"name": "missing_discharge_status_code_flag", "description": "A flag that indicates whether the discharge status code is missing for the encounter.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "invalid_discharge_status_code_flag": {"name": "invalid_discharge_status_code_flag", "description": "A flag that indicates whether the discharge status code that is present for this encounter is invalid. This flag is 1 only when the discharge status code is present but invalid.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "missing_primary_diagnosis_flag": {"name": "missing_primary_diagnosis_flag", "description": "A flag that indicates whether there is no primary diagnosis associated with the encounter.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "multiple_primary_diagnosis": {"name": "multiple_primary_diagnosis", "description": "A flag that indicates whether there are multiple primary diagnoses associated with the encounter.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "invalid_primary_diagnosis_code": {"name": "invalid_primary_diagnosis_code", "description": "A flag that indicates whether the primary diagnosis present for this encounter is invalid, i.e. a non existing ICD-10-CM code. This flag indicates that a primary diagnosis code is indeed present for the encounter, but it is not a valid ICD-10-CM code.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "no_diagnosis_ccs_flag": {"name": "no_diagnosis_ccs_flag", "description": "A flag that indicates whether there is no CCS diagnosis category associated with the primary ICD-10-CM diagnosis code for the encounter. This flag indicates that there is a valid primary ICD-10-CM diagnosis code associated with the encounter, but there is no CCS diagnosis category associated with that ICD-10-CM code.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "overlaps_with_another_encounter_flag": {"name": "overlaps_with_another_encounter_flag", "description": "A flag that indicates whether this encounter's dates overlap with those of another encounter in the dataset", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": "#161a7d"}, "patch_path": "the_tuva_project://models/readmissions/readmissions_models.yml", "compiled_path": null, "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": 1701215339.795031}, "model.the_tuva_project.readmissions__exclusion": {"resource_type": "model", "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.readmissions__encounter_with_ccs", "seed.the_tuva_project.readmissions__exclusion_ccs_diagnosis_category"]}, "config": {"enabled": true, "alias": "_int_exclusion", "schema": "readmissions", "database": null, "tags": ["readmissions"], "meta": {}, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#161a7d"}, "bind": false, "post-hook": [], "pre-hook": []}, "database": "dev_sarah", "schema": "readmissions", "fqn": ["the_tuva_project", "readmissions", "intermediate", "readmissions__exclusion"], "unique_id": "model.the_tuva_project.readmissions__exclusion", "raw_code": "{{ config(\n enabled = var('readmissions_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\n )\n}}\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 {{ ref('readmissions__encounter_with_ccs') }}\nwhere\n(ccs_diagnosis_category is not null)\nand\n(\nccs_diagnosis_category in\n (select distinct ccs_diagnosis_category\n from {{ ref('readmissions__exclusion_ccs_diagnosis_category') }} )\n)\n)\n\n\nselect *, '{{ var('tuva_last_run')}}' as tuva_last_run\nfrom exclusions", "language": "sql", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/the_tuva_project", "path": "readmissions/intermediate/readmissions__exclusion.sql", "original_file_path": "models/readmissions/intermediate/readmissions__exclusion.sql", "name": "readmissions__exclusion", "alias": "_int_exclusion", "checksum": {"name": "sha256", "checksum": "d27ff53532444bdce91b3108d6dd1b4737903870366797dd5cd5ae831d2c50b8"}, "tags": ["readmissions"], "refs": [["readmissions__encounter_with_ccs"], ["readmissions__exclusion_ccs_diagnosis_category"]], "sources": [], "metrics": [], "description": "This model lists all encounters that are excluded from being index admissions because they belong to one of the exclusion categories.", "columns": {"encounter_id": {"name": "encounter_id", "description": "The unique identifier for the encounter", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": "#161a7d"}, "patch_path": "the_tuva_project://models/readmissions/readmissions_models.yml", "compiled_path": null, "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": 1701215339.803539}, "model.the_tuva_project.readmissions__index_admission": {"resource_type": "model", "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"]}, "config": {"enabled": true, "alias": "_int_index_admission", "schema": "readmissions", "database": null, "tags": ["readmissions"], "meta": {}, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#161a7d"}, "bind": false, "post-hook": [], "pre-hook": []}, "database": "dev_sarah", "schema": "readmissions", "fqn": ["the_tuva_project", "readmissions", "intermediate", "readmissions__index_admission"], "unique_id": "model.the_tuva_project.readmissions__index_admission", "raw_code": "{{ config(\n enabled = var('readmissions_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\n )\n}}\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, '{{ var('tuva_last_run')}}' as tuva_last_run\nfrom {{ ref('readmissions__encounter') }} a\ninner join {{ ref('readmissions__index_time_requirement') }} b\n on a.encounter_id = b.encounter_id\ninner join {{ ref('readmissions__index_discharge_requirement') }} c\n on a.encounter_id = c.encounter_id\nleft join {{ ref('readmissions__exclusion') }} d\n on a.encounter_id = d.encounter_id\nwhere d.encounter_id is null", "language": "sql", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/the_tuva_project", "path": "readmissions/intermediate/readmissions__index_admission.sql", "original_file_path": "models/readmissions/intermediate/readmissions__index_admission.sql", "name": "readmissions__index_admission", "alias": "_int_index_admission", "checksum": {"name": "sha256", "checksum": "bbb59c9f797afc1ee141cd849b1a437d52f059e8c6e188026cb0d8189e0c5a68"}, "tags": ["readmissions"], "refs": [["readmissions__encounter"], ["readmissions__index_time_requirement"], ["readmissions__index_discharge_requirement"], ["readmissions__exclusion"]], "sources": [], "metrics": [], "description": "This model lists all index admissions for the hospital wide readmissions measure. These represent encounter_ids that meet the requirements to be an index admission for the HWR measure.", "columns": {"encounter_id": {"name": "encounter_id", "description": "The unique identifier for the encounter", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": "#161a7d"}, "patch_path": "the_tuva_project://models/readmissions/readmissions_models.yml", "compiled_path": null, "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": 1701215339.805399}, "model.the_tuva_project.readmissions__index_time_requirement": {"resource_type": "model", "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.readmissions__encounter", "model.the_tuva_project.readmissions__encounter"]}, "config": {"enabled": true, "alias": "_int_index_time_requirement", "schema": "readmissions", "database": null, "tags": ["readmissions"], "meta": {}, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#161a7d"}, "bind": false, "post-hook": [], "pre-hook": []}, "database": "dev_sarah", "schema": "readmissions", "fqn": ["the_tuva_project", "readmissions", "intermediate", "readmissions__index_time_requirement"], "unique_id": "model.the_tuva_project.readmissions__index_time_requirement", "raw_code": "{{ config(\n enabled = var('readmissions_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\n )\n}}\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, '{{ var('tuva_last_run')}}' as tuva_last_run\nfrom {{ ref('readmissions__encounter') }}\nwhere discharge_date <= (select max(discharge_date)\n from {{ ref('readmissions__encounter') }} ) - 30", "language": "sql", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/the_tuva_project", "path": "readmissions/intermediate/readmissions__index_time_requirement.sql", "original_file_path": "models/readmissions/intermediate/readmissions__index_time_requirement.sql", "name": "readmissions__index_time_requirement", "alias": "_int_index_time_requirement", "checksum": {"name": "sha256", "checksum": "305870bec4cc273c38adcc4b930ddfd9923739b2f1e1f2c3ba87094888f28c49"}, "tags": ["readmissions"], "refs": [["readmissions__encounter"], ["readmissions__encounter"]], "sources": [], "metrics": [], "description": "This model lists all encounters that meet the time requirement to be an index admission.", "columns": {"encounter_id": {"name": "encounter_id", "description": "The unique identifier for the encounter", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": "#161a7d"}, "patch_path": "the_tuva_project://models/readmissions/readmissions_models.yml", "compiled_path": null, "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": 1701215339.809325}, "model.the_tuva_project.readmissions__planned_encounter": {"resource_type": "model", "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.readmissions__procedure_ccs", "seed.the_tuva_project.readmissions__always_planned_ccs_procedure_category", "model.the_tuva_project.readmissions__encounter_with_ccs", "seed.the_tuva_project.readmissions__always_planned_ccs_diagnosis_category", "model.the_tuva_project.readmissions__procedure_ccs", "seed.the_tuva_project.readmissions__potentially_planned_ccs_procedure_category", "model.the_tuva_project.readmissions__procedure_ccs", "seed.the_tuva_project.readmissions__potentially_planned_icd_10_pcs", "model.the_tuva_project.readmissions__encounter_with_ccs", "seed.the_tuva_project.readmissions__acute_diagnosis_icd_10_cm", "seed.the_tuva_project.readmissions__acute_diagnosis_ccs"]}, "config": {"enabled": true, "alias": "_int_planned_encounter", "schema": "readmissions", "database": null, "tags": ["readmissions"], "meta": {}, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#161a7d"}, "bind": false, "post-hook": [], "pre-hook": []}, "database": "dev_sarah", "schema": "readmissions", "fqn": ["the_tuva_project", "readmissions", "intermediate", "readmissions__planned_encounter"], "unique_id": "model.the_tuva_project.readmissions__planned_encounter", "raw_code": "{{ config(\n enabled = var('readmissions_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\n )\n}}\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 {{ ref('readmissions__procedure_ccs') }} pccs\ninner join {{ ref('readmissions__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 {{ ref('readmissions__encounter_with_ccs') }} dccs\ninner join {{ ref('readmissions__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 {{ ref('readmissions__procedure_ccs') }} pccs\ninner join {{ ref('readmissions__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 {{ ref('readmissions__procedure_ccs') }} pcs\ninner join {{ ref('readmissions__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 {{ ref('readmissions__encounter_with_ccs') }} dccs\nleft join {{ ref('readmissions__acute_diagnosis_icd_10_cm') }} adi\n on dccs.primary_diagnosis_code = adi.icd_10_cm\nleft join {{ ref('readmissions__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 * , '{{ var('tuva_last_run')}}' as tuva_last_run from always_planned_px\nunion distinct\nselect *, '{{ var('tuva_last_run')}}' as tuva_last_run from always_planned_dx\nunion distinct\nselect *, '{{ var('tuva_last_run')}}' as tuva_last_run from potentially_planned_that_are_actually_planned", "language": "sql", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/the_tuva_project", "path": "readmissions/intermediate/readmissions__planned_encounter.sql", "original_file_path": "models/readmissions/intermediate/readmissions__planned_encounter.sql", "name": "readmissions__planned_encounter", "alias": "_int_planned_encounter", "checksum": {"name": "sha256", "checksum": "563061c7bf2a55274cb8c5758986646143842fdd44b4e870112faef594985129"}, "tags": ["readmissions"], "refs": [["readmissions__procedure_ccs"], ["readmissions__always_planned_ccs_procedure_category"], ["readmissions__encounter_with_ccs"], ["readmissions__always_planned_ccs_diagnosis_category"], ["readmissions__procedure_ccs"], ["readmissions__potentially_planned_ccs_procedure_category"], ["readmissions__procedure_ccs"], ["readmissions__potentially_planned_icd_10_pcs"], ["readmissions__encounter_with_ccs"], ["readmissions__acute_diagnosis_icd_10_cm"], ["readmissions__acute_diagnosis_ccs"]], "sources": [], "metrics": [], "description": "This model gives a list of all encounter_ids that were planned encounters.", "columns": {"encounter_id": {"name": "encounter_id", "description": "The unique identifier for the encounter", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": "#161a7d"}, "patch_path": "the_tuva_project://models/readmissions/readmissions_models.yml", "compiled_path": null, "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": 1701215339.811323}, "model.the_tuva_project.readmissions__encounter": {"resource_type": "model", "depends_on": {"macros": ["macro.dbt.type_string"], "nodes": ["model.the_tuva_project.readmissions__stg_core__encounter"]}, "config": {"enabled": true, "alias": "_int_encounter", "schema": "readmissions", "database": null, "tags": ["readmissions"], "meta": {}, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#161a7d"}, "bind": false, "post-hook": [], "pre-hook": []}, "database": "dev_sarah", "schema": "readmissions", "fqn": ["the_tuva_project", "readmissions", "intermediate", "readmissions__encounter"], "unique_id": "model.the_tuva_project.readmissions__encounter", "raw_code": "{{ config(\n enabled = var('readmissions_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\n )\n}}\n\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 {{ dbt.type_string() }}) as encounter_id,\n cast(patient_id as {{ dbt.type_string() }}) 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 {{ dbt.type_string() }}) as discharge_disposition_code,\n cast(facility_npi as {{ dbt.type_string() }}) as facility_npi,\n cast(ms_drg_code as {{ dbt.type_string() }}) as ms_drg_code,\n cast(paid_amount as numeric) as paid_amount,\n cast(primary_diagnosis_code as {{ dbt.type_string() }}) as primary_diagnosis_code,\n '{{ var('tuva_last_run')}}' as tuva_last_run\nfrom {{ ref('readmissions__stg_core__encounter') }}", "language": "sql", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/the_tuva_project", "path": "readmissions/intermediate/readmissions__encounter.sql", "original_file_path": "models/readmissions/intermediate/readmissions__encounter.sql", "name": "readmissions__encounter", "alias": "_int_encounter", "checksum": {"name": "sha256", "checksum": "69b1397fd8f7cdb5ed0c9ce7e6b7e6123463718f2e7df6a159a37aab2676de1c"}, "tags": ["readmissions"], "refs": [["readmissions__stg_core__encounter"]], "sources": [], "metrics": [], "description": "This is a staging table for the input layer. Each row represents a unique acute inpatient encounter.", "columns": {"encounter_id": {"name": "encounter_id", "description": "The unique identifier for the encounter", "meta": {}, "data_type": null, "quote": null, "tags": []}, "patient_id": {"name": "patient_id", "description": "The unique identifier for the patient", "meta": {}, "data_type": null, "quote": null, "tags": []}, "admit_date": {"name": "admit_date", "description": "The date of admission for the inpatient visit", "meta": {}, "data_type": null, "quote": null, "tags": []}, "discharge_date": {"name": "discharge_date", "description": "The date of discharge for the inpatient visit", "meta": {}, "data_type": null, "quote": null, "tags": []}, "discharge_status_code": {"name": "discharge_status_code", "description": "The valid 2-digit discharge status for the inpatient visit", "meta": {}, "data_type": null, "quote": null, "tags": []}, "facility": {"name": "facility", "description": "A name or ID for the facility where the inpatient visit occured", "meta": {}, "data_type": null, "quote": null, "tags": []}, "ms_drg": {"name": "ms_drg", "description": "The MS-DRG associted with the inpatient visit", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": "#161a7d"}, "patch_path": "the_tuva_project://models/readmissions/readmissions_models.yml", "compiled_path": null, "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": 1701215339.819382}, "model.the_tuva_project.readmissions__readmission_crude": {"resource_type": "model", "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"]}, "config": {"enabled": true, "alias": "_int_readmission_crude", "schema": "readmissions", "database": null, "tags": ["readmissions"], "meta": {}, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#161a7d"}, "bind": false, "post-hook": [], "pre-hook": []}, "database": "dev_sarah", "schema": "readmissions", "fqn": ["the_tuva_project", "readmissions", "intermediate", "readmissions__readmission_crude"], "unique_id": "model.the_tuva_project.readmissions__readmission_crude", "raw_code": "{{ config(\n enabled = var('readmissions_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\n )\n}}\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 {{ ref('readmissions__encounter') }} enc\nleft join {{ ref('readmissions__encounter_overlap') }} over_a\n on enc.encounter_id = over_a.encounter_id_A\nleft join {{ ref('readmissions__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 ({{ dbt.datediff(\"bb.admit_date\", \"aa.discharge_date\", \"day\") }}) <= 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 *, '{{ var('tuva_last_run')}}' as tuva_last_run\nfrom readmission_calc", "language": "sql", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/the_tuva_project", "path": "readmissions/intermediate/readmissions__readmission_crude.sql", "original_file_path": "models/readmissions/intermediate/readmissions__readmission_crude.sql", "name": "readmissions__readmission_crude", "alias": "_int_readmission_crude", "checksum": {"name": "sha256", "checksum": "5af78fb194df2ee56d8e4a8aa186bc36aec5310976948597a1f1a1938919bb3c"}, "tags": ["readmissions"], "refs": [["readmissions__encounter"], ["readmissions__encounter_overlap"], ["readmissions__encounter_overlap"]], "sources": [], "metrics": [], "description": "This model lists all encounters and whether they had a 'crude' readmission, meaning that the encounter had a hospitalization after discharge, without regard to all CMS readmission logic.", "columns": {"encounter_id": {"name": "encounter_id", "description": "The unique identifier for the encounter", "meta": {}, "data_type": null, "quote": null, "tags": []}, "patient_id": {"name": "patient_id", "description": "The unique identifier for the patient", "meta": {}, "data_type": null, "quote": null, "tags": []}, "admit_date": {"name": "admit_date", "description": "The date of admission for the inpatient visit", "meta": {}, "data_type": null, "quote": null, "tags": []}, "discharge_date": {"name": "discharge_date", "description": "", "meta": {}, "data_type": null, "quote": null, "tags": []}, "had_readmission_flag": {"name": "had_readmission_flag", "description": "A flag to indicate whether the encounter had a readmission any number of days after discharge", "meta": {}, "data_type": null, "quote": null, "tags": []}, "days_to_readmit": {"name": "days_to_readmit", "description": "An integer to indicate the number of days to readmission", "meta": {}, "data_type": null, "quote": null, "tags": []}, "readmit_30_flag": {"name": "readmit_30_flag", "description": "A flag to indicate whether the encounter had a 30-day readmission", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": "#161a7d"}, "patch_path": "the_tuva_project://models/readmissions/readmissions_models.yml", "compiled_path": null, "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": 1701215339.8164532}, "model.the_tuva_project.readmissions__procedure_ccs": {"resource_type": "model", "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"]}, "config": {"enabled": true, "alias": "_int_procedure_ccs", "schema": "readmissions", "database": null, "tags": ["readmissions"], "meta": {}, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#161a7d"}, "bind": false, "post-hook": [], "pre-hook": []}, "database": "dev_sarah", "schema": "readmissions", "fqn": ["the_tuva_project", "readmissions", "intermediate", "readmissions__procedure_ccs"], "unique_id": "model.the_tuva_project.readmissions__procedure_ccs", "raw_code": "{{ config(\n enabled = var('readmissions_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\n )\n}}\n\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 '{{ var('tuva_last_run')}}' as tuva_last_run\nfrom\n {{ ref('readmissions__stg_core__procedure') }} aa\n left join {{ ref('terminology__icd_10_pcs') }} bb\n on aa.normalized_code = bb.icd_10_pcs\n left join {{ ref('readmissions__icd_10_pcs_to_ccs') }} cc\n on aa.normalized_code = cc.icd_10_pcs\nwhere aa.normalized_code_type = 'icd-10-pcs'", "language": "sql", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/the_tuva_project", "path": "readmissions/intermediate/readmissions__procedure_ccs.sql", "original_file_path": "models/readmissions/intermediate/readmissions__procedure_ccs.sql", "name": "readmissions__procedure_ccs", "alias": "_int_procedure_ccs", "checksum": {"name": "sha256", "checksum": "27a1a42aad97c8878be854759a446bbfb68f7fb9d69f2e3c7a22ab7e0afd4c60"}, "tags": ["readmissions"], "refs": [["readmissions__stg_core__procedure"], ["terminology__icd_10_pcs"], ["readmissions__icd_10_pcs_to_ccs"]], "sources": [], "metrics": [], "description": "This model includes all procedures from the stg_procedure model and adds a valid_icd_10_pcs_flag to indicate if the ICD-10-PCS code for this procedure is valid. We also add the CCS procedure category associated with the procedure", "columns": {"encounter_id": {"name": "encounter_id", "description": "The unique identifier for the encounter", "meta": {}, "data_type": null, "quote": null, "tags": []}, "procedure_code": {"name": "procedure_code", "description": "An ICD-10-PCS code associated with this encounter_id", "meta": {}, "data_type": null, "quote": null, "tags": []}, "valid_icd_10_pcs_flag": {"name": "valid_icd_10_pcs_flag", "description": "A flag indicating if the ICD-10-PCS procedure code given is valid", "meta": {}, "data_type": null, "quote": null, "tags": []}, "ccs_procedure_category": {"name": "ccs_procedure_category", "description": "The CCS code associated with the given ICD-10-PCS procedure", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": "#161a7d"}, "patch_path": "the_tuva_project://models/readmissions/readmissions_models.yml", "compiled_path": null, "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": 1701215339.81355}, "model.the_tuva_project.readmissions__encounter_with_ccs": {"resource_type": "model", "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.readmissions__encounter", "seed.the_tuva_project.terminology__icd_10_cm", "seed.the_tuva_project.readmissions__icd_10_cm_to_ccs"]}, "config": {"enabled": true, "alias": "_int_encounter_with_ccs", "schema": "readmissions", "database": null, "tags": ["readmissions"], "meta": {}, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#161a7d"}, "bind": false, "post-hook": [], "pre-hook": []}, "database": "dev_sarah", "schema": "readmissions", "fqn": ["the_tuva_project", "readmissions", "intermediate", "readmissions__encounter_with_ccs"], "unique_id": "model.the_tuva_project.readmissions__encounter_with_ccs", "raw_code": "{{ config(\n enabled = var('readmissions_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\n )\n}}\n\n-- Here we add a CCS diagnosis category to\n-- every encounter that we can add a CCS diagnosis category to.\n-- The CCS diagnosis category is found using\n-- the encounter's primary diagnosis code.\n\n\nselect\n aa.encounter_id,\n aa.patient_id,\n aa.admit_date,\n aa.discharge_date,\n aa.discharge_disposition_code,\n aa.facility_npi,\n aa.ms_drg_code,\n aa.paid_amount,\n aa.primary_diagnosis_code,\n\n case\n when bb.icd_10_cm is not null then 1\n else 0\n end as valid_primary_diagnosis_code_flag,\n\n cc.ccs_diagnosis_category,\n\n '{{ var('tuva_last_run')}}' as tuva_last_run\n\nfrom\n {{ ref('readmissions__encounter') }} aa\n left join {{ ref('terminology__icd_10_cm') }} bb\n on aa.primary_diagnosis_code = bb.icd_10_cm\n left join {{ ref('readmissions__icd_10_cm_to_ccs') }} cc\n on aa.primary_diagnosis_code = cc.icd_10_cm", "language": "sql", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/the_tuva_project", "path": "readmissions/intermediate/readmissions__encounter_with_ccs.sql", "original_file_path": "models/readmissions/intermediate/readmissions__encounter_with_ccs.sql", "name": "readmissions__encounter_with_ccs", "alias": "_int_encounter_with_ccs", "checksum": {"name": "sha256", "checksum": "24551ca63236a478d8d3cb00b185c08893611b094cc353fb6014a5e37d1dff0b"}, "tags": ["readmissions"], "refs": [["readmissions__encounter"], ["terminology__icd_10_cm"], ["readmissions__icd_10_cm_to_ccs"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#161a7d"}, "patch_path": "the_tuva_project://models/readmissions/readmissions_models.yml", "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"schema": "readmissions", "alias": "_int_encounter_with_ccs", "tags": "readmissions", "materialized": "view", "enabled": true, "bind": false, "docs": {"node_color": "#161a7d"}}, "created_at": 1701215339.801476}, "model.the_tuva_project.readmissions__index_discharge_requirement": {"resource_type": "model", "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.readmissions__encounter", "model.the_tuva_project.readmissions__encounter"]}, "config": {"enabled": true, "alias": "_int_index_discharge_requirement", "schema": "readmissions", "database": null, "tags": ["readmissions"], "meta": {}, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#161a7d"}, "bind": false, "post-hook": [], "pre-hook": []}, "database": "dev_sarah", "schema": "readmissions", "fqn": ["the_tuva_project", "readmissions", "intermediate", "readmissions__index_discharge_requirement"], "unique_id": "model.the_tuva_project.readmissions__index_discharge_requirement", "raw_code": "{{ config(\n enabled = var('readmissions_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\n )\n}}\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 {{ ref('readmissions__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, '{{ var('tuva_last_run')}}' as tuva_last_run\nfrom {{ ref('readmissions__encounter') }} a\nleft join all_invalid_discharges b\n on a.encounter_id = b.encounter_id\nwhere b.encounter_id is null", "language": "sql", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/the_tuva_project", "path": "readmissions/intermediate/readmissions__index_discharge_requirement.sql", "original_file_path": "models/readmissions/intermediate/readmissions__index_discharge_requirement.sql", "name": "readmissions__index_discharge_requirement", "alias": "_int_index_discharge_requirement", "checksum": {"name": "sha256", "checksum": "a6d50fccefae6d851d6e9f2e0d1b7484a749c1154e123aa571149d178e5c493b"}, "tags": ["readmissions"], "refs": [["readmissions__encounter"], ["readmissions__encounter"]], "sources": [], "metrics": [], "description": "This model lists all encounters that meet the discharge disposition requirement to be an index admission.", "columns": {"encounter_id": {"name": "encounter_id", "description": "The unique identifier for the encounter", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": "#161a7d"}, "patch_path": "the_tuva_project://models/readmissions/readmissions_models.yml", "compiled_path": null, "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": 1701215339.807463}, "model.the_tuva_project.cms_hcc__stg_core__condition": {"resource_type": "model", "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.core__condition"]}, "config": {"enabled": true, "alias": "_stg_condition", "schema": "cms_hcc", "database": null, "tags": ["cms_hcc"], "meta": {}, "materialized": "ephemeral", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "bind": false, "post-hook": [], "pre-hook": []}, "database": "dev_sarah", "schema": "cms_hcc", "fqn": ["the_tuva_project", "cms_hcc", "staging", "cms_hcc__stg_core__condition"], "unique_id": "model.the_tuva_project.cms_hcc__stg_core__condition", "raw_code": "{{ config(\n enabled = var('cms_hcc_enabled',var('claims_enabled',var('clinical_enabled',var('tuva_marts_enabled',False))))\n )\n}}\nselect\n claim_id\n , patient_id\n , recorded_date\n , condition_type\n , normalized_code_type as code_type\n , normalized_code as code\n , '{{ var('tuva_last_run')}}' as tuva_last_run\nfrom {{ ref('core__condition') }}", "language": "sql", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/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", "name": "cms_hcc__stg_core__condition", "alias": "_stg_condition", "checksum": {"name": "sha256", "checksum": "c98db96a6175d161b62ffc89de15c2ab5081d89da22a120c026c15ce99b7f5b0"}, "tags": ["cms_hcc"], "refs": [["core__condition"]], "sources": [], "metrics": [], "description": "Staging conditions from core.", "columns": {"claim_id": {"name": "claim_id", "description": "Unique claim_id for each claim.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "patient_id": {"name": "patient_id", "description": "Unique patient_id for each person.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "recorded_date": {"name": "recorded_date", "description": "Date in which the condition was recorded.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "condition_type": {"name": "condition_type", "description": "The type of condition.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "code_type": {"name": "code_type", "description": "The type of condition code.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "code": {"name": "code", "description": "The condition code.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://models/cms_hcc/cms_hcc_models.yml", "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"schema": "cms_hcc", "alias": "_stg_condition", "tags": "cms_hcc", "materialized": "ephemeral", "enabled": true, "bind": false}, "created_at": 1701215339.868486}, "model.the_tuva_project.cms_hcc__stg_core__patient": {"resource_type": "model", "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.core__patient"]}, "config": {"enabled": true, "alias": "_stg_patient", "schema": "cms_hcc", "database": null, "tags": ["cms_hcc"], "meta": {}, "materialized": "ephemeral", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "bind": false, "post-hook": [], "pre-hook": []}, "database": "dev_sarah", "schema": "cms_hcc", "fqn": ["the_tuva_project", "cms_hcc", "staging", "cms_hcc__stg_core__patient"], "unique_id": "model.the_tuva_project.cms_hcc__stg_core__patient", "raw_code": "{{ config(\n enabled = var('cms_hcc_enabled',var('claims_enabled',var('clinical_enabled',var('tuva_marts_enabled',False))))\n )\n}}\nselect\n patient_id\n , sex\n , birth_date\n , death_date\n , '{{ var('tuva_last_run')}}' as tuva_last_run\nfrom {{ ref('core__patient') }}", "language": "sql", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/the_tuva_project", "path": "cms_hcc/staging/cms_hcc__stg_core__patient.sql", "original_file_path": "models/cms_hcc/staging/cms_hcc__stg_core__patient.sql", "name": "cms_hcc__stg_core__patient", "alias": "_stg_patient", "checksum": {"name": "sha256", "checksum": "e7856238a902887befd29ec7e3bac11a7b4f47acd1c1fdfddfd2c399f96b08a0"}, "tags": ["cms_hcc"], "refs": [["core__patient"]], "sources": [], "metrics": [], "description": "Staging patient from core.", "columns": {"patient_id": {"name": "patient_id", "description": "Unique identifier for each patient in the dataset.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "sex": {"name": "sex", "description": "Biological sex of the patient.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "birth_date": {"name": "birth_date", "description": "Date the patient was born.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "death_date": {"name": "death_date", "description": "The death date of the patient if there is one.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://models/cms_hcc/cms_hcc_models.yml", "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"schema": "cms_hcc", "alias": "_stg_patient", "tags": "cms_hcc", "materialized": "ephemeral", "enabled": true, "bind": false}, "created_at": 1701215339.8762329}, "model.the_tuva_project.cms_hcc__stg_core__medical_claim": {"resource_type": "model", "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.core__medical_claim"]}, "config": {"enabled": true, "alias": "_stg_medical_claim", "schema": "cms_hcc", "database": null, "tags": ["cms_hcc"], "meta": {}, "materialized": "ephemeral", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "bind": false, "post-hook": [], "pre-hook": []}, "database": "dev_sarah", "schema": "cms_hcc", "fqn": ["the_tuva_project", "cms_hcc", "staging", "cms_hcc__stg_core__medical_claim"], "unique_id": "model.the_tuva_project.cms_hcc__stg_core__medical_claim", "raw_code": "{{ config(\n enabled = var('cms_hcc_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\n )\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 , '{{ var('tuva_last_run')}}' as tuva_last_run\nfrom {{ ref('core__medical_claim') }}", "language": "sql", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/the_tuva_project", "path": "cms_hcc/staging/cms_hcc__stg_core__medical_claim.sql", "original_file_path": "models/cms_hcc/staging/cms_hcc__stg_core__medical_claim.sql", "name": "cms_hcc__stg_core__medical_claim", "alias": "_stg_medical_claim", "checksum": {"name": "sha256", "checksum": "ac9505314ff81401a8769ba8ca69e5b557247ffdf67064119e1761431e14ccec"}, "tags": ["cms_hcc"], "refs": [["core__medical_claim"]], "sources": [], "metrics": [], "description": "Staging medical claims from core.", "columns": {"claim_id": {"name": "claim_id", "description": "Unique identifier for each claim.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "claim_line_number": {"name": "claim_line_number", "description": "Indicates the line number for the particular line of the claim.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "claim_type": {"name": "claim_type", "description": "Indicates whether the claim is professional (CMS-1500), institutional (UB-04), dental, or vision.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "patient_id": {"name": "patient_id", "description": "Unique identifier for each patient in the dataset.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "claim_start_date": {"name": "claim_start_date", "description": "Start date for the claim.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "claim_end_date": {"name": "claim_end_date", "description": "End date for the claim.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "bill_type_code": {"name": "bill_type_code", "description": "Bill type code for the claim (institutional claims only).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "hcpcs_code": {"name": "hcpcs_code", "description": "HCPCS level 1 or level 2 code for the claim line.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://models/cms_hcc/cms_hcc_models.yml", "compiled_path": null, "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": 1701215339.8739}, "model.the_tuva_project.cms_hcc__stg_core__eligibility": {"resource_type": "model", "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.core__eligibility"]}, "config": {"enabled": true, "alias": "_stg_eligibility", "schema": "cms_hcc", "database": null, "tags": ["cms_hcc"], "meta": {}, "materialized": "ephemeral", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "bind": false, "post-hook": [], "pre-hook": []}, "database": "dev_sarah", "schema": "cms_hcc", "fqn": ["the_tuva_project", "cms_hcc", "staging", "cms_hcc__stg_core__eligibility"], "unique_id": "model.the_tuva_project.cms_hcc__stg_core__eligibility", "raw_code": "{{ config(\n enabled = var('cms_hcc_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\n )\n}}\nselect\n patient_id\n , enrollment_start_date\n , enrollment_end_date\n , original_reason_entitlement_code\n , dual_status_code\n , medicare_status_code\n , '{{ var('tuva_last_run')}}' as tuva_last_run\nfrom {{ ref('core__eligibility') }}", "language": "sql", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/the_tuva_project", "path": "cms_hcc/staging/cms_hcc__stg_core__eligibility.sql", "original_file_path": "models/cms_hcc/staging/cms_hcc__stg_core__eligibility.sql", "name": "cms_hcc__stg_core__eligibility", "alias": "_stg_eligibility", "checksum": {"name": "sha256", "checksum": "b9477f45b603026a03efcbf99a649bc6c6efed51def11e7394ced446affafc0a"}, "tags": ["cms_hcc"], "refs": [["core__eligibility"]], "sources": [], "metrics": [], "description": "Staging eligibility from core.", "columns": {"patient_id": {"name": "patient_id", "description": "Unique identifier for each patient in the dataset.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "enrollment_start_date": {"name": "enrollment_start_date", "description": "Date the patient's insurance eligibility began.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "enrollment_end_date": {"name": "enrollment_end_date", "description": "Date the patient's insurance eligibility ended.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "dual_status_code": {"name": "dual_status_code", "description": "Indicates whether the patient is dually eligible for Medicare and Medicaid.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "medicare_status_code": {"name": "medicare_status_code", "description": "Indicates how the patient became eligible for Medicare.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://models/cms_hcc/cms_hcc_models.yml", "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"schema": "cms_hcc", "alias": "_stg_eligibility", "tags": "cms_hcc", "materialized": "ephemeral", "enabled": true, "bind": false}, "created_at": 1701215339.870997}, "model.the_tuva_project.cms_hcc__patient_risk_factors": {"resource_type": "model", "depends_on": {"macros": ["macro.dbt.type_string", "macro.dbt.type_numeric"], "nodes": ["model.the_tuva_project.cms_hcc__int_demographic_factors", "model.the_tuva_project.cms_hcc__int_demographic_factors", "model.the_tuva_project.cms_hcc__int_disease_factors", "model.the_tuva_project.cms_hcc__int_enrollment_interaction_factors", "model.the_tuva_project.cms_hcc__int_disabled_interaction_factors", "model.the_tuva_project.cms_hcc__int_disease_interaction_factors", "model.the_tuva_project.cms_hcc__int_hcc_count_factors"]}, "config": {"enabled": true, "alias": "patient_risk_factors", "schema": "cms_hcc", "database": null, "tags": ["cms_hcc"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "bind": false, "post-hook": [], "pre-hook": []}, "database": "dev_sarah", "schema": "cms_hcc", "fqn": ["the_tuva_project", "cms_hcc", "final", "cms_hcc__patient_risk_factors"], "unique_id": "model.the_tuva_project.cms_hcc__patient_risk_factors", "raw_code": "{{ config(\n enabled = var('cms_hcc_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\n )\n}}\nwith demographic_factors as (\n\n select\n patient_id\n /* concatenate demographic risk factors */\n , gender\n || ', '\n || age_group\n || ' Years'\n || ', '\n || enrollment_status\n || ' Enrollee'\n || ', '\n || case\n when medicaid_status = 'Yes' then 'Medicaid'\n else 'Non-Medicaid'\n end\n || ', '\n || dual_status\n || ' Dual'\n || ', '\n || orec\n || ', '\n || case\n when institutional_status = 'Yes' then 'Institutional'\n else 'Non-Institutional'\n end\n as description\n , coefficient\n , factor_type\n , model_version\n , payment_year\n from {{ ref('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 , orec_default\n , institutional_status_default\n from {{ ref('cms_hcc__int_demographic_factors') }}\n\n)\n\n, disease_factors as (\n\n select\n patient_id\n , hcc_description || ' (HCC ' || hcc_code || ')' as description\n , coefficient\n , factor_type\n , model_version\n , payment_year\n from {{ ref('cms_hcc__int_disease_factors') }}\n\n)\n\n, enrollment_interactions as (\n\n select\n patient_id\n , description\n , coefficient\n , factor_type\n , model_version\n , payment_year\n from {{ ref('cms_hcc__int_enrollment_interaction_factors') }}\n\n)\n\n, disabled_interactions as (\n\n select\n patient_id\n , description\n , coefficient\n , factor_type\n , model_version\n , payment_year\n from {{ ref('cms_hcc__int_disabled_interaction_factors') }}\n\n)\n\n, disease_interactions as (\n\n select\n patient_id\n , description\n , coefficient\n , factor_type\n , model_version\n , payment_year\n from {{ ref('cms_hcc__int_disease_interaction_factors') }}\n\n)\n\n, hcc_counts as (\n\n select\n patient_id\n , description\n , coefficient\n , factor_type\n , model_version\n , payment_year\n from {{ ref('cms_hcc__int_hcc_count_factors') }}\n\n)\n\n, unioned as (\n\n select * from demographic_factors\n union all\n select * from disease_factors\n union all\n select * from enrollment_interactions\n union all\n select * from disabled_interactions\n union all\n select * from disease_interactions\n union all\n select * from hcc_counts\n\n)\n\n, add_defaults as (\n\n select\n unioned.patient_id\n , demographic_defaults.enrollment_status_default\n , demographic_defaults.medicaid_dual_status_default\n , demographic_defaults.orec_default\n , demographic_defaults.institutional_status_default\n , unioned.description as risk_factor_description\n , unioned.coefficient\n , unioned.factor_type\n , unioned.model_version\n , unioned.payment_year\n from unioned\n left join demographic_defaults\n on unioned.patient_id = demographic_defaults.patient_id\n\n)\n\n, add_data_types as (\n\n select\n cast(patient_id as {{ dbt.type_string() }}) as patient_id\n , cast(enrollment_status_default as boolean) as enrollment_status_default\n , cast(medicaid_dual_status_default as boolean) as medicaid_dual_status_default\n , cast(orec_default as boolean) as orec_default\n , cast(institutional_status_default as boolean) as institutional_status_default\n , cast(factor_type as {{ dbt.type_string() }}) as factor_type\n , cast(risk_factor_description as {{ dbt.type_string() }}) as risk_factor_description\n , round(cast(coefficient as {{ dbt.type_numeric() }}),3) as coefficient\n , cast(model_version as {{ dbt.type_string() }}) as model_version\n , cast(payment_year as integer) as payment_year\n from add_defaults\n\n)\n\nselect\n patient_id\n , enrollment_status_default\n , medicaid_dual_status_default\n , orec_default\n , institutional_status_default\n , factor_type\n , risk_factor_description\n , coefficient\n , model_version\n , payment_year\n , '{{ var('tuva_last_run')}}' as tuva_last_run\nfrom add_data_types", "language": "sql", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/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", "name": "cms_hcc__patient_risk_factors", "alias": "patient_risk_factors", "checksum": {"name": "sha256", "checksum": "07d50d984e63daf5f14627ada10a1d6b3d5f27bc23575d1b49b69a11899f7c09"}, "tags": ["cms_hcc"], "refs": [["cms_hcc__int_demographic_factors"], ["cms_hcc__int_demographic_factors"], ["cms_hcc__int_disease_factors"], ["cms_hcc__int_enrollment_interaction_factors"], ["cms_hcc__int_disabled_interaction_factors"], ["cms_hcc__int_disease_interaction_factors"], ["cms_hcc__int_hcc_count_factors"]], "sources": [], "metrics": [], "description": "This final model displays the contributing demographic and disease risk factors, interactions, and HCCs for each enrollee in the payment year.\n", "columns": {"patient_id": {"name": "patient_id", "description": "Unique ID for the patient.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "enrollment_status_default": {"name": "enrollment_status_default", "description": "Indicates the input data was missing and a default status was used.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "medicaid_dual_status_default": {"name": "medicaid_dual_status_default", "description": "Indicates the input data was missing and a default status was used.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "orec_default": {"name": "orec_default", "description": "Indicates the input data was missing and a default status was used.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "institutional_status_default": {"name": "institutional_status_default", "description": "Indicates the input data was missing and a default status was used.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "risk_factor_description": {"name": "risk_factor_description", "description": "Description of the risk factor.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "coefficient": {"name": "coefficient", "description": "Relative factor value that correspond to the CMS HCC model's risk indicators.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "factor_type": {"name": "factor_type", "description": "Type of risk factor, e.g. Demographic, Disease, etc.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "model_version": {"name": "model_version", "description": "CMS HCC model version.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "payment_year": {"name": "payment_year", "description": "The payment year the HCC and risk scores are being calculated for.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The date the model was run.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://models/cms_hcc/cms_hcc_models.yml", "compiled_path": null, "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": 1701215339.830646}, "model.the_tuva_project.cms_hcc__patient_risk_scores": {"resource_type": "model", "depends_on": {"macros": ["macro.dbt.type_numeric", "macro.dbt.type_string"], "nodes": ["seed.the_tuva_project.cms_hcc__adjustment_rates", "model.the_tuva_project.cms_hcc__patient_risk_factors"]}, "config": {"enabled": true, "alias": "patient_risk_scores", "schema": "cms_hcc", "database": null, "tags": ["cms_hcc"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "bind": false, "post-hook": [], "pre-hook": []}, "database": "dev_sarah", "schema": "cms_hcc", "fqn": ["the_tuva_project", "cms_hcc", "final", "cms_hcc__patient_risk_scores"], "unique_id": "model.the_tuva_project.cms_hcc__patient_risk_scores", "raw_code": "{{ config(\n enabled = var('cms_hcc_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\n )\n}}\nwith seed_adjustment_rates as (\n\n select\n model_version\n , payment_year\n , normalization_factor\n , ma_coding_pattern_adjustment\n from {{ ref('cms_hcc__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 {{ ref('cms_hcc__patient_risk_factors') }}\n\n)\n\n, raw_score as (\n\n select\n patient_id\n , round(cast(sum(coefficient) as {{ dbt.type_numeric() }}),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 {{ dbt.type_numeric() }}),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 {{ dbt.type_numeric() }}),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 {{ dbt.type_string() }}) as patient_id\n , round(cast(raw_risk_score as {{ dbt.type_numeric() }}),3) as raw_risk_score\n , round(cast(normalized_risk_score as {{ dbt.type_numeric() }}),3) as normalized_risk_score\n , round(cast(payment_risk_score as {{ dbt.type_numeric() }}),3) as payment_risk_score\n , cast(model_version as {{ dbt.type_string() }}) as model_version\n , cast(payment_year as integer) as payment_year\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 , '{{ var('tuva_last_run')}}' as tuva_last_run\nfrom add_data_types", "language": "sql", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/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", "name": "cms_hcc__patient_risk_scores", "alias": "patient_risk_scores", "checksum": {"name": "sha256", "checksum": "9674cf463450eb72482dc12dc60ede45ea0afa83e792dc8bf86bc88ae5673aaf"}, "tags": ["cms_hcc"], "refs": [["cms_hcc__adjustment_rates"], ["cms_hcc__patient_risk_factors"]], "sources": [], "metrics": [], "description": "This final model calculates the CMS HCC raw risk score, normalized risk score, and payment risk score for each enrollee in the payment year.\n", "columns": {"patient_id": {"name": "patient_id", "description": "Unique ID for the patient.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "raw_risk_score": {"name": "raw_risk_score", "description": "The sum of all patient risk factors.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "normalized_risk_score": {"name": "normalized_risk_score", "description": "The raw risk score divided by the normalization adjustment factor for the corresponding HCC model version and payment year's rate announcement from CMS.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "payment_risk_score": {"name": "payment_risk_score", "description": "The normalized risk score multiplied by the MA coding pattern adjustment factor for the corresponding HCC model version and payment years rate announcement from CMS.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "model_version": {"name": "model_version", "description": "CMS HCC model version.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "payment_year": {"name": "payment_year", "description": "The payment year the HCC and risk scores are being calculated for.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The date the model was run.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://models/cms_hcc/cms_hcc_models.yml", "compiled_path": null, "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": 1701215339.8333929}, "model.the_tuva_project.cms_hcc__patient_hcc_history": {"resource_type": "model", "depends_on": {"macros": ["macro.dbt.type_string"], "nodes": ["model.the_tuva_project.cms_hcc__int_all_conditions"]}, "config": {"enabled": true, "alias": "patient_hcc_history", "schema": "cms_hcc", "database": null, "tags": ["cms_hcc"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "bind": false, "post-hook": [], "pre-hook": []}, "database": "dev_sarah", "schema": "cms_hcc", "fqn": ["the_tuva_project", "cms_hcc", "final", "cms_hcc__patient_hcc_history"], "unique_id": "model.the_tuva_project.cms_hcc__patient_hcc_history", "raw_code": "{{ config(\n enabled = var('cms_hcc_enabled',var('claims_enabled',var('clinical_enabled',var('tuva_marts_enabled',False))))\n )\n}}\n\nwith all_conditions as (\n\n select\n patient_id\n , recorded_date\n , condition_type\n , icd_10_cm_code\n , hcc_code\n , hcc_description\n , model_version\n , payment_year\n from {{ ref('cms_hcc__int_all_conditions') }}\n\n)\n\n, grouped as (\n\n select\n patient_id\n , hcc_code\n , hcc_description\n , payment_year\n , min(recorded_date) as first_recorded\n , max(recorded_date) as last_recorded\n from all_conditions\n where hcc_code is not null\n group by\n patient_id\n , hcc_code\n , hcc_description\n , payment_year\n\n)\n\n, add_flag as (\n\n select\n patient_id\n , hcc_code\n , hcc_description\n , first_recorded\n , last_recorded\n , payment_year\n , case\n when extract(year from last_recorded) = payment_year\n then 1\n else 0\n end as payment_year_recorded\n from grouped\n\n)\n\n, all_conditions_with_flag as (\n\n select\n all_conditions.patient_id\n , all_conditions.recorded_date\n , all_conditions.condition_type\n , all_conditions.icd_10_cm_code\n , all_conditions.hcc_code\n , all_conditions.hcc_description\n , all_conditions.model_version\n , all_conditions.payment_year\n , add_flag.first_recorded\n , add_flag.last_recorded\n , add_flag.payment_year_recorded\n from all_conditions\n left join add_flag\n on all_conditions.patient_id = add_flag.patient_id\n and all_conditions.hcc_code = add_flag.hcc_code\n\n)\n\n, add_data_types as (\n\n select\n cast(patient_id as {{ dbt.type_string() }}) as patient_id\n , cast(recorded_date as date) as recorded_date\n , cast(condition_type as {{ dbt.type_string() }}) as condition_type\n , cast(icd_10_cm_code as {{ dbt.type_string() }}) as icd_10_cm_code\n , cast(hcc_code as {{ dbt.type_string() }}) as hcc_code\n , cast(hcc_description as {{ dbt.type_string() }}) as hcc_description\n , cast(first_recorded as date) as first_recorded\n , cast(last_recorded as date) as last_recorded\n , cast(payment_year_recorded as boolean) as payment_year_recorded\n , cast(model_version as {{ dbt.type_string() }}) as model_version\n , cast(payment_year as integer) as payment_year\n from all_conditions_with_flag\n\n)\n\nselect\n patient_id\n , recorded_date\n , condition_type\n , icd_10_cm_code\n , hcc_code\n , hcc_description\n , first_recorded\n , last_recorded\n , payment_year_recorded\n , model_version\n , payment_year\n , '{{ var('tuva_last_run')}}' as tuva_last_run\nfrom add_data_types", "language": "sql", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/the_tuva_project", "path": "cms_hcc/final/cms_hcc__patient_hcc_history.sql", "original_file_path": "models/cms_hcc/final/cms_hcc__patient_hcc_history.sql", "name": "cms_hcc__patient_hcc_history", "alias": "patient_hcc_history", "checksum": {"name": "sha256", "checksum": "cf67e86288ead7fd7683c4e05771b80c6787c8172ee8aaea5b4697fe399634a7"}, "tags": ["cms_hcc"], "refs": [["cms_hcc__int_all_conditions"]], "sources": [], "metrics": [], "description": "This final model displays the full history of a patient's recorded HCCs with a flag for recorded during the payment year.\n", "columns": {"patient_id": {"name": "patient_id", "description": "Unique ID for the patient.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "recorded_date": {"name": "recorded_date", "description": "Date in which the ICD-10-CM condition was recorded.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "condition_type": {"name": "condition_type", "description": "The type of condition.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "icd_10_cm_code": {"name": "icd_10_cm_code", "description": "The ICD-10-CM condition code.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "hcc_code": {"name": "hcc_code", "description": "HCC code from the latest CMS HCC model available in the mart.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "hcc_description": {"name": "hcc_description", "description": "HCC description from the latest CMS HCC model available in the mart.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "first_recorded": {"name": "first_recorded", "description": "Date the HCC was first recorded in the patient's record.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "last_recorded": {"name": "last_recorded", "description": "Date the HCC was last recorded in the patient's record.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "payment_year_recorded": {"name": "payment_year_recorded", "description": "Flag indicating that the ICD-10-CM code mapped to the HCC was recorded during the payment year.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "model_version": {"name": "model_version", "description": "CMS HCC model version.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "payment_year": {"name": "payment_year", "description": "The payment year the HCC and risk scores are being calculated for.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The date the model was run.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://models/cms_hcc/cms_hcc_models.yml", "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"schema": "cms_hcc", "alias": "patient_hcc_history", "tags": "cms_hcc", "materialized": "table", "enabled": true, "bind": false}, "created_at": 1701215339.8274078}, "model.the_tuva_project.cms_hcc__int_disease_factors": {"resource_type": "model", "depends_on": {"macros": ["macro.dbt.type_string", "macro.dbt.type_numeric"], "nodes": ["model.the_tuva_project.cms_hcc__int_demographic_factors", "model.the_tuva_project.cms_hcc__int_hcc_hierarchy", "seed.the_tuva_project.cms_hcc__disease_factors"]}, "config": {"enabled": true, "alias": "_int_disease_factors", "schema": "cms_hcc", "database": null, "tags": ["cms_hcc"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "bind": false, "post-hook": [], "pre-hook": []}, "database": "dev_sarah", "schema": "cms_hcc", "fqn": ["the_tuva_project", "cms_hcc", "intermediate", "cms_hcc__int_disease_factors"], "unique_id": "model.the_tuva_project.cms_hcc__int_disease_factors", "raw_code": "{{ config(\n enabled = var('cms_hcc_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\n )\n}}\n/*\nThe hcc_model_version var has been set here so it gets compiled.\n*/\n\n{% set model_version_compiled = var('cms_hcc_model_version') -%}\n\nwith demographics as (\n\n select\n patient_id\n , enrollment_status\n , gender\n , age_group\n , medicaid_status\n , dual_status\n , orec\n , institutional_status\n , model_version\n , payment_year\n from {{ ref('cms_hcc__int_demographic_factors') }}\n\n)\n\n, hcc_hierarchy as (\n\n select\n patient_id\n , hcc_code\n from {{ ref('cms_hcc__int_hcc_hierarchy') }}\n\n)\n\n, seed_disease_factors as (\n\n select\n model_version\n , factor_type\n , enrollment_status\n , medicaid_status\n , dual_status\n , orec\n , institutional_status\n , hcc_code\n , description\n , coefficient\n from {{ ref('cms_hcc__disease_factors') }}\n where model_version = '{{ model_version_compiled }}'\n\n)\n\n, demographics_with_hccs as (\n\n select\n demographics.patient_id\n , demographics.enrollment_status\n , demographics.gender\n , demographics.age_group\n , demographics.medicaid_status\n , demographics.dual_status\n , demographics.orec\n , demographics.institutional_status\n , demographics.model_version\n , demographics.payment_year\n , hcc_hierarchy.hcc_code\n from demographics\n inner join hcc_hierarchy\n on demographics.patient_id = hcc_hierarchy.patient_id\n\n)\n\n, disease_factors as (\n\n select\n demographics_with_hccs.patient_id\n , demographics_with_hccs.hcc_code\n , demographics_with_hccs.model_version\n , demographics_with_hccs.payment_year\n , seed_disease_factors.factor_type\n , seed_disease_factors.description\n , seed_disease_factors.coefficient\n from demographics_with_hccs\n inner join seed_disease_factors\n on demographics_with_hccs.enrollment_status = seed_disease_factors.enrollment_status\n and demographics_with_hccs.medicaid_status = seed_disease_factors.medicaid_status\n and demographics_with_hccs.dual_status = seed_disease_factors.dual_status\n and demographics_with_hccs.orec = seed_disease_factors.orec\n and demographics_with_hccs.institutional_status = seed_disease_factors.institutional_status\n and demographics_with_hccs.hcc_code = seed_disease_factors.hcc_code\n\n)\n\n, add_data_types as (\n\n select\n cast(patient_id as {{ dbt.type_string() }}) as patient_id\n , cast(hcc_code as {{ dbt.type_string() }}) as hcc_code\n , cast(description as {{ dbt.type_string() }}) as hcc_description\n , round(cast(coefficient as {{ dbt.type_numeric() }}),3) as coefficient\n , cast(factor_type as {{ dbt.type_string() }}) as factor_type\n , cast(model_version as {{ dbt.type_string() }}) as model_version\n , cast(payment_year as integer) as payment_year\n from disease_factors\n\n)\n\nselect\n patient_id\n , hcc_code\n , hcc_description\n , coefficient\n , factor_type\n , model_version\n , payment_year\n , '{{ var('tuva_last_run')}}' as tuva_last_run\nfrom add_data_types", "language": "sql", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/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", "name": "cms_hcc__int_disease_factors", "alias": "_int_disease_factors", "checksum": {"name": "sha256", "checksum": "4a0c169b8860a5a2a81badaae447e8a566948d9aaa3089d251112ae6e61d01bc"}, "tags": ["cms_hcc"], "refs": [["cms_hcc__int_demographic_factors"], ["cms_hcc__int_hcc_hierarchy"], ["cms_hcc__disease_factors"]], "sources": [], "metrics": [], "description": "Disease factor values for every enrollee's final payment-eligible HCC after the hierarchy has been applied and necessary HCCs dropped for the corresponding HCC model version and payment year.\n", "columns": {"patient_id": {"name": "patient_id", "description": "Unique ID for the patient.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "hcc_code": {"name": "hcc_code", "description": "HCC code.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "hcc_description": {"name": "hcc_description", "description": "HCC description.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "coefficient": {"name": "coefficient", "description": "Relative factor value that correspond to the CMS HCC model's risk indicators.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "factor_type": {"name": "factor_type", "description": "Type of risk factor, e.g. Demographic, Disease, etc.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "model_version": {"name": "model_version", "description": "CMS HCC model version.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "payment_year": {"name": "payment_year", "description": "The payment year the HCC and risk scores are being calculated for.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The date the model was run.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://models/cms_hcc/cms_hcc_models.yml", "compiled_path": null, "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": 1701215339.8460732}, "model.the_tuva_project.cms_hcc__int_eligible_conditions": {"resource_type": "model", "depends_on": {"macros": ["macro.dbt.type_string"], "nodes": ["model.the_tuva_project.cms_hcc__stg_core__medical_claim", "model.the_tuva_project.cms_hcc__stg_core__condition", "seed.the_tuva_project.cms_hcc__cpt_hcpcs"]}, "config": {"enabled": true, "alias": "_int_eligible_conditions", "schema": "cms_hcc", "database": null, "tags": ["cms_hcc"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "bind": false, "post-hook": [], "pre-hook": []}, "database": "dev_sarah", "schema": "cms_hcc", "fqn": ["the_tuva_project", "cms_hcc", "intermediate", "cms_hcc__int_eligible_conditions"], "unique_id": "model.the_tuva_project.cms_hcc__int_eligible_conditions", "raw_code": "{{ config(\n enabled = var('cms_hcc_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\n )\n}}\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\n{% set model_version_compiled = var('cms_hcc_model_version') -%}\n{% set payment_year_compiled = var('cms_hcc_payment_year') -%}\n{% set collection_year = payment_year_compiled - 1 -%}\n\nwith 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 {{ ref('cms_hcc__stg_core__medical_claim') }}\n\n)\n\n, conditions as (\n\n select\n claim_id\n , patient_id\n , code\n from {{ ref('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 {{ ref('cms_hcc__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) = {{ collection_year }}\n and cpt_hcpcs_list.payment_year = {{ payment_year_compiled }}\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) = {{ collection_year }}\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) = {{ collection_year }}\n and cpt_hcpcs_list.payment_year = {{ payment_year_compiled }}\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 {{ dbt.type_string() }}) as patient_id\n , cast(code as {{ dbt.type_string() }}) as condition_code\n , cast('{{ model_version_compiled }}' as {{ dbt.type_string() }}) as model_version\n , cast('{{ payment_year_compiled }}' as integer) as payment_year\n from eligible_conditions\n\n)\n\nselect\n patient_id\n , condition_code\n , model_version\n , payment_year\n , '{{ var('tuva_last_run')}}' as tuva_last_run\nfrom add_data_types", "language": "sql", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/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", "name": "cms_hcc__int_eligible_conditions", "alias": "_int_eligible_conditions", "checksum": {"name": "sha256", "checksum": "0618fc2a34ddf522126972aeec56c49f6b34ece779faae370f57836849053156"}, "tags": ["cms_hcc"], "refs": [["cms_hcc__stg_core__medical_claim"], ["cms_hcc__stg_core__condition"], ["cms_hcc__cpt_hcpcs"]], "sources": [], "metrics": [], "description": "Conditions from eligible risk-adjustable claims per claim type for the collection year.\n", "columns": {"patient_id": {"name": "patient_id", "description": "Unique ID for the patient.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "condition_code": {"name": "condition_code", "description": "The condition code.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "model_version": {"name": "model_version", "description": "CMS HCC model version.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "payment_year": {"name": "payment_year", "description": "The payment year the HCC and risk scores are being calculated for.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The date the model was run.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://models/cms_hcc/cms_hcc_models.yml", "compiled_path": null, "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": 1701215339.8515232}, "model.the_tuva_project.cms_hcc__int_disease_interaction_factors": {"resource_type": "model", "depends_on": {"macros": ["macro.dbt.type_string", "macro.dbt.type_numeric"], "nodes": ["model.the_tuva_project.cms_hcc__int_demographic_factors", "model.the_tuva_project.cms_hcc__int_hcc_hierarchy", "seed.the_tuva_project.cms_hcc__disease_interaction_factors"]}, "config": {"enabled": true, "alias": "_int_disease_interaction_factors", "schema": "cms_hcc", "database": null, "tags": ["cms_hcc"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "bind": false, "post-hook": [], "pre-hook": []}, "database": "dev_sarah", "schema": "cms_hcc", "fqn": ["the_tuva_project", "cms_hcc", "intermediate", "cms_hcc__int_disease_interaction_factors"], "unique_id": "model.the_tuva_project.cms_hcc__int_disease_interaction_factors", "raw_code": "{{ config(\n enabled = var('cms_hcc_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\n )\n}}\n/*\nThe hcc_model_version var has been set here so it gets compiled.\n*/\n\n{% set model_version_compiled = var('cms_hcc_model_version') -%}\n\nwith demographics as (\n\n select\n patient_id\n , enrollment_status\n , gender\n , age_group\n , medicaid_status\n , dual_status\n , orec\n , institutional_status\n , model_version\n , payment_year\n from {{ ref('cms_hcc__int_demographic_factors') }}\n\n)\n\n, hcc_hierarchy as (\n\n select\n patient_id\n , hcc_code\n from {{ ref('cms_hcc__int_hcc_hierarchy') }}\n\n)\n\n, seed_interaction_factors as (\n\n select\n model_version\n , factor_type\n , enrollment_status\n , medicaid_status\n , dual_status\n , orec\n , institutional_status\n , short_name\n , description\n , hcc_code_1\n , hcc_code_2\n , coefficient\n from {{ ref('cms_hcc__disease_interaction_factors') }}\n where model_version = '{{ model_version_compiled }}'\n\n)\n\n, demographics_with_hccs as (\n\n select\n demographics.patient_id\n , demographics.enrollment_status\n , demographics.medicaid_status\n , demographics.dual_status\n , demographics.orec\n , demographics.institutional_status\n , demographics.model_version\n , demographics.payment_year\n , hcc_hierarchy.hcc_code\n from demographics\n inner join hcc_hierarchy\n on demographics.patient_id = hcc_hierarchy.patient_id\n\n)\n\n, demographics_with_interactions as (\n\n select\n demographics_with_hccs.patient_id\n , demographics_with_hccs.model_version\n , demographics_with_hccs.payment_year\n , interactions_code_1.factor_type\n , interactions_code_1.description\n , interactions_code_1.hcc_code_1\n , interactions_code_1.hcc_code_2\n , interactions_code_1.coefficient\n from demographics_with_hccs\n inner join seed_interaction_factors as interactions_code_1\n on demographics_with_hccs.enrollment_status = interactions_code_1.enrollment_status\n and demographics_with_hccs.medicaid_status = interactions_code_1.medicaid_status\n and demographics_with_hccs.dual_status = interactions_code_1.dual_status\n and demographics_with_hccs.orec = interactions_code_1.orec\n and demographics_with_hccs.institutional_status = interactions_code_1.institutional_status\n and demographics_with_hccs.hcc_code = interactions_code_1.hcc_code_1\n\n)\n\n, disease_interactions as (\n\n select\n demographics_with_interactions.patient_id\n , demographics_with_interactions.factor_type\n , demographics_with_interactions.hcc_code_1\n , demographics_with_interactions.hcc_code_2\n , demographics_with_interactions.description\n , demographics_with_interactions.coefficient\n , demographics_with_interactions.model_version\n , demographics_with_interactions.payment_year\n from demographics_with_interactions\n inner join demographics_with_hccs as interactions_code_2\n on demographics_with_interactions.patient_id = interactions_code_2.patient_id\n and demographics_with_interactions.hcc_code_2 = interactions_code_2.hcc_code\n)\n\n, add_data_types as (\n\n select\n cast(patient_id as {{ dbt.type_string() }}) as patient_id\n , cast(hcc_code_1 as {{ dbt.type_string() }}) as hcc_code_1\n , cast(hcc_code_2 as {{ dbt.type_string() }}) as hcc_code_2\n , cast(description as {{ dbt.type_string() }}) as description\n , round(cast(coefficient as {{ dbt.type_numeric() }}),3) as coefficient\n , cast(factor_type as {{ dbt.type_string() }}) as factor_type\n , cast(model_version as {{ dbt.type_string() }}) as model_version\n , cast(payment_year as integer) as payment_year\n from disease_interactions\n\n)\n\nselect\n patient_id\n , hcc_code_1\n , hcc_code_2\n , description\n , coefficient\n , factor_type\n , model_version\n , payment_year\n , '{{ var('tuva_last_run')}}' as tuva_last_run\nfrom add_data_types", "language": "sql", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/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", "name": "cms_hcc__int_disease_interaction_factors", "alias": "_int_disease_interaction_factors", "checksum": {"name": "sha256", "checksum": "e15ffaa857df927530cc21df4d5348d0dc60d338fffa5ead8a095aaca3baba4e"}, "tags": ["cms_hcc"], "refs": [["cms_hcc__int_demographic_factors"], ["cms_hcc__int_hcc_hierarchy"], ["cms_hcc__disease_interaction_factors"]], "sources": [], "metrics": [], "description": "Disease interaction factor values for final payment-eligible HCC after the hierarchy has been applied and necessary HCCs dropped for the corresponding HCC model version and payment year.\n", "columns": {"patient_id": {"name": "patient_id", "description": "Unique ID for the patient.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "hcc_code_1": {"name": "hcc_code_1", "description": "HCC code 1 of the interaction.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "hcc_code_2": {"name": "hcc_code_2", "description": "HCC code 2 of the interaction.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "description": {"name": "description", "description": "Description of the disease interaction.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "coefficient": {"name": "coefficient", "description": "Relative factor value that correspond to the CMS HCC model's risk indicators.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "factor_type": {"name": "factor_type", "description": "Type of risk factor, e.g. Demographic, Disease, etc.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "model_version": {"name": "model_version", "description": "CMS HCC model version.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "payment_year": {"name": "payment_year", "description": "The payment year the HCC and risk scores are being calculated for.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The date the model was run.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://models/cms_hcc/cms_hcc_models.yml", "compiled_path": null, "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": 1701215339.849066}, "model.the_tuva_project.cms_hcc__int_all_conditions": {"resource_type": "model", "depends_on": {"macros": ["macro.dbt.type_string"], "nodes": ["model.the_tuva_project.cms_hcc__stg_core__condition", "seed.the_tuva_project.cms_hcc__icd_10_cm_mappings", "seed.the_tuva_project.cms_hcc__icd_10_cm_mappings", "seed.the_tuva_project.cms_hcc__disease_factors"]}, "config": {"enabled": true, "alias": "_int_all_conditions", "schema": "cms_hcc", "database": null, "tags": ["cms_hcc"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "bind": false, "post-hook": [], "pre-hook": []}, "database": "dev_sarah", "schema": "cms_hcc", "fqn": ["the_tuva_project", "cms_hcc", "intermediate", "cms_hcc__int_all_conditions"], "unique_id": "model.the_tuva_project.cms_hcc__int_all_conditions", "raw_code": "{{ config(\n enabled = var('cms_hcc_enabled',var('claims_enabled',var('clinical_enabled',var('tuva_marts_enabled',False))))\n )\n}}\n\n{% set model_version_compiled = var('cms_hcc_model_version') -%}\n{% set payment_year_compiled = var('cms_hcc_payment_year') -%}\n\nwith conditions as (\n\n select\n patient_id\n , recorded_date\n , condition_type\n , code_type\n , code\n from {{ ref('cms_hcc__stg_core__condition') }}\n\n)\n\n, seed_hcc_mapping as (\n\n select\n diagnosis_code\n , cms_hcc_v24\n from {{ ref('cms_hcc__icd_10_cm_mappings') }}\n where payment_year = (select max(payment_year) from {{ ref('cms_hcc__icd_10_cm_mappings') }})\n and cms_hcc_v24_flag = 'Yes'\n\n)\n\n, seed_hcc_descriptions as (\n\n select distinct\n hcc_code\n , description\n from {{ ref('cms_hcc__disease_factors') }}\n where model_version = '{{ model_version_compiled }}'\n\n)\n\n, joined as (\n\n select\n conditions.patient_id\n , conditions.recorded_date\n , conditions.condition_type\n , conditions.code\n , seed_hcc_mapping.cms_hcc_v24 as hcc_code\n , seed_hcc_descriptions.description as hcc_description\n from conditions\n left join seed_hcc_mapping\n on conditions.code = seed_hcc_mapping.diagnosis_code\n left join seed_hcc_descriptions\n on seed_hcc_mapping.cms_hcc_v24 = seed_hcc_descriptions.hcc_code\n where conditions.code_type = 'icd-10-cm'\n\n)\n\n, add_data_types as (\n\n select\n cast(patient_id as {{ dbt.type_string() }}) as patient_id\n , cast(recorded_date as date) as recorded_date\n , cast(condition_type as {{ dbt.type_string() }}) as condition_type\n , cast(code as {{ dbt.type_string() }}) as icd_10_cm_code\n , cast(hcc_code as {{ dbt.type_string() }}) as hcc_code\n , cast(hcc_description as {{ dbt.type_string() }}) as hcc_description\n , cast('{{ model_version_compiled }}' as {{ dbt.type_string() }}) as model_version\n , cast({{ payment_year_compiled }} as integer) as payment_year\n from joined\n\n)\n\nselect\n patient_id\n , recorded_date\n , condition_type\n , icd_10_cm_code\n , hcc_code\n , hcc_description\n , model_version\n , payment_year\n , '{{ var('tuva_last_run')}}' as tuva_last_run\nfrom add_data_types", "language": "sql", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/the_tuva_project", "path": "cms_hcc/intermediate/cms_hcc__int_all_conditions.sql", "original_file_path": "models/cms_hcc/intermediate/cms_hcc__int_all_conditions.sql", "name": "cms_hcc__int_all_conditions", "alias": "_int_all_conditions", "checksum": {"name": "sha256", "checksum": "30a65294d80a7dcea30bed44caf60294b9c14e533f890f60f565a8b3b53ef052"}, "tags": ["cms_hcc"], "refs": [["cms_hcc__stg_core__condition"], ["cms_hcc__icd_10_cm_mappings"], ["cms_hcc__icd_10_cm_mappings"], ["cms_hcc__disease_factors"]], "sources": [], "metrics": [], "description": "All historical conditions mapped to HCCs.", "columns": {"patient_id": {"name": "patient_id", "description": "Unique ID for the patient.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "recorded_date": {"name": "recorded_date", "description": "Date in which the condition was recorded.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "condition_type": {"name": "condition_type", "description": "The type of condition.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "icd_10_cm_code": {"name": "icd_10_cm_code", "description": "The ICD-10-CM condition code.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "hcc_code": {"name": "hcc_code", "description": "HCC code from the latest CMS HCC model available in the mart.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "hcc_description": {"name": "hcc_description", "description": "HCC description from the latest CMS HCC model available in the mart.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "model_version": {"name": "model_version", "description": "CMS HCC model version.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "payment_year": {"name": "payment_year", "description": "The payment year the HCC and risk scores are being calculated for.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The date the model was run.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://models/cms_hcc/cms_hcc_models.yml", "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"schema": "cms_hcc", "alias": "_int_all_conditions", "tags": "cms_hcc", "materialized": "table", "enabled": true, "bind": false}, "created_at": 1701215339.83638}, "model.the_tuva_project.cms_hcc__int_hcc_hierarchy": {"resource_type": "model", "depends_on": {"macros": ["macro.dbt.type_string"], "nodes": ["model.the_tuva_project.cms_hcc__int_hcc_mapping", "seed.the_tuva_project.cms_hcc__disease_hierarchy"]}, "config": {"enabled": true, "alias": "_int_hcc_hierarchy", "schema": "cms_hcc", "database": null, "tags": ["cms_hcc"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "bind": false, "post-hook": [], "pre-hook": []}, "database": "dev_sarah", "schema": "cms_hcc", "fqn": ["the_tuva_project", "cms_hcc", "intermediate", "cms_hcc__int_hcc_hierarchy"], "unique_id": "model.the_tuva_project.cms_hcc__int_hcc_hierarchy", "raw_code": "{{ config(\n enabled = var('cms_hcc_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\n )\n}}\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\n{% set model_version_compiled = var('cms_hcc_model_version') -%}\n\nwith hcc_mapping as (\n\n select distinct\n patient_id\n , hcc_code\n , model_version\n , payment_year\n from {{ ref('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 {{ ref('cms_hcc__disease_hierarchy') }}\n where model_version = '{{ model_version_compiled }}'\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 {{ dbt.type_string() }}) as patient_id\n , cast(model_version as {{ dbt.type_string() }}) as model_version\n , cast(payment_year as integer) as payment_year\n , cast(hcc_code as {{ dbt.type_string() }}) as hcc_code\n from unioned\n\n)\n\nselect\n patient_id\n , model_version\n , payment_year\n , hcc_code\n , '{{ var('tuva_last_run')}}' as tuva_last_run\nfrom add_data_types", "language": "sql", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/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", "name": "cms_hcc__int_hcc_hierarchy", "alias": "_int_hcc_hierarchy", "checksum": {"name": "sha256", "checksum": "d72a8368dfff17bb6361c0711b59e459ae3999ce90f098845030ff7d62f69d94"}, "tags": ["cms_hcc"], "refs": [["cms_hcc__int_hcc_mapping"], ["cms_hcc__disease_hierarchy"]], "sources": [], "metrics": [], "description": "HCC hierarchy for the corresponding HCC model version and payment year applied to the mapped payment-eligible HCCs.\n", "columns": {"patient_id": {"name": "patient_id", "description": "Unique ID for the patient.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "model_version": {"name": "model_version", "description": "CMS HCC model version.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "payment_year": {"name": "payment_year", "description": "The payment year the HCC and risk scores are being calculated for.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "hcc_code": {"name": "hcc_code", "description": "HCC code.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The date the model was run.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://models/cms_hcc/cms_hcc_models.yml", "compiled_path": null, "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": 1701215339.8594172}, "model.the_tuva_project.cms_hcc__int_hcc_mapping": {"resource_type": "model", "depends_on": {"macros": ["macro.dbt.type_string"], "nodes": ["model.the_tuva_project.cms_hcc__int_eligible_conditions", "seed.the_tuva_project.cms_hcc__icd_10_cm_mappings"]}, "config": {"enabled": true, "alias": "_int_hcc_mapping", "schema": "cms_hcc", "database": null, "tags": ["cms_hcc"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "bind": false, "post-hook": [], "pre-hook": []}, "database": "dev_sarah", "schema": "cms_hcc", "fqn": ["the_tuva_project", "cms_hcc", "intermediate", "cms_hcc__int_hcc_mapping"], "unique_id": "model.the_tuva_project.cms_hcc__int_hcc_mapping", "raw_code": "{{ config(\n enabled = var('cms_hcc_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\n )\n}}\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\n{% set model_version_compiled = var('cms_hcc_model_version') -%}\n{% set payment_year_compiled = var('cms_hcc_payment_year') -%}\n\nwith conditions as (\n\n select\n patient_id\n , condition_code\n , model_version\n , payment_year\n from {{ ref('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 {{ ref('cms_hcc__icd_10_cm_mappings') }}\n where payment_year = {{ payment_year_compiled }}\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 {{ dbt.type_string() }}) as patient_id\n , cast(condition_code as {{ dbt.type_string() }}) as condition_code\n , cast(hcc_code as {{ dbt.type_string() }}) as hcc_code\n , cast(model_version as {{ dbt.type_string() }}) as model_version\n , cast(payment_year as integer) as payment_year\n from mapped\n\n)\n\nselect\n patient_id\n , condition_code\n , hcc_code\n , model_version\n , payment_year\n , '{{ var('tuva_last_run')}}' as tuva_last_run\nfrom add_data_types", "language": "sql", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/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", "name": "cms_hcc__int_hcc_mapping", "alias": "_int_hcc_mapping", "checksum": {"name": "sha256", "checksum": "2b8fd3acbfac51227f62775148a39ca809467f8aaa1d62328b7d1e97f7efc872"}, "tags": ["cms_hcc"], "refs": [["cms_hcc__int_eligible_conditions"], ["cms_hcc__icd_10_cm_mappings"]], "sources": [], "metrics": [], "description": "Eligible conditions mapped to HCC codes for the corresponding HCC model version and payment year\n", "columns": {"patient_id": {"name": "patient_id", "description": "Unique ID for the patient.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "condition_code": {"name": "condition_code", "description": "Condition code.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "hcc_code": {"name": "hcc_code", "description": "HCC code.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "model_version": {"name": "model_version", "description": "CMS HCC model version.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "payment_year": {"name": "payment_year", "description": "The payment year the HCC and risk scores are being calculated for.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The date the model was run.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://models/cms_hcc/cms_hcc_models.yml", "compiled_path": null, "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": 1701215339.862027}, "model.the_tuva_project.cms_hcc__int_disabled_interaction_factors": {"resource_type": "model", "depends_on": {"macros": ["macro.dbt.type_string", "macro.dbt.type_numeric"], "nodes": ["model.the_tuva_project.cms_hcc__int_demographic_factors", "model.the_tuva_project.cms_hcc__int_hcc_hierarchy", "seed.the_tuva_project.cms_hcc__disabled_interaction_factors"]}, "config": {"enabled": true, "alias": "_int_disabled_interaction_factors", "schema": "cms_hcc", "database": null, "tags": ["cms_hcc"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "bind": false, "post-hook": [], "pre-hook": []}, "database": "dev_sarah", "schema": "cms_hcc", "fqn": ["the_tuva_project", "cms_hcc", "intermediate", "cms_hcc__int_disabled_interaction_factors"], "unique_id": "model.the_tuva_project.cms_hcc__int_disabled_interaction_factors", "raw_code": "{{ config(\n enabled = var('cms_hcc_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\n )\n}}\n/*\nThe hcc_model_version var has been set here so it gets compiled.\n*/\n\n{% set model_version_compiled = var('cms_hcc_model_version') -%}\n\nwith demographics as (\n\n select\n patient_id\n , enrollment_status\n , institutional_status\n , model_version\n , payment_year\n from {{ ref('cms_hcc__int_demographic_factors') }}\n\n)\n\n, hcc_hierarchy as (\n\n select\n patient_id\n , hcc_code\n from {{ ref('cms_hcc__int_hcc_hierarchy') }}\n\n)\n\n, seed_interaction_factors as (\n\n select\n model_version\n , factor_type\n , enrollment_status\n , institutional_status\n , short_name\n , description\n , hcc_code\n , coefficient\n from {{ ref('cms_hcc__disabled_interaction_factors') }}\n where model_version = '{{ model_version_compiled }}'\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.factor_type\n , seed_interaction_factors.description\n , seed_interaction_factors.coefficient\n from demographics_with_hccs\n inner join seed_interaction_factors\n on demographics_with_hccs.enrollment_status = seed_interaction_factors.enrollment_status\n and demographics_with_hccs.institutional_status = seed_interaction_factors.institutional_status\n and demographics_with_hccs.hcc_code = seed_interaction_factors.hcc_code\n\n)\n\n, add_data_types as (\n\nselect\n cast(patient_id as {{ dbt.type_string() }}) as patient_id\n , cast(description as {{ dbt.type_string() }}) as description\n , round(cast(coefficient as {{ dbt.type_numeric() }}),3) as coefficient\n , cast(factor_type as {{ dbt.type_string() }}) as factor_type\n , cast(model_version as {{ dbt.type_string() }}) as model_version\n , cast(payment_year as integer) as payment_year\nfrom interactions\n\n)\n\nselect\n patient_id\n , description\n , coefficient\n , factor_type\n , model_version\n , payment_year\n , '{{ var('tuva_last_run')}}' as tuva_last_run\nfrom add_data_types", "language": "sql", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/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", "name": "cms_hcc__int_disabled_interaction_factors", "alias": "_int_disabled_interaction_factors", "checksum": {"name": "sha256", "checksum": "1cda2ed7f93f93b6791914273e3d958397b5b49b4940e3ae9ee53967a898ef1e"}, "tags": ["cms_hcc"], "refs": [["cms_hcc__int_demographic_factors"], ["cms_hcc__int_hcc_hierarchy"], ["cms_hcc__disabled_interaction_factors"]], "sources": [], "metrics": [], "description": "Disabled and disease interaction factor values for the corresponding HCC model version and payment year.\n", "columns": {"patient_id": {"name": "patient_id", "description": "Unique ID for the patient.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "description": {"name": "description", "description": "Description of the disabled and disease interaction.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "coefficient": {"name": "coefficient", "description": "Relative factor value that correspond to the CMS HCC model's risk indicators.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "factor_type": {"name": "factor_type", "description": "Type of risk factor, e.g. Demographic, Disease, etc.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "model_version": {"name": "model_version", "description": "CMS HCC model version.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "payment_year": {"name": "payment_year", "description": "The payment year the HCC and risk scores are being calculated for.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The date the model was run.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://models/cms_hcc/cms_hcc_models.yml", "compiled_path": null, "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": 1701215339.843176}, "model.the_tuva_project.cms_hcc__int_hcc_count_factors": {"resource_type": "model", "depends_on": {"macros": ["macro.dbt.type_string", "macro.dbt.type_numeric"], "nodes": ["model.the_tuva_project.cms_hcc__int_demographic_factors", "seed.the_tuva_project.cms_hcc__payment_hcc_count_factors", "model.the_tuva_project.cms_hcc__int_hcc_hierarchy"]}, "config": {"enabled": true, "alias": "_int_hcc_count_factors", "schema": "cms_hcc", "database": null, "tags": ["cms_hcc"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "bind": false, "post-hook": [], "pre-hook": []}, "database": "dev_sarah", "schema": "cms_hcc", "fqn": ["the_tuva_project", "cms_hcc", "intermediate", "cms_hcc__int_hcc_count_factors"], "unique_id": "model.the_tuva_project.cms_hcc__int_hcc_count_factors", "raw_code": "{{ config(\n enabled = var('cms_hcc_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\n )\n}}\n/*\nThe hcc_model_version var has been set here so it gets compiled.\n*/\n\n{% set model_version_compiled = var('cms_hcc_model_version') -%}\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 {{ ref('cms_hcc__int_demographic_factors') }}\n\n)\n\n, seed_payment_hcc_count_factors as (\n\n select\n model_version\n , factor_type\n , enrollment_status\n , medicaid_status\n , dual_status\n , orec\n , institutional_status\n , payment_hcc_count\n , description\n , coefficient\n from {{ ref('cms_hcc__payment_hcc_count_factors') }}\n where model_version = '{{ model_version_compiled }}'\n\n)\n\n, hcc_hierarchy as (\n\n select\n patient_id\n , hcc_code\n from {{ ref('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 {{ dbt.type_string() }})\n end as hcc_count_string\n from demographics_with_hcc_counts\n\n)\n\n, hcc_counts as (\n\n select\n hcc_counts_normalized.patient_id\n , hcc_counts_normalized.model_version\n , hcc_counts_normalized.payment_year\n , seed_payment_hcc_count_factors.factor_type\n , seed_payment_hcc_count_factors.description\n , seed_payment_hcc_count_factors.coefficient\n from hcc_counts_normalized\n inner join seed_payment_hcc_count_factors\n on hcc_counts_normalized.enrollment_status = seed_payment_hcc_count_factors.enrollment_status\n and hcc_counts_normalized.medicaid_status = seed_payment_hcc_count_factors.medicaid_status\n and hcc_counts_normalized.dual_status = seed_payment_hcc_count_factors.dual_status\n and hcc_counts_normalized.orec = seed_payment_hcc_count_factors.orec\n and hcc_counts_normalized.institutional_status = seed_payment_hcc_count_factors.institutional_status\n and hcc_counts_normalized.hcc_count_string = seed_payment_hcc_count_factors.payment_hcc_count\n\n)\n\n, add_data_types as (\n\n select\n cast(patient_id as {{ dbt.type_string() }}) as patient_id\n , cast(description as {{ dbt.type_string() }}) as description\n , round(cast(coefficient as {{ dbt.type_numeric() }}),3) as coefficient\n , cast(factor_type as {{ dbt.type_string() }}) as factor_type\n , cast(model_version as {{ dbt.type_string() }}) as model_version\n , cast(payment_year as integer) as payment_year\n from hcc_counts\n\n)\n\nselect\n patient_id\n , description\n , coefficient\n , factor_type\n , model_version\n , payment_year\n , '{{ var('tuva_last_run')}}' as tuva_last_run\nfrom add_data_types", "language": "sql", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/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", "name": "cms_hcc__int_hcc_count_factors", "alias": "_int_hcc_count_factors", "checksum": {"name": "sha256", "checksum": "207b160ded0440e04109f7b5abccb2803943276eb81fcc1aa4df62b0fc4049f6"}, "tags": ["cms_hcc"], "refs": [["cms_hcc__int_demographic_factors"], ["cms_hcc__payment_hcc_count_factors"], ["cms_hcc__int_hcc_hierarchy"]], "sources": [], "metrics": [], "description": "Final payment-eligible HCC count factor values for the corresponding HCC model version and payment year.\n", "columns": {"patient_id": {"name": "patient_id", "description": "Unique ID for the patient.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "description": {"name": "description", "description": "HCC counts.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "coefficient": {"name": "coefficient", "description": "Relative factor value that correspond to the CMS HCC model's risk indicators.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "factor_type": {"name": "factor_type", "description": "Type of risk factor, e.g. Demographic, Disease, etc.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "model_version": {"name": "model_version", "description": "CMS HCC model version.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "payment_year": {"name": "payment_year", "description": "The payment year the HCC and risk scores are being calculated for.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The date the model was run.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://models/cms_hcc/cms_hcc_models.yml", "compiled_path": null, "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": 1701215339.857057}, "model.the_tuva_project.cms_hcc__int_demographic_factors": {"resource_type": "model", "depends_on": {"macros": ["macro.dbt.type_string", "macro.dbt.type_numeric"], "nodes": ["model.the_tuva_project.cms_hcc__int_members", "seed.the_tuva_project.cms_hcc__demographic_factors"]}, "config": {"enabled": true, "alias": "_int_demographic_factors", "schema": "cms_hcc", "database": null, "tags": ["cms_hcc"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "bind": false, "post-hook": [], "pre-hook": []}, "database": "dev_sarah", "schema": "cms_hcc", "fqn": ["the_tuva_project", "cms_hcc", "intermediate", "cms_hcc__int_demographic_factors"], "unique_id": "model.the_tuva_project.cms_hcc__int_demographic_factors", "raw_code": "{{ config(\n enabled = var('cms_hcc_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\n )\n}}\n/*\nThe hcc_model_version var has been set here so it gets compiled.\n*/\n\n{% set model_version_compiled = var('cms_hcc_model_version') -%}\n\nwith members as (\n\n select\n patient_id\n , enrollment_status\n , gender\n , age_group\n , medicaid_status\n , dual_status\n , orec\n , institutional_status\n , enrollment_status_default\n , medicaid_dual_status_default\n , orec_default\n , institutional_status_default\n , model_version\n , payment_year\n from {{ ref('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 {{ ref('cms_hcc__demographic_factors') }}\n where plan_segment is null /* data not available */\n and model_version = '{{ model_version_compiled }}'\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.orec_default\n , members.institutional_status_default\n , members.model_version\n , members.payment_year\n , seed_demographic_factors.factor_type\n , seed_demographic_factors.coefficient\n from members\n inner join seed_demographic_factors\n on members.enrollment_status = seed_demographic_factors.enrollment_status\n and members.gender = seed_demographic_factors.gender\n and members.age_group = seed_demographic_factors.age_group\n and members.medicaid_status = seed_demographic_factors.medicaid_status\n and members.orec = seed_demographic_factors.orec\n where members.enrollment_status = 'New'\n\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.orec_default\n , members.institutional_status_default\n , members.model_version\n , members.payment_year\n , seed_demographic_factors.factor_type\n , seed_demographic_factors.coefficient\n from members\n inner join seed_demographic_factors\n on members.enrollment_status = seed_demographic_factors.enrollment_status\n and members.gender = seed_demographic_factors.gender\n and members.age_group = seed_demographic_factors.age_group\n and members.medicaid_status = seed_demographic_factors.medicaid_status\n and members.dual_status = seed_demographic_factors.dual_status\n and members.orec = seed_demographic_factors.orec\n and members.institutional_status = seed_demographic_factors.institutional_status\n where members.enrollment_status = 'Continuing'\n\n)\n\n, unioned as (\n\n select * from new_enrollees\n union all\n select * from continuining_enrollees\n\n)\n\n, add_data_types as (\n\n select\n cast(patient_id as {{ dbt.type_string() }}) as patient_id\n , cast(enrollment_status as {{ dbt.type_string() }}) as enrollment_status\n , cast(gender as {{ dbt.type_string() }}) as gender\n , cast(age_group as {{ dbt.type_string() }}) as age_group\n , cast(medicaid_status as {{ dbt.type_string() }}) as medicaid_status\n , cast(dual_status as {{ dbt.type_string() }}) as dual_status\n , cast(orec as {{ dbt.type_string() }}) as orec\n , cast(institutional_status as {{ dbt.type_string() }}) as institutional_status\n , cast(enrollment_status_default as boolean) as enrollment_status_default\n , cast(medicaid_dual_status_default as boolean) as medicaid_dual_status_default\n , cast(orec_default as boolean) as orec_default\n , cast(institutional_status_default as boolean) as institutional_status_default\n , round(cast(coefficient as {{ dbt.type_numeric() }}),3) as coefficient\n , cast(factor_type as {{ dbt.type_string() }}) as factor_type\n , cast(model_version as {{ dbt.type_string() }}) as model_version\n , cast(payment_year as integer) as payment_year\n from unioned\n\n)\n\nselect\n patient_id\n , enrollment_status\n , gender\n , age_group\n , medicaid_status\n , dual_status\n , orec\n , institutional_status\n , enrollment_status_default\n , medicaid_dual_status_default\n , orec_default\n , institutional_status_default\n , coefficient\n , factor_type\n , model_version\n , payment_year\n , '{{ var('tuva_last_run')}}' as tuva_last_run\nfrom add_data_types", "language": "sql", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/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", "name": "cms_hcc__int_demographic_factors", "alias": "_int_demographic_factors", "checksum": {"name": "sha256", "checksum": "5b8e0542ec1ea58f9dfda8c438f5c5f26656f81e295300acfcd8c4d5c25e9830"}, "tags": ["cms_hcc"], "refs": [["cms_hcc__int_members"], ["cms_hcc__demographic_factors"]], "sources": [], "metrics": [], "description": "Demographic and enrollment risk relative factor values for the corresponding HCC model version and payment year.\n", "columns": {"patient_id": {"name": "patient_id", "description": "Unique ID for the patient.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "enrollment_status": {"name": "enrollment_status", "description": "Indicates whether the patient is a \"Continuing\" or \"New\" enrollee.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "gender": {"name": "gender", "description": "Indicates whether the patient is \"Female\" or \"Male\".", "meta": {}, "data_type": null, "quote": null, "tags": []}, "age_group": {"name": "age_group", "description": "Indicates what age group the patient is in. (e.g. \"60-64\"). CMS guidance: Age is calculated as of Feb 1 of the payment year.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "medicaid_status": {"name": "medicaid_status", "description": "Indicates whether the patient is enrolled in Medicaid.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "dual_status": {"name": "dual_status", "description": "Indicates whether the patient has \"Full\", \"Partial\", or \"Non\" dual status.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "orec": {"name": "orec", "description": "Indicates the Original Reason for Entitlement Code (OREC) \"Aged\", \"Disabled\", or \"ESRD\".\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "institutional_status": {"name": "institutional_status", "description": "Indicates whether the patient resided in an institution for at least 90 days.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "enrollment_status_default": {"name": "enrollment_status_default", "description": "Indicates the input data was missing and a default status was used.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "medicaid_dual_status_default": {"name": "medicaid_dual_status_default", "description": "Indicates the input data was missing and a default status was used.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "orec_default": {"name": "orec_default", "description": "Indicates the input data was missing and a default status was used.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "institutional_status_default": {"name": "institutional_status_default", "description": "Indicates the input data was missing and a default status was used.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "coefficient": {"name": "coefficient", "description": "Relative factor value that correspond to the CMS HCC model's risk indicators.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "factor_type": {"name": "factor_type", "description": "Type of risk factor, e.g. Demographic, Disease, etc.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "model_version": {"name": "model_version", "description": "CMS HCC model version.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "payment_year": {"name": "payment_year", "description": "The payment year the HCC and risk scores are being calculated for.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The date the model was run.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://models/cms_hcc/cms_hcc_models.yml", "compiled_path": null, "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": 1701215339.840451}, "model.the_tuva_project.cms_hcc__int_members": {"resource_type": "model", "depends_on": {"macros": ["macro.dbt.datediff", "macro.dbt.type_string"], "nodes": ["model.the_tuva_project.cms_hcc__stg_core__eligibility", "model.the_tuva_project.cms_hcc__stg_core__patient"]}, "config": {"enabled": true, "alias": "_int_members", "schema": "cms_hcc", "database": null, "tags": ["cms_hcc"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "bind": false, "post-hook": [], "pre-hook": []}, "database": "dev_sarah", "schema": "cms_hcc", "fqn": ["the_tuva_project", "cms_hcc", "intermediate", "cms_hcc__int_members"], "unique_id": "model.the_tuva_project.cms_hcc__int_members", "raw_code": "{{ config(\n enabled = var('cms_hcc_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\n )\n}}\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\n{% set model_version = var('cms_hcc_model_version') -%}\n{% set payment_year = var('cms_hcc_payment_year') -%}\n{% set payment_year_age_date = payment_year ~ '-02-01' -%}\n{% set collection_year = payment_year - 1 -%}\n{% set collection_year_start = collection_year ~ '-01-01' -%}\n{% set collection_year_end = collection_year ~ '-12-31' -%}\n\nwith stg_eligibility as (\n\n select\n patient_id\n , enrollment_start_date\n , enrollment_end_date\n , original_reason_entitlement_code\n , dual_status_code\n , medicare_status_code\n , row_number() over(\n partition by patient_id\n order by enrollment_end_date desc\n ) as row_num /* used to dedupe eligibility */\n from {{ ref('cms_hcc__stg_core__eligibility') }}\n where\n /* filter to members with eligibility in collection or payment year */\n (extract(year from enrollment_start_date) >= {{ collection_year }}\n or extract(year from enrollment_end_date) <= {{ payment_year }})\n\n)\n\n, stg_patient as (\n\n select\n patient_id\n , sex\n , birth_date\n , floor({{ datediff('birth_date', \"'\"~payment_year_age_date~\"'\", 'hour') }} / 8766.0) as payment_year_age\n , death_date\n from {{ ref('cms_hcc__stg_core__patient') }}\n\n)\n\n, cap_collection_start_end_dates as (\n\n select\n patient_id\n , enrollment_start_date\n , enrollment_end_date\n , case\n when enrollment_start_date < '{{ collection_year_start }}'\n then '{{ collection_year_start }}'\n else enrollment_start_date\n end as proxy_enrollment_start_date\n , case\n when enrollment_end_date > '{{ collection_year_end }}'\n then '{{ collection_year_end }}'\n else enrollment_end_date\n end as proxy_enrollment_end_date\n from stg_eligibility\n where\n /* filter to members with eligibility in collection year */\n (extract(year from enrollment_start_date) = {{ collection_year }}\n or extract(year from enrollment_end_date) = {{ collection_year }})\n\n)\n\n, calculate_prior_coverage as (\n\n select patient_id\n , sum({{ datediff('proxy_enrollment_start_date', 'proxy_enrollment_end_date', 'month') }} + 1) as coverage_months /* include starting month */\n from cap_collection_start_end_dates\n group by patient_id\n\n)\n\n/*\n CMS guidance: A \u201cNew Enrollee\u201d status is when a beneficiary has less than\n 12 months of coverage prior to the payment year.\n*/\n, add_enrollment as (\n\n select\n patient_id\n , case\n when coverage_months < 12 then 'New'\n else 'Continuing'\n end as enrollment_status\n from calculate_prior_coverage\n\n)\n\n, latest_eligibility as (\n\n select\n stg_eligibility.patient_id\n , stg_patient.sex as gender\n , stg_patient.payment_year_age\n , stg_eligibility.original_reason_entitlement_code\n , stg_eligibility.dual_status_code\n , stg_eligibility.medicare_status_code\n /*\n Defaulting to \"New\" enrollment status when missing.\n */\n , case\n when add_enrollment.enrollment_status is null then 'New'\n else add_enrollment.enrollment_status\n end as enrollment_status\n , case\n when add_enrollment.enrollment_status is null then TRUE\n else FALSE\n end as enrollment_status_default\n from stg_eligibility\n left join add_enrollment\n on stg_eligibility.patient_id = add_enrollment.patient_id\n left join stg_patient\n on stg_eligibility.patient_id = stg_patient.patient_id\n where stg_eligibility.row_num = 1\n /* filter to members with eligibility in payment year */\n and extract(year from stg_eligibility.enrollment_start_date) <= {{ payment_year }}\n and extract(year from stg_eligibility.enrollment_end_date) >= {{ payment_year }}\n\n)\n\n, add_age_group as (\n\n select\n patient_id\n , gender\n , payment_year_age\n , original_reason_entitlement_code\n , dual_status_code\n , medicare_status_code\n , enrollment_status\n , enrollment_status_default\n , case\n when enrollment_status = 'Continuing' and payment_year_age between 0 and 34 then '0-34'\n when enrollment_status = 'Continuing' and payment_year_age between 35 and 44 then '35-44'\n when enrollment_status = 'Continuing' and payment_year_age between 45 and 54 then '45-54'\n when enrollment_status = 'Continuing' and payment_year_age between 55 and 59 then '55-59'\n when enrollment_status = 'Continuing' and payment_year_age between 60 and 64 then '60-64'\n when enrollment_status = 'Continuing' and payment_year_age between 65 and 69 then '65-69'\n when enrollment_status = 'Continuing' and payment_year_age between 70 and 74 then '70-74'\n when enrollment_status = 'Continuing' and payment_year_age between 75 and 79 then '75-79'\n when enrollment_status = 'Continuing' and payment_year_age between 80 and 84 then '80-84'\n when enrollment_status = 'Continuing' and payment_year_age between 85 and 89 then '85-89'\n when enrollment_status = 'Continuing' and payment_year_age between 90 and 94 then '90-94'\n when enrollment_status = 'Continuing' and payment_year_age >= 95 then '>=95'\n when enrollment_status = 'New' and payment_year_age between 0 and 34 then '0-34'\n when enrollment_status = 'New' and payment_year_age between 35 and 44 then '35-44'\n when enrollment_status = 'New' and payment_year_age between 45 and 54 then '45-54'\n when enrollment_status = 'New' and payment_year_age between 55 and 59 then '55-59'\n when enrollment_status = 'New' and payment_year_age between 60 and 64 then '60-64'\n when enrollment_status = 'New' and payment_year_age = 65 then '65'\n when enrollment_status = 'New' and payment_year_age = 66 then '66'\n when enrollment_status = 'New' and payment_year_age = 67 then '67'\n when enrollment_status = 'New' and payment_year_age = 68 then '68'\n when enrollment_status = 'New' and payment_year_age = 69 then '69'\n when enrollment_status = 'New' and payment_year_age between 70 and 74 then '70-74'\n when enrollment_status = 'New' and payment_year_age between 75 and 79 then '75-79'\n when enrollment_status = 'New' and payment_year_age between 80 and 84 then '80-84'\n when enrollment_status = 'New' and payment_year_age between 85 and 89 then '85-89'\n when enrollment_status = 'New' and payment_year_age between 90 and 94 then '90-94'\n when enrollment_status = 'New' and payment_year_age >= 95 then '>=95'\n end as age_group\n from latest_eligibility\n\n)\n\n, add_status_logic as (\n\n select\n patient_id\n , enrollment_status\n , case\n when gender = 'female' then 'Female'\n when gender = 'male' then 'Male'\n else null\n end as gender\n , age_group\n , case\n when dual_status_code in ('01','02','03','04','05','06','08') then 'Yes'\n else 'No'\n end as medicaid_status\n , case\n when dual_status_code in ('02','04','08') then 'Full'\n when dual_status_code in ('01','03','05','06') then 'Partial'\n else 'Non'\n end as dual_status\n /*\n The CMS-HCC model does not have factors for ESRD for these edge-cases,\n we default to 'Aged'. When OREC is missing, latest Medicare status is\n used, if available.\n */\n , case\n when original_reason_entitlement_code in ('0','2') then 'Aged'\n when original_reason_entitlement_code in ('1','3') then 'Disabled'\n when original_reason_entitlement_code is null and medicare_status_code in ('10','11','31') then 'Aged'\n when original_reason_entitlement_code is null and medicare_status_code in ('20','21') then 'Disabled'\n when coalesce(original_reason_entitlement_code,medicare_status_code) is null then 'Aged'\n end as orec\n /*\n Defaulting everyone to non-institutional until logic is added\n */\n , cast('No' as {{ dbt.type_string() }}) as institutional_status\n , enrollment_status_default\n , case\n when dual_status_code is null then TRUE\n else FALSE\n end as medicaid_dual_status_default\n /*\n Setting default true when OREC or Medicare Status is ESRD, or null.\n */\n , case\n when original_reason_entitlement_code in ('2') then TRUE\n when original_reason_entitlement_code is null and medicare_status_code in ('31') then TRUE\n when coalesce(original_reason_entitlement_code,medicare_status_code) is null then TRUE\n else FALSE\n end as orec_default\n /*\n Setting default true until institutional logic is added\n */\n , TRUE as institutional_status_default\n from add_age_group\n\n)\n\n, add_data_types as (\n\n select\n cast(patient_id as {{ dbt.type_string() }}) as patient_id\n , cast(enrollment_status as {{ dbt.type_string() }}) as enrollment_status\n , cast(gender as {{ dbt.type_string() }}) as gender\n , cast(age_group as {{ dbt.type_string() }}) as age_group\n , cast(medicaid_status as {{ dbt.type_string() }}) as medicaid_status\n , cast(dual_status as {{ dbt.type_string() }}) as dual_status\n , cast(orec as {{ dbt.type_string() }}) as orec\n , cast(institutional_status as {{ dbt.type_string() }}) as institutional_status\n , cast(enrollment_status_default as boolean) as enrollment_status_default\n , cast(medicaid_dual_status_default as boolean) as medicaid_dual_status_default\n , cast(orec_default as boolean) as orec_default\n , cast(institutional_status_default as boolean) as institutional_status_default\n , cast('{{ model_version }}' as {{ dbt.type_string() }}) as model_version\n , cast('{{ payment_year }}' as integer) as payment_year\n from add_status_logic\n\n)\n\nselect\n patient_id\n , enrollment_status\n , gender\n , age_group\n , medicaid_status\n , dual_status\n , orec\n , institutional_status\n , enrollment_status_default\n , medicaid_dual_status_default\n , orec_default\n , institutional_status_default\n , model_version\n , payment_year\n , '{{ var('tuva_last_run')}}' as tuva_last_run\nfrom add_data_types", "language": "sql", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/the_tuva_project", "path": "cms_hcc/intermediate/cms_hcc__int_members.sql", "original_file_path": "models/cms_hcc/intermediate/cms_hcc__int_members.sql", "name": "cms_hcc__int_members", "alias": "_int_members", "checksum": {"name": "sha256", "checksum": "59eda8c59d3c83e9d022ab049fec3b6c9ffb940b85bfa4724e4daa86886010c3"}, "tags": ["cms_hcc"], "refs": [["cms_hcc__stg_core__eligibility"], ["cms_hcc__stg_core__patient"]], "sources": [], "metrics": [], "description": "Transformed eligibility data into the demographic risk segments required for the CMS HCC and risk calculations.\n", "columns": {"patient_id": {"name": "patient_id", "description": "Unique ID for the patient.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "enrollment_status": {"name": "enrollment_status", "description": "Indicates whether the patient is a \"Continuing\" or \"New\" enrollee.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "gender": {"name": "gender", "description": "Indicates whether the patient is \"Female\" or \"Male\".", "meta": {}, "data_type": null, "quote": null, "tags": []}, "age_group": {"name": "age_group", "description": "Indicates what age group the patient is in. (e.g. \"60-64\"). CMS guidance: Age is calculated as of Feb 1 of the payment year.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "medicaid_status": {"name": "medicaid_status", "description": "Indicates whether the patient is enrolled in Medicaid.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "dual_status": {"name": "dual_status", "description": "Indicates whether the patient has \"Full\", \"Partial\", or \"Non\" dual status.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "orec": {"name": "orec", "description": "Indicates the Original Reason for Entitlement Code (OREC) \"Aged\", \"Disabled\", or \"ESRD\". If available, current Medicare Status is used when OREC is missing.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "institutional_status": {"name": "institutional_status", "description": "Indicates whether the patient resided in an institution for at least 90 days.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "enrollment_status_default": {"name": "enrollment_status_default", "description": "Indicates the input data was missing and a default status was used.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "medicaid_dual_status_default": {"name": "medicaid_dual_status_default", "description": "Indicates the input data was missing and a default status was used.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "orec_default": {"name": "orec_default", "description": "Indicates the input data was missing and a default status was used.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "institutional_status_default": {"name": "institutional_status_default", "description": "Indicates the input data was missing and a default status was used.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "model_version": {"name": "model_version", "description": "CMS HCC model version.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "payment_year": {"name": "payment_year", "description": "The payment year the HCC and risk scores are being calculated for.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The date the model was run.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://models/cms_hcc/cms_hcc_models.yml", "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"schema": "cms_hcc", "alias": "_int_members", "tags": "cms_hcc", "materialized": "table", "enabled": true, "bind": false}, "created_at": 1701215339.865907}, "model.the_tuva_project.cms_hcc__int_enrollment_interaction_factors": {"resource_type": "model", "depends_on": {"macros": ["macro.dbt.type_string", "macro.dbt.type_numeric"], "nodes": ["model.the_tuva_project.cms_hcc__int_demographic_factors", "seed.the_tuva_project.cms_hcc__enrollment_interaction_factors"]}, "config": {"enabled": true, "alias": "_int_enrollment_interaction_factors", "schema": "cms_hcc", "database": null, "tags": ["cms_hcc"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "bind": false, "post-hook": [], "pre-hook": []}, "database": "dev_sarah", "schema": "cms_hcc", "fqn": ["the_tuva_project", "cms_hcc", "intermediate", "cms_hcc__int_enrollment_interaction_factors"], "unique_id": "model.the_tuva_project.cms_hcc__int_enrollment_interaction_factors", "raw_code": "{{ config(\n enabled = var('cms_hcc_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\n )\n}}\n/*\nThe hcc_model_version var has been set here so it gets compiled.\n*/\n\n{% set model_version_compiled = var('cms_hcc_model_version') -%}\n\nwith demographics as (\n\n select\n patient_id\n , enrollment_status\n , gender\n , age_group\n , medicaid_status\n , dual_status\n , orec\n , institutional_status\n , model_version\n , payment_year\n from {{ ref('cms_hcc__int_demographic_factors') }}\n\n)\n\n, seed_interaction_factors as (\n\n select\n model_version\n , factor_type\n , gender\n , enrollment_status\n , medicaid_status\n , dual_status\n , institutional_status\n , description\n , coefficient\n from {{ ref('cms_hcc__enrollment_interaction_factors') }}\n where model_version = '{{ model_version_compiled }}'\n\n)\n\n/*\n Originally disabled interactions for non-institutional members >= 65\n*/\n, non_institutional_interactions as (\n\n select\n demographics.patient_id\n , demographics.model_version\n , demographics.payment_year\n , seed_interaction_factors.factor_type\n , seed_interaction_factors.description\n , seed_interaction_factors.coefficient\n from demographics\n inner join seed_interaction_factors\n on demographics.gender = seed_interaction_factors.gender\n and demographics.enrollment_status = seed_interaction_factors.enrollment_status\n and demographics.medicaid_status = seed_interaction_factors.medicaid_status\n and demographics.dual_status = seed_interaction_factors.dual_status\n and demographics.institutional_status = seed_interaction_factors.institutional_status\n where demographics.institutional_status = 'No'\n and demographics.orec = 'Disabled'\n and demographics.age_group in (\n '65-69'\n , '70-74'\n , '75-79'\n , '80-84'\n , '85-89'\n , '90-94'\n , '>=95'\n )\n\n)\n\n/*\n Medicaid interactions for institutional members\n*/\n, institutional_interactions as (\n\n select\n demographics.patient_id\n , demographics.model_version\n , demographics.payment_year\n , seed_interaction_factors.factor_type\n , seed_interaction_factors.description\n , seed_interaction_factors.coefficient\n from demographics\n inner join seed_interaction_factors\n on demographics.enrollment_status = seed_interaction_factors.enrollment_status\n and demographics.institutional_status = seed_interaction_factors.institutional_status\n 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 {{ dbt.type_string() }}) as patient_id\n , cast(description as {{ dbt.type_string() }}) as description\n , round(cast(coefficient as {{ dbt.type_numeric() }}),3) as coefficient\n , cast(factor_type as {{ dbt.type_string() }}) as factor_type\n , cast(model_version as {{ dbt.type_string() }}) as model_version\n , cast(payment_year as integer) as payment_year\n from unioned\n\n)\n\nselect\n patient_id\n , description\n , coefficient\n , factor_type\n , model_version\n , payment_year\n , '{{ var('tuva_last_run')}}' as tuva_last_run\nfrom add_data_types", "language": "sql", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/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", "name": "cms_hcc__int_enrollment_interaction_factors", "alias": "_int_enrollment_interaction_factors", "checksum": {"name": "sha256", "checksum": "13121c69461d4f45d628242b57c7d84c551561a10c9a236c901ebb9261e96d49"}, "tags": ["cms_hcc"], "refs": [["cms_hcc__int_demographic_factors"], ["cms_hcc__enrollment_interaction_factors"]], "sources": [], "metrics": [], "description": "Enrollment interaction factor values for the corresponding HCC model version and payment year.\n", "columns": {"patient_id": {"name": "patient_id", "description": "Unique ID for the patient.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "description": {"name": "description", "description": "Description of the enrollment interaction.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "coefficient": {"name": "coefficient", "description": "Relative factor value that correspond to the CMS HCC model's risk indicators.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "factor_type": {"name": "factor_type", "description": "Type of risk factor, e.g. Demographic, Disease, etc.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "model_version": {"name": "model_version", "description": "CMS HCC model version.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "payment_year": {"name": "payment_year", "description": "The payment year the HCC and risk scores are being calculated for.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The date the model was run.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://models/cms_hcc/cms_hcc_models.yml", "compiled_path": null, "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": 1701215339.854319}, "model.the_tuva_project.emergency_department__summary": {"resource_type": "model", "depends_on": {"macros": ["macro.dbt.datediff"], "nodes": ["model.the_tuva_project.emergency_department__int_encounter_id", "model.the_tuva_project.emergency_department__int_encounter_start_and_end_dates", "model.input_layer.medical_claim", "model.the_tuva_project.emergency_department__int_encounter_id", "model.the_tuva_project.emergency_department__int_first_claim_values", "model.the_tuva_project.emergency_department__int_last_claim_values", "model.input_layer.medical_claim", "model.the_tuva_project.emergency_department__int_encounter_id", "model.input_layer.eligibility", "model.the_tuva_project.emergency_department__int_institutional_encounter_id", "seed.the_tuva_project.terminology__provider", "seed.the_tuva_project.terminology__discharge_disposition", "seed.the_tuva_project.terminology__admit_source", "seed.the_tuva_project.terminology__admit_type", "seed.the_tuva_project.terminology__ms_drg", "seed.the_tuva_project.terminology__apr_drg", "seed.the_tuva_project.terminology__icd_10_cm", "seed.the_tuva_project.terminology__icd_9_cm"]}, "config": {"enabled": true, "alias": "emergency_department_summary", "schema": "claims_preprocessing", "database": null, "tags": ["emergency_department", "claims_preprocessing"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "bind": false, "post-hook": [], "pre-hook": []}, "database": "dev_sarah", "schema": "claims_preprocessing", "fqn": ["the_tuva_project", "claims_preprocessing", "emergency_department", "final", "emergency_department__summary"], "unique_id": "model.the_tuva_project.emergency_department__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('emergency_department__int_encounter_id') }} a\r\ninner join {{ ref('emergency_department__int_encounter_start_and_end_dates') }} b\r\n on a.encounter_id = b.encounter_id\r\n)\r\n\r\n, institutional_claim_details as (\r\n select\r\n b.encounter_id\r\n , first.diagnosis_code_1\r\n , first.diagnosis_code_type\r\n , first.facility_npi as facility_npi\r\n , first.ms_drg_code as ms_drg_code\r\n , first.apr_drg_code as apr_drg_code\r\n , first.admit_source_code as admit_source_code\r\n , first.admit_type_code as admit_type_code\r\n , last.discharge_disposition_code as discharge_disposition_code\r\n , sum(paid_amount) as inst_paid_amount\r\n , sum(allowed_amount) as inst_allowed_amount\r\n , sum(charge_amount) as inst_charge_amount\r\n , max(data_source) as data_source\r\n from {{ ref('medical_claim') }} a\r\n inner join {{ ref('emergency_department__int_encounter_id') }} b\r\n on a.claim_id = b.claim_id\r\n and a.claim_line_number = b.claim_line_number\r\n and a.claim_type = 'institutional'\r\n inner join {{ ref('emergency_department__int_first_claim_values') }} first\r\n on b.encounter_id = first.encounter_id\r\n and first.claim_row = 1\r\n inner join {{ ref('emergency_department__int_last_claim_values') }} last\r\n on b.encounter_id = last.encounter_id\r\n and last.claim_row = 1\r\n group by\r\n b.encounter_id\r\n , first.diagnosis_code_1\r\n , first.diagnosis_code_type\r\n , first.facility_npi\r\n , first.ms_drg_code\r\n , first.apr_drg_code\r\n , first.admit_source_code\r\n , first.admit_type_code\r\n , last.discharge_disposition_code\r\n)\r\n\r\n, professional_claim_details as (\r\nselect\r\n b.encounter_id\r\n, sum(paid_amount) as prof_paid_amount\r\n, sum(allowed_amount) as prof_allowed_amount\r\n, sum(charge_amount) as prof_charge_amount\r\nfrom {{ ref('medical_claim') }} a\r\ninner join {{ ref('emergency_department__int_encounter_id') }} b\r\n on a.claim_id = b.claim_id\r\n and a.claim_line_number = b.claim_line_number\r\n and a.claim_type = 'professional'\r\ngroup by 1\r\n)\r\n\r\n, patient as (\r\nselect distinct\r\n patient_id\r\n, birth_date\r\n, gender\r\n, race\r\nfrom {{ ref('eligibility') }}\r\n)\r\n\r\n, provider as (\r\nselect\r\n a.encounter_id\r\n, max(a.facility_npi) as facility_npi\r\n, b.provider_first_name\r\n, b.provider_last_name\r\n, count(distinct facility_npi) as npi_count\r\nfrom {{ ref('emergency_department__int_institutional_encounter_id') }} a\r\nleft join {{ ref('terminology__provider') }} b\r\n on a.facility_npi = b.npi\r\ngroup by 1,3,4\r\n)\r\n\r\nselect\r\n a.encounter_id\r\n , a.encounter_start_date\r\n , a.encounter_end_date\r\n , a.patient_id\r\n , {{ dbt.datediff(\"birth_date\",\"encounter_end_date\",\"day\")}}/365 as admit_age\r\n , e.gender\r\n , e.race\r\n , c.diagnosis_code_type as primary_diagnosis_code_type\r\n , c.diagnosis_code_1 as primary_diagnosis_code\r\n , coalesce(icd10cm.description, icd9cm.long_description) as primary_diagnosis_description\r\n , f.facility_npi\r\n , f.provider_first_name\r\n , f.provider_last_name\r\n , c.ms_drg_code\r\n , j.ms_drg_description\r\n , j.medical_surgical\r\n , c.apr_drg_code\r\n , k.apr_drg_description\r\n , c.admit_source_code\r\n , h.admit_source_description\r\n , c.admit_type_code\r\n , i.admit_type_description\r\n , c.discharge_disposition_code\r\n , g.discharge_disposition_description\r\n , c.inst_paid_amount + coalesce(d.prof_paid_amount,0) as total_paid_amount\r\n , c.inst_allowed_amount + coalesce(d.prof_allowed_amount,0) as total_allowed_amount\r\n , c.inst_charge_amount + coalesce(d.prof_charge_amount,0) as total_charge_amount\r\n , {{ dbt.datediff(\"a.encounter_start_date\",\"a.encounter_end_date\",\"day\") }} as length_of_stay\r\n , case\r\n when c.discharge_disposition_code = '20' then 1\r\n else 0\r\n end mortality_flag\r\n , data_source\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom distinct_encounters a\r\nleft join institutional_claim_details c\r\n on a.encounter_id = c.encounter_id\r\nleft join professional_claim_details d\r\n on a.encounter_id = d.encounter_id\r\nleft join patient e\r\n on a.patient_id = e.patient_id\r\nleft join provider f\r\n on a.encounter_id = f.encounter_id\r\nleft join {{ ref('terminology__discharge_disposition') }} g\r\n on c.discharge_disposition_code = g.discharge_disposition_code\r\nleft join {{ ref('terminology__admit_source') }} h\r\n on c.admit_source_code = h.admit_source_code\r\nleft join {{ ref('terminology__admit_type') }} i\r\n on c.admit_type_code = i.admit_type_code\r\nleft join {{ ref('terminology__ms_drg') }} j\r\n on c.ms_drg_code = j.ms_drg_code\r\nleft join {{ ref('terminology__apr_drg') }} k\r\n on c.apr_drg_code = k.apr_drg_code\r\nleft join {{ ref('terminology__icd_10_cm')}} icd10cm\r\n on c.diagnosis_code_1 = icd10cm.icd_10_cm\r\n and c.diagnosis_code_type = 'icd-10-cm'\r\nleft join {{ ref('terminology__icd_9_cm')}} icd9cm\r\n on c.diagnosis_code_1 = icd9cm.icd_9_cm\r\n and c.diagnosis_code_type = 'icd-9-cm'", "language": "sql", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/the_tuva_project", "path": "claims_preprocessing/emergency_department/final/emergency_department__summary.sql", "original_file_path": "models/claims_preprocessing/emergency_department/final/emergency_department__summary.sql", "name": "emergency_department__summary", "alias": "emergency_department_summary", "checksum": {"name": "sha256", "checksum": "8ebd499a3126efc3cee2bf74ba9ef7d569bb29e63d71db01f89a18215705e715"}, "tags": ["emergency_department", "claims_preprocessing"], "refs": [["emergency_department__int_encounter_id"], ["emergency_department__int_encounter_start_and_end_dates"], ["medical_claim"], ["emergency_department__int_encounter_id"], ["emergency_department__int_first_claim_values"], ["emergency_department__int_last_claim_values"], ["medical_claim"], ["emergency_department__int_encounter_id"], ["eligibility"], ["emergency_department__int_institutional_encounter_id"], ["terminology__provider"], ["terminology__discharge_disposition"], ["terminology__admit_source"], ["terminology__admit_type"], ["terminology__ms_drg"], ["terminology__apr_drg"], ["terminology__icd_10_cm"], ["terminology__icd_9_cm"]], "sources": [], "metrics": [], "description": "This table pulls together all the data needed to perform acute inpatient analytics into a single table.", "columns": {"encounter_id": {"name": "encounter_id", "description": "Unique identifier for the emergency_department encounter.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "encounter_start_date": {"name": "encounter_start_date", "description": "Date when the patient was admitted.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "encounter_end_date": {"name": "encounter_end_date", "description": "Date when the patient was discharged.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "patient_id": {"name": "patient_id", "description": "Unique identifier for each patient in the dataset.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "admit_age": {"name": "admit_age", "description": "The age of the patient as of their admission date.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "gender": {"name": "gender", "description": "The gender of the patient.", "meta": {"terminology": "/terminology/demographics/gender"}, "data_type": null, "quote": null, "tags": []}, "race": {"name": "race", "description": "The race of the patient.", "meta": {"terminology": "/terminology/demographics/race"}, "data_type": null, "quote": null, "tags": []}, "facility_npi": {"name": "facility_npi", "description": "The NPI for the facility where the encounter occurred.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "provider_first_name": {"name": "provider_first_name", "description": "The first name of the provider.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "provider_last_name": {"name": "provider_last_name", "description": "The last name of the provider.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "ms_drg_code": {"name": "ms_drg_code", "description": "The MS-DRG code associted with the inpatient visit", "meta": {"terminology": "/terminology/conditions-and-procedures/ms-drg"}, "data_type": null, "quote": null, "tags": []}, "ms_drg_description": {"name": "ms_drg_description", "description": "The MS-DRG description associted with the inpatient visit", "meta": {"terminology": "/terminology/conditions-and-procedures/ms-drg"}, "data_type": null, "quote": null, "tags": []}, "medical_surgical": {"name": "medical_surgical", "description": "Indicates whether the MS-DRG is medical or surgical in nature.", "meta": {"terminology": "/terminology/conditions-and-procedures/ms-drg"}, "data_type": null, "quote": null, "tags": []}, "apr_drg_code": {"name": "apr_drg_code", "description": "The APR-DRG code associted with the inpatient visit", "meta": {"terminology": "/terminology/conditions-and-procedures/apr-drg"}, "data_type": null, "quote": null, "tags": []}, "apr_drg_description": {"name": "apr_drg_description", "description": "The APR-DRG description associted with the inpatient visit", "meta": {"terminology": "/terminology/conditions-and-procedures/apr-drg"}, "data_type": null, "quote": null, "tags": []}, "admit_source_code": {"name": "admit_source_code", "description": "Admission source code for the encounter.", "meta": {"terminology": "/terminology/administrative-codes/admit-source"}, "data_type": null, "quote": null, "tags": []}, "admit_source_description": {"name": "admit_source_description", "description": "Admission source description for the encounter.", "meta": {"terminology": "/terminology/administrative-codes/admit-source"}, "data_type": null, "quote": null, "tags": []}, "admit_type_code": {"name": "admit_type_code", "description": "Admission type code for the encounter.", "meta": {"terminology": "/terminology/administrative-codes/admit-type"}, "data_type": null, "quote": null, "tags": []}, "admit_type_description": {"name": "admit_type_description", "description": "Admission type description for the encounter.", "meta": {"terminology": "/terminology/administrative-codes/admit-type"}, "data_type": null, "quote": null, "tags": []}, "discharge_disposition_code": {"name": "discharge_disposition_code", "description": "Discharge disposition code for the encounter.", "meta": {"terminology": "/terminology/administrative-codes/discharge-disposition"}, "data_type": null, "quote": null, "tags": []}, "discharge_disposition_description": {"name": "discharge_disposition_description", "description": "Discharge disposition description for the encounter.", "meta": {"terminology": "/terminology/administrative-codes/discharge-disposition"}, "data_type": null, "quote": null, "tags": []}, "total_paid_amount": {"name": "total_paid_amount", "description": "The total paid amount across all claims for the encounter.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "total_allowed_amount": {"name": "total_allowed_amount", "description": "The total allowed amount across all claims for the encounter.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "total_charge_amount": {"name": "total_charge_amount", "description": "The total charge amount across all claims for the encounter.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "length_of_stay": {"name": "length_of_stay", "description": "The length of stay for the encoujnter.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "mortality_flag": {"name": "mortality_flag", "description": "1 if a patient died during the encounter, 0 otherwise.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "data_source": {"name": "data_source", "description": "User-configured field that indicates the data source (e.g. typically named after the payer and state \"BCBS Tennessee\").", "meta": {}, "data_type": null, "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The time at with the model was materialized. Generated by `dbt_utils.pretty_time` as the local time of the `dbt run` environment. Timezone is configurable via the `tuva_last_run` var.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://models/claims_preprocessing/claims_preprocessing_models.yml", "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "emergency_department_summary", "tags": ["emergency_department", "claims_preprocessing"], "materialized": "table", "enabled": true, "bind": false}, "created_at": 1701215339.979708}, "model.the_tuva_project.emergency_department__int_encounter_id": {"resource_type": "model", "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.emergency_department__int_institutional_encounter_id", "model.input_layer.medical_claim", "model.the_tuva_project.emergency_department__int_professional_encounter_id"]}, "config": {"enabled": true, "alias": "_int_emergency_department_encounter_id", "schema": "claims_preprocessing", "database": null, "tags": ["emergency_department", "claims_preprocessing"], "meta": {}, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "bind": false, "post-hook": [], "pre-hook": []}, "database": "dev_sarah", "schema": "claims_preprocessing", "fqn": ["the_tuva_project", "claims_preprocessing", "emergency_department", "intermediate", "emergency_department__int_encounter_id"], "unique_id": "model.the_tuva_project.emergency_department__int_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\nselect\r\n inst.patient_id,\r\n inst.claim_id,\r\n med.claim_line_number,\r\n inst.encounter_id,\r\n '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('emergency_department__int_institutional_encounter_id') }} inst\r\nleft join {{ ref('medical_claim') }} med\r\n on inst.claim_id = med.claim_id\r\n\r\nunion distinct\r\n\r\nselect\r\n patient_id,\r\n claim_id,\r\n claim_line_number,\r\n encounter_id,\r\n '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('emergency_department__int_professional_encounter_id') }}\r\nwhere (orphan_claim_flag = 0) and (encounter_count = 1)", "language": "sql", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/the_tuva_project", "path": "claims_preprocessing/emergency_department/intermediate/emergency_department__int_encounter_id.sql", "original_file_path": "models/claims_preprocessing/emergency_department/intermediate/emergency_department__int_encounter_id.sql", "name": "emergency_department__int_encounter_id", "alias": "_int_emergency_department_encounter_id", "checksum": {"name": "sha256", "checksum": "adc3dbea15a367a6ea68c6c322af263f3fa674a9507c8fcf806d993a929f5bec"}, "tags": ["emergency_department", "claims_preprocessing"], "refs": [["emergency_department__int_institutional_encounter_id"], ["medical_claim"], ["emergency_department__int_professional_encounter_id"]], "sources": [], "metrics": [], "description": "Fix encounter_id so each professional claim can only belong to one encounter", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://models/claims_preprocessing/claims_preprocessing_models.yml", "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_emergency_department_encounter_id", "tags": ["emergency_department", "claims_preprocessing"], "materialized": "view", "enabled": true, "bind": false}, "created_at": 1701215339.981629}, "model.the_tuva_project.emergency_department__int_first_claim_values": {"resource_type": "model", "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.emergency_department__int_encounter_id", "model.input_layer.medical_claim"]}, "config": {"enabled": true, "alias": "_int_emergency_department_first_claim_values", "schema": "claims_preprocessing", "database": null, "tags": ["emergency_department", "claims_preprocessing"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "bind": false, "post-hook": [], "pre-hook": []}, "database": "dev_sarah", "schema": "claims_preprocessing", "fqn": ["the_tuva_project", "claims_preprocessing", "emergency_department", "intermediate", "emergency_department__int_first_claim_values"], "unique_id": "model.the_tuva_project.emergency_department__int_first_claim_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 first_claim_values as(\r\n select distinct\r\n e.encounter_id\r\n , coalesce(claim_start_date, admission_date) as claim_start\r\n , diagnosis_code_1\r\n , diagnosis_code_type\r\n , admit_source_code\r\n , admit_type_code\r\n , facility_npi\r\n , ms_drg_code\r\n , apr_drg_code\r\n from {{ ref('emergency_department__int_encounter_id')}} e\r\n inner join {{ ref('medical_claim') }} m\r\n on e.claim_id = m.claim_id\r\n where claim_type = 'institutional'\r\n)\r\n\r\nselect\r\n encounter_id\r\n , claim_start\r\n , diagnosis_code_1\r\n , diagnosis_code_type\r\n , admit_source_code\r\n , admit_type_code\r\n , facility_npi\r\n , ms_drg_code\r\n , apr_drg_code\r\n , row_number() over (partition by encounter_id order by claim_start) as claim_row\r\nfrom first_claim_values", "language": "sql", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/the_tuva_project", "path": "claims_preprocessing/emergency_department/intermediate/emergency_department__int_first_claim_values.sql", "original_file_path": "models/claims_preprocessing/emergency_department/intermediate/emergency_department__int_first_claim_values.sql", "name": "emergency_department__int_first_claim_values", "alias": "_int_emergency_department_first_claim_values", "checksum": {"name": "sha256", "checksum": "9cddf3276eba155c0599138672c4887df4a6a3cd5f11aae6b0a5cd5d76614d2f"}, "tags": ["emergency_department", "claims_preprocessing"], "refs": [["emergency_department__int_encounter_id"], ["medical_claim"]], "sources": [], "metrics": [], "description": "Orders claims to pull out encounter details (admit type, drg, etc)", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://models/claims_preprocessing/claims_preprocessing_models.yml", "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_emergency_department_first_claim_values", "tags": ["emergency_department", "claims_preprocessing"], "materialized": "table", "enabled": true, "bind": false}, "created_at": 1701215339.985426}, "model.the_tuva_project.emergency_department__int_institutional_claims": {"resource_type": "model", "depends_on": {"macros": [], "nodes": ["model.input_layer.medical_claim", "model.the_tuva_project.service_category__service_category_grouper"]}, "config": {"enabled": true, "alias": "_int_emergency_department_institutional_claims", "schema": "claims_preprocessing", "database": null, "tags": ["emergency_department", "claims_preprocessing"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "bind": false, "post-hook": [], "pre-hook": []}, "database": "dev_sarah", "schema": "claims_preprocessing", "fqn": ["the_tuva_project", "claims_preprocessing", "emergency_department", "intermediate", "emergency_department__int_institutional_claims"], "unique_id": "model.the_tuva_project.emergency_department__int_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\nwith emergency_department_claim_lines as (\r\nselect\r\n mc.patient_id,\r\n mc.claim_id,\r\n mc.claim_line_number,\r\n mc.claim_start_date,\r\n mc.claim_end_date,\r\n mc.admission_date,\r\n mc.discharge_date,\r\n mc.admit_source_code,\r\n mc.admit_type_code,\r\n mc.discharge_disposition_code,\r\n mc.facility_npi,\r\n mc.claim_type,\r\n mc.data_source\r\nfrom {{ ref('medical_claim') }} mc\r\ninner join {{ ref('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 = 'Emergency Department'\r\n),\r\n\r\ndata_quality_flags as (\r\nselect\r\n claim_id,\r\n-- patient_id_not_unique:\r\n case\r\n when count(distinct patient_id) > 1 then 1\r\n else 0\r\n end as patient_id_not_unique,\r\n-- patient_id_missing: \r\n case\r\n when max(patient_id) is null then 1\r\n else 0\r\n end as patient_id_missing, \r\n-- claim_start_date_not_unique:\r\n case\r\n when count(distinct claim_start_date) > 1 then 1\r\n else 0\r\n end as claim_start_date_not_unique,\r\n-- claim_start_date_missing: \r\n case\r\n when max(claim_start_date) is null then 1\r\n else 0\r\n end as claim_start_date_missing,\r\n-- claim_end_date_not_unique:\r\n case\r\n when count(distinct claim_end_date) > 1 then 1\r\n else 0\r\n end as claim_end_date_not_unique,\r\n-- claim_end_date_missing: \r\n case\r\n when max(claim_end_date) is null then 1\r\n else 0\r\n end as claim_end_date_missing,\r\n-- claim_start_date_after_claim_end_date:\r\n case\r\n when min(claim_start_date) > max(claim_end_date) then 1\r\n else 0\r\n end as claim_start_date_after_claim_end_date,\r\n-- admission_date_not_unique:\r\n case\r\n when count(distinct admission_date) > 1 then 1\r\n else 0\r\n end as admission_date_not_unique,\r\n-- admission_date_missing: \r\n case\r\n when max(admission_date) is null then 1\r\n else 0\r\n end as admission_date_missing,\r\n-- discharge_date_not_unique:\r\n case\r\n when count(distinct discharge_date) > 1 then 1\r\n else 0\r\n end as discharge_date_not_unique,\r\n-- discharge_date_missing: \r\n case\r\n when max(discharge_date) is null then 1\r\n else 0\r\n end as discharge_date_missing,\r\n-- admission_date_after_discharge_date:\r\n case\r\n when min(admission_date) > max(discharge_date) then 1\r\n else 0\r\n end as admission_date_after_discharge_date,\r\n-- admit_type_code_not_unique:\r\n case\r\n when count(distinct admit_type_code) > 1 then 1\r\n else 0\r\n end as admit_type_code_not_unique,\r\n-- admit_type_code_missing: \r\n case\r\n when max(admit_type_code) is null then 1\r\n else 0\r\n end as admit_type_code_missing, \r\n-- admit_source_code_not_unique:\r\n case\r\n when count(distinct admit_source_code) > 1 then 1\r\n else 0\r\n end as admit_source_code_not_unique,\r\n-- admit_source_code_missing: \r\n case\r\n when max(admit_source_code) is null then 1\r\n else 0\r\n end as admit_source_code_missing, \r\n-- discharge_disposition_code_not_unique:\r\n case\r\n when count(distinct discharge_disposition_code) > 1 then 1\r\n else 0\r\n end as discharge_disposition_code_not_unique,\r\n-- discharge_disposition_code_missing: \r\n case\r\n when max(discharge_disposition_code) is null then 1\r\n else 0\r\n end as discharge_disposition_code_missing,\r\n-- facility_npi_not_unique:\r\n case\r\n when count(distinct facility_npi) > 1 then 1\r\n else 0\r\n end as facility_npi_not_unique,\r\n-- facility_npi_missing: \r\n case\r\n when max(facility_npi) is null then 1\r\n else 0\r\n end as facility_npi_missing,\r\n-- claim_type_not_unique:\r\n case\r\n when count(distinct claim_type) > 1 then 1\r\n else 0\r\n end as claim_type_not_unique,\r\n-- claim_type_missing: \r\n case\r\n when max(claim_type) is null then 1\r\n else 0\r\n end as claim_type_missing,\r\n-- claim_type_not_institutional:\r\n case\r\n when max(claim_type) <> 'institutional'\r\n and min(claim_type) <> 'institutional' then 1\r\n else 0\r\n end as claim_type_not_institutional\r\nfrom emergency_department_claim_lines\r\ngroup by claim_id\r\n),\r\n\r\n\r\nheader_level_values as (\r\nselect\r\n claim_id,\r\n max(patient_id) as patient_id,\r\n min(claim_start_date) as claim_start_date,\r\n max(claim_end_date) as claim_end_date,\r\n min(admission_date) as admission_date,\r\n max(discharge_date) as discharge_date,\r\n max(admit_source_code) as admit_source_code,\r\n max(admit_type_code) as admit_type_code,\r\n max(discharge_disposition_code) as discharge_disposition_code,\r\n max(facility_npi) as facility_npi,\r\n max(claim_type) as claim_type,\r\n coalesce(min(admission_date),\r\n min(claim_start_date)) as start_date,\r\n coalesce(max(discharge_date),\r\n max(claim_end_date)) as end_date,\r\n case\r\n when min(admission_date) is not null then 'admission_date'\r\n when min(claim_start_date) is not null then 'claim_start_date'\r\n else null\r\n end as date_used_as_start_date,\r\n case\r\n when max(discharge_date) is not null then 'discharge_date'\r\n when max(claim_end_date) is not null then 'claim_end_date'\r\n else null\r\n end as date_used_as_end_date,\r\n data_source\r\nfrom emergency_department_claim_lines\r\ngroup by claim_id, data_source\r\n)\r\n\r\nselect\r\n h.patient_id as patient_id,\r\n h.claim_id as claim_id, \r\n h.claim_start_date as claim_start_date,\r\n h.claim_end_date as claim_end_date,\r\n h.admission_date as admission_date,\r\n h.discharge_date as discharge_date,\r\n h.admit_source_code as admit_source_code,\r\n h.admit_type_code as admit_type_code,\r\n h.discharge_disposition_code as discharge_disposition_code,\r\n h.facility_npi as facility_npi,\r\n h.claim_type as claim_type,\r\n h.start_date as start_date,\r\n h.end_date as end_date,\r\n h.date_used_as_start_date,\r\n h.date_used_as_end_date, \r\n\r\n case\r\n when\r\n ( (dq.patient_id_not_unique = 1) or\r\n (dq.patient_id_missing = 1) or\r\n (dq.discharge_disposition_code_not_unique = 1) or\r\n (dq.discharge_disposition_code_missing = 1) or\r\n (dq.facility_npi_not_unique = 1) or\r\n (dq.facility_npi_missing = 1) or\r\n (h.date_used_as_start_date is null) or\r\n\t(h.date_used_as_end_date is null) or\r\n\t(h.start_date > h.end_date) ) then 1\r\n else 0\r\n end as dq_problem,\r\n\r\n case\r\n when\r\n ( (dq.claim_start_date_not_unique = 1) or\r\n\t(dq.claim_start_date_missing = 1) or\r\n (dq.claim_end_date_not_unique = 1) or\r\n (dq.claim_end_date_missing = 1) or\r\n (dq.claim_start_date_after_claim_end_date = 1) or\r\n (dq.admission_date_not_unique = 1) or\r\n (dq.admission_date_missing = 1) or\r\n (dq.discharge_date_not_unique = 1) or\r\n (dq.discharge_date_missing = 1) or\r\n (dq.admission_date_after_discharge_date = 1) or\r\n (dq.admit_type_code_not_unique = 1) or\r\n (dq.admit_type_code_missing = 1) or\r\n (dq.admit_source_code_not_unique = 1) or\r\n (dq.admit_source_code_missing = 1) or\t\r\n (dq.claim_type_not_unique = 1) or\r\n (dq.claim_type_missing = 1) or\r\n (dq.claim_type_not_institutional = 1) ) then 1\r\n else 0\r\n end as dq_insight,\r\n\r\n case\r\n when (h.date_used_as_start_date is null) then 1\r\n else 0\r\n end as start_date_not_determined,\r\n \r\n case\r\n when (h.date_used_as_end_date is null) then 1\r\n else 0\r\n end as end_date_not_determined,\r\n\r\n case\r\n when (h.start_date > h.end_date) then 1\r\n else 0\r\n end as start_date_after_end_date,\r\n \r\n dq.patient_id_not_unique as patient_id_not_unique,\r\n dq.patient_id_missing as patient_id_missing,\r\n dq.claim_start_date_not_unique as claim_start_date_not_unique,\r\n dq.claim_start_date_missing as claim_start_date_missing,\r\n dq.claim_end_date_not_unique as claim_end_date_not_unique,\r\n dq.claim_end_date_missing as claim_end_date_missing,\r\n dq.claim_start_date_after_claim_end_date\r\n as claim_start_date_after_claim_end_date,\r\n dq.admission_date_not_unique as admission_date_not_unique,\r\n dq.admission_date_missing as admission_date_missing,\r\n dq.discharge_date_not_unique as discharge_date_not_unique,\r\n dq.discharge_date_missing as discharge_date_missing,\r\n dq.admission_date_after_discharge_date\r\n as admission_date_after_discharge_date,\r\n dq.admit_type_code_not_unique\r\n as admit_type_code_not_unique,\r\n dq.admit_type_code_missing\r\n as admit_type_code_missing,\r\n dq.admit_source_code_not_unique\r\n as admit_source_code_not_unique,\r\n dq.admit_source_code_missing\r\n as admit_source_code_missing,\r\n dq.discharge_disposition_code_not_unique\r\n as discharge_disposition_code_not_unique,\r\n dq.discharge_disposition_code_missing\r\n as discharge_disposition_code_missing,\r\n dq.facility_npi_not_unique as facility_npi_not_unique,\r\n dq.facility_npi_missing as facility_npi_missing,\r\n dq.claim_type_not_unique as claim_type_not_unique,\r\n dq.claim_type_missing as claim_type_missing,\r\n dq.claim_type_not_institutional as claim_type_not_institutional,\r\n h.data_source,\r\n '{{ var('tuva_last_run')}}' as tuva_last_run\r\n\r\nfrom header_level_values h\r\nleft join data_quality_flags dq\r\n on h.claim_id = dq.claim_id", "language": "sql", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/the_tuva_project", "path": "claims_preprocessing/emergency_department/intermediate/emergency_department__int_institutional_claims.sql", "original_file_path": "models/claims_preprocessing/emergency_department/intermediate/emergency_department__int_institutional_claims.sql", "name": "emergency_department__int_institutional_claims", "alias": "_int_emergency_department_institutional_claims", "checksum": {"name": "sha256", "checksum": "398f97d285ec419ae74565b0ddd06e91672451e7a2f91e6b6d001881933f0186"}, "tags": ["emergency_department", "claims_preprocessing"], "refs": [["medical_claim"], ["service_category__service_category_grouper"]], "sources": [], "metrics": [], "description": "All emergency_department institutional claim_ids with header values and data quality flags", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://models/claims_preprocessing/claims_preprocessing_models.yml", "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_emergency_department_institutional_claims", "tags": ["emergency_department", "claims_preprocessing"], "materialized": "table", "enabled": true, "bind": false}, "created_at": 1701215339.9874759}, "model.the_tuva_project.emergency_department__int_encounter_start_and_end_dates": {"resource_type": "model", "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.emergency_department__int_institutional_claims", "model.the_tuva_project.emergency_department__int_institutional_encounter_id"]}, "config": {"enabled": true, "alias": "_int_emergency_department_encounter_start_and_end_dates", "schema": "claims_preprocessing", "database": null, "tags": ["emergency_department", "claims_preprocessing"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "bind": false, "post-hook": [], "pre-hook": []}, "database": "dev_sarah", "schema": "claims_preprocessing", "fqn": ["the_tuva_project", "claims_preprocessing", "emergency_department", "intermediate", "emergency_department__int_encounter_start_and_end_dates"], "unique_id": "model.the_tuva_project.emergency_department__int_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\nwith add_encounter_id_to_emergency_department_encounters as (\r\nselect\r\n aip.claim_id as claim_id,\r\n aip.patient_id as patient_id,\r\n aip.start_date as start_date,\r\n aip.end_date as end_date,\r\n eid.encounter_id as encounter_id\r\nfrom {{ ref('emergency_department__int_institutional_claims') }} aip\r\nleft join {{ ref('emergency_department__int_institutional_encounter_id') }} eid\r\n on aip.patient_id = eid.patient_id\r\n and aip.claim_id = eid.claim_id\r\n),\r\n\r\nencounter_start_and_end_dates as (\r\nselect\r\n patient_id,\r\n encounter_id,\r\n min(start_date) as encounter_start_date,\r\n max(end_date) as encounter_end_date\r\nfrom add_encounter_id_to_emergency_department_encounters\r\ngroup by patient_id, encounter_id\r\n)\r\n\r\nselect \r\n patient_id\r\n , encounter_id\r\n , encounter_start_date\r\n , encounter_end_date\r\n , coalesce(encounter_start_date, encounter_end_date) as determined_encounter_start_date\r\n , coalesce(encounter_end_date, encounter_start_date) as determined_encounter_end_date\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom encounter_start_and_end_dates", "language": "sql", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/the_tuva_project", "path": "claims_preprocessing/emergency_department/intermediate/emergency_department__int_encounter_start_and_end_dates.sql", "original_file_path": "models/claims_preprocessing/emergency_department/intermediate/emergency_department__int_encounter_start_and_end_dates.sql", "name": "emergency_department__int_encounter_start_and_end_dates", "alias": "_int_emergency_department_encounter_start_and_end_dates", "checksum": {"name": "sha256", "checksum": "ad00019be1b1cb0144f2ae596cea2ee9b8ad12b82791296e85d6f830d61b9ba1"}, "tags": ["emergency_department", "claims_preprocessing"], "refs": [["emergency_department__int_institutional_claims"], ["emergency_department__int_institutional_encounter_id"]], "sources": [], "metrics": [], "description": "Defines encounter start and end dates for emergency_department encounters", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://models/claims_preprocessing/claims_preprocessing_models.yml", "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_emergency_department_encounter_start_and_end_dates", "tags": ["emergency_department", "claims_preprocessing"], "materialized": "table", "enabled": true, "bind": false}, "created_at": 1701215339.983597}, "model.the_tuva_project.emergency_department__int_last_claim_values": {"resource_type": "model", "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.emergency_department__int_encounter_id", "model.input_layer.medical_claim"]}, "config": {"enabled": true, "alias": "_int_emergency_department_last_claim_values", "schema": "claims_preprocessing", "database": null, "tags": ["emergency_department", "claims_preprocessing"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "bind": false, "post-hook": [], "pre-hook": []}, "database": "dev_sarah", "schema": "claims_preprocessing", "fqn": ["the_tuva_project", "claims_preprocessing", "emergency_department", "intermediate", "emergency_department__int_last_claim_values"], "unique_id": "model.the_tuva_project.emergency_department__int_last_claim_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 first_claim_values as(\r\n select distinct\r\n e.encounter_id\r\n , coalesce(claim_start_date, admission_date) as claim_start\r\n , discharge_disposition_code\r\n from {{ ref('emergency_department__int_encounter_id')}} e\r\n inner join {{ ref('medical_claim') }} m\r\n on e.claim_id = m.claim_id\r\n where claim_type = 'institutional'\r\n)\r\n\r\nselect\r\n encounter_id\r\n , claim_start\r\n , discharge_disposition_code\r\n , row_number() over (partition by encounter_id order by claim_start desc) as claim_row\r\nfrom first_claim_values", "language": "sql", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/the_tuva_project", "path": "claims_preprocessing/emergency_department/intermediate/emergency_department__int_last_claim_values.sql", "original_file_path": "models/claims_preprocessing/emergency_department/intermediate/emergency_department__int_last_claim_values.sql", "name": "emergency_department__int_last_claim_values", "alias": "_int_emergency_department_last_claim_values", "checksum": {"name": "sha256", "checksum": "f2a15c429ab8316ffcdb4973b832970f4f39d644e2d3f1caf8be187d9299bac5"}, "tags": ["emergency_department", "claims_preprocessing"], "refs": [["emergency_department__int_encounter_id"], ["medical_claim"]], "sources": [], "metrics": [], "description": "Orders claims to pull out encounter details (discharge disposition, etc)", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://models/claims_preprocessing/claims_preprocessing_models.yml", "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_emergency_department_last_claim_values", "tags": ["emergency_department", "claims_preprocessing"], "materialized": "table", "enabled": true, "bind": false}, "created_at": 1701215339.992917}, "model.the_tuva_project.emergency_department__int_professional_encounter_id": {"resource_type": "model", "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.service_category__service_category_grouper", "model.input_layer.medical_claim", "model.the_tuva_project.emergency_department__int_encounter_start_and_end_dates"]}, "config": {"enabled": true, "alias": "_int_emergency_department_professional_encounter_id", "schema": "claims_preprocessing", "database": null, "tags": ["emergency_department", "claims_preprocessing"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "bind": false, "post-hook": [], "pre-hook": []}, "database": "dev_sarah", "schema": "claims_preprocessing", "fqn": ["the_tuva_project", "claims_preprocessing", "emergency_department", "intermediate", "emergency_department__int_professional_encounter_id"], "unique_id": "model.the_tuva_project.emergency_department__int_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\nwith emergency_department_professional_claim_ids as (\r\nselect \r\n claim_id\r\n , claim_line_number\r\nfrom {{ ref('service_category__service_category_grouper') }} \r\nwhere claim_type = 'professional'\r\n and service_category_2 = 'Emergency Department'\r\n),\r\n\r\nemergency_department_professional_claim_lines as (\r\nselect\r\n mc.claim_id\r\n , mc.claim_line_number\r\n , mc.patient_id\r\n , mc.claim_start_date as start_date\r\n , mc.claim_end_date as end_date\t \r\nfrom {{ ref('medical_claim') }} mc\r\ninner join emergency_department_professional_claim_ids prof\r\n on mc.claim_id = prof.claim_id\r\n and mc.claim_line_number = prof.claim_line_number\r\n),\r\n\r\n\r\nemergency_department_professional_claim_dates as (\r\nselect\r\n claim_id\r\n , claim_line_number\r\n , patient_id\r\n , min(start_date) as start_date\r\n , max(end_date) as end_date\r\nfrom emergency_department_professional_claim_lines\r\ngroup by \r\n claim_id\r\n , claim_line_number\r\n , patient_id\r\n),\r\n\r\n\r\nroll_up_professional_claims_to_institutional_claims as (\r\n select\r\n aa.patient_id\r\n , aa.claim_id\r\n , aa.claim_line_number\r\n , aa.start_date\r\n , aa.end_date\r\n , bb.encounter_id\r\n , case\r\n when bb.encounter_id is null then 1\r\n else 0\r\n end as orphan_claim_flag\r\n from emergency_department_professional_claim_dates aa\r\n left join {{ ref('emergency_department__int_encounter_start_and_end_dates') }} bb\r\n on aa.patient_id = bb.patient_id\r\n and (coalesce(aa.start_date, aa.end_date) between coalesce(bb.encounter_start_date, bb.determined_encounter_start_date) and coalesce(bb.encounter_end_date, bb.determined_encounter_end_date))\r\n and (coalesce(aa.end_date, aa.start_date) between coalesce(bb.encounter_start_date, bb.determined_encounter_start_date) and coalesce(bb.encounter_end_date, bb.determined_encounter_end_date))\r\n),\r\n\r\nprofessional_claims_in_more_than_one_encounter as (\r\nselect\r\n patient_id\r\n , claim_id\r\n , claim_line_number\r\n , min(start_date) as start_date\r\n , max(end_date) as end_date\r\n , count(distinct encounter_id) as encounter_count\r\nfrom roll_up_professional_claims_to_institutional_claims\r\ngroup by patient_id, claim_id, claim_line_number\r\nhaving count(distinct encounter_id) > 1\r\n),\r\n\r\n\r\nprofessional_claims_not_in_more_than_one_encounter as (\r\nselect\r\n aa.patient_id,\r\n aa.claim_id,\r\n aa.claim_line_number,\r\n aa.start_date,\r\n aa.end_date,\r\n aa.encounter_id,\r\n aa.orphan_claim_flag,\r\n case\r\n when (aa.orphan_claim_flag = 1) then 0\r\n else 1\r\n end as encounter_count\r\nfrom roll_up_professional_claims_to_institutional_claims aa\r\nleft join professional_claims_in_more_than_one_encounter bb\r\non aa.claim_id = bb.claim_id\r\nand aa.claim_line_number = bb.claim_line_number\r\nand aa.patient_id = bb.patient_id\r\nwhere (bb.patient_id is null) and (bb.claim_id is null)\r\n),\r\n\r\n\r\nall_emergency_department_professional_claims as (\r\nselect\r\n patient_id,\r\n claim_id,\r\n claim_line_number,\r\n start_date,\r\n end_date,\r\n encounter_id,\r\n orphan_claim_flag,\r\n encounter_count\r\nfrom professional_claims_not_in_more_than_one_encounter\r\n\r\nunion all\r\n\r\nselect\r\n patient_id,\r\n claim_id,\r\n claim_line_number,\r\n start_date,\r\n end_date,\r\n null as encounter_id,\r\n 0 as orphan_claim_count,\r\n encounter_count\r\nfrom professional_claims_in_more_than_one_encounter\r\n)\r\n\r\n\r\n\r\nselect *, '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom all_emergency_department_professional_claims", "language": "sql", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/the_tuva_project", "path": "claims_preprocessing/emergency_department/intermediate/emergency_department__int_professional_encounter_id.sql", "original_file_path": "models/claims_preprocessing/emergency_department/intermediate/emergency_department__int_professional_encounter_id.sql", "name": "emergency_department__int_professional_encounter_id", "alias": "_int_emergency_department_professional_encounter_id", "checksum": {"name": "sha256", "checksum": "dd4b55e8de1f3e257c9f64039c0404a57eaee1a9fd7493a5fcdf6d8a4feb82e6"}, "tags": ["emergency_department", "claims_preprocessing"], "refs": [["service_category__service_category_grouper"], ["medical_claim"], ["emergency_department__int_encounter_start_and_end_dates"]], "sources": [], "metrics": [], "description": "Assigns encounter_id to every emergency_department professional claim", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://models/claims_preprocessing/claims_preprocessing_models.yml", "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_emergency_department_professional_encounter_id", "tags": ["emergency_department", "claims_preprocessing"], "materialized": "table", "enabled": true, "bind": false}, "created_at": 1701215339.990985}, "model.the_tuva_project.emergency_department__int_institutional_encounter_id": {"resource_type": "model", "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.emergency_department__int_institutional_claims"]}, "config": {"enabled": true, "alias": "_int_emergency_department_institutional_encounter_id", "schema": "claims_preprocessing", "database": null, "tags": ["emergency_department", "claims_preprocessing"], "meta": {}, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "bind": false, "post-hook": [], "pre-hook": []}, "database": "dev_sarah", "schema": "claims_preprocessing", "fqn": ["the_tuva_project", "claims_preprocessing", "emergency_department", "intermediate", "emergency_department__int_institutional_encounter_id"], "unique_id": "model.the_tuva_project.emergency_department__int_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\nwith add_row_num as (\r\nselect\r\n patient_id,\r\n claim_id,\r\n start_date,\r\n end_date,\r\n discharge_disposition_code,\r\n facility_npi,\r\n row_number() over (partition by patient_id order by end_date, start_date, claim_id) as row_num\r\nfrom {{ ref('emergency_department__int_institutional_claims') }}\r\n),\r\n\r\ncheck_for_merges_with_larger_row_num as (\r\nselect\r\n aa.patient_id,\r\n aa.claim_id as claim_id_a,\r\n bb.claim_id as claim_id_b,\r\n aa.row_num as row_num_a,\r\n bb.row_num as row_num_b,\r\n case\r\n -- Claims with same end_date and same facility_npi should be merged:\r\n when (aa.end_date = bb.end_date\r\n and aa.facility_npi = bb.facility_npi) then 1\r\n -- Claims with different end_date \r\n -- should be merged if they overlap:\r\n when ( (aa.end_date <> bb.end_date) and \r\n (aa.end_date >= bb.start_date) and --overlap requirement\r\n (aa.facility_npi = bb.facility_npi)\r\n\t )then 1\r\n else 0\r\n end as merge_flag\r\nfrom add_row_num aa\r\n inner join add_row_num bb\r\n on aa.patient_id = bb.patient_id\r\n and aa.row_num < bb.row_num\r\n),\r\n\r\nmerges_with_larger_row_num as (\r\nselect\r\n patient_id,\r\n claim_id_a,\r\n claim_id_b,\r\n row_num_a,\r\n row_num_b,\r\n merge_flag\r\nfrom check_for_merges_with_larger_row_num\r\nwhere merge_flag = 1\r\n),\r\n\r\n\r\nclaim_ids_that_merge_with_larger_row_num as (\r\nselect distinct claim_id_a as claim_id\r\nfrom merges_with_larger_row_num\r\n),\r\n\r\n\r\nclaim_ids_having_a_smaller_row_num_merging_with_a_larger_row_num as (\r\nselect distinct aa.claim_id as claim_id\r\nfrom add_row_num aa\r\n inner join\r\n merges_with_larger_row_num bb\r\n on aa.patient_id = bb.patient_id\r\n and bb.row_num_a < aa.row_num\r\n and bb.row_num_b > aa.row_num\r\n),\r\n\r\n\r\nclose_flags as (\r\nselect\r\n aa.patient_id,\r\n aa.claim_id,\r\n aa.start_date,\r\n aa.end_date,\r\n aa.discharge_disposition_code,\r\n aa.facility_npi,\r\n aa.row_num,\r\n case when (bb.claim_id is null and cc.claim_id is null) then 1\r\n else 0\r\n end as close_flag\r\n\r\nfrom add_row_num aa\r\n\r\nleft join claim_ids_that_merge_with_larger_row_num bb\r\non aa.claim_id = bb.claim_id\r\n\r\nleft join claim_ids_having_a_smaller_row_num_merging_with_a_larger_row_num cc\r\non aa.claim_id = cc.claim_id\r\n),\r\n\r\n\r\njoin_every_row_to_later_closes as (\r\nselect\r\n aa.patient_id as patient_id,\r\n aa.claim_id as claim_id,\r\n aa.row_num as row_num,\r\n bb.row_num as row_num_b\r\nfrom close_flags aa inner join close_flags bb\r\n on aa.patient_id = bb.patient_id\r\n and aa.row_num <= bb.row_num\r\nwhere bb.close_flag = 1\r\n),\r\n\r\n\r\nfind_min_closing_row_num_for_every_claim as (\r\nselect\r\n patient_id,\r\n claim_id,\r\n min(row_num_b) as min_closing_row\r\nfrom join_every_row_to_later_closes\r\ngroup by patient_id, claim_id\r\n),\r\n\r\n\r\nadd_min_closing_row_to_every_claim as (\r\nselect\r\n aa.patient_id as patient_id,\r\n aa.claim_id as claim_id,\r\n aa.start_date as start_date,\r\n aa.end_date as end_date,\r\n aa.discharge_disposition_code as discharge_disposition_code,\r\n aa.facility_npi as facility_npi,\r\n aa.row_num as row_num,\r\n aa.close_flag as close_flag,\r\n bb.min_closing_row as min_closing_row\r\nfrom close_flags aa\r\n left join find_min_closing_row_num_for_every_claim bb\r\n on aa.patient_id = bb.patient_id\r\n and aa.claim_id = bb.claim_id\r\n),\r\n\r\n\r\nadd_encounter_id as (\r\nselect\r\n aa.patient_id as patient_id,\r\n aa.claim_id as claim_id,\r\n aa.start_date as start_date,\r\n aa.end_date as end_date,\r\n aa.discharge_disposition_code as discharge_disposition_code,\r\n aa.facility_npi as facility_npi,\r\n aa.row_num as row_num,\r\n aa.close_flag as close_flag,\r\n aa.min_closing_row as min_closing_row,\r\n bb.claim_id as encounter_id\r\nfrom add_min_closing_row_to_every_claim aa\r\n left join add_min_closing_row_to_every_claim bb\r\n on aa.patient_id = bb.patient_id\r\n and aa.min_closing_row = bb.row_num\r\n)\r\n\r\nselect *, '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom add_encounter_id", "language": "sql", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/the_tuva_project", "path": "claims_preprocessing/emergency_department/intermediate/emergency_department__int_institutional_encounter_id.sql", "original_file_path": "models/claims_preprocessing/emergency_department/intermediate/emergency_department__int_institutional_encounter_id.sql", "name": "emergency_department__int_institutional_encounter_id", "alias": "_int_emergency_department_institutional_encounter_id", "checksum": {"name": "sha256", "checksum": "47389ee5e825ebe802761f9ee313c78f1464b0b094d2b6043c037947c1a8eafd"}, "tags": ["emergency_department", "claims_preprocessing"], "refs": [["emergency_department__int_institutional_claims"]], "sources": [], "metrics": [], "description": "Assigns encounter_id to every emergency_department institutional claim", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://models/claims_preprocessing/claims_preprocessing_models.yml", "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_emergency_department_institutional_encounter_id", "tags": ["emergency_department", "claims_preprocessing"], "enabled": true, "bind": false}, "created_at": 1701215339.9891782}, "model.the_tuva_project.data_profiling__test_result": {"resource_type": "model", "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"]}, "config": {"enabled": true, "alias": "test_result", "schema": "claims_preprocessing", "database": null, "tags": ["data_profiling", "claims_preprocessing"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#141161"}, "bind": false, "post-hook": [], "pre-hook": []}, "database": "dev_sarah", "schema": "claims_preprocessing", "fqn": ["the_tuva_project", "claims_preprocessing", "data_profiling", "final", "data_profiling__test_result"], "unique_id": "model.the_tuva_project.data_profiling__test_result", "raw_code": "{{ config(\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\n )\n}}\n\nselect * from {{ ref('data_profiling__test_result_stage_medical_claim') }}\n\nunion all\n\nselect * from {{ ref('data_profiling__test_result_stage_eligibility') }}\n\nunion all\n\nselect * from {{ ref('data_profiling__test_result_stage_pharmacy_claim') }}", "language": "sql", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/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", "name": "data_profiling__test_result", "alias": "test_result", "checksum": {"name": "sha256", "checksum": "4ad5e69dbc36f94ea7c31f9afb5c0d8629ed305c2d0368874edda5f6f7b64650"}, "tags": ["data_profiling", "claims_preprocessing"], "refs": [["data_profiling__test_result_stage_medical_claim"], ["data_profiling__test_result_stage_eligibility"], ["data_profiling__test_result_stage_pharmacy_claim"]], "sources": [], "metrics": [], "description": "", "columns": {"source_table": {"name": "source_table", "description": "Table this test is in reference to", "meta": {}, "data_type": null, "quote": null, "tags": []}, "grain": {"name": "grain", "description": "Grain of the test", "meta": {}, "data_type": null, "quote": null, "tags": []}, "test_category": {"name": "test_category", "description": "Category of test", "meta": {}, "data_type": null, "quote": null, "tags": []}, "test_name": {"name": "test_name", "description": "Name of the test being performed", "meta": {}, "data_type": null, "quote": null, "tags": []}, "claim_type": {"name": "claim_type", "description": "Specific claim type, if any, that this test is specific to", "meta": {}, "data_type": null, "quote": null, "tags": []}, "failures": {"name": "failures", "description": "Number of failures of this test", "meta": {}, "data_type": "integer", "quote": null, "tags": []}, "denominator": {"name": "denominator", "description": "Total number of records analyzed for this test", "meta": {}, "data_type": "integer", "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The time at with the model was materialized. Generated by `dbt_utils.pretty_time` as the local time of the `dbt run` environment. Timezone is configurable via the `tuva_last_run` var.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": "#141161"}, "patch_path": "the_tuva_project://models/claims_preprocessing/claims_preprocessing_models.yml", "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "test_result", "tags": ["data_profiling", "claims_preprocessing"], "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#141161"}}, "created_at": 1701215339.9690838}, "model.the_tuva_project.data_profiling__use_case": {"resource_type": "model", "depends_on": {"macros": [], "nodes": ["model.input_layer.medical_claim", "model.the_tuva_project.data_profiling__test_detail", "model.input_layer.medical_claim", "model.the_tuva_project.data_profiling__test_detail", "model.input_layer.medical_claim", "model.the_tuva_project.data_profiling__test_detail", "model.input_layer.medical_claim", "model.the_tuva_project.data_profiling__test_detail", "model.input_layer.pharmacy_claim", "model.the_tuva_project.data_profiling__test_detail", "model.input_layer.eligibility", "model.the_tuva_project.data_profiling__test_detail", "model.input_layer.medical_claim", "model.the_tuva_project.data_profiling__test_detail", "model.input_layer.pharmacy_claim", "model.the_tuva_project.data_profiling__test_detail"]}, "config": {"enabled": true, "alias": "use_case", "schema": "claims_preprocessing", "database": null, "tags": ["data_profiling", "claims_preprocessing"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#141161"}, "bind": false, "post-hook": [], "pre-hook": []}, "database": "dev_sarah", "schema": "claims_preprocessing", "fqn": ["the_tuva_project", "claims_preprocessing", "data_profiling", "final", "data_profiling__use_case"], "unique_id": "model.the_tuva_project.data_profiling__use_case", "raw_code": "{{ config(\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\n )\n}}\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 {{ ref('medical_claim') }}) as denominator\n from {{ ref('data_profiling__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 {{ ref('medical_claim') }} ) as denominator\n from {{ ref('data_profiling__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 {{ ref('medical_claim') }} ) as denominator\n from {{ ref('data_profiling__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 {{ ref('medical_claim') }} ) as denominator\n from {{ ref('data_profiling__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 {{ ref('pharmacy_claim') }} ) as denominator\n from {{ ref('data_profiling__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 {{ ref('eligibility') }} ) as denominator\n from {{ ref('data_profiling__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 {{ ref('medical_claim') }} ) as denominator\n from {{ ref('data_profiling__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 {{ ref('pharmacy_claim') }} ) as denominator\n from {{ ref('data_profiling__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 *, '{{ var('tuva_last_run')}}' as tuva_last_run from use_case_stage", "language": "sql", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/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", "name": "data_profiling__use_case", "alias": "use_case", "checksum": {"name": "sha256", "checksum": "9560ca72885aa48a2d344fc6c977bdac513b0e232f53feb0bb92de8aa1feab73"}, "tags": ["data_profiling", "claims_preprocessing"], "refs": [["medical_claim"], ["data_profiling__test_detail"], ["medical_claim"], ["data_profiling__test_detail"], ["medical_claim"], ["data_profiling__test_detail"], ["medical_claim"], ["data_profiling__test_detail"], ["pharmacy_claim"], ["data_profiling__test_detail"], ["eligibility"], ["data_profiling__test_detail"], ["medical_claim"], ["data_profiling__test_detail"], ["pharmacy_claim"], ["data_profiling__test_detail"]], "sources": [], "metrics": [], "description": "", "columns": {"use_case": {"name": "use_case", "description": "The mart or logic that would be affected by test failures", "meta": {}, "data_type": null, "quote": null, "tags": []}, "source_table": {"name": "source_table", "description": "Table this use case is in reference to", "meta": {}, "data_type": null, "quote": null, "tags": []}, "test_name": {"name": "test_name", "description": "Name of the test being performed", "meta": {}, "data_type": null, "quote": null, "tags": []}, "failures": {"name": "failures", "description": "Number of failures of this test", "meta": {}, "data_type": "integer", "quote": null, "tags": []}, "denominator": {"name": "denominator", "description": "Total number of records analyzed for this test", "meta": {}, "data_type": "integer", "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": "#141161"}, "patch_path": "the_tuva_project://models/claims_preprocessing/claims_preprocessing_models.yml", "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "use_case", "tags": ["data_profiling", "claims_preprocessing"], "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#141161"}}, "created_at": 1701215339.9720042}, "model.the_tuva_project.data_profiling__test_detail": {"resource_type": "model", "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"]}, "config": {"enabled": true, "alias": "test_detail", "schema": "claims_preprocessing", "database": null, "tags": ["data_profiling", "claims_preprocessing"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#141161"}, "bind": false, "post-hook": [], "pre-hook": []}, "database": "dev_sarah", "schema": "claims_preprocessing", "fqn": ["the_tuva_project", "claims_preprocessing", "data_profiling", "final", "data_profiling__test_detail"], "unique_id": "model.the_tuva_project.data_profiling__test_detail", "raw_code": "{{ config(\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\n )\n}}\n\nwith test_detail_union as(\n\nselect * from {{ ref('data_profiling__test_detail_stage_medical_claim') }}\nunion all\nselect * from {{ ref('data_profiling__test_detail_stage_eligibility') }}\nunion all\nselect * from {{ ref('data_profiling__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 , '{{ var('tuva_last_run')}}' as tuva_last_run\nfrom test_detail_union", "language": "sql", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/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", "name": "data_profiling__test_detail", "alias": "test_detail", "checksum": {"name": "sha256", "checksum": "b6f7005a1254d3e3b83f0ae68adca8941e1dddcb6b67f629edfe0265b51b84b3"}, "tags": ["data_profiling", "claims_preprocessing"], "refs": [["data_profiling__test_detail_stage_medical_claim"], ["data_profiling__test_detail_stage_eligibility"], ["data_profiling__test_detail_stage_pharmacy_claim"]], "sources": [], "metrics": [], "description": "", "columns": {"source_table": {"name": "source_table", "description": "Table this test is in reference to", "meta": {}, "data_type": null, "quote": null, "tags": []}, "test_category": {"name": "test_category", "description": "Category of test", "meta": {}, "data_type": null, "quote": null, "tags": []}, "test_name": {"name": "test_name", "description": "Name of the test being performed", "meta": {}, "data_type": null, "quote": null, "tags": []}, "grain": {"name": "grain", "description": "Grain of the test", "meta": {}, "data_type": null, "quote": null, "tags": []}, "claim_type": {"name": "claim_type", "description": "Specific claim type, if any, that this test is specific to", "meta": {}, "data_type": null, "quote": null, "tags": []}, "foreign_key": {"name": "foreign_key", "description": "The column this table can be used to join back to the source table", "meta": {}, "data_type": null, "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The time at with the model was materialized. Generated by `dbt_utils.pretty_time` as the local time of the `dbt run` environment. Timezone is configurable via the `tuva_last_run` var.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": "#141161"}, "patch_path": "the_tuva_project://models/claims_preprocessing/claims_preprocessing_models.yml", "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "test_detail", "tags": ["data_profiling", "claims_preprocessing"], "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#141161"}}, "created_at": 1701215339.96579}, "model.the_tuva_project.data_profiling__summary": {"resource_type": "model", "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"]}, "config": {"enabled": true, "alias": "data_profiling_summary", "schema": "claims_preprocessing", "database": null, "tags": ["data_profiling", "claims_preprocessing"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#141161"}, "bind": false, "post-hook": [], "pre-hook": []}, "database": "dev_sarah", "schema": "claims_preprocessing", "fqn": ["the_tuva_project", "claims_preprocessing", "data_profiling", "final", "data_profiling__summary"], "unique_id": "model.the_tuva_project.data_profiling__summary", "raw_code": "{{ config(\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\n )\n}}\n\nwith test_failure_summary as (\n select\n cast(source_table as {{ dbt.type_string() }} ) as source_table\n , cast(grain as {{ dbt.type_string() }} ) as grain\n , cast(test_category as {{ dbt.type_string() }} ) as test_category\n , cast(count(distinct foreign_key) as int) as counts\n from {{ ref('data_profiling__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 {{ dbt.type_string() }} ) as source_table\n , cast(grain as {{ dbt.type_string() }} ) as grain\n , cast(test_category as {{ dbt.type_string() }} ) 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 {{ dbt.type_string() }} ) as source_table\n , cast('claim_id' as {{ dbt.type_string() }} ) as grain\n , cast('duplicate_claims' as {{ dbt.type_string() }} ) as test_category\n , cast(0 as int) as counts\n ) failure_stub\n where not exists (select 1 from {{ ref('data_profiling__medical_claim_duplicates' )}} )\n union all\n select * from (\n select\n cast('medical_claim' as {{ dbt.type_string() }} ) as source_table\n , cast('claim_id' as {{ dbt.type_string() }} ) as grain\n , cast('claim_type' as {{ dbt.type_string() }} ) as test_category\n , cast(0 as int) as counts \n ) failure_stub\n where not exists (select 1 from {{ ref('data_profiling__claim_type_mapping_failures' )}} )\n and not exists (select 1 from {{ ref('data_profiling__claim_type_unmapped' )}} )\n and not exists (select 1 from {{ ref('data_profiling__medical_claim_inst_missing_values' )}} where test_category = 'claim_type')\n and not exists (select 1 from {{ ref('data_profiling__medical_claim_prof_missing_values' )}} where test_category = 'claim_type')\n union all\n select * from (\n select\n cast('medical_claim' as {{ dbt.type_string() }} ) as source_table\n , cast('claim_id' as {{ dbt.type_string() }} ) as grain\n , cast('header' as {{ dbt.type_string() }} ) as test_category\n , cast(0 as int) as counts\n ) failure_stub\n where not exists (select 1 from {{ ref('data_profiling__institutional_header_fail_details' )}} )\n and not exists (select 1 from {{ ref('data_profiling__professional_header_fail_details' )}} )\n union all\n select * from (\n select\n cast('medical_claim' as {{ dbt.type_string() }} ) as source_table\n , cast('claim_id' as {{ dbt.type_string() }} ) as grain\n , cast('invalid_values' as {{ dbt.type_string() }} ) as test_category\n , cast(0 as int) as counts\n ) failure_stub\n where not exists (select 1 from {{ ref('data_profiling__medical_claim_invalid_values' )}} )\n union all\n select * from (\n select\n cast('medical_claim' as {{ dbt.type_string() }} ) as source_table\n , cast('claim_id' as {{ dbt.type_string() }} ) as grain\n , cast('missing_values' as {{ dbt.type_string() }} ) as test_category\n , cast(0 as int) as counts\n ) failure_stub\n where not exists (select 1 from {{ ref('data_profiling__medical_claim_inst_missing_values' )}} )\n and not exists (select 1 from {{ ref('data_profiling__medical_claim_prof_missing_values' )}} )\n\n /**** eligibility ****/\n union all\n select * from (\n select\n cast('eligibility' as {{ dbt.type_string() }} ) as source_table\n , cast('patient_id' as {{ dbt.type_string() }} ) as grain\n , cast('duplicate_eligibility' as {{ dbt.type_string() }} ) as test_category\n , cast(0 as int) as counts\n ) failure_stub\n where not exists (select 1 from {{ ref('data_profiling__eligibility_duplicates' )}} )\n union all\n select * from (\n select\n cast('eligibility' as {{ dbt.type_string() }} ) as source_table\n , cast('patient_id' as {{ dbt.type_string() }} ) as grain\n , cast('invalid_values' as {{ dbt.type_string() }} ) as test_category\n , cast(0 as int) as counts\n ) failure_stub\n where not exists (select 1 from {{ ref('data_profiling__eligibility_invalid_values' )}} )\n union all\n select * from (\n select\n cast('eligibility' as {{ dbt.type_string() }} ) as source_table\n , cast('patient_id' as {{ dbt.type_string() }} ) as grain\n , cast('missing_values' as {{ dbt.type_string() }} ) as test_category\n , cast(0 as int) as counts\n ) failure_stub\n where not exists (select 1 from {{ ref('data_profiling__eligibility_missing_values' )}} )\n\n /**** pharmacy_claim ****/\n union all\n select * from (\n select\n cast('pharmacy_claim' as {{ dbt.type_string() }} ) as source_table\n , cast('claim_id' as {{ dbt.type_string() }} ) as grain\n , cast('duplicate_claims' as {{ dbt.type_string() }} ) as test_category\n , cast(0 as int) as counts\n ) failure_stub\n where not exists (select 1 from {{ ref('data_profiling__pharmacy_claim_duplicates' )}} )\n union all\n select * from (\n select\n cast('pharmacy_claim' as {{ dbt.type_string() }} ) as source_table\n , cast('claim_id' as {{ dbt.type_string() }} ) as grain\n , cast('missing_values' as {{ dbt.type_string() }} ) as test_category\n , cast(0 as int) as counts\n ) failure_stub\n where not exists (select 1 from {{ ref('data_profiling__pharmacy_claim_missing_values' )}} )\n)\n\nselect \n cast(source_table as {{ dbt.type_string() }} ) 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 {{ dbt.type_string() }} ) as test_category\n , cast(counts as int) as counts\n , '{{ var('tuva_last_run')}}' as tuva_last_run\nfrom summary_union", "language": "sql", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/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", "name": "data_profiling__summary", "alias": "data_profiling_summary", "checksum": {"name": "sha256", "checksum": "0dd13bd86616fc593dafec30e53ce14d07b21dbd6844985ac7a388d67de9c8b3"}, "tags": ["data_profiling", "claims_preprocessing"], "refs": [["data_profiling__test_detail"], ["data_profiling__medical_claim_duplicates"], ["data_profiling__claim_type_mapping_failures"], ["data_profiling__claim_type_unmapped"], ["data_profiling__medical_claim_inst_missing_values"], ["data_profiling__medical_claim_prof_missing_values"], ["data_profiling__institutional_header_fail_details"], ["data_profiling__professional_header_fail_details"], ["data_profiling__medical_claim_invalid_values"], ["data_profiling__medical_claim_inst_missing_values"], ["data_profiling__medical_claim_prof_missing_values"], ["data_profiling__eligibility_duplicates"], ["data_profiling__eligibility_invalid_values"], ["data_profiling__eligibility_missing_values"], ["data_profiling__pharmacy_claim_duplicates"], ["data_profiling__pharmacy_claim_missing_values"]], "sources": [], "metrics": [], "description": "", "columns": {"source_table": {"name": "source_table", "description": "Table this test category is in reference to", "meta": {}, "data_type": null, "quote": null, "tags": []}, "test_category": {"name": "test_category", "description": "Category of test", "meta": {}, "data_type": null, "quote": null, "tags": []}, "counts": {"name": "counts", "description": "Aggregated counts of all tests in this category and table that failed", "meta": {}, "data_type": "integer", "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The time at with the model was materialized. Generated by `dbt_utils.pretty_time` as the local time of the `dbt run` environment. Timezone is configurable via the `tuva_last_run` var.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": "#141161"}, "patch_path": "the_tuva_project://models/claims_preprocessing/claims_preprocessing_models.yml", "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "data_profiling_summary", "tags": ["data_profiling", "claims_preprocessing"], "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#141161"}}, "created_at": 1701215339.962869}, "model.the_tuva_project.data_profiling__eligibility_plausibility": {"resource_type": "model", "depends_on": {"macros": [], "nodes": ["model.input_layer.eligibility", "model.input_layer.eligibility", "model.input_layer.eligibility", "model.input_layer.eligibility", "model.input_layer.eligibility"]}, "config": {"enabled": true, "alias": "_int_eligibility_plausibility", "schema": "claims_preprocessing", "database": null, "tags": ["data_profiling", "claims_preprocessing"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#141161"}, "bind": false, "post-hook": [], "pre-hook": []}, "database": "dev_sarah", "schema": "claims_preprocessing", "fqn": ["the_tuva_project", "claims_preprocessing", "data_profiling", "intermediate", "data_profiling__eligibility_plausibility"], "unique_id": "model.the_tuva_project.data_profiling__eligibility_plausibility", "raw_code": "{{ config(\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\n )\n}}\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 , '{{ var('tuva_last_run')}}' as tuva_last_run\n from {{ ref('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 , '{{ var('tuva_last_run')}}' as tuva_last_run\n from {{ ref('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 , '{{ var('tuva_last_run')}}' as tuva_last_run\n from {{ ref('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 , '{{ var('tuva_last_run')}}' as tuva_last_run\n from {{ ref('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 , '{{ var('tuva_last_run')}}' as tuva_last_run\n from {{ ref('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", "language": "sql", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/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", "name": "data_profiling__eligibility_plausibility", "alias": "_int_eligibility_plausibility", "checksum": {"name": "sha256", "checksum": "d65d16721777a3b7cd4777aca884d731a316aae8ab580892ecd01e3401631ea0"}, "tags": ["data_profiling", "claims_preprocessing"], "refs": [["eligibility"], ["eligibility"], ["eligibility"], ["eligibility"], ["eligibility"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#141161"}, "patch_path": "the_tuva_project://models/claims_preprocessing/claims_preprocessing_models.yml", "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_eligibility_plausibility", "tags": ["data_profiling", "claims_preprocessing"], "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#141161"}}, "created_at": 1701215339.9506402}, "model.the_tuva_project.data_profiling__pharmacy_claim_duplicates": {"resource_type": "model", "depends_on": {"macros": [], "nodes": ["model.input_layer.pharmacy_claim"]}, "config": {"enabled": true, "alias": "_int_pharmacy_claim_duplicates", "schema": "claims_preprocessing", "database": null, "tags": ["data_profiling", "claims_preprocessing"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#141161"}, "bind": false, "post-hook": [], "pre-hook": []}, "database": "dev_sarah", "schema": "claims_preprocessing", "fqn": ["the_tuva_project", "claims_preprocessing", "data_profiling", "intermediate", "data_profiling__pharmacy_claim_duplicates"], "unique_id": "model.the_tuva_project.data_profiling__pharmacy_claim_duplicates", "raw_code": "{{ config(\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\n )\n}}\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 , '{{ var('tuva_last_run')}}' as tuva_last_run\nfrom {{ ref('pharmacy_claim') }} \ngroup by\n claim_id\n , claim_line_number\nhaving count(*) > 1", "language": "sql", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/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", "name": "data_profiling__pharmacy_claim_duplicates", "alias": "_int_pharmacy_claim_duplicates", "checksum": {"name": "sha256", "checksum": "d78e3a8170d1ce98da3e14db298ef92086c164bb681009da5612f65a42770b34"}, "tags": ["data_profiling", "claims_preprocessing"], "refs": [["pharmacy_claim"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#141161"}, "patch_path": "the_tuva_project://models/claims_preprocessing/claims_preprocessing_models.yml", "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_pharmacy_claim_duplicates", "tags": ["data_profiling", "claims_preprocessing"], "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#141161"}}, "created_at": 1701215339.954548}, "model.the_tuva_project.data_profiling__institutional_header_fail_details": {"resource_type": "model", "depends_on": {"macros": ["macro.the_tuva_project.header_duplicate_check"], "nodes": ["model.the_tuva_project.data_profiling__institutional_header_failures"]}, "config": {"enabled": true, "alias": "_int_institutional_header_fail_details", "schema": "claims_preprocessing", "database": null, "tags": ["data_profiling", "claims_preprocessing"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#141161"}, "bind": false, "post-hook": [], "pre-hook": []}, "database": "dev_sarah", "schema": "claims_preprocessing", "fqn": ["the_tuva_project", "claims_preprocessing", "data_profiling", "intermediate", "data_profiling__institutional_header_fail_details"], "unique_id": "model.the_tuva_project.data_profiling__institutional_header_fail_details", "raw_code": "{{ config(\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\n )\n}}\n\n{% set institutional_header_column_list = [\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] -%}\n\n\nwith institutional_header_duplicates as(\n\n {{ header_duplicate_check(builtins.ref('data_profiling__institutional_header_failures'), institutional_header_column_list, 'institutional') }}\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 , '{{ var('tuva_last_run')}}' as tuva_last_run\nfrom institutional_header_duplicates\ngroup by \n claim_id\n , column_checked||' duplicated'", "language": "sql", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/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", "name": "data_profiling__institutional_header_fail_details", "alias": "_int_institutional_header_fail_details", "checksum": {"name": "sha256", "checksum": "cd5c6d15c7180d18e5c5f137352cc933b4b5616ee10d3825ebc35c1ac219833f"}, "tags": ["data_profiling", "claims_preprocessing"], "refs": [["data_profiling__institutional_header_failures"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#141161"}, "patch_path": "the_tuva_project://models/claims_preprocessing/claims_preprocessing_models.yml", "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_institutional_header_fail_details", "tags": ["data_profiling", "claims_preprocessing"], "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#141161"}}, "created_at": 1701215339.9191191}, "model.the_tuva_project.data_profiling__institutional_header_failures": {"resource_type": "model", "depends_on": {"macros": [], "nodes": ["model.input_layer.medical_claim", "model.input_layer.medical_claim"]}, "config": {"enabled": true, "alias": "_int_institutional_header_failures", "schema": "claims_preprocessing", "database": null, "tags": ["data_profiling", "claims_preprocessing"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#141161"}, "bind": false, "post-hook": [], "pre-hook": []}, "database": "dev_sarah", "schema": "claims_preprocessing", "fqn": ["the_tuva_project", "claims_preprocessing", "data_profiling", "intermediate", "data_profiling__institutional_header_failures"], "unique_id": "model.the_tuva_project.data_profiling__institutional_header_failures", "raw_code": "{{ config(\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\n )\n}}\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 {{ ref('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.*, '{{ var('tuva_last_run')}}' as tuva_last_run from claims_with_duplicates dupe\ninner join {{ ref('medical_claim') }} med\n on dupe.claim_id = med.claim_id", "language": "sql", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/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", "name": "data_profiling__institutional_header_failures", "alias": "_int_institutional_header_failures", "checksum": {"name": "sha256", "checksum": "5b41e417c89ffeab3eb7af1f0fc64006aca0e39881e2a8a9677e7783d466d2ea"}, "tags": ["data_profiling", "claims_preprocessing"], "refs": [["medical_claim"], ["medical_claim"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#141161"}, "patch_path": "the_tuva_project://models/claims_preprocessing/claims_preprocessing_models.yml", "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_institutional_header_failures", "tags": ["data_profiling", "claims_preprocessing"], "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#141161"}}, "created_at": 1701215339.915276}, "model.the_tuva_project.data_profiling__test_detail_stage_pharmacy_claim": {"resource_type": "model", "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.data_profiling__pharmacy_claim_duplicates", "model.the_tuva_project.data_profiling__pharmacy_claim_missing_values"]}, "config": {"enabled": true, "alias": "_int_test_detail_stage_pharmacy_claim", "schema": "claims_preprocessing", "database": null, "tags": ["data_profiling", "claims_preprocessing"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#141161"}, "bind": false, "post-hook": [], "pre-hook": []}, "database": "dev_sarah", "schema": "claims_preprocessing", "fqn": ["the_tuva_project", "claims_preprocessing", "data_profiling", "intermediate", "data_profiling__test_detail_stage_pharmacy_claim"], "unique_id": "model.the_tuva_project.data_profiling__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", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/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", "name": "data_profiling__test_detail_stage_pharmacy_claim", "alias": "_int_test_detail_stage_pharmacy_claim", "checksum": {"name": "sha256", "checksum": "c57e4871a6e66fe9e628ea04674fd01484c2cccd36cda5da1d951e2f342c1573"}, "tags": ["data_profiling", "claims_preprocessing"], "refs": [["data_profiling__pharmacy_claim_duplicates"], ["data_profiling__pharmacy_claim_missing_values"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#141161"}, "patch_path": "the_tuva_project://models/claims_preprocessing/claims_preprocessing_models.yml", "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_test_detail_stage_pharmacy_claim", "tags": ["data_profiling", "claims_preprocessing"], "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#141161"}}, "created_at": 1701215339.960213}, "model.the_tuva_project.data_profiling__claim_type_unmapped": {"resource_type": "model", "depends_on": {"macros": [], "nodes": ["model.input_layer.medical_claim"]}, "config": {"enabled": true, "alias": "_int_claim_type_unmapped", "schema": "claims_preprocessing", "database": null, "tags": ["data_profiling", "claims_preprocessing"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#141161"}, "bind": false, "post-hook": [], "pre-hook": []}, "database": "dev_sarah", "schema": "claims_preprocessing", "fqn": ["the_tuva_project", "claims_preprocessing", "data_profiling", "intermediate", "data_profiling__claim_type_unmapped"], "unique_id": "model.the_tuva_project.data_profiling__claim_type_unmapped", "raw_code": "{{ config(\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\n )\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 missing' as test_name\n , '{{ var('tuva_last_run')}}' as tuva_last_run\nfrom {{ ref('medical_claim') }} \nwhere claim_type is null\ngroup by\n claim_id", "language": "sql", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/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", "name": "data_profiling__claim_type_unmapped", "alias": "_int_claim_type_unmapped", "checksum": {"name": "sha256", "checksum": "ab38f90d0218825b1176f99dbb0c8edbaef41f835c1c9354d2ddf44c1e0e132d"}, "tags": ["data_profiling", "claims_preprocessing"], "refs": [["medical_claim"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#141161"}, "patch_path": "the_tuva_project://models/claims_preprocessing/claims_preprocessing_models.yml", "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_claim_type_unmapped", "tags": ["data_profiling", "claims_preprocessing"], "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#141161"}}, "created_at": 1701215339.9133031}, "model.the_tuva_project.data_profiling__claim_type_mapping_failures": {"resource_type": "model", "depends_on": {"macros": [], "nodes": ["model.input_layer.medical_claim"]}, "config": {"enabled": true, "alias": "_int_claim_type_mapping_failures", "schema": "claims_preprocessing", "database": null, "tags": ["data_profiling", "claims_preprocessing"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#141161"}, "bind": false, "post-hook": [], "pre-hook": []}, "database": "dev_sarah", "schema": "claims_preprocessing", "fqn": ["the_tuva_project", "claims_preprocessing", "data_profiling", "intermediate", "data_profiling__claim_type_mapping_failures"], "unique_id": "model.the_tuva_project.data_profiling__claim_type_mapping_failures", "raw_code": "{{ config(\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\n )\n}}\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 {{ ref('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 , '{{ var('tuva_last_run')}}' as tuva_last_run\nfrom claim_type_mapping\nwhere source_claim_type <> data_profiling_claim_type\ngroup by\n claim_id", "language": "sql", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/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", "name": "data_profiling__claim_type_mapping_failures", "alias": "_int_claim_type_mapping_failures", "checksum": {"name": "sha256", "checksum": "5ef4e48b783e4e3682e7fbc7ee628f3887a90f9a4e8f6041f482c6d6e85ecbca"}, "tags": ["data_profiling", "claims_preprocessing"], "refs": [["medical_claim"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#141161"}, "patch_path": "the_tuva_project://models/claims_preprocessing/claims_preprocessing_models.yml", "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_claim_type_mapping_failures", "tags": ["data_profiling", "claims_preprocessing"], "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#141161"}}, "created_at": 1701215339.928637}, "model.the_tuva_project.data_profiling__eligibility_duplicates": {"resource_type": "model", "depends_on": {"macros": [], "nodes": ["model.input_layer.eligibility"]}, "config": {"enabled": true, "alias": "_int_eligibility_duplicates", "schema": "claims_preprocessing", "database": null, "tags": ["data_profiling", "claims_preprocessing"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#141161"}, "bind": false, "post-hook": [], "pre-hook": []}, "database": "dev_sarah", "schema": "claims_preprocessing", "fqn": ["the_tuva_project", "claims_preprocessing", "data_profiling", "intermediate", "data_profiling__eligibility_duplicates"], "unique_id": "model.the_tuva_project.data_profiling__eligibility_duplicates", "raw_code": "{{ config(\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\n )\n}}\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 , '{{ var('tuva_last_run')}}' as tuva_last_run\nfrom {{ ref('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", "language": "sql", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/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", "name": "data_profiling__eligibility_duplicates", "alias": "_int_eligibility_duplicates", "checksum": {"name": "sha256", "checksum": "00a0ee7970c2f9d4389e36931b9acd28ea29defda2d5dd3738b00f3710f6d01c"}, "tags": ["data_profiling", "claims_preprocessing"], "refs": [["eligibility"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#141161"}, "patch_path": "the_tuva_project://models/claims_preprocessing/claims_preprocessing_models.yml", "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_eligibility_duplicates", "tags": ["data_profiling", "claims_preprocessing"], "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#141161"}}, "created_at": 1701215339.941015}, "model.the_tuva_project.data_profiling__medical_claim_invalid_values": {"resource_type": "model", "depends_on": {"macros": [], "nodes": ["model.input_layer.medical_claim", "seed.the_tuva_project.terminology__bill_type", "model.input_layer.medical_claim", "seed.the_tuva_project.terminology__revenue_center", "model.input_layer.medical_claim", "seed.the_tuva_project.terminology__discharge_disposition", "model.input_layer.medical_claim", "seed.the_tuva_project.terminology__admit_source", "model.input_layer.medical_claim", "seed.the_tuva_project.terminology__admit_type", "model.input_layer.medical_claim", "seed.the_tuva_project.terminology__ms_drg", "model.input_layer.medical_claim", "seed.the_tuva_project.terminology__apr_drg", "model.input_layer.medical_claim", "seed.the_tuva_project.terminology__present_on_admission", "model.input_layer.medical_claim", "seed.the_tuva_project.terminology__code_type", "model.input_layer.medical_claim", "seed.the_tuva_project.terminology__place_of_service", "model.input_layer.medical_claim", "seed.the_tuva_project.terminology__code_type", "model.input_layer.medical_claim", "seed.the_tuva_project.terminology__icd_10_cm", "model.input_layer.medical_claim", "seed.the_tuva_project.terminology__claim_type"]}, "config": {"enabled": true, "alias": "_int_medical_claim_invalid_values", "schema": "claims_preprocessing", "database": null, "tags": ["data_profiling", "claims_preprocessing"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#141161"}, "bind": false, "post-hook": [], "pre-hook": []}, "database": "dev_sarah", "schema": "claims_preprocessing", "fqn": ["the_tuva_project", "claims_preprocessing", "data_profiling", "intermediate", "data_profiling__medical_claim_invalid_values"], "unique_id": "model.the_tuva_project.data_profiling__medical_claim_invalid_values", "raw_code": "{{ config(\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\n )\n}}\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 , '{{ var('tuva_last_run')}}' as tuva_last_run\n from {{ ref('medical_claim') }} med\n left join {{ ref('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 , '{{ var('tuva_last_run')}}' as tuva_last_run\n from {{ ref('medical_claim') }} med\n left join {{ ref('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 , '{{ var('tuva_last_run')}}' as tuva_last_run\n from {{ ref('medical_claim') }} med\n left join {{ ref('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 , '{{ var('tuva_last_run')}}' as tuva_last_run\n from {{ ref('medical_claim') }} med\n left join {{ ref('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 , '{{ var('tuva_last_run')}}' as tuva_last_run\n from {{ ref('medical_claim') }} med\n left join {{ ref('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 , '{{ var('tuva_last_run')}}' as tuva_last_run\n from {{ ref('medical_claim') }} med\n left join {{ ref('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 , '{{ var('tuva_last_run')}}' as tuva_last_run\n from {{ ref('medical_claim') }} med\n left join {{ ref('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 , '{{ var('tuva_last_run')}}' as tuva_last_run\n from {{ ref('medical_claim') }} med\n left join {{ ref('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 , '{{ var('tuva_last_run')}}' as tuva_last_run\n from {{ ref('medical_claim') }} med\n left join {{ ref('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 , '{{ var('tuva_last_run')}}' as tuva_last_run\n from {{ ref('medical_claim') }} med\n left join {{ ref('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 , '{{ var('tuva_last_run')}}' as tuva_last_run\n from {{ ref('medical_claim') }} med\n left join {{ ref('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 , '{{ var('tuva_last_run')}}' as tuva_last_run\n from {{ ref('medical_claim') }} med\n left join {{ ref('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 , '{{ var('tuva_last_run')}}' as tuva_last_run\n from {{ ref('medical_claim') }} med\n left join {{ ref('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", "language": "sql", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/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", "name": "data_profiling__medical_claim_invalid_values", "alias": "_int_medical_claim_invalid_values", "checksum": {"name": "sha256", "checksum": "5fcdb427c22ef42affe9ab14c1dc89280887c6e97de17749408704f3d3062ad7"}, "tags": ["data_profiling", "claims_preprocessing"], "refs": [["medical_claim"], ["terminology__bill_type"], ["medical_claim"], ["terminology__revenue_center"], ["medical_claim"], ["terminology__discharge_disposition"], ["medical_claim"], ["terminology__admit_source"], ["medical_claim"], ["terminology__admit_type"], ["medical_claim"], ["terminology__ms_drg"], ["medical_claim"], ["terminology__apr_drg"], ["medical_claim"], ["terminology__present_on_admission"], ["medical_claim"], ["terminology__code_type"], ["medical_claim"], ["terminology__place_of_service"], ["medical_claim"], ["terminology__code_type"], ["medical_claim"], ["terminology__icd_10_cm"], ["medical_claim"], ["terminology__claim_type"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#141161"}, "patch_path": "the_tuva_project://models/claims_preprocessing/claims_preprocessing_models.yml", "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_medical_claim_invalid_values", "tags": ["data_profiling", "claims_preprocessing"], "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#141161"}}, "created_at": 1701215339.922961}, "model.the_tuva_project.data_profiling__medical_claim_prof_missing_values": {"resource_type": "model", "depends_on": {"macros": ["macro.the_tuva_project.medical_claim_missing_column_check"], "nodes": ["model.input_layer.medical_claim"]}, "config": {"enabled": true, "alias": "_int_medical_claim_prof_missing_values", "schema": "claims_preprocessing", "database": null, "tags": ["data_profiling", "claims_preprocessing"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#141161"}, "bind": false, "post-hook": [], "pre-hook": []}, "database": "dev_sarah", "schema": "claims_preprocessing", "fqn": ["the_tuva_project", "claims_preprocessing", "data_profiling", "intermediate", "data_profiling__medical_claim_prof_missing_values"], "unique_id": "model.the_tuva_project.data_profiling__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", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/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", "name": "data_profiling__medical_claim_prof_missing_values", "alias": "_int_medical_claim_prof_missing_values", "checksum": {"name": "sha256", "checksum": "e5fe39288a98102636082dd5ecaef522b520a9f3775b510adcfbb3be6e3b31f6"}, "tags": ["data_profiling", "claims_preprocessing"], "refs": [["medical_claim"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#141161"}, "patch_path": "the_tuva_project://models/claims_preprocessing/claims_preprocessing_models.yml", "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_medical_claim_prof_missing_values", "tags": ["data_profiling", "claims_preprocessing"], "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#141161"}}, "created_at": 1701215339.926775}, "model.the_tuva_project.data_profiling__medical_claim_denominators": {"resource_type": "model", "depends_on": {"macros": ["macro.dbt.type_string"], "nodes": ["model.input_layer.medical_claim", "model.input_layer.medical_claim", "model.input_layer.medical_claim", "model.input_layer.medical_claim", "model.input_layer.medical_claim", "model.input_layer.medical_claim", "model.input_layer.medical_claim", "model.input_layer.medical_claim", "model.input_layer.medical_claim", "model.input_layer.medical_claim", "model.input_layer.medical_claim", "model.input_layer.medical_claim", "model.input_layer.medical_claim", "model.input_layer.medical_claim", "model.input_layer.medical_claim"]}, "config": {"enabled": true, "alias": "_int_medical_claim_denominators", "schema": "claims_preprocessing", "database": null, "tags": ["data_profiling", "claims_preprocessing"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#141161"}, "bind": false, "post-hook": [], "pre-hook": []}, "database": "dev_sarah", "schema": "claims_preprocessing", "fqn": ["the_tuva_project", "claims_preprocessing", "data_profiling", "intermediate", "data_profiling__medical_claim_denominators"], "unique_id": "model.the_tuva_project.data_profiling__medical_claim_denominators", "raw_code": "{{ config(\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\n )\n}}\n\nwith professional_denominator as(\n select \n cast('professional' as {{ dbt.type_string() }} ) as test_denominator_name\n , cast(count(distinct claim_id) as int) as denominator\n , '{{ var('tuva_last_run')}}' as tuva_last_run\n from {{ ref('medical_claim') }}\n where claim_type = 'professional'\n)\n\n, institutional_denominator as(\n select \n cast('institutional' as {{ dbt.type_string() }} ) as test_denominator_name\n , count(distinct claim_id) as denominator\n , '{{ var('tuva_last_run')}}' as tuva_last_run\n from {{ ref('medical_claim') }}\n where claim_type = 'institutional'\n)\n\n, all_claim_denominator as(\n select \n cast('all' as {{ dbt.type_string() }} ) as test_denominator_name\n , count(distinct claim_id) as denominator\n , '{{ var('tuva_last_run')}}' as tuva_last_run\n from {{ ref('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 {{ dbt.type_string() }} ) as test_denominator_name\n , count(distinct claim_id) as denominator\n , '{{ var('tuva_last_run')}}' as tuva_last_run\n from {{ ref('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 {{ dbt.type_string() }} ) as test_denominator_name\n , count(distinct claim_id) as denominator\n , '{{ var('tuva_last_run')}}' as tuva_last_run\n from {{ ref('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 {{ dbt.type_string() }} ) as test_denominator_name\n , count(distinct claim_id) as denominator\n , '{{ var('tuva_last_run')}}' as tuva_last_run\n from {{ ref('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 {{ dbt.type_string() }} ) as test_denominator_name\n , count(distinct claim_id) as denominator\n , '{{ var('tuva_last_run')}}' as tuva_last_run\n from {{ ref('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 {{ dbt.type_string() }} ) as test_denominator_name\n , count(distinct claim_id) as denominator\n , '{{ var('tuva_last_run')}}' as tuva_last_run\n from {{ ref('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 {{ dbt.type_string() }} ) as test_denominator_name\n , count(distinct claim_id) as denominator\n , '{{ var('tuva_last_run')}}' as tuva_last_run\n from {{ ref('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 {{ dbt.type_string() }} ) as test_denominator_name\n , count(distinct claim_id) as denominator\n , '{{ var('tuva_last_run')}}' as tuva_last_run\n from {{ ref('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 {{ dbt.type_string() }} ) as test_denominator_name\n , count(distinct claim_id) as denominator\n , '{{ var('tuva_last_run')}}' as tuva_last_run\n from {{ ref('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 {{ dbt.type_string() }} ) as test_denominator_name\n , count(distinct claim_id) as denominator\n , '{{ var('tuva_last_run')}}' as tuva_last_run\n from {{ ref('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 {{ dbt.type_string() }} ) as test_denominator_name\n , count(distinct claim_id) as denominator\n , '{{ var('tuva_last_run')}}' as tuva_last_run\n from {{ ref('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 {{ dbt.type_string() }} ) as test_denominator_name\n , count(distinct claim_id) as denominator\n , '{{ var('tuva_last_run')}}' as tuva_last_run\n from {{ ref('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 {{ dbt.type_string() }} ) as test_denominator_name\n , count(distinct claim_id) as denominator\n , '{{ var('tuva_last_run')}}' as tuva_last_run\n from {{ ref('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", "language": "sql", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/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", "name": "data_profiling__medical_claim_denominators", "alias": "_int_medical_claim_denominators", "checksum": {"name": "sha256", "checksum": "ac36a1dc318e2808cd81c36956f12e45ec0e01d62a7189daaff258cbd4cc78dc"}, "tags": ["data_profiling", "claims_preprocessing"], "refs": [["medical_claim"], ["medical_claim"], ["medical_claim"], ["medical_claim"], ["medical_claim"], ["medical_claim"], ["medical_claim"], ["medical_claim"], ["medical_claim"], ["medical_claim"], ["medical_claim"], ["medical_claim"], ["medical_claim"], ["medical_claim"], ["medical_claim"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#141161"}, "patch_path": "the_tuva_project://models/claims_preprocessing/claims_preprocessing_models.yml", "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_medical_claim_denominators", "tags": ["data_profiling", "claims_preprocessing"], "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#141161"}}, "created_at": 1701215339.934706}, "model.the_tuva_project.data_profiling__test_detail_stage_eligibility": {"resource_type": "model", "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"]}, "config": {"enabled": true, "alias": "_int_test_detail_stage_eligibility", "schema": "claims_preprocessing", "database": null, "tags": ["data_profiling", "claims_preprocessing"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#141161"}, "bind": false, "post-hook": [], "pre-hook": []}, "database": "dev_sarah", "schema": "claims_preprocessing", "fqn": ["the_tuva_project", "claims_preprocessing", "data_profiling", "intermediate", "data_profiling__test_detail_stage_eligibility"], "unique_id": "model.the_tuva_project.data_profiling__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", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/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", "name": "data_profiling__test_detail_stage_eligibility", "alias": "_int_test_detail_stage_eligibility", "checksum": {"name": "sha256", "checksum": "3ea257ce7d15d19f894d261b9c90e28d2565c9c71a6f58480a9e9380df89f49c"}, "tags": ["data_profiling", "claims_preprocessing"], "refs": [["data_profiling__eligibility_duplicates"], ["data_profiling__eligibility_missing_values"], ["data_profiling__eligibility_invalid_values"], ["data_profiling__eligibility_plausibility"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#141161"}, "patch_path": "the_tuva_project://models/claims_preprocessing/claims_preprocessing_models.yml", "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_test_detail_stage_eligibility", "tags": ["data_profiling", "claims_preprocessing"], "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#141161"}}, "created_at": 1701215339.952517}, "model.the_tuva_project.data_profiling__eligibility_missing_values": {"resource_type": "model", "depends_on": {"macros": ["macro.the_tuva_project.eligibility_missing_column_check"], "nodes": ["model.input_layer.eligibility"]}, "config": {"enabled": true, "alias": "_int_eligibility_missing_values", "schema": "claims_preprocessing", "database": null, "tags": ["data_profiling", "claims_preprocessing"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#141161"}, "bind": false, "post-hook": [], "pre-hook": []}, "database": "dev_sarah", "schema": "claims_preprocessing", "fqn": ["the_tuva_project", "claims_preprocessing", "data_profiling", "intermediate", "data_profiling__eligibility_missing_values"], "unique_id": "model.the_tuva_project.data_profiling__eligibility_missing_values", "raw_code": "{{ config(\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\n )\n}}\n\n{% set eligibility_missing_column_list = [\n 'patient_id'\n , 'member_id'\n , 'gender'\n , 'race'\n , 'birth_date'\n , 'death_date'\n , 'death_flag'\n , 'enrollment_start_date'\n , 'enrollment_end_date'\n , 'payer'\n , 'payer_type'\n , 'dual_status_code'\n , 'medicare_status_code'\n , 'first_name'\n , 'last_name'\n , 'address'\n , 'city'\n , 'state'\n , 'zip_code'\n , 'phone'\n , 'data_source'\n] -%}\n\n\n\nwith eligibility_missing as(\n\n {{ eligibility_missing_column_check(builtins.ref('eligibility'), eligibility_missing_column_list) }}\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 , '{{ var('tuva_last_run')}}' as tuva_last_run\nfrom eligibility_missing\ngroup by\n patient_id\n , column_checked||' missing'", "language": "sql", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/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", "name": "data_profiling__eligibility_missing_values", "alias": "_int_eligibility_missing_values", "checksum": {"name": "sha256", "checksum": "f7747c47ae98ddf44838491bb223bfdcf0a95f49b8243daf7d8cd01453e18b5e"}, "tags": ["data_profiling", "claims_preprocessing"], "refs": [["eligibility"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#141161"}, "patch_path": "the_tuva_project://models/claims_preprocessing/claims_preprocessing_models.yml", "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_eligibility_missing_values", "tags": ["data_profiling", "claims_preprocessing"], "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#141161"}}, "created_at": 1701215339.944839}, "model.the_tuva_project.data_profiling__pharmacy_claim_missing_values": {"resource_type": "model", "depends_on": {"macros": ["macro.the_tuva_project.pharmacy_claim_missing_column_check"], "nodes": ["model.input_layer.pharmacy_claim"]}, "config": {"enabled": true, "alias": "_int_pharmacy_claim_missing_values", "schema": "claims_preprocessing", "database": null, "tags": ["data_profiling", "claims_preprocessing"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#141161"}, "bind": false, "post-hook": [], "pre-hook": []}, "database": "dev_sarah", "schema": "claims_preprocessing", "fqn": ["the_tuva_project", "claims_preprocessing", "data_profiling", "intermediate", "data_profiling__pharmacy_claim_missing_values"], "unique_id": "model.the_tuva_project.data_profiling__pharmacy_claim_missing_values", "raw_code": "{{ config(\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\n )\n}}\n\n{% set pharmacy_claim_missing_column_list = [\n 'claim_id'\n , 'claim_line_number'\n , 'patient_id'\n , 'member_id'\n , 'prescribing_provider_npi'\n , 'dispensing_provider_npi'\n , 'dispensing_date'\n , 'ndc_code'\n , 'quantity'\n , 'days_supply'\n , 'refills'\n , 'paid_date'\n , 'paid_amount'\n , 'allowed_amount'\n , 'data_source'\n] -%}\n\n\n\nwith eligibility_missing as(\n\n {{ pharmacy_claim_missing_column_check(builtins.ref('pharmacy_claim'), pharmacy_claim_missing_column_list) }}\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 , '{{ var('tuva_last_run')}}' as tuva_last_run\nfrom eligibility_missing\ngroup by\n claim_id\n , column_checked||' missing'", "language": "sql", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/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", "name": "data_profiling__pharmacy_claim_missing_values", "alias": "_int_pharmacy_claim_missing_values", "checksum": {"name": "sha256", "checksum": "130802e940a8e54c37f3de2f7f41b9aa6a5ef8c1261426444540e8c6de7ee533"}, "tags": ["data_profiling", "claims_preprocessing"], "refs": [["pharmacy_claim"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#141161"}, "patch_path": "the_tuva_project://models/claims_preprocessing/claims_preprocessing_models.yml", "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_pharmacy_claim_missing_values", "tags": ["data_profiling", "claims_preprocessing"], "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#141161"}}, "created_at": 1701215339.956406}, "model.the_tuva_project.data_profiling__test_result_stage_medical_claim": {"resource_type": "model", "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"]}, "config": {"enabled": true, "alias": "_int_test_result_stage_medical_claim", "schema": "claims_preprocessing", "database": null, "tags": ["data_profiling", "claims_preprocessing"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#141161"}, "bind": false, "post-hook": [], "pre-hook": []}, "database": "dev_sarah", "schema": "claims_preprocessing", "fqn": ["the_tuva_project", "claims_preprocessing", "data_profiling", "intermediate", "data_profiling__test_result_stage_medical_claim"], "unique_id": "model.the_tuva_project.data_profiling__test_result_stage_medical_claim", "raw_code": "{{ config(\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\n )\n}}\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 , '{{ var('tuva_last_run')}}' as tuva_last_run\nfrom {{ ref('data_profiling__test_detail') }} det\ninner join {{ ref('data_profiling__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 , '{{ var('tuva_last_run')}}' as tuva_last_run\nfrom {{ ref('data_profiling__test_detail') }} det\ninner join {{ ref('data_profiling__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", "language": "sql", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/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", "name": "data_profiling__test_result_stage_medical_claim", "alias": "_int_test_result_stage_medical_claim", "checksum": {"name": "sha256", "checksum": "bdb3b7b95d8aef2db3e1fbb89b117f9e0b841d1e750062d7c43c092d31c8d27e"}, "tags": ["data_profiling", "claims_preprocessing"], "refs": [["data_profiling__test_detail"], ["data_profiling__medical_claim_denominators"], ["data_profiling__test_detail"], ["data_profiling__medical_claim_denominators"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#141161"}, "patch_path": "the_tuva_project://models/claims_preprocessing/claims_preprocessing_models.yml", "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_test_result_stage_medical_claim", "tags": ["data_profiling", "claims_preprocessing"], "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#141161"}}, "created_at": 1701215339.932469}, "model.the_tuva_project.data_profiling__professional_header_fail_details": {"resource_type": "model", "depends_on": {"macros": ["macro.the_tuva_project.header_duplicate_check"], "nodes": ["model.the_tuva_project.data_profiling__professional_header_failures"]}, "config": {"enabled": true, "alias": "_int_professional_header_fail_details", "schema": "claims_preprocessing", "database": null, "tags": ["data_profiling", "claims_preprocessing"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#141161"}, "bind": false, "post-hook": [], "pre-hook": []}, "database": "dev_sarah", "schema": "claims_preprocessing", "fqn": ["the_tuva_project", "claims_preprocessing", "data_profiling", "intermediate", "data_profiling__professional_header_fail_details"], "unique_id": "model.the_tuva_project.data_profiling__professional_header_fail_details", "raw_code": "{{ config(\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\n )\n}}\n\n{% set professional_header_column_list = [\n 'claim_id'\n , 'claim_type'\n , 'patient_id'\n , 'member_id'\n , 'claim_start_date'\n , 'claim_end_date'\n , 'place_of_service_code'\n , 'billing_npi'\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] -%}\n\nwith professional_header_duplicates as(\n\n {{ header_duplicate_check(builtins.ref('data_profiling__professional_header_failures'), professional_header_column_list, 'professional') }}\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 , '{{ var('tuva_last_run')}}' as tuva_last_run\nfrom professional_header_duplicates\ngroup by \n claim_id\n , column_checked||' duplicated'", "language": "sql", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/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", "name": "data_profiling__professional_header_fail_details", "alias": "_int_professional_header_fail_details", "checksum": {"name": "sha256", "checksum": "efc3d6a997e152df5d17577a6fdb10ece078dcceeb6151e0372545b64584ab72"}, "tags": ["data_profiling", "claims_preprocessing"], "refs": [["data_profiling__professional_header_failures"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#141161"}, "patch_path": "the_tuva_project://models/claims_preprocessing/claims_preprocessing_models.yml", "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_professional_header_fail_details", "tags": ["data_profiling", "claims_preprocessing"], "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#141161"}}, "created_at": 1701215339.9209962}, "model.the_tuva_project.data_profiling__test_detail_stage_medical_claim": {"resource_type": "model", "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"]}, "config": {"enabled": true, "alias": "_int_test_detail_stage_medical_claim", "schema": "claims_preprocessing", "database": null, "tags": ["data_profiling", "claims_preprocessing"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#141161"}, "bind": false, "post-hook": [], "pre-hook": []}, "database": "dev_sarah", "schema": "claims_preprocessing", "fqn": ["the_tuva_project", "claims_preprocessing", "data_profiling", "intermediate", "data_profiling__test_detail_stage_medical_claim"], "unique_id": "model.the_tuva_project.data_profiling__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", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/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", "name": "data_profiling__test_detail_stage_medical_claim", "alias": "_int_test_detail_stage_medical_claim", "checksum": {"name": "sha256", "checksum": "be30aefba51ac1c3e53870f9210c97a3996ecc8c98247451522ab9d97322e7b3"}, "tags": ["data_profiling", "claims_preprocessing"], "refs": [["data_profiling__institutional_header_fail_details"], ["data_profiling__professional_header_fail_details"], ["data_profiling__medical_claim_inst_missing_values"], ["data_profiling__medical_claim_prof_missing_values"], ["data_profiling__medical_claim_invalid_values"], ["data_profiling__claim_type_unmapped"], ["data_profiling__claim_type_mapping_failures"], ["data_profiling__medical_claim_duplicates"], ["data_profiling__medical_claim_plausibility"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#141161"}, "patch_path": "the_tuva_project://models/claims_preprocessing/claims_preprocessing_models.yml", "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_test_detail_stage_medical_claim", "tags": ["data_profiling", "claims_preprocessing"], "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#141161"}}, "created_at": 1701215339.9391448}, "model.the_tuva_project.data_profiling__medical_claim_plausibility": {"resource_type": "model", "depends_on": {"macros": [], "nodes": ["model.input_layer.medical_claim", "model.input_layer.medical_claim"]}, "config": {"enabled": true, "alias": "_int_medical_claim_plausibility", "schema": "claims_preprocessing", "database": null, "tags": ["data_profiling", "claims_preprocessing"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#141161"}, "bind": false, "post-hook": [], "pre-hook": []}, "database": "dev_sarah", "schema": "claims_preprocessing", "fqn": ["the_tuva_project", "claims_preprocessing", "data_profiling", "intermediate", "data_profiling__medical_claim_plausibility"], "unique_id": "model.the_tuva_project.data_profiling__medical_claim_plausibility", "raw_code": "{{ config(\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\n )\n}}\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 , '{{ var('tuva_last_run')}}' as tuva_last_run\n from {{ ref('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 , '{{ var('tuva_last_run')}}' as tuva_last_run\n from {{ ref('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", "language": "sql", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/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", "name": "data_profiling__medical_claim_plausibility", "alias": "_int_medical_claim_plausibility", "checksum": {"name": "sha256", "checksum": "4b0b9d287c392284637a0812b10d1e7b117d26d0cc316be3c5458edfaa6ff774"}, "tags": ["data_profiling", "claims_preprocessing"], "refs": [["medical_claim"], ["medical_claim"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#141161"}, "patch_path": "the_tuva_project://models/claims_preprocessing/claims_preprocessing_models.yml", "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_medical_claim_plausibility", "tags": ["data_profiling", "claims_preprocessing"], "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#141161"}}, "created_at": 1701215339.936996}, "model.the_tuva_project.data_profiling__test_result_stage_eligibility": {"resource_type": "model", "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"]}, "config": {"enabled": true, "alias": "_int_test_result_stage_eligibility", "schema": "claims_preprocessing", "database": null, "tags": ["data_profiling", "claims_preprocessing"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#141161"}, "bind": false, "post-hook": [], "pre-hook": []}, "database": "dev_sarah", "schema": "claims_preprocessing", "fqn": ["the_tuva_project", "claims_preprocessing", "data_profiling", "intermediate", "data_profiling__test_result_stage_eligibility"], "unique_id": "model.the_tuva_project.data_profiling__test_result_stage_eligibility", "raw_code": "{{ config(\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\n )\n}}\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 , '{{ var('tuva_last_run')}}' as tuva_last_run\nfrom {{ ref('data_profiling__test_detail') }} det\ninner join {{ ref('data_profiling__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 , '{{ var('tuva_last_run')}}' as tuva_last_run\nfrom {{ ref('data_profiling__test_detail') }} det\ninner join {{ ref('data_profiling__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", "language": "sql", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/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", "name": "data_profiling__test_result_stage_eligibility", "alias": "_int_test_result_stage_eligibility", "checksum": {"name": "sha256", "checksum": "e40c1d3367d0b315662af02afc4057155eac7cfd07a2df6bfc2dad82a0cdf42e"}, "tags": ["data_profiling", "claims_preprocessing"], "refs": [["data_profiling__test_detail"], ["data_profiling__eligibility_denominators"], ["data_profiling__test_detail"], ["data_profiling__eligibility_denominators"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#141161"}, "patch_path": "the_tuva_project://models/claims_preprocessing/claims_preprocessing_models.yml", "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_test_result_stage_eligibility", "tags": ["data_profiling", "claims_preprocessing"], "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#141161"}}, "created_at": 1701215339.946792}, "model.the_tuva_project.data_profiling__professional_header_failures": {"resource_type": "model", "depends_on": {"macros": [], "nodes": ["model.input_layer.medical_claim", "model.input_layer.medical_claim"]}, "config": {"enabled": true, "alias": "_int_professional_header_failures", "schema": "claims_preprocessing", "database": null, "tags": ["data_profiling", "claims_preprocessing"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#141161"}, "bind": false, "post-hook": [], "pre-hook": []}, "database": "dev_sarah", "schema": "claims_preprocessing", "fqn": ["the_tuva_project", "claims_preprocessing", "data_profiling", "intermediate", "data_profiling__professional_header_failures"], "unique_id": "model.the_tuva_project.data_profiling__professional_header_failures", "raw_code": "{{ config(\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\n )\n}}\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 {{ ref('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.*, '{{ var('tuva_last_run')}}' as tuva_last_run from claims_with_duplicates dupe\ninner join {{ ref('medical_claim') }} med\n on dupe.claim_id = med.claim_id", "language": "sql", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/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", "name": "data_profiling__professional_header_failures", "alias": "_int_professional_header_failures", "checksum": {"name": "sha256", "checksum": "068a95eb5a74c7ee5ba4338caf7523f3a993c59347577f3f13a257fed76e7689"}, "tags": ["data_profiling", "claims_preprocessing"], "refs": [["medical_claim"], ["medical_claim"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#141161"}, "patch_path": "the_tuva_project://models/claims_preprocessing/claims_preprocessing_models.yml", "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_professional_header_failures", "tags": ["data_profiling", "claims_preprocessing"], "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#141161"}}, "created_at": 1701215339.91712}, "model.the_tuva_project.data_profiling__eligibility_invalid_values": {"resource_type": "model", "depends_on": {"macros": [], "nodes": ["model.input_layer.eligibility", "seed.the_tuva_project.terminology__gender", "model.input_layer.eligibility", "seed.the_tuva_project.terminology__race", "model.input_layer.eligibility", "seed.the_tuva_project.terminology__payer_type", "model.input_layer.eligibility", "seed.the_tuva_project.terminology__medicare_orec", "model.input_layer.eligibility", "seed.the_tuva_project.terminology__medicare_dual_eligibility", "model.input_layer.eligibility", "seed.the_tuva_project.terminology__medicare_status"]}, "config": {"enabled": true, "alias": "_int_eligibility_invalid_values", "schema": "claims_preprocessing", "database": null, "tags": ["data_profiling", "claims_preprocessing"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#141161"}, "bind": false, "post-hook": [], "pre-hook": []}, "database": "dev_sarah", "schema": "claims_preprocessing", "fqn": ["the_tuva_project", "claims_preprocessing", "data_profiling", "intermediate", "data_profiling__eligibility_invalid_values"], "unique_id": "model.the_tuva_project.data_profiling__eligibility_invalid_values", "raw_code": "{{ config(\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\n )\n}}\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 , '{{ var('tuva_last_run')}}' as tuva_last_run\n from {{ ref('eligibility') }} elig\n left join {{ ref('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 , '{{ var('tuva_last_run')}}' as tuva_last_run\n from {{ ref('eligibility') }} elig\n left join {{ ref('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 , '{{ var('tuva_last_run')}}' as tuva_last_run\n from {{ ref('eligibility') }} elig\n left join {{ ref('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_orec as(\n select\n 'orec 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.original_reason_entitlement_code\n , count(elig.original_reason_entitlement_code) as filled_row_count\n , '{{ var('tuva_last_run')}}' as tuva_last_run\n from {{ ref('eligibility') }} elig\n left join {{ ref('terminology__medicare_orec') }} orec\n on elig.original_reason_entitlement_code = orec.original_reason_entitlement_code\n where orec.original_reason_entitlement_code is null\n and elig.original_reason_entitlement_code is not null\n group by\n patient_id\n , elig.original_reason_entitlement_code\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 , '{{ var('tuva_last_run')}}' as tuva_last_run\n from {{ ref('eligibility') }} elig\n left join {{ ref('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 , '{{ var('tuva_last_run')}}' as tuva_last_run\n from {{ ref('eligibility') }} elig\n left join {{ ref('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_orec\nunion all\nselect * from valid_dual_status_code\nunion all\nselect * from valid_medicare_status_code", "language": "sql", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/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", "name": "data_profiling__eligibility_invalid_values", "alias": "_int_eligibility_invalid_values", "checksum": {"name": "sha256", "checksum": "738e6bd50e16818c38ad76317517739c4c7ab3efc872d0f5fe08028fafdda5e8"}, "tags": ["data_profiling", "claims_preprocessing"], "refs": [["eligibility"], ["terminology__gender"], ["eligibility"], ["terminology__race"], ["eligibility"], ["terminology__payer_type"], ["eligibility"], ["terminology__medicare_orec"], ["eligibility"], ["terminology__medicare_dual_eligibility"], ["eligibility"], ["terminology__medicare_status"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#141161"}, "patch_path": "the_tuva_project://models/claims_preprocessing/claims_preprocessing_models.yml", "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_eligibility_invalid_values", "tags": ["data_profiling", "claims_preprocessing"], "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#141161"}}, "created_at": 1701215339.9429681}, "model.the_tuva_project.data_profiling__eligibility_denominators": {"resource_type": "model", "depends_on": {"macros": ["macro.dbt.type_string"], "nodes": ["model.input_layer.eligibility", "model.input_layer.eligibility", "model.input_layer.eligibility", "model.input_layer.eligibility", "model.input_layer.eligibility", "model.input_layer.eligibility", "model.input_layer.eligibility"]}, "config": {"enabled": true, "alias": "_int_eligibility_denominators", "schema": "claims_preprocessing", "database": null, "tags": ["data_profiling", "claims_preprocessing"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#141161"}, "bind": false, "post-hook": [], "pre-hook": []}, "database": "dev_sarah", "schema": "claims_preprocessing", "fqn": ["the_tuva_project", "claims_preprocessing", "data_profiling", "intermediate", "data_profiling__eligibility_denominators"], "unique_id": "model.the_tuva_project.data_profiling__eligibility_denominators", "raw_code": "{{ config(\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\n )\n}}\n\nwith all_denominator as(\n select\n cast('all' as {{ dbt.type_string() }} ) as test_denominator_name\n , count(distinct patient_id) as denominator\n , '{{ var('tuva_last_run')}}' as tuva_last_run\n from {{ ref('eligibility') }}\n)\n, gender_denominator as(\n select\n cast('gender invalid' as {{ dbt.type_string() }} ) as test_denominator_name\n , count(distinct patient_id) as denominator\n , '{{ var('tuva_last_run')}}' as tuva_last_run\n from {{ ref('eligibility') }}\n where gender is not null\n)\n, race_denominator as(\n select\n cast('race invalid' as {{ dbt.type_string() }} ) as test_denominator_name\n , count(distinct patient_id) as denominator\n , '{{ var('tuva_last_run')}}' as tuva_last_run\n from {{ ref('eligibility') }}\n where race is not null\n)\n, payer_type_denominator as(\n select\n cast('payer_type invalid' as {{ dbt.type_string() }} ) as test_denominator_name\n , count(distinct patient_id) as denominator\n , '{{ var('tuva_last_run')}}' as tuva_last_run\n from {{ ref('eligibility') }}\n where payer_type is not null\n)\n, orec_denominator as(\n select\n cast('orec invalid' as {{ dbt.type_string() }} ) as test_denominator_name\n , count(distinct patient_id) as denominator\n , '{{ var('tuva_last_run')}}' as tuva_last_run\n from {{ ref('eligibility') }}\n where original_reason_entitlement_code is not null\n)\n, dual_status_denominator as(\n select\n cast('dual_status_code invalid' as {{ dbt.type_string() }} ) as test_denominator_name\n , count(distinct patient_id) as denominator\n , '{{ var('tuva_last_run')}}' as tuva_last_run\n from {{ ref('eligibility') }}\n where dual_status_code is not null\n)\n, medicare_status_denominator as(\n select\n cast('medicare_status_code invalid' as {{ dbt.type_string() }} ) as test_denominator_name\n , count(distinct patient_id) as denominator\n , '{{ var('tuva_last_run')}}' as tuva_last_run\n from {{ ref('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 orec_denominator\nunion all\nselect * from dual_status_denominator\nunion all \nselect * from medicare_status_denominator", "language": "sql", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/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", "name": "data_profiling__eligibility_denominators", "alias": "_int_eligibility_denominators", "checksum": {"name": "sha256", "checksum": "038d39df1a5c7c3fe8923b8ef1da2888481ef091b9d1a0f02de33c980b2b233d"}, "tags": ["data_profiling", "claims_preprocessing"], "refs": [["eligibility"], ["eligibility"], ["eligibility"], ["eligibility"], ["eligibility"], ["eligibility"], ["eligibility"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#141161"}, "patch_path": "the_tuva_project://models/claims_preprocessing/claims_preprocessing_models.yml", "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_eligibility_denominators", "tags": ["data_profiling", "claims_preprocessing"], "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#141161"}}, "created_at": 1701215339.9486709}, "model.the_tuva_project.data_profiling__medical_claim_inst_missing_values": {"resource_type": "model", "depends_on": {"macros": ["macro.the_tuva_project.medical_claim_missing_column_check"], "nodes": ["model.input_layer.medical_claim"]}, "config": {"enabled": true, "alias": "_int_medical_claim_inst_missing_values", "schema": "claims_preprocessing", "database": null, "tags": ["data_profiling", "claims_preprocessing"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#141161"}, "bind": false, "post-hook": [], "pre-hook": []}, "database": "dev_sarah", "schema": "claims_preprocessing", "fqn": ["the_tuva_project", "claims_preprocessing", "data_profiling", "intermediate", "data_profiling__medical_claim_inst_missing_values"], "unique_id": "model.the_tuva_project.data_profiling__medical_claim_inst_missing_values", "raw_code": "{{ config(\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\n )\n}}\n\n{% set institutional_missing_column_list = [\n 'claim_id'\n , 'claim_line_number'\n , 'patient_id'\n , 'member_id'\n , 'claim_start_date'\n , 'claim_end_date'\n , 'bill_type_code'\n , 'revenue_center_code'\n , 'hcpcs_code'\n , 'rendering_npi'\n , 'billing_npi'\n , 'facility_npi'\n , 'paid_date'\n , 'paid_amount'\n , 'diagnosis_code_type'\n , 'diagnosis_code_1'\n , 'data_source'\n] -%}\n\nwith institutional_missing as(\n\n {{ medical_claim_missing_column_check(builtins.ref('medical_claim'), institutional_missing_column_list, 'institutional') }}\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 , '{{ var('tuva_last_run')}}' as tuva_last_run\nfrom institutional_missing\ngroup by\n claim_id\n , column_checked||' missing'", "language": "sql", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/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", "name": "data_profiling__medical_claim_inst_missing_values", "alias": "_int_medical_claim_inst_missing_values", "checksum": {"name": "sha256", "checksum": "397e0ec46e30657165c78056caca438ab3bd896e9b8f69add35f12b74b3f9578"}, "tags": ["data_profiling", "claims_preprocessing"], "refs": [["medical_claim"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#141161"}, "patch_path": "the_tuva_project://models/claims_preprocessing/claims_preprocessing_models.yml", "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_medical_claim_inst_missing_values", "tags": ["data_profiling", "claims_preprocessing"], "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#141161"}}, "created_at": 1701215339.9248269}, "model.the_tuva_project.data_profiling__medical_claim_duplicates": {"resource_type": "model", "depends_on": {"macros": [], "nodes": ["model.input_layer.medical_claim"]}, "config": {"enabled": true, "alias": "_int_medical_claim_duplicates", "schema": "claims_preprocessing", "database": null, "tags": ["data_profiling", "claims_preprocessing"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#141161"}, "bind": false, "post-hook": [], "pre-hook": []}, "database": "dev_sarah", "schema": "claims_preprocessing", "fqn": ["the_tuva_project", "claims_preprocessing", "data_profiling", "intermediate", "data_profiling__medical_claim_duplicates"], "unique_id": "model.the_tuva_project.data_profiling__medical_claim_duplicates", "raw_code": "{{ config(\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\n )\n}}\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 , '{{ var('tuva_last_run')}}' as tuva_last_run\nfrom {{ ref('medical_claim') }} \ngroup by\n claim_id\n , claim_line_number\nhaving count(*) > 1", "language": "sql", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/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", "name": "data_profiling__medical_claim_duplicates", "alias": "_int_medical_claim_duplicates", "checksum": {"name": "sha256", "checksum": "3001956a2120783896ef30e63eed44f04e560f8377e9829e9e74d592e7688dde"}, "tags": ["data_profiling", "claims_preprocessing"], "refs": [["medical_claim"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#141161"}, "patch_path": "the_tuva_project://models/claims_preprocessing/claims_preprocessing_models.yml", "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_medical_claim_duplicates", "tags": ["data_profiling", "claims_preprocessing"], "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#141161"}}, "created_at": 1701215339.9305978}, "model.the_tuva_project.data_profiling__test_result_stage_pharmacy_claim": {"resource_type": "model", "depends_on": {"macros": ["macro.dbt.type_string"], "nodes": ["model.input_layer.pharmacy_claim", "model.the_tuva_project.data_profiling__test_detail"]}, "config": {"enabled": true, "alias": "_int_test_result_stage_pharmacy_claim", "schema": "claims_preprocessing", "database": null, "tags": ["data_profiling", "claims_preprocessing"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#141161"}, "bind": false, "post-hook": [], "pre-hook": []}, "database": "dev_sarah", "schema": "claims_preprocessing", "fqn": ["the_tuva_project", "claims_preprocessing", "data_profiling", "intermediate", "data_profiling__test_result_stage_pharmacy_claim"], "unique_id": "model.the_tuva_project.data_profiling__test_result_stage_pharmacy_claim", "raw_code": "{{ config(\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\n )\n}}\n\nwith pharmacy_claim_denominator as(\n select \n cast('all' as {{ dbt.type_string() }} ) as claim_type\n , cast(count(distinct claim_id) as int) as count\n , cast('{{ var('tuva_last_run')}}' as {{ dbt.type_string() }} ) as tuva_last_run\n from {{ ref('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 {{ ref('data_profiling__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", "language": "sql", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/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", "name": "data_profiling__test_result_stage_pharmacy_claim", "alias": "_int_test_result_stage_pharmacy_claim", "checksum": {"name": "sha256", "checksum": "7ffa69180d3317c370affc9713b57221ef8dbc74a4ac261771cc05d69ff8d3a9"}, "tags": ["data_profiling", "claims_preprocessing"], "refs": [["pharmacy_claim"], ["data_profiling__test_detail"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#141161"}, "patch_path": "the_tuva_project://models/claims_preprocessing/claims_preprocessing_models.yml", "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_test_result_stage_pharmacy_claim", "tags": ["data_profiling", "claims_preprocessing"], "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#141161"}}, "created_at": 1701215339.958375}, "model.the_tuva_project.service_category__stg_medical_claim": {"resource_type": "model", "depends_on": {"macros": [], "nodes": ["model.input_layer.medical_claim"]}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["service_category_grouper", "claims_preprocessing"], "meta": {}, "materialized": "ephemeral", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "bind": false, "post-hook": [], "pre-hook": []}, "database": "dev_sarah", "schema": "dbt_sarah", "fqn": ["the_tuva_project", "claims_preprocessing", "service_category", "staging", "service_category__stg_medical_claim"], "unique_id": "model.the_tuva_project.service_category__stg_medical_claim", "raw_code": "{{ config(\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\n )\n}}\n\nselect\nAPR_DRG_CODE,\nBILL_TYPE_CODE,\nCLAIM_ID,\nCLAIM_LINE_NUMBER,\nCLAIM_TYPE,\nHCPCS_CODE,\nMS_DRG_CODE,\nPLACE_OF_SERVICE_CODE,\nREVENUE_CENTER_CODE,\n'{{ var('tuva_last_run')}}' as tuva_last_run\nfrom {{ ref('medical_claim') }}", "language": "sql", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/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", "name": "service_category__stg_medical_claim", "alias": "service_category__stg_medical_claim", "checksum": {"name": "sha256", "checksum": "0825d55b88258f59b271d6536bf5542c2dd317351b00db4ab7434ba0b124d3b2"}, "tags": ["service_category_grouper", "claims_preprocessing"], "refs": [["medical_claim"]], "sources": [], "metrics": [], "description": "Staging med claims for sc grouper", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://models/claims_preprocessing/claims_preprocessing_models.yml", "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"materialized": "ephemeral", "tags": ["service_category_grouper", "claims_preprocessing"], "enabled": true, "bind": false}, "created_at": 1701215340.0542169}, "model.the_tuva_project.service_category__dq_input_layer_results": {"resource_type": "model", "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.service_category__dq_input_layer_tests"]}, "config": {"enabled": true, "alias": "_dq_input_layer_results", "schema": "claims_preprocessing", "database": null, "tags": ["service_category_grouper", "claims_preprocessing"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "bind": false, "post-hook": [], "pre-hook": []}, "database": "dev_sarah", "schema": "claims_preprocessing", "fqn": ["the_tuva_project", "claims_preprocessing", "service_category", "data_quality", "service_category__dq_input_layer_results"], "unique_id": "model.the_tuva_project.service_category__dq_input_layer_results", "raw_code": "{{ config(\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\n )\n}}\n\nselect\n dq_problem\n, count(distinct claim_id) as distinct_claims\n, '{{ var('tuva_last_run')}}' as tuva_last_run\nfrom {{ ref('service_category__dq_input_layer_tests') }}\ngroup by 1", "language": "sql", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/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", "name": "service_category__dq_input_layer_results", "alias": "_dq_input_layer_results", "checksum": {"name": "sha256", "checksum": "0153d75e226c9f3d5403c0ce0ca022c42b397004ae6111cbd5701d98c79138dc"}, "tags": ["service_category_grouper", "claims_preprocessing"], "refs": [["service_category__dq_input_layer_tests"]], "sources": [], "metrics": [], "description": "N/A", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://models/claims_preprocessing/claims_preprocessing_models.yml", "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_dq_input_layer_results", "materialized": "table", "tags": ["service_category_grouper", "claims_preprocessing"], "enabled": true, "bind": false}, "created_at": 1701215340.0562491}, "model.the_tuva_project.service_category__dq_multiple_service_categories_professional": {"resource_type": "model", "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.service_category__combined_professional"]}, "config": {"enabled": true, "alias": "_dq_multiple_service_categories_professional", "schema": "claims_preprocessing", "database": null, "tags": ["service_category_grouper", "claims_preprocessing"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "bind": false, "post-hook": [], "pre-hook": []}, "database": "dev_sarah", "schema": "claims_preprocessing", "fqn": ["the_tuva_project", "claims_preprocessing", "service_category", "data_quality", "service_category__dq_multiple_service_categories_professional"], "unique_id": "model.the_tuva_project.service_category__dq_multiple_service_categories_professional", "raw_code": "{{ config(\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\n )\n}}\n\nselect\n claim_id\n, claim_line_number\n, count(distinct service_category_2) as distinct_service_category_count\n, '{{ var('tuva_last_run')}}' as tuva_last_run\nfrom {{ ref('service_category__combined_professional') }}\ngroup by 1,2\nhaving count(distinct service_category_2) > 1", "language": "sql", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/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", "name": "service_category__dq_multiple_service_categories_professional", "alias": "_dq_multiple_service_categories_professional", "checksum": {"name": "sha256", "checksum": "75b2b979b8bd7d1d1251a7aa90f4f765b47d1a463596be3dd21570537d35d9ff"}, "tags": ["service_category_grouper", "claims_preprocessing"], "refs": [["service_category__combined_professional"]], "sources": [], "metrics": [], "description": "N/A", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://models/claims_preprocessing/claims_preprocessing_models.yml", "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_dq_multiple_service_categories_professional", "materialized": "table", "tags": ["service_category_grouper", "claims_preprocessing"], "enabled": true, "bind": false}, "created_at": 1701215340.06188}, "model.the_tuva_project.service_category__dq_multiple_service_categories_institutional": {"resource_type": "model", "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.service_category__combined_institutional"]}, "config": {"enabled": true, "alias": "_dq_multiple_service_categories_institutional", "schema": "claims_preprocessing", "database": null, "tags": ["service_category_grouper", "claims_preprocessing"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "bind": false, "post-hook": [], "pre-hook": []}, "database": "dev_sarah", "schema": "claims_preprocessing", "fqn": ["the_tuva_project", "claims_preprocessing", "service_category", "data_quality", "service_category__dq_multiple_service_categories_institutional"], "unique_id": "model.the_tuva_project.service_category__dq_multiple_service_categories_institutional", "raw_code": "{{ config(\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\n )\n}}\n\nselect\n claim_id\n, count(distinct service_category_2) as distinct_service_category_count\n, '{{ var('tuva_last_run')}}' as tuva_last_run\nfrom {{ ref('service_category__combined_institutional') }}\ngroup by 1\nhaving count(distinct service_category_2) > 1", "language": "sql", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/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", "name": "service_category__dq_multiple_service_categories_institutional", "alias": "_dq_multiple_service_categories_institutional", "checksum": {"name": "sha256", "checksum": "b0aa09f9d0ba10b8b974ed8890e0a5791f3a7607dff0d7ef10b2dbf41f51541f"}, "tags": ["service_category_grouper", "claims_preprocessing"], "refs": [["service_category__combined_institutional"]], "sources": [], "metrics": [], "description": "N/A", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://models/claims_preprocessing/claims_preprocessing_models.yml", "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_dq_multiple_service_categories_institutional", "materialized": "table", "tags": ["service_category_grouper", "claims_preprocessing"], "enabled": true, "bind": false}, "created_at": 1701215340.0600169}, "model.the_tuva_project.service_category__dq_input_layer_tests": {"resource_type": "model", "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"]}, "config": {"enabled": true, "alias": "_dq_input_layer_tests", "schema": "claims_preprocessing", "database": null, "tags": ["service_category_grouper", "claims_preprocessing"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "bind": false, "post-hook": [], "pre-hook": []}, "database": "dev_sarah", "schema": "claims_preprocessing", "fqn": ["the_tuva_project", "claims_preprocessing", "service_category", "data_quality", "service_category__dq_input_layer_tests"], "unique_id": "model.the_tuva_project.service_category__dq_input_layer_tests", "raw_code": "{{ config(\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\n )\n}}\n\nselect distinct \n claim_id\n, 'Multiple claim_type' as dq_problem\n, '{{ var('tuva_last_run')}}' as tuva_last_run\nfrom {{ ref('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, '{{ var('tuva_last_run')}}' as tuva_last_run\nfrom {{ ref('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, '{{ var('tuva_last_run')}}' as tuva_last_run\nfrom {{ ref('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, '{{ var('tuva_last_run')}}' as tuva_last_run\nfrom {{ ref('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, '{{ var('tuva_last_run')}}' as tuva_last_run\nfrom {{ ref('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, '{{ var('tuva_last_run')}}' as tuva_last_run\nfrom {{ ref('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, '{{ var('tuva_last_run')}}' as tuva_last_run\nfrom {{ ref('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, '{{ var('tuva_last_run')}}' as tuva_last_run\nfrom {{ ref('service_category__stg_medical_claim') }} a\ninner join {{ ref('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, '{{ var('tuva_last_run')}}' as tuva_last_run\nfrom {{ ref('service_category__stg_medical_claim') }} a\ninner join {{ ref('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, '{{ var('tuva_last_run')}}' as tuva_last_run\nfrom {{ ref('service_category__stg_medical_claim') }} a\ninner join {{ ref('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, '{{ var('tuva_last_run')}}' as tuva_last_run\nfrom {{ ref('service_category__stg_medical_claim') }} a\ninner join {{ ref('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, '{{ var('tuva_last_run')}}' as tuva_last_run\nfrom {{ ref('service_category__stg_medical_claim') }} a\ninner join {{ ref('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, '{{ var('tuva_last_run')}}' as tuva_last_run\nfrom {{ ref('service_category__stg_medical_claim') }} a\ninner join {{ ref('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, '{{ var('tuva_last_run')}}' as tuva_last_run\nfrom {{ ref('service_category__stg_medical_claim') }} a\ninner join {{ ref('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", "language": "sql", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/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", "name": "service_category__dq_input_layer_tests", "alias": "_dq_input_layer_tests", "checksum": {"name": "sha256", "checksum": "fc16e6bfa3c2a7c10ae467283d062e71fc0d35fb9da979b6a8c65fdd76f7782a"}, "tags": ["service_category_grouper", "claims_preprocessing"], "refs": [["service_category__stg_medical_claim"], ["service_category__stg_medical_claim"], ["service_category__stg_medical_claim"], ["service_category__stg_medical_claim"], ["service_category__stg_medical_claim"], ["service_category__stg_medical_claim"], ["service_category__stg_medical_claim"], ["service_category__stg_medical_claim"], ["terminology__claim_type"], ["service_category__stg_medical_claim"], ["terminology__place_of_service"], ["service_category__stg_medical_claim"], ["terminology__bill_type"], ["service_category__stg_medical_claim"], ["terminology__revenue_center"], ["service_category__stg_medical_claim"], ["terminology__hcpcs_level_2"], ["service_category__stg_medical_claim"], ["terminology__ms_drg"], ["service_category__stg_medical_claim"], ["terminology__apr_drg"]], "sources": [], "metrics": [], "description": "N/A", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://models/claims_preprocessing/claims_preprocessing_models.yml", "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_dq_input_layer_tests", "materialized": "table", "tags": ["service_category_grouper", "claims_preprocessing"], "enabled": true, "bind": false}, "created_at": 1701215340.058051}, "model.the_tuva_project.service_category__service_category_grouper": {"resource_type": "model", "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"]}, "config": {"enabled": true, "alias": "service_category_grouper", "schema": "claims_preprocessing", "database": null, "tags": ["service_category_grouper", "claims_preprocessing"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "bind": false, "post-hook": [], "pre-hook": []}, "database": "dev_sarah", "schema": "claims_preprocessing", "fqn": ["the_tuva_project", "claims_preprocessing", "service_category", "final", "service_category__service_category_grouper"], "unique_id": "model.the_tuva_project.service_category__service_category_grouper", "raw_code": "{{ config(\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\n )\n}}\nwith 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 , '{{ var('tuva_last_run')}}' as tuva_last_run\n from {{ ref('service_category__stg_medical_claim') }} a\n left join {{ ref('service_category__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 , '{{ var('tuva_last_run')}}' as tuva_last_run\n from {{ ref('service_category__stg_medical_claim') }} a\n left join {{ ref('service_category__combined_institutional') }} b\n on a.claim_id = b.claim_id\n where a.claim_type = 'institutional'\n)\n, service_category_2_deduplication as(\n select \n claim_id\n , claim_line_number\n , claim_type\n , service_category_1\n , service_category_2\n , row_number() over (partition by claim_id, claim_line_number order by \n case\n when service_category_2 = 'Acute Inpatient' then 3\n when service_category_2 = 'Ambulance' then 7\n when service_category_2 = 'Ambulatory Surgery' then 8\n when service_category_2 = 'Dialysis' then 17\n when service_category_2 = 'Durable Medical Equipment' then 1\n when service_category_2 = 'Emergency Department' then 5\n when service_category_2 = 'Home Health' then 9\n when service_category_2 = 'Hospice' then 10\n when service_category_2 = 'Inpatient Psychiatric' then 11\n when service_category_2 = 'Inpatient Rehabilitation' then 12\n when service_category_2 = 'Lab' then 13\n when service_category_2 = 'Office Visit' then 4\n when service_category_2 = 'Outpatient Hospital or Clinic' then 14\n when service_category_2 = 'Outpatient Psychiatric' then 15\n when service_category_2 = 'Outpatient Rehabilitation' then 16\n when service_category_2 = 'Skilled Nursing' then 6\n when service_category_2 = 'Urgent Care' then 2\n when service_category_2 is null then 18\n else 99 end) as duplicate_row_number\n from service_category_1_mapping\n)\n\nselect\n claim_id\n , claim_line_number\n , claim_type\n , service_category_1\n , service_category_2\nfrom service_category_2_deduplication\nwhere duplicate_row_number = 1", "language": "sql", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/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", "name": "service_category__service_category_grouper", "alias": "service_category_grouper", "checksum": {"name": "sha256", "checksum": "ef849e362fb992c82a4c7e60e3a7d9fac20c8be30de7d767fb7b5844e2e4d218"}, "tags": ["service_category_grouper", "claims_preprocessing"], "refs": [["service_category__stg_medical_claim"], ["service_category__combined_professional"], ["service_category__stg_medical_claim"], ["service_category__combined_institutional"]], "sources": [], "metrics": [], "description": "Assigns every claim line into a unique service category.", "columns": {"claim_id": {"name": "claim_id", "description": "Unique identifier for each claim.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "claim_line_number": {"name": "claim_line_number", "description": "Indicates the line number for the particular line of the claim.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "claim_type": {"name": "claim_type", "description": "Indicated the type of claims", "meta": {}, "data_type": null, "quote": null, "tags": []}, "service_category_1": {"name": "service_category_1", "description": "The first service category of the claim line", "meta": {}, "data_type": null, "quote": null, "tags": []}, "service_category_2": {"name": "service_category_2", "description": "The second, more specific service category of the claim line", "meta": {}, "data_type": null, "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The time at with the model was materialized. Generated by `dbt_utils.pretty_time` as the local time of the `dbt run` environment. Timezone is configurable via the `tuva_last_run` var.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://models/claims_preprocessing/claims_preprocessing_models.yml", "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "service_category_grouper", "materialized": "table", "tags": ["service_category_grouper", "claims_preprocessing"], "enabled": true, "bind": false}, "created_at": 1701215339.995682}, "model.the_tuva_project.service_category__hospice_professional": {"resource_type": "model", "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.service_category__stg_medical_claim"]}, "config": {"enabled": true, "alias": "_int_hospice_professional", "schema": "claims_preprocessing", "database": null, "tags": ["service_category_grouper", "claims_preprocessing"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "bind": false, "post-hook": [], "pre-hook": []}, "database": "dev_sarah", "schema": "claims_preprocessing", "fqn": ["the_tuva_project", "claims_preprocessing", "service_category", "intermediate", "service_category__hospice_professional"], "unique_id": "model.the_tuva_project.service_category__hospice_professional", "raw_code": "{{ config(\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\n )\n}}\n\nselect distinct \n claim_id\n, claim_line_number\n, 'Hospice' as service_category_2\n, '{{ var('tuva_last_run')}}' as tuva_last_run\nfrom {{ ref('service_category__stg_medical_claim') }}\nwhere claim_type = 'professional'\n and place_of_service_code in ('34')", "language": "sql", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/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", "name": "service_category__hospice_professional", "alias": "_int_hospice_professional", "checksum": {"name": "sha256", "checksum": "9f6404c47e48a07a0ad0da4d0334375920ca48635c740c17ae2b56bc1f6d7113"}, "tags": ["service_category_grouper", "claims_preprocessing"], "refs": [["service_category__stg_medical_claim"]], "sources": [], "metrics": [], "description": "N/A", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://models/claims_preprocessing/claims_preprocessing_models.yml", "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_hospice_professional", "materialized": "table", "tags": ["service_category_grouper", "claims_preprocessing"], "enabled": true, "bind": false}, "created_at": 1701215340.023946}, "model.the_tuva_project.service_category__ambulatory_surgery_professional": {"resource_type": "model", "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.service_category__stg_medical_claim", "model.the_tuva_project.service_category__dme_professional"]}, "config": {"enabled": true, "alias": "_int_ambulatory_surgery_professional", "schema": "claims_preprocessing", "database": null, "tags": ["service_category_grouper", "claims_preprocessing"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "bind": false, "post-hook": [], "pre-hook": []}, "database": "dev_sarah", "schema": "claims_preprocessing", "fqn": ["the_tuva_project", "claims_preprocessing", "service_category", "intermediate", "service_category__ambulatory_surgery_professional"], "unique_id": "model.the_tuva_project.service_category__ambulatory_surgery_professional", "raw_code": "{{ config(\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\n )\n}}\n\nselect distinct \n a.claim_id\n, a.claim_line_number\n, 'Ambulatory Surgery' as service_category_2\n, '{{ var('tuva_last_run')}}' as tuva_last_run\nfrom {{ ref('service_category__stg_medical_claim') }} a\nleft join {{ ref('service_category__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)", "language": "sql", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/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", "name": "service_category__ambulatory_surgery_professional", "alias": "_int_ambulatory_surgery_professional", "checksum": {"name": "sha256", "checksum": "a436c587da1c3c136440ebcfbd6601b73f13bb2c2e7ac18268f3f31c66ee29e9"}, "tags": ["service_category_grouper", "claims_preprocessing"], "refs": [["service_category__stg_medical_claim"], ["service_category__dme_professional"]], "sources": [], "metrics": [], "description": "N/A", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://models/claims_preprocessing/claims_preprocessing_models.yml", "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_ambulatory_surgery_professional", "materialized": "table", "tags": ["service_category_grouper", "claims_preprocessing"], "enabled": true, "bind": false}, "created_at": 1701215340.006907}, "model.the_tuva_project.service_category__home_health_professional": {"resource_type": "model", "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.service_category__stg_medical_claim", "model.the_tuva_project.service_category__dme_professional"]}, "config": {"enabled": true, "alias": "_int_home_health_professional", "schema": "claims_preprocessing", "database": null, "tags": ["service_category_grouper", "claims_preprocessing"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "bind": false, "post-hook": [], "pre-hook": []}, "database": "dev_sarah", "schema": "claims_preprocessing", "fqn": ["the_tuva_project", "claims_preprocessing", "service_category", "intermediate", "service_category__home_health_professional"], "unique_id": "model.the_tuva_project.service_category__home_health_professional", "raw_code": "{{ config(\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\n )\n}}\n\nselect distinct \n a.claim_id\n, a.claim_line_number\n, 'Home Health' as service_category_2\n, '{{ var('tuva_last_run')}}' as tuva_last_run\nfrom {{ ref('service_category__stg_medical_claim') }} a\nleft join {{ ref('service_category__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)", "language": "sql", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/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", "name": "service_category__home_health_professional", "alias": "_int_home_health_professional", "checksum": {"name": "sha256", "checksum": "eb91a35a7bd895dec5029c6a2948c5b216b8b6d5c03f10e704afcbd6fea03ee6"}, "tags": ["service_category_grouper", "claims_preprocessing"], "refs": [["service_category__stg_medical_claim"], ["service_category__dme_professional"]], "sources": [], "metrics": [], "description": "N/A", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://models/claims_preprocessing/claims_preprocessing_models.yml", "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_home_health_professional", "materialized": "table", "tags": ["service_category_grouper", "claims_preprocessing"], "enabled": true, "bind": false}, "created_at": 1701215340.020035}, "model.the_tuva_project.service_category__urgent_care_professional": {"resource_type": "model", "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.service_category__stg_medical_claim"]}, "config": {"enabled": true, "alias": "_int_urgent_care_professional", "schema": "claims_preprocessing", "database": null, "tags": ["service_category_grouper", "claims_preprocessing"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "bind": false, "post-hook": [], "pre-hook": []}, "database": "dev_sarah", "schema": "claims_preprocessing", "fqn": ["the_tuva_project", "claims_preprocessing", "service_category", "intermediate", "service_category__urgent_care_professional"], "unique_id": "model.the_tuva_project.service_category__urgent_care_professional", "raw_code": "{{ config(\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\n )\n}}\n\nselect distinct \n claim_id\n, claim_line_number\n, 'Urgent Care' as service_category_2\n, '{{ var('tuva_last_run')}}' as tuva_last_run\nfrom {{ ref('service_category__stg_medical_claim') }}\nwhere claim_type = 'professional'\n and place_of_service_code in ('20')", "language": "sql", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/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", "name": "service_category__urgent_care_professional", "alias": "_int_urgent_care_professional", "checksum": {"name": "sha256", "checksum": "bef186ab9e3a2678df57bd21d4ff55c790ff622a02b79a8ab00a05eb61f015b5"}, "tags": ["service_category_grouper", "claims_preprocessing"], "refs": [["service_category__stg_medical_claim"]], "sources": [], "metrics": [], "description": "N/A", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://models/claims_preprocessing/claims_preprocessing_models.yml", "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_urgent_care_professional", "materialized": "table", "tags": ["service_category_grouper", "claims_preprocessing"], "enabled": true, "bind": false}, "created_at": 1701215340.050547}, "model.the_tuva_project.service_category__duplicate_bill_types": {"resource_type": "model", "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.service_category__stg_medical_claim"]}, "config": {"enabled": true, "alias": "_int_duplicate_bill_types", "schema": "claims_preprocessing", "database": null, "tags": ["service_category_grouper", "claims_preprocessing"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "bind": false, "post-hook": [], "pre-hook": []}, "database": "dev_sarah", "schema": "claims_preprocessing", "fqn": ["the_tuva_project", "claims_preprocessing", "service_category", "intermediate", "service_category__duplicate_bill_types"], "unique_id": "model.the_tuva_project.service_category__duplicate_bill_types", "raw_code": "{{ config(\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\n )\n}}\n\nselect distinct\n claim_id\n, count(distinct bill_type_code) as cnt\nfrom {{ ref('service_category__stg_medical_claim') }}\ngroup by 1\nhaving count(distinct bill_type_code) > 1", "language": "sql", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/the_tuva_project", "path": "claims_preprocessing/service_category/intermediate/service_category__duplicate_bill_types.sql", "original_file_path": "models/claims_preprocessing/service_category/intermediate/service_category__duplicate_bill_types.sql", "name": "service_category__duplicate_bill_types", "alias": "_int_duplicate_bill_types", "checksum": {"name": "sha256", "checksum": "18f8d12e785b1774510a0dfbac2e5f68d8796690d63c726bab111863630bc3b9"}, "tags": ["service_category_grouper", "claims_preprocessing"], "refs": [["service_category__stg_medical_claim"]], "sources": [], "metrics": [], "description": "N/A", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://models/claims_preprocessing/claims_preprocessing_models.yml", "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_duplicate_bill_types", "materialized": "table", "tags": ["service_category_grouper", "claims_preprocessing"], "enabled": true, "bind": false}, "created_at": 1701215340.052929}, "model.the_tuva_project.service_category__dialysis_professional": {"resource_type": "model", "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.service_category__stg_medical_claim"]}, "config": {"enabled": true, "alias": "_int_dialysis_professional", "schema": "claims_preprocessing", "database": null, "tags": ["service_category_grouper", "claims_preprocessing"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "bind": false, "post-hook": [], "pre-hook": []}, "database": "dev_sarah", "schema": "claims_preprocessing", "fqn": ["the_tuva_project", "claims_preprocessing", "service_category", "intermediate", "service_category__dialysis_professional"], "unique_id": "model.the_tuva_project.service_category__dialysis_professional", "raw_code": "{{ config(\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\n )\n}}\n\nselect distinct \n claim_id\n, claim_line_number\n, 'Dialysis' as service_category_2\n, '{{ var('tuva_last_run')}}' as tuva_last_run\nfrom {{ ref('service_category__stg_medical_claim') }}\nwhere claim_type = 'professional'\n and place_of_service_code in ('65')", "language": "sql", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/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", "name": "service_category__dialysis_professional", "alias": "_int_dialysis_professional", "checksum": {"name": "sha256", "checksum": "9222d5b442380f56a44bee117e590d1536eac15f289db558c713d1a61695c9e3"}, "tags": ["service_category_grouper", "claims_preprocessing"], "refs": [["service_category__stg_medical_claim"]], "sources": [], "metrics": [], "description": "N/A", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://models/claims_preprocessing/claims_preprocessing_models.yml", "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_dialysis_professional", "materialized": "table", "tags": ["service_category_grouper", "claims_preprocessing"], "enabled": true, "bind": false}, "created_at": 1701215340.0106251}, "model.the_tuva_project.service_category__lab_institutional": {"resource_type": "model", "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.service_category__stg_medical_claim"]}, "config": {"enabled": true, "alias": "_int_lab_institutional", "schema": "claims_preprocessing", "database": null, "tags": ["service_category_grouper", "claims_preprocessing"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "bind": false, "post-hook": [], "pre-hook": []}, "database": "dev_sarah", "schema": "claims_preprocessing", "fqn": ["the_tuva_project", "claims_preprocessing", "service_category", "intermediate", "service_category__lab_institutional"], "unique_id": "model.the_tuva_project.service_category__lab_institutional", "raw_code": "{{ config(\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\n )\n}}\n\nselect distinct \n claim_id\n, 'Lab' as service_category_2\n, '{{ var('tuva_last_run')}}' as tuva_last_run\nfrom {{ ref('service_category__stg_medical_claim') }}\nwhere claim_type = 'institutional'\n and left(bill_type_code,2) in ('14')", "language": "sql", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/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", "name": "service_category__lab_institutional", "alias": "_int_lab_institutional", "checksum": {"name": "sha256", "checksum": "c93dab069d145e7002b3c5f56ebc380f4f1fea0b9783f63ec994025e68ee6ce9"}, "tags": ["service_category_grouper", "claims_preprocessing"], "refs": [["service_category__stg_medical_claim"]], "sources": [], "metrics": [], "description": "N/A", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://models/claims_preprocessing/claims_preprocessing_models.yml", "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_lab_institutional", "materialized": "table", "tags": ["service_category_grouper", "claims_preprocessing"], "enabled": true, "bind": false}, "created_at": 1701215340.0297668}, "model.the_tuva_project.service_category__inpatient_rehab_professional": {"resource_type": "model", "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.service_category__stg_medical_claim"]}, "config": {"enabled": true, "alias": "_int_inpatient_rehab_professional", "schema": "claims_preprocessing", "database": null, "tags": ["service_category_grouper", "claims_preprocessing"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "bind": false, "post-hook": [], "pre-hook": []}, "database": "dev_sarah", "schema": "claims_preprocessing", "fqn": ["the_tuva_project", "claims_preprocessing", "service_category", "intermediate", "service_category__inpatient_rehab_professional"], "unique_id": "model.the_tuva_project.service_category__inpatient_rehab_professional", "raw_code": "{{ config(\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\n )\n}}\n\nselect distinct \n claim_id\n, claim_line_number\n, 'Inpatient Rehabilitation' as service_category_2\n, '{{ var('tuva_last_run')}}' as tuva_last_run\nfrom {{ ref('service_category__stg_medical_claim') }}\nwhere claim_type = 'professional'\n and place_of_service_code in ('61')", "language": "sql", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/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", "name": "service_category__inpatient_rehab_professional", "alias": "_int_inpatient_rehab_professional", "checksum": {"name": "sha256", "checksum": "15e37d1f5b3af77520031c112df2efaacae32168de0f0368d2e63314ed0bda2e"}, "tags": ["service_category_grouper", "claims_preprocessing"], "refs": [["service_category__stg_medical_claim"]], "sources": [], "metrics": [], "description": "N/A", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://models/claims_preprocessing/claims_preprocessing_models.yml", "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_inpatient_rehab_professional", "materialized": "table", "tags": ["service_category_grouper", "claims_preprocessing"], "enabled": true, "bind": false}, "created_at": 1701215340.027832}, "model.the_tuva_project.service_category__dialysis_institutional": {"resource_type": "model", "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.service_category__stg_medical_claim"]}, "config": {"enabled": true, "alias": "_int_dialysis_institutional", "schema": "claims_preprocessing", "database": null, "tags": ["service_category_grouper", "claims_preprocessing"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "bind": false, "post-hook": [], "pre-hook": []}, "database": "dev_sarah", "schema": "claims_preprocessing", "fqn": ["the_tuva_project", "claims_preprocessing", "service_category", "intermediate", "service_category__dialysis_institutional"], "unique_id": "model.the_tuva_project.service_category__dialysis_institutional", "raw_code": "{{ config(\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\n )\n}}\n\nselect distinct \n claim_id\n, 'Dialysis' as service_category_2\n, '{{ var('tuva_last_run')}}' as tuva_last_run\nfrom {{ ref('service_category__stg_medical_claim') }}\nwhere claim_type = 'institutional'\n and left(bill_type_code,2) in ('72')", "language": "sql", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/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", "name": "service_category__dialysis_institutional", "alias": "_int_dialysis_institutional", "checksum": {"name": "sha256", "checksum": "0db2c73527e1b488c0ca7196a4dfc3206d7e88c4138214961759af8376f50057"}, "tags": ["service_category_grouper", "claims_preprocessing"], "refs": [["service_category__stg_medical_claim"]], "sources": [], "metrics": [], "description": "N/A", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://models/claims_preprocessing/claims_preprocessing_models.yml", "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_dialysis_institutional", "materialized": "table", "tags": ["service_category_grouper", "claims_preprocessing"], "enabled": true, "bind": false}, "created_at": 1701215340.0086908}, "model.the_tuva_project.service_category__dme_professional": {"resource_type": "model", "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.service_category__stg_medical_claim"]}, "config": {"enabled": true, "alias": "_int_dme_professional", "schema": "claims_preprocessing", "database": null, "tags": ["service_category_grouper", "claims_preprocessing"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "bind": false, "post-hook": [], "pre-hook": []}, "database": "dev_sarah", "schema": "claims_preprocessing", "fqn": ["the_tuva_project", "claims_preprocessing", "service_category", "intermediate", "service_category__dme_professional"], "unique_id": "model.the_tuva_project.service_category__dme_professional", "raw_code": "{{ config(\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\n )\n}}\n\nselect distinct \n claim_id\n, claim_line_number\n, 'Durable Medical Equipment' as service_category_2\n, '{{ var('tuva_last_run')}}' as tuva_last_run\nfrom {{ ref('service_category__stg_medical_claim') }}\nwhere claim_type = 'professional'\n and hcpcs_code between 'E0100' and 'E8002'", "language": "sql", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/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", "name": "service_category__dme_professional", "alias": "_int_dme_professional", "checksum": {"name": "sha256", "checksum": "e550991c585a166a0f7ce439bf1b34ad7e715c81f4cac31f0615b6b30dca8c0f"}, "tags": ["service_category_grouper", "claims_preprocessing"], "refs": [["service_category__stg_medical_claim"]], "sources": [], "metrics": [], "description": "N/A", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://models/claims_preprocessing/claims_preprocessing_models.yml", "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_dme_professional", "materialized": "table", "tags": ["service_category_grouper", "claims_preprocessing"], "enabled": true, "bind": false}, "created_at": 1701215340.0124102}, "model.the_tuva_project.service_category__home_health_institutional": {"resource_type": "model", "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.service_category__stg_medical_claim"]}, "config": {"enabled": true, "alias": "_int_home_health_institutional", "schema": "claims_preprocessing", "database": null, "tags": ["service_category_grouper", "claims_preprocessing"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "bind": false, "post-hook": [], "pre-hook": []}, "database": "dev_sarah", "schema": "claims_preprocessing", "fqn": ["the_tuva_project", "claims_preprocessing", "service_category", "intermediate", "service_category__home_health_institutional"], "unique_id": "model.the_tuva_project.service_category__home_health_institutional", "raw_code": "{{ config(\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\n )\n}}\n\nselect distinct \n claim_id\n, 'Home Health' as service_category_2\n, '{{ var('tuva_last_run')}}' as tuva_last_run\nfrom {{ ref('service_category__stg_medical_claim') }}\nwhere claim_type = 'institutional'\n and left(bill_type_code,2) in ('31','32','33')", "language": "sql", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/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", "name": "service_category__home_health_institutional", "alias": "_int_home_health_institutional", "checksum": {"name": "sha256", "checksum": "39a3540db246d1004cf1901a541b584b3d7addac8a79c8defab743851f63429e"}, "tags": ["service_category_grouper", "claims_preprocessing"], "refs": [["service_category__stg_medical_claim"]], "sources": [], "metrics": [], "description": "N/A", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://models/claims_preprocessing/claims_preprocessing_models.yml", "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_home_health_institutional", "materialized": "table", "tags": ["service_category_grouper", "claims_preprocessing"], "enabled": true, "bind": false}, "created_at": 1701215340.018069}, "model.the_tuva_project.service_category__emergency_department_professional": {"resource_type": "model", "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.service_category__stg_medical_claim"]}, "config": {"enabled": true, "alias": "_int_emergency_department_professional", "schema": "claims_preprocessing", "database": null, "tags": ["service_category_grouper", "claims_preprocessing"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "bind": false, "post-hook": [], "pre-hook": []}, "database": "dev_sarah", "schema": "claims_preprocessing", "fqn": ["the_tuva_project", "claims_preprocessing", "service_category", "intermediate", "service_category__emergency_department_professional"], "unique_id": "model.the_tuva_project.service_category__emergency_department_professional", "raw_code": "{{ config(\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\n )\n}}\n\nselect distinct \n claim_id\n, claim_line_number\n, 'Emergency Department' as service_category_2\n, '{{ var('tuva_last_run')}}' as tuva_last_run\nfrom {{ ref('service_category__stg_medical_claim') }}\nwhere claim_type = 'professional'\n and place_of_service_code = '23'", "language": "sql", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/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", "name": "service_category__emergency_department_professional", "alias": "_int_emergency_department_professional", "checksum": {"name": "sha256", "checksum": "bea86c99330b95669ce9f77ca5d8581293480ab8d1f73aee468cf96d7be5487e"}, "tags": ["service_category_grouper", "claims_preprocessing"], "refs": [["service_category__stg_medical_claim"]], "sources": [], "metrics": [], "description": "N/A", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://models/claims_preprocessing/claims_preprocessing_models.yml", "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_emergency_department_professional", "materialized": "table", "tags": ["service_category_grouper", "claims_preprocessing"], "enabled": true, "bind": false}, "created_at": 1701215340.0161438}, "model.the_tuva_project.service_category__inpatient_psychiatric_professional": {"resource_type": "model", "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.service_category__stg_medical_claim"]}, "config": {"enabled": true, "alias": "_int_inpatient_psychiatric_professional", "schema": "claims_preprocessing", "database": null, "tags": ["service_category_grouper", "claims_preprocessing"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "bind": false, "post-hook": [], "pre-hook": []}, "database": "dev_sarah", "schema": "claims_preprocessing", "fqn": ["the_tuva_project", "claims_preprocessing", "service_category", "intermediate", "service_category__inpatient_psychiatric_professional"], "unique_id": "model.the_tuva_project.service_category__inpatient_psychiatric_professional", "raw_code": "{{ config(\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\n )\n}}\n\nselect distinct \n claim_id\n, claim_line_number\n, 'Inpatient Psychiatric' as service_category_2\n, '{{ var('tuva_last_run')}}' as tuva_last_run\nfrom {{ ref('service_category__stg_medical_claim') }}\nwhere claim_type = 'professional'\n and place_of_service_code in ('51','55','56')", "language": "sql", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/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", "name": "service_category__inpatient_psychiatric_professional", "alias": "_int_inpatient_psychiatric_professional", "checksum": {"name": "sha256", "checksum": "465f57389afdc14729f03f1dcab74e8f339d332b43b339f0959671b5fcebfd09"}, "tags": ["service_category_grouper", "claims_preprocessing"], "refs": [["service_category__stg_medical_claim"]], "sources": [], "metrics": [], "description": "N/A", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://models/claims_preprocessing/claims_preprocessing_models.yml", "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_inpatient_psychiatric_professional", "materialized": "table", "tags": ["service_category_grouper", "claims_preprocessing"], "enabled": true, "bind": false}, "created_at": 1701215340.025981}, "model.the_tuva_project.service_category__skilled_nursing_institutional": {"resource_type": "model", "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.service_category__stg_medical_claim"]}, "config": {"enabled": true, "alias": "_int_skilled_nursing_institutional", "schema": "claims_preprocessing", "database": null, "tags": ["service_category_grouper", "claims_preprocessing"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "bind": false, "post-hook": [], "pre-hook": []}, "database": "dev_sarah", "schema": "claims_preprocessing", "fqn": ["the_tuva_project", "claims_preprocessing", "service_category", "intermediate", "service_category__skilled_nursing_institutional"], "unique_id": "model.the_tuva_project.service_category__skilled_nursing_institutional", "raw_code": "{{ config(\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\n )\n}}\n\nselect distinct \n claim_id\n, 'Skilled Nursing' as service_category_2\n, '{{ var('tuva_last_run')}}' as tuva_last_run\nfrom {{ ref('service_category__stg_medical_claim') }}\nwhere claim_type = 'institutional'\n and left(bill_type_code,2) in ('21','22')", "language": "sql", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/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", "name": "service_category__skilled_nursing_institutional", "alias": "_int_skilled_nursing_institutional", "checksum": {"name": "sha256", "checksum": "540aa77d916138feb370e1c910f3fe07ab2d3ee30663050821a137c4c1aeb8e9"}, "tags": ["service_category_grouper", "claims_preprocessing"], "refs": [["service_category__stg_medical_claim"]], "sources": [], "metrics": [], "description": "N/A", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://models/claims_preprocessing/claims_preprocessing_models.yml", "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_skilled_nursing_institutional", "materialized": "table", "tags": ["service_category_grouper", "claims_preprocessing"], "enabled": true, "bind": false}, "created_at": 1701215340.045007}, "model.the_tuva_project.service_category__hospice_institutional": {"resource_type": "model", "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.service_category__stg_medical_claim"]}, "config": {"enabled": true, "alias": "_int_hospice_institutional", "schema": "claims_preprocessing", "database": null, "tags": ["service_category_grouper", "claims_preprocessing"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "bind": false, "post-hook": [], "pre-hook": []}, "database": "dev_sarah", "schema": "claims_preprocessing", "fqn": ["the_tuva_project", "claims_preprocessing", "service_category", "intermediate", "service_category__hospice_institutional"], "unique_id": "model.the_tuva_project.service_category__hospice_institutional", "raw_code": "{{ config(\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\n )\n}}\n\nselect distinct \n claim_id\n, 'Hospice' as service_category_2\n, '{{ var('tuva_last_run')}}' as tuva_last_run\nfrom {{ ref('service_category__stg_medical_claim') }}\nwhere claim_type = 'institutional'\n and left(bill_type_code,2) in ('81','82')", "language": "sql", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/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", "name": "service_category__hospice_institutional", "alias": "_int_hospice_institutional", "checksum": {"name": "sha256", "checksum": "ebbffe3eb2aea1f6a21075a9ed95b78d792249fb0e96881a9602eb67fd932ada"}, "tags": ["service_category_grouper", "claims_preprocessing"], "refs": [["service_category__stg_medical_claim"]], "sources": [], "metrics": [], "description": "N/A", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://models/claims_preprocessing/claims_preprocessing_models.yml", "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_hospice_institutional", "materialized": "table", "tags": ["service_category_grouper", "claims_preprocessing"], "enabled": true, "bind": false}, "created_at": 1701215340.022107}, "model.the_tuva_project.service_category__outpatient_hospital_or_clinic_professional": {"resource_type": "model", "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.service_category__stg_medical_claim"]}, "config": {"enabled": true, "alias": "_int_outpatient_hospital_or_clinic_professional", "schema": "claims_preprocessing", "database": null, "tags": ["service_category_grouper", "claims_preprocessing"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "bind": false, "post-hook": [], "pre-hook": []}, "database": "dev_sarah", "schema": "claims_preprocessing", "fqn": ["the_tuva_project", "claims_preprocessing", "service_category", "intermediate", "service_category__outpatient_hospital_or_clinic_professional"], "unique_id": "model.the_tuva_project.service_category__outpatient_hospital_or_clinic_professional", "raw_code": "{{ config(\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\n )\n}}\n\nselect distinct \n claim_id\n, claim_line_number\n, 'Outpatient Hospital or Clinic' as service_category_2\n, '{{ var('tuva_last_run')}}' as tuva_last_run\nfrom {{ ref('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')", "language": "sql", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/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", "name": "service_category__outpatient_hospital_or_clinic_professional", "alias": "_int_outpatient_hospital_or_clinic_professional", "checksum": {"name": "sha256", "checksum": "052943cb247579c08b433229e0cb7d07e450d099e8a7b1ab8267e006313051ec"}, "tags": ["service_category_grouper", "claims_preprocessing"], "refs": [["service_category__stg_medical_claim"]], "sources": [], "metrics": [], "description": "N/A", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://models/claims_preprocessing/claims_preprocessing_models.yml", "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_outpatient_hospital_or_clinic_professional", "materialized": "table", "tags": ["service_category_grouper", "claims_preprocessing"], "enabled": true, "bind": false}, "created_at": 1701215340.037378}, "model.the_tuva_project.service_category__skilled_nursing_professional": {"resource_type": "model", "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.service_category__stg_medical_claim", "model.the_tuva_project.service_category__dme_professional"]}, "config": {"enabled": true, "alias": "_int_skilled_nursing_professional", "schema": "claims_preprocessing", "database": null, "tags": ["service_category_grouper", "claims_preprocessing"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "bind": false, "post-hook": [], "pre-hook": []}, "database": "dev_sarah", "schema": "claims_preprocessing", "fqn": ["the_tuva_project", "claims_preprocessing", "service_category", "intermediate", "service_category__skilled_nursing_professional"], "unique_id": "model.the_tuva_project.service_category__skilled_nursing_professional", "raw_code": "{{ config(\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\n )\n}}\n\nselect distinct \n a.claim_id\n, a.claim_line_number\n, 'Skilled Nursing' as service_category_2\n, '{{ var('tuva_last_run')}}' as tuva_last_run\nfrom {{ ref('service_category__stg_medical_claim') }} a\nleft join {{ ref('service_category__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)", "language": "sql", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/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", "name": "service_category__skilled_nursing_professional", "alias": "_int_skilled_nursing_professional", "checksum": {"name": "sha256", "checksum": "2d5376240b800c65d05b28979c7bd88f025545f331e601d88072691f8e85870f"}, "tags": ["service_category_grouper", "claims_preprocessing"], "refs": [["service_category__stg_medical_claim"], ["service_category__dme_professional"]], "sources": [], "metrics": [], "description": "N/A", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://models/claims_preprocessing/claims_preprocessing_models.yml", "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_skilled_nursing_professional", "materialized": "table", "tags": ["service_category_grouper", "claims_preprocessing"], "enabled": true, "bind": false}, "created_at": 1701215340.046793}, "model.the_tuva_project.service_category__lab_professional": {"resource_type": "model", "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.service_category__stg_medical_claim"]}, "config": {"enabled": true, "alias": "_int_lab_professional", "schema": "claims_preprocessing", "database": null, "tags": ["service_category_grouper", "claims_preprocessing"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "bind": false, "post-hook": [], "pre-hook": []}, "database": "dev_sarah", "schema": "claims_preprocessing", "fqn": ["the_tuva_project", "claims_preprocessing", "service_category", "intermediate", "service_category__lab_professional"], "unique_id": "model.the_tuva_project.service_category__lab_professional", "raw_code": "{{ config(\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\n )\n}}\n\nselect distinct \n claim_id\n, claim_line_number\n, 'Lab' as service_category_2\n, '{{ var('tuva_last_run')}}' as tuva_last_run\nfrom {{ ref('service_category__stg_medical_claim') }}\nwhere claim_type = 'professional'\n and place_of_service_code = '81'", "language": "sql", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/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", "name": "service_category__lab_professional", "alias": "_int_lab_professional", "checksum": {"name": "sha256", "checksum": "d02515a43270345cf23a5e6077f4020baa73e090f50c82160a28c964b459c20e"}, "tags": ["service_category_grouper", "claims_preprocessing"], "refs": [["service_category__stg_medical_claim"]], "sources": [], "metrics": [], "description": "N/A", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://models/claims_preprocessing/claims_preprocessing_models.yml", "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_lab_professional", "materialized": "table", "tags": ["service_category_grouper", "claims_preprocessing"], "enabled": true, "bind": false}, "created_at": 1701215340.031557}, "model.the_tuva_project.service_category__combined_institutional": {"resource_type": "model", "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.service_category__duplicate_bill_types", "model.the_tuva_project.service_category__acute_inpatient_institutional", "model.the_tuva_project.service_category__dialysis_institutional", "model.the_tuva_project.service_category__emergency_department_institutional", "model.the_tuva_project.service_category__home_health_institutional", "model.the_tuva_project.service_category__hospice_institutional", "model.the_tuva_project.service_category__lab_institutional", "model.the_tuva_project.service_category__outpatient_hospital_or_clinic_institutional", "model.the_tuva_project.service_category__outpatient_psychiatric_institutional", "model.the_tuva_project.service_category__skilled_nursing_institutional", "model.the_tuva_project.service_category__urgent_care_institutional"]}, "config": {"enabled": true, "alias": "_int_combined_institutional", "schema": "claims_preprocessing", "database": null, "tags": ["service_category_grouper", "claims_preprocessing"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "bind": false, "post-hook": [], "pre-hook": []}, "database": "dev_sarah", "schema": "claims_preprocessing", "fqn": ["the_tuva_project", "claims_preprocessing", "service_category", "intermediate", "service_category__combined_institutional"], "unique_id": "model.the_tuva_project.service_category__combined_institutional", "raw_code": "{{ config(\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\n )\n}}\n\nwith duplicate_bill_types as (\nselect distinct\n claim_id\n, 'Other' as service_category_2\nfrom {{ ref('service_category__duplicate_bill_types') }}\n)\n\n, combine as (\nselect *\nfrom {{ ref('service_category__acute_inpatient_institutional') }}\n\nunion all\n\nselect *\nfrom {{ ref('service_category__dialysis_institutional') }}\n\nunion all\n\nselect *\nfrom {{ ref('service_category__emergency_department_institutional') }}\n\nunion all\n\nselect *\nfrom {{ ref('service_category__home_health_institutional') }}\n\nunion all\n\nselect *\nfrom {{ ref('service_category__hospice_institutional') }}\n\nunion all\n\nselect *\nfrom {{ ref('service_category__lab_institutional') }}\n\nunion all\n\nselect *\nfrom {{ ref('service_category__outpatient_hospital_or_clinic_institutional') }}\n\nunion all\n\nselect *\nfrom {{ ref('service_category__outpatient_psychiatric_institutional') }}\n\nunion all\n\nselect *\nfrom {{ ref('service_category__skilled_nursing_institutional') }}\n\nunion all\n\nselect *\nfrom {{ ref('service_category__urgent_care_institutional') }}\n)\n\nselect\n claim_id\n, service_category_2\nfrom duplicate_bill_types\n\nunion all\n\nselect\n a.claim_id\n, a.service_category_2\nfrom combine a\nleft join duplicate_bill_types b\n on a.claim_id = b.claim_id\nwhere b.claim_id is null", "language": "sql", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/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", "name": "service_category__combined_institutional", "alias": "_int_combined_institutional", "checksum": {"name": "sha256", "checksum": "f69e498d95f17ebbc0e17e220dd7a3fccf3386cff3f3fac856f22ea5b607b608"}, "tags": ["service_category_grouper", "claims_preprocessing"], "refs": [["service_category__duplicate_bill_types"], ["service_category__acute_inpatient_institutional"], ["service_category__dialysis_institutional"], ["service_category__emergency_department_institutional"], ["service_category__home_health_institutional"], ["service_category__hospice_institutional"], ["service_category__lab_institutional"], ["service_category__outpatient_hospital_or_clinic_institutional"], ["service_category__outpatient_psychiatric_institutional"], ["service_category__skilled_nursing_institutional"], ["service_category__urgent_care_institutional"]], "sources": [], "metrics": [], "description": "N/A", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://models/claims_preprocessing/claims_preprocessing_models.yml", "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_combined_institutional", "materialized": "table", "tags": ["service_category_grouper", "claims_preprocessing"], "enabled": true, "bind": false}, "created_at": 1701215339.99943}, "model.the_tuva_project.service_category__urgent_care_institutional": {"resource_type": "model", "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.service_category__stg_medical_claim", "model.the_tuva_project.service_category__emergency_department_institutional"]}, "config": {"enabled": true, "alias": "_int_urgent_care_institutional", "schema": "claims_preprocessing", "database": null, "tags": ["service_category_grouper", "claims_preprocessing"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "bind": false, "post-hook": [], "pre-hook": []}, "database": "dev_sarah", "schema": "claims_preprocessing", "fqn": ["the_tuva_project", "claims_preprocessing", "service_category", "intermediate", "service_category__urgent_care_institutional"], "unique_id": "model.the_tuva_project.service_category__urgent_care_institutional", "raw_code": "{{ config(\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\n )\n}}\n\nselect distinct \n a.claim_id\n, 'Urgent Care' as service_category_2\n, '{{ var('tuva_last_run')}}' as tuva_last_run\nfrom {{ ref('service_category__stg_medical_claim') }} a\nleft join {{ ref('service_category__emergency_department_institutional') }} b\n on a.claim_id = b.claim_id\nwhere claim_type = 'institutional'\n and revenue_center_code = '0456'\n and left(bill_type_code,2) in ('13','71','73')\n and b.claim_id is null", "language": "sql", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/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", "name": "service_category__urgent_care_institutional", "alias": "_int_urgent_care_institutional", "checksum": {"name": "sha256", "checksum": "c9276e41639a67f3426d08db8e9dcbf41f5fd3dbab1aa2aa73619253418bf377"}, "tags": ["service_category_grouper", "claims_preprocessing"], "refs": [["service_category__stg_medical_claim"], ["service_category__emergency_department_institutional"]], "sources": [], "metrics": [], "description": "N/A", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://models/claims_preprocessing/claims_preprocessing_models.yml", "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_urgent_care_institutional", "materialized": "table", "tags": ["service_category_grouper", "claims_preprocessing"], "enabled": true, "bind": false}, "created_at": 1701215340.048728}, "model.the_tuva_project.service_category__acute_inpatient_institutional": {"resource_type": "model", "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"]}, "config": {"enabled": true, "alias": "_int_acute_inpatient_institutional", "schema": "claims_preprocessing", "database": null, "tags": ["service_category_grouper", "claims_preprocessing"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "bind": false, "post-hook": [], "pre-hook": []}, "database": "dev_sarah", "schema": "claims_preprocessing", "fqn": ["the_tuva_project", "claims_preprocessing", "service_category", "intermediate", "service_category__acute_inpatient_institutional"], "unique_id": "model.the_tuva_project.service_category__acute_inpatient_institutional", "raw_code": "{{ config(\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\n )\n}}\n\nwith room_and_board_requirement as (\nselect distinct \n claim_id\nfrom {{ ref('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 {{ ref('service_category__stg_medical_claim') }} mc\nleft join {{ ref('terminology__ms_drg')}} msdrg\n on mc.ms_drg_code = msdrg.ms_drg_code\nleft join {{ ref('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 {{ ref('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, '{{ var('tuva_last_run')}}' as tuva_last_run\nfrom {{ ref('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", "language": "sql", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/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", "name": "service_category__acute_inpatient_institutional", "alias": "_int_acute_inpatient_institutional", "checksum": {"name": "sha256", "checksum": "102b98bfad308a4b15a56e009424b8cb75e94d87ac512dff9d6b400066ca685c"}, "tags": ["service_category_grouper", "claims_preprocessing"], "refs": [["service_category__stg_medical_claim"], ["service_category__stg_medical_claim"], ["terminology__ms_drg"], ["terminology__apr_drg"], ["service_category__stg_medical_claim"], ["service_category__stg_medical_claim"]], "sources": [], "metrics": [], "description": "N/A", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://models/claims_preprocessing/claims_preprocessing_models.yml", "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_acute_inpatient_institutional", "materialized": "table", "tags": ["service_category_grouper", "claims_preprocessing"], "enabled": true, "bind": false}, "created_at": 1701215340.0012228}, "model.the_tuva_project.service_category__office_visit_professional": {"resource_type": "model", "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.service_category__stg_medical_claim"]}, "config": {"enabled": true, "alias": "_int_office_visit_professional", "schema": "claims_preprocessing", "database": null, "tags": ["service_category_grouper", "claims_preprocessing"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "bind": false, "post-hook": [], "pre-hook": []}, "database": "dev_sarah", "schema": "claims_preprocessing", "fqn": ["the_tuva_project", "claims_preprocessing", "service_category", "intermediate", "service_category__office_visit_professional"], "unique_id": "model.the_tuva_project.service_category__office_visit_professional", "raw_code": "{{ config(\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\n )\n}}\n\nselect distinct \n claim_id\n, claim_line_number\n, 'Office Visit' as service_category_2\n, '{{ var('tuva_last_run')}}' as tuva_last_run\nfrom {{ ref('service_category__stg_medical_claim') }}\nwhere claim_type = 'professional'\n and place_of_service_code in ('11','02')", "language": "sql", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/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", "name": "service_category__office_visit_professional", "alias": "_int_office_visit_professional", "checksum": {"name": "sha256", "checksum": "2cbbf68b4dba7ef381f9b08926d395be97e2d82a474888d03d8cdd211878f3ff"}, "tags": ["service_category_grouper", "claims_preprocessing"], "refs": [["service_category__stg_medical_claim"]], "sources": [], "metrics": [], "description": "N/A", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://models/claims_preprocessing/claims_preprocessing_models.yml", "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_office_visit_professional", "materialized": "table", "tags": ["service_category_grouper", "claims_preprocessing"], "enabled": true, "bind": false}, "created_at": 1701215340.03355}, "model.the_tuva_project.service_category__combined_professional": {"resource_type": "model", "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.service_category__acute_inpatient_professional", "model.the_tuva_project.service_category__ambulatory_surgery_professional", "model.the_tuva_project.service_category__dialysis_professional", "model.the_tuva_project.service_category__emergency_department_professional", "model.the_tuva_project.service_category__home_health_professional", "model.the_tuva_project.service_category__hospice_professional", "model.the_tuva_project.service_category__inpatient_psychiatric_professional", "model.the_tuva_project.service_category__inpatient_rehab_professional", "model.the_tuva_project.service_category__lab_professional", "model.the_tuva_project.service_category__office_visit_professional", "model.the_tuva_project.service_category__outpatient_hospital_or_clinic_professional", "model.the_tuva_project.service_category__outpatient_psychiatric_professional", "model.the_tuva_project.service_category__outpatient_rehab_professional", "model.the_tuva_project.service_category__skilled_nursing_professional", "model.the_tuva_project.service_category__urgent_care_professional", "model.the_tuva_project.service_category__dme_professional", "model.the_tuva_project.service_category__ambulance_professional", "model.the_tuva_project.service_category__dme_professional", "model.the_tuva_project.service_category__dme_professional", "model.the_tuva_project.service_category__ambulance_professional"]}, "config": {"enabled": true, "alias": "_int_combined_professional", "schema": "claims_preprocessing", "database": null, "tags": ["service_category_grouper", "claims_preprocessing"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "bind": false, "post-hook": [], "pre-hook": []}, "database": "dev_sarah", "schema": "claims_preprocessing", "fqn": ["the_tuva_project", "claims_preprocessing", "service_category", "intermediate", "service_category__combined_professional"], "unique_id": "model.the_tuva_project.service_category__combined_professional", "raw_code": "{{ config(\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\n )\n}}\n\nwith combined as (\nselect *\nfrom {{ ref('service_category__acute_inpatient_professional') }}\n\nunion all\n\nselect *\nfrom {{ ref('service_category__ambulatory_surgery_professional') }}\n\nunion all\n\nselect *\nfrom {{ ref('service_category__dialysis_professional') }}\n\nunion all\n\nselect *\nfrom {{ ref('service_category__emergency_department_professional') }}\n\nunion all\n\nselect *\nfrom {{ ref('service_category__home_health_professional') }}\n\nunion all\n\nselect *\nfrom {{ ref('service_category__hospice_professional') }}\n\nunion all\n\nselect *\nfrom {{ ref('service_category__inpatient_psychiatric_professional') }}\n\nunion all\n\nselect *\nfrom {{ ref('service_category__inpatient_rehab_professional') }}\n\nunion all\n\nselect *\nfrom {{ ref('service_category__lab_professional') }}\n\nunion all\n\nselect *\nfrom {{ ref('service_category__office_visit_professional') }}\n\nunion all\n\nselect *\nfrom {{ ref('service_category__outpatient_hospital_or_clinic_professional') }}\n\nunion all\n\nselect *\nfrom {{ ref('service_category__outpatient_psychiatric_professional') }}\n\nunion all\n\nselect *\nfrom {{ ref('service_category__outpatient_rehab_professional') }}\n\nunion all\n\nselect *\nfrom {{ ref('service_category__skilled_nursing_professional') }}\n\nunion all\n\nselect *\nfrom {{ ref('service_category__urgent_care_professional') }}\n)\n\nselect \n claim_id\n, claim_line_number\n, service_category_2\n, tuva_last_run\nfrom {{ ref('service_category__dme_professional') }}\n\nunion all\n\nselect \n a.claim_id\n, a.claim_line_number\n, a.service_category_2\n, a.tuva_last_run\nfrom {{ ref('service_category__ambulance_professional') }} a\nleft join {{ ref('service_category__dme_professional') }} b\n on a.claim_id = b.claim_id\n and a.claim_line_number = b.claim_line_number\nwhere (b.claim_id is null and b.claim_line_number is null)\n\nunion all\n\nselect \n a.claim_id\n, a.claim_line_number\n, a.service_category_2\n, a.tuva_last_run\nfrom combined a\nleft join {{ ref('service_category__dme_professional') }} b\n on a.claim_id = b.claim_id\n and a.claim_line_number = b.claim_line_number\nleft join {{ ref('service_category__ambulance_professional') }} c\n on a.claim_id = c.claim_id\n and a.claim_line_number = c.claim_line_number\nwhere (b.claim_id is null and b.claim_line_number is null)\n and (c.claim_id is null and c.claim_line_number is null)", "language": "sql", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/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", "name": "service_category__combined_professional", "alias": "_int_combined_professional", "checksum": {"name": "sha256", "checksum": "3d32397613f5bce6e4fc5ec30b388512cf712a18a5e53a3bc1965c4fabbe37f4"}, "tags": ["service_category_grouper", "claims_preprocessing"], "refs": [["service_category__acute_inpatient_professional"], ["service_category__ambulatory_surgery_professional"], ["service_category__dialysis_professional"], ["service_category__emergency_department_professional"], ["service_category__home_health_professional"], ["service_category__hospice_professional"], ["service_category__inpatient_psychiatric_professional"], ["service_category__inpatient_rehab_professional"], ["service_category__lab_professional"], ["service_category__office_visit_professional"], ["service_category__outpatient_hospital_or_clinic_professional"], ["service_category__outpatient_psychiatric_professional"], ["service_category__outpatient_rehab_professional"], ["service_category__skilled_nursing_professional"], ["service_category__urgent_care_professional"], ["service_category__dme_professional"], ["service_category__ambulance_professional"], ["service_category__dme_professional"], ["service_category__dme_professional"], ["service_category__ambulance_professional"]], "sources": [], "metrics": [], "description": "N/A", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://models/claims_preprocessing/claims_preprocessing_models.yml", "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_combined_professional", "materialized": "table", "tags": ["service_category_grouper", "claims_preprocessing"], "enabled": true, "bind": false}, "created_at": 1701215339.997489}, "model.the_tuva_project.service_category__ambulance_professional": {"resource_type": "model", "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.service_category__stg_medical_claim"]}, "config": {"enabled": true, "alias": "_int_ambulance_professional", "schema": "claims_preprocessing", "database": null, "tags": ["service_category_grouper", "claims_preprocessing"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "bind": false, "post-hook": [], "pre-hook": []}, "database": "dev_sarah", "schema": "claims_preprocessing", "fqn": ["the_tuva_project", "claims_preprocessing", "service_category", "intermediate", "service_category__ambulance_professional"], "unique_id": "model.the_tuva_project.service_category__ambulance_professional", "raw_code": "{{ config(\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\n )\n}}\n\nselect distinct \n claim_id\n, claim_line_number\n, 'Ambulance' as service_category_2\n, '{{ var('tuva_last_run')}}' as tuva_last_run\nfrom {{ ref('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'))", "language": "sql", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/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", "name": "service_category__ambulance_professional", "alias": "_int_ambulance_professional", "checksum": {"name": "sha256", "checksum": "50b1e4793cfe956fb8bd2b5add08bbf455f44565cdecb7ab7595a821353121a0"}, "tags": ["service_category_grouper", "claims_preprocessing"], "refs": [["service_category__stg_medical_claim"]], "sources": [], "metrics": [], "description": "N/A", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://models/claims_preprocessing/claims_preprocessing_models.yml", "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_ambulance_professional", "materialized": "table", "tags": ["service_category_grouper", "claims_preprocessing"], "enabled": true, "bind": false}, "created_at": 1701215340.004988}, "model.the_tuva_project.service_category__outpatient_psychiatric_professional": {"resource_type": "model", "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.service_category__stg_medical_claim"]}, "config": {"enabled": true, "alias": "_int_outpatient_psychiatric_professional", "schema": "claims_preprocessing", "database": null, "tags": ["service_category_grouper", "claims_preprocessing"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "bind": false, "post-hook": [], "pre-hook": []}, "database": "dev_sarah", "schema": "claims_preprocessing", "fqn": ["the_tuva_project", "claims_preprocessing", "service_category", "intermediate", "service_category__outpatient_psychiatric_professional"], "unique_id": "model.the_tuva_project.service_category__outpatient_psychiatric_professional", "raw_code": "{{ config(\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\n )\n}}\n\nselect distinct \n claim_id\n, claim_line_number\n, 'Outpatient Psychiatric' as service_category_2\n, '{{ var('tuva_last_run')}}' as tuva_last_run\nfrom {{ ref('service_category__stg_medical_claim') }}\nwhere claim_type = 'professional'\n and place_of_service_code in ('52','53','57','58')", "language": "sql", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/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", "name": "service_category__outpatient_psychiatric_professional", "alias": "_int_outpatient_psychiatric_professional", "checksum": {"name": "sha256", "checksum": "57c360280ab2e02065cd5f171a3140eabf98c45f306ca0c6d25a23cb8d4e8da4"}, "tags": ["service_category_grouper", "claims_preprocessing"], "refs": [["service_category__stg_medical_claim"]], "sources": [], "metrics": [], "description": "N/A", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://models/claims_preprocessing/claims_preprocessing_models.yml", "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_outpatient_psychiatric_professional", "materialized": "table", "tags": ["service_category_grouper", "claims_preprocessing"], "enabled": true, "bind": false}, "created_at": 1701215340.041236}, "model.the_tuva_project.service_category__emergency_department_institutional": {"resource_type": "model", "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.service_category__stg_medical_claim", "model.the_tuva_project.service_category__acute_inpatient_institutional"]}, "config": {"enabled": true, "alias": "_int_emergency_department_institutional", "schema": "claims_preprocessing", "database": null, "tags": ["service_category_grouper", "claims_preprocessing"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "bind": false, "post-hook": [], "pre-hook": []}, "database": "dev_sarah", "schema": "claims_preprocessing", "fqn": ["the_tuva_project", "claims_preprocessing", "service_category", "intermediate", "service_category__emergency_department_institutional"], "unique_id": "model.the_tuva_project.service_category__emergency_department_institutional", "raw_code": "{{ config(\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\n )\n}}\n\nselect distinct \n med.claim_id\n , 'Emergency Department' as service_category_2\n , '{{ var('tuva_last_run')}}' as tuva_last_run\nfrom {{ ref('service_category__stg_medical_claim') }} med\nleft join {{ ref('service_category__acute_inpatient_institutional') }} inpatient\n on med.claim_id = inpatient.claim_id\nwhere claim_type = 'institutional'\nand revenue_center_code in ('0450','0451','0452','0459','0981')\nand inpatient.claim_id is null\n-- 0456, urgent care, is included in most published definitions\n-- that also include a requirement of a bill type code for\n-- inpatient or outpatient hospital.", "language": "sql", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/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", "name": "service_category__emergency_department_institutional", "alias": "_int_emergency_department_institutional", "checksum": {"name": "sha256", "checksum": "28541b14bd2f5f643cbe8567d6bbc45847512c8743abc6e30fe0f7f0145f6fdd"}, "tags": ["service_category_grouper", "claims_preprocessing"], "refs": [["service_category__stg_medical_claim"], ["service_category__acute_inpatient_institutional"]], "sources": [], "metrics": [], "description": "N/A", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://models/claims_preprocessing/claims_preprocessing_models.yml", "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_emergency_department_institutional", "materialized": "table", "tags": ["service_category_grouper", "claims_preprocessing"], "enabled": true, "bind": false}, "created_at": 1701215340.014346}, "model.the_tuva_project.service_category__outpatient_hospital_or_clinic_institutional": {"resource_type": "model", "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"]}, "config": {"enabled": true, "alias": "_int_outpatient_hospital_or_clinic_institutional", "schema": "claims_preprocessing", "database": null, "tags": ["service_category_grouper", "claims_preprocessing"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "bind": false, "post-hook": [], "pre-hook": []}, "database": "dev_sarah", "schema": "claims_preprocessing", "fqn": ["the_tuva_project", "claims_preprocessing", "service_category", "intermediate", "service_category__outpatient_hospital_or_clinic_institutional"], "unique_id": "model.the_tuva_project.service_category__outpatient_hospital_or_clinic_institutional", "raw_code": "{{ config(\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\n )\n}}\n\nselect distinct \n a.claim_id\n, 'Outpatient Hospital or Clinic' as service_category_2\n, '{{ var('tuva_last_run')}}' as tuva_last_run\nfrom {{ ref('service_category__stg_medical_claim') }} a\nleft join {{ ref('service_category__emergency_department_institutional') }} b\n on a.claim_id = b.claim_id\nleft join {{ ref('service_category__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", "language": "sql", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/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", "name": "service_category__outpatient_hospital_or_clinic_institutional", "alias": "_int_outpatient_hospital_or_clinic_institutional", "checksum": {"name": "sha256", "checksum": "28128bda9ea23283556e27e74e68d38fd43c387634a682af1766424ad7b13262"}, "tags": ["service_category_grouper", "claims_preprocessing"], "refs": [["service_category__stg_medical_claim"], ["service_category__emergency_department_institutional"], ["service_category__urgent_care_institutional"]], "sources": [], "metrics": [], "description": "N/A", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://models/claims_preprocessing/claims_preprocessing_models.yml", "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_outpatient_hospital_or_clinic_institutional", "materialized": "table", "tags": ["service_category_grouper", "claims_preprocessing"], "enabled": true, "bind": false}, "created_at": 1701215340.035338}, "model.the_tuva_project.service_category__outpatient_rehab_professional": {"resource_type": "model", "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.service_category__stg_medical_claim"]}, "config": {"enabled": true, "alias": "_int_outpatient_rehab_professional", "schema": "claims_preprocessing", "database": null, "tags": ["service_category_grouper", "claims_preprocessing"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "bind": false, "post-hook": [], "pre-hook": []}, "database": "dev_sarah", "schema": "claims_preprocessing", "fqn": ["the_tuva_project", "claims_preprocessing", "service_category", "intermediate", "service_category__outpatient_rehab_professional"], "unique_id": "model.the_tuva_project.service_category__outpatient_rehab_professional", "raw_code": "{{ config(\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\n )\n}}\n\nselect distinct \n claim_id\n, claim_line_number\n, 'Outpatient Rehabilitation' as service_category_2\n, '{{ var('tuva_last_run')}}' as tuva_last_run\nfrom {{ ref('service_category__stg_medical_claim') }}\nwhere claim_type = 'professional'\n and place_of_service_code in ('62')", "language": "sql", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/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", "name": "service_category__outpatient_rehab_professional", "alias": "_int_outpatient_rehab_professional", "checksum": {"name": "sha256", "checksum": "1bff47377ee62565644d65bcbf20b48eb55cd6aa30f26f825a760a79547bc642"}, "tags": ["service_category_grouper", "claims_preprocessing"], "refs": [["service_category__stg_medical_claim"]], "sources": [], "metrics": [], "description": "N/A", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://models/claims_preprocessing/claims_preprocessing_models.yml", "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_outpatient_rehab_professional", "materialized": "table", "tags": ["service_category_grouper", "claims_preprocessing"], "enabled": true, "bind": false}, "created_at": 1701215340.043069}, "model.the_tuva_project.service_category__outpatient_psychiatric_institutional": {"resource_type": "model", "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.service_category__stg_medical_claim"]}, "config": {"enabled": true, "alias": "_int_outpatient_psychiatric_institutional", "schema": "claims_preprocessing", "database": null, "tags": ["service_category_grouper", "claims_preprocessing"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "bind": false, "post-hook": [], "pre-hook": []}, "database": "dev_sarah", "schema": "claims_preprocessing", "fqn": ["the_tuva_project", "claims_preprocessing", "service_category", "intermediate", "service_category__outpatient_psychiatric_institutional"], "unique_id": "model.the_tuva_project.service_category__outpatient_psychiatric_institutional", "raw_code": "{{ config(\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\n )\n}}\n\nselect distinct \n claim_id\n, 'Outpatient Psychiatric' as service_category_2\n, '{{ var('tuva_last_run')}}' as tuva_last_run\nfrom {{ ref('service_category__stg_medical_claim') }}\nwhere claim_type = 'institutional'\n and left(bill_type_code,2) in ('52')", "language": "sql", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/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", "name": "service_category__outpatient_psychiatric_institutional", "alias": "_int_outpatient_psychiatric_institutional", "checksum": {"name": "sha256", "checksum": "86d5748aa48ca63f0a2ef4fb1fab84cbf0f114d43f16f27f8a4bb0fbe02303be"}, "tags": ["service_category_grouper", "claims_preprocessing"], "refs": [["service_category__stg_medical_claim"]], "sources": [], "metrics": [], "description": "N/A", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://models/claims_preprocessing/claims_preprocessing_models.yml", "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_outpatient_psychiatric_institutional", "materialized": "table", "tags": ["service_category_grouper", "claims_preprocessing"], "enabled": true, "bind": false}, "created_at": 1701215340.03927}, "model.the_tuva_project.service_category__acute_inpatient_professional": {"resource_type": "model", "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.service_category__stg_medical_claim"]}, "config": {"enabled": true, "alias": "_int_acute_inpatient_professional", "schema": "claims_preprocessing", "database": null, "tags": ["service_category_grouper", "claims_preprocessing"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "bind": false, "post-hook": [], "pre-hook": []}, "database": "dev_sarah", "schema": "claims_preprocessing", "fqn": ["the_tuva_project", "claims_preprocessing", "service_category", "intermediate", "service_category__acute_inpatient_professional"], "unique_id": "model.the_tuva_project.service_category__acute_inpatient_professional", "raw_code": "{{ config(\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\n )\n}}\n\nselect distinct\n claim_id\n, claim_line_number\n, 'Acute Inpatient' as service_category_2\n, '{{ var('tuva_last_run')}}' as tuva_last_run\nfrom {{ ref('service_category__stg_medical_claim') }}\nwhere claim_type = 'professional'\n and place_of_service_code = '21'", "language": "sql", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/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", "name": "service_category__acute_inpatient_professional", "alias": "_int_acute_inpatient_professional", "checksum": {"name": "sha256", "checksum": "e9bab19d3e02d461a0c3eaa360c38fdf7b386a92891d50701b326e976e9d0e58"}, "tags": ["service_category_grouper", "claims_preprocessing"], "refs": [["service_category__stg_medical_claim"]], "sources": [], "metrics": [], "description": "N/A", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://models/claims_preprocessing/claims_preprocessing_models.yml", "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_acute_inpatient_professional", "materialized": "table", "tags": ["service_category_grouper", "claims_preprocessing"], "enabled": true, "bind": false}, "created_at": 1701215340.003149}, "model.the_tuva_project.acute_inpatient__stg_medical_claim": {"resource_type": "model", "depends_on": {"macros": [], "nodes": ["model.input_layer.medical_claim"]}, "config": {"enabled": true, "alias": "_stg_medical_claim", "schema": null, "database": null, "tags": ["acute_inpatient", "claims_preprocessing"], "meta": {}, "materialized": "ephemeral", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#0f3d0b"}, "bind": false, "post-hook": [], "pre-hook": []}, "database": "dev_sarah", "schema": "dbt_sarah", "fqn": ["the_tuva_project", "claims_preprocessing", "acute_inpatient", "staging", "acute_inpatient__stg_medical_claim"], "unique_id": "model.the_tuva_project.acute_inpatient__stg_medical_claim", "raw_code": "{{ config(\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\n )\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, '{{ var('tuva_last_run')}}' as tuva_last_run\nfrom {{ ref('medical_claim') }}", "language": "sql", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/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", "name": "acute_inpatient__stg_medical_claim", "alias": "_stg_medical_claim", "checksum": {"name": "sha256", "checksum": "34396d51d949064d2026a027f2129fc5faaba816dd8a0fa3bdcff86ef90ad215"}, "tags": ["acute_inpatient", "claims_preprocessing"], "refs": [["medical_claim"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#0f3d0b"}, "patch_path": "the_tuva_project://models/claims_preprocessing/claims_preprocessing_models.yml", "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"alias": "_stg_medical_claim", "tags": ["acute_inpatient", "claims_preprocessing"], "materialized": "ephemeral", "enabled": true, "bind": false, "docs": {"node_color": "#0f3d0b"}}, "created_at": 1701215339.91}, "model.the_tuva_project.acute_inpatient__stg_service_category": {"resource_type": "model", "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.service_category__service_category_grouper"]}, "config": {"enabled": true, "alias": "_stg_service_category", "schema": null, "database": null, "tags": ["acute_inpatient", "claims_preprocessing"], "meta": {}, "materialized": "ephemeral", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#0f3d0b"}, "bind": false, "post-hook": [], "pre-hook": []}, "database": "dev_sarah", "schema": "dbt_sarah", "fqn": ["the_tuva_project", "claims_preprocessing", "acute_inpatient", "staging", "acute_inpatient__stg_service_category"], "unique_id": "model.the_tuva_project.acute_inpatient__stg_service_category", "raw_code": "{{ config(\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\n )\n}}\n\n\nSELECT\n claim_id\n, claim_type\n, claim_line_number\n, service_category_2\n, '{{ var('tuva_last_run')}}' as tuva_last_run\nfrom {{ ref('service_category__service_category_grouper')}}", "language": "sql", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/the_tuva_project", "path": "claims_preprocessing/acute_inpatient/staging/acute_inpatient__stg_service_category.sql", "original_file_path": "models/claims_preprocessing/acute_inpatient/staging/acute_inpatient__stg_service_category.sql", "name": "acute_inpatient__stg_service_category", "alias": "_stg_service_category", "checksum": {"name": "sha256", "checksum": "2209519a82d2ab3d0f216a7634d07152514384339013c7fed208cffecb3646d3"}, "tags": ["acute_inpatient", "claims_preprocessing"], "refs": [["service_category__service_category_grouper"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#0f3d0b"}, "patch_path": "the_tuva_project://models/claims_preprocessing/claims_preprocessing_models.yml", "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"alias": "_stg_service_category", "tags": ["acute_inpatient", "claims_preprocessing"], "materialized": "ephemeral", "enabled": true, "bind": false, "docs": {"node_color": "#0f3d0b"}}, "created_at": 1701215339.911433}, "model.the_tuva_project.acute_inpatient__stg_eligibility": {"resource_type": "model", "depends_on": {"macros": [], "nodes": ["model.input_layer.eligibility"]}, "config": {"enabled": true, "alias": "_stg_eligibility", "schema": null, "database": null, "tags": ["acute_inpatient", "claims_preprocessing"], "meta": {}, "materialized": "ephemeral", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#0f3d0b"}, "bind": false, "post-hook": [], "pre-hook": []}, "database": "dev_sarah", "schema": "dbt_sarah", "fqn": ["the_tuva_project", "claims_preprocessing", "acute_inpatient", "staging", "acute_inpatient__stg_eligibility"], "unique_id": "model.the_tuva_project.acute_inpatient__stg_eligibility", "raw_code": "{{ config(\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\n )\n}}\n\nselect\n patient_id\n, birth_date\n, gender\n, race\n, '{{ var('tuva_last_run')}}' as tuva_last_run\nfrom {{ ref('eligibility') }}", "language": "sql", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/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", "name": "acute_inpatient__stg_eligibility", "alias": "_stg_eligibility", "checksum": {"name": "sha256", "checksum": "1124dc822b609d878df88cc0f4674ee49db96cd5a9fed3278b9c26cae3e5216b"}, "tags": ["acute_inpatient", "claims_preprocessing"], "refs": [["eligibility"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#0f3d0b"}, "patch_path": "the_tuva_project://models/claims_preprocessing/claims_preprocessing_models.yml", "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"alias": "_stg_eligibility", "tags": ["acute_inpatient", "claims_preprocessing"], "materialized": "ephemeral", "enabled": true, "bind": false, "docs": {"node_color": "#0f3d0b"}}, "created_at": 1701215339.908664}, "model.the_tuva_project.acute_inpatient__summary": {"resource_type": "model", "depends_on": {"macros": ["macro.dbt.datediff"], "nodes": ["model.the_tuva_project.acute_inpatient__encounter_id", "model.the_tuva_project.acute_inpatient__encounter_start_and_end_dates", "model.input_layer.medical_claim", "model.the_tuva_project.acute_inpatient__encounter_id", "model.the_tuva_project.acute_inpatient__first_claim_values", "model.the_tuva_project.acute_inpatient__last_claim_values", "model.the_tuva_project.acute_inpatient__stg_medical_claim", "model.the_tuva_project.acute_inpatient__encounter_id", "model.the_tuva_project.acute_inpatient__stg_eligibility", "model.the_tuva_project.acute_inpatient__institutional_encounter_id", "seed.the_tuva_project.terminology__provider", "seed.the_tuva_project.terminology__discharge_disposition", "seed.the_tuva_project.terminology__admit_source", "seed.the_tuva_project.terminology__admit_type", "seed.the_tuva_project.terminology__ms_drg", "seed.the_tuva_project.terminology__apr_drg", "seed.the_tuva_project.terminology__icd_10_cm", "seed.the_tuva_project.terminology__icd_9_cm"]}, "config": {"enabled": true, "alias": "acute_inpatient_summary", "schema": "claims_preprocessing", "database": null, "tags": ["acute_inpatient", "claims_preprocessing"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#0f3d0b"}, "bind": false, "post-hook": [], "pre-hook": []}, "database": "dev_sarah", "schema": "claims_preprocessing", "fqn": ["the_tuva_project", "claims_preprocessing", "acute_inpatient", "final", "acute_inpatient__summary"], "unique_id": "model.the_tuva_project.acute_inpatient__summary", "raw_code": "{{ config(\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\n )\n}}\n\nwith distinct_encounters as (\n select distinct\n a.encounter_id\n , a.patient_id\n , b.encounter_start_date\n , b.encounter_end_date\nfrom {{ ref('acute_inpatient__encounter_id') }} a\ninner join {{ ref('acute_inpatient__encounter_start_and_end_dates') }} b\n on a.encounter_id = b.encounter_id\n)\n\n, institutional_claim_details as (\n select\n b.encounter_id\n , first.diagnosis_code_1\n , first.diagnosis_code_type\n , first.facility_npi as facility_npi\n , first.ms_drg_code as ms_drg_code\n , first.apr_drg_code as apr_drg_code\n , first.admit_source_code as admit_source_code\n , first.admit_type_code as admit_type_code\n , last.discharge_disposition_code as discharge_disposition_code\n , sum(paid_amount) as inst_paid_amount\n , sum(allowed_amount) as inst_allowed_amount\n , sum(charge_amount) as inst_charge_amount\n , max(data_source) as data_source\n from {{ ref('medical_claim') }} a\n inner join {{ ref('acute_inpatient__encounter_id') }} b\n on a.claim_id = b.claim_id\n and a.claim_line_number = b.claim_line_number\n and a.claim_type = 'institutional'\n inner join {{ ref('acute_inpatient__first_claim_values') }} first\n on b.encounter_id = first.encounter_id\n and first.claim_row = 1\n inner join {{ ref('acute_inpatient__last_claim_values') }} last\n on b.encounter_id = last.encounter_id\n and last.claim_row = 1\n group by\n b.encounter_id\n , first.diagnosis_code_1\n , first.diagnosis_code_type\n , first.facility_npi\n , first.ms_drg_code\n , first.apr_drg_code\n , first.admit_source_code\n , first.admit_type_code\n , last.discharge_disposition_code\n)\n\n, professional_claim_details as (\n select\n b.encounter_id\n , sum(paid_amount) as prof_paid_amount\n , sum(allowed_amount) as prof_allowed_amount\n , sum(charge_amount) as prof_charge_amount\n from {{ ref('acute_inpatient__stg_medical_claim') }} a\n inner join {{ ref('acute_inpatient__encounter_id') }} b\n on a.claim_id = b.claim_id\n and a.claim_line_number = b.claim_line_number\n and a.claim_type = 'professional'\ngroup by 1\n)\n\n, patient as (\n select distinct\n patient_id\n , birth_date\n , gender\n , race\n from {{ ref('acute_inpatient__stg_eligibility') }}\n )\n\n, provider as (\n select\n a.encounter_id\n , max(a.facility_npi) as facility_npi\n , b.provider_first_name\n , b.provider_last_name\n , count(distinct facility_npi) as npi_count\n from {{ ref('acute_inpatient__institutional_encounter_id') }} a\n left join {{ ref('terminology__provider') }} b\n on a.facility_npi = b.npi\n group by 1,3,4\n)\n\nselect\n a.encounter_id\n, a.encounter_start_date\n, a.encounter_end_date\n, a.patient_id\n, {{ dbt.datediff(\"birth_date\",\"encounter_end_date\",\"day\")}}/365 as admit_age\n, e.gender\n, e.race\n, c.diagnosis_code_type as primary_diagnosis_code_type\n, c.diagnosis_code_1 as primary_diagnosis_code\n, coalesce(icd10cm.description, icd9cm.long_description) as primary_diagnosis_description\n, f.facility_npi\n, f.provider_first_name\n, f.provider_last_name\n, c.ms_drg_code\n, j.ms_drg_description\n, j.medical_surgical\n, c.apr_drg_code\n, k.apr_drg_description\n, c.admit_source_code\n, h.admit_source_description\n, c.admit_type_code\n, i.admit_type_description\n, c.discharge_disposition_code\n, g.discharge_disposition_description\n, c.inst_paid_amount + coalesce(d.prof_paid_amount,0) as total_paid_amount\n, c.inst_allowed_amount + coalesce(d.prof_allowed_amount,0) as total_allowed_amount\n, c.inst_charge_amount + coalesce(d.prof_charge_amount,0) as total_charge_amount\n, {{ dbt.datediff(\"a.encounter_start_date\",\"a.encounter_end_date\",\"day\") }} 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, '{{ var('tuva_last_run')}}' 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 {{ ref('terminology__discharge_disposition') }} g\n on c.discharge_disposition_code = g.discharge_disposition_code\nleft join {{ ref('terminology__admit_source') }} h\n on c.admit_source_code = h.admit_source_code\nleft join {{ ref('terminology__admit_type') }} i\n on c.admit_type_code = i.admit_type_code\nleft join {{ ref('terminology__ms_drg') }} j\n on c.ms_drg_code = j.ms_drg_code\nleft join {{ ref('terminology__apr_drg') }} k\n on c.apr_drg_code = k.apr_drg_code\nleft join {{ ref('terminology__icd_10_cm')}} icd10cm\n on c.diagnosis_code_1 = icd10cm.icd_10_cm\n and c.diagnosis_code_type = 'icd-10-cm'\nleft join {{ ref('terminology__icd_9_cm')}} icd9cm\n on c.diagnosis_code_1 = icd9cm.icd_9_cm\n and c.diagnosis_code_type = 'icd-9-cm'", "language": "sql", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/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", "name": "acute_inpatient__summary", "alias": "acute_inpatient_summary", "checksum": {"name": "sha256", "checksum": "2c7134e1d4bb9293da6cc7b6949924a8ca43abfd1ead18ac20b442d0fdaa02c3"}, "tags": ["acute_inpatient", "claims_preprocessing"], "refs": [["acute_inpatient__encounter_id"], ["acute_inpatient__encounter_start_and_end_dates"], ["medical_claim"], ["acute_inpatient__encounter_id"], ["acute_inpatient__first_claim_values"], ["acute_inpatient__last_claim_values"], ["acute_inpatient__stg_medical_claim"], ["acute_inpatient__encounter_id"], ["acute_inpatient__stg_eligibility"], ["acute_inpatient__institutional_encounter_id"], ["terminology__provider"], ["terminology__discharge_disposition"], ["terminology__admit_source"], ["terminology__admit_type"], ["terminology__ms_drg"], ["terminology__apr_drg"], ["terminology__icd_10_cm"], ["terminology__icd_9_cm"]], "sources": [], "metrics": [], "description": "This table pulls together all the data needed to perform acute inpatient analytics into a single table.", "columns": {"encounter_id": {"name": "encounter_id", "description": "Unique identifier for the acute inpatient encounter.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "encounter_start_date": {"name": "encounter_start_date", "description": "Date when the patient was admitted.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "encounter_end_date": {"name": "encounter_end_date", "description": "Date when the patient was discharged.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "patient_id": {"name": "patient_id", "description": "Unique identifier for each patient in the dataset.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "admit_age": {"name": "admit_age", "description": "The age of the patient as of their admission date.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "gender": {"name": "gender", "description": "The gender of the patient.", "meta": {"terminology": "/terminology/demographics/gender"}, "data_type": null, "quote": null, "tags": []}, "race": {"name": "race", "description": "The race of the patient.", "meta": {"terminology": "/terminology/demographics/race"}, "data_type": null, "quote": null, "tags": []}, "facility_npi": {"name": "facility_npi", "description": "The NPI for the facility where the encounter occurred.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "provider_first_name": {"name": "provider_first_name", "description": "The first name of the provider.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "provider_last_name": {"name": "provider_last_name", "description": "The last name of the provider.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "ms_drg_code": {"name": "ms_drg_code", "description": "The MS-DRG code associted with the inpatient visit", "meta": {"terminology": "/terminology/conditions-and-procedures/ms-drg"}, "data_type": null, "quote": null, "tags": []}, "ms_drg_description": {"name": "ms_drg_description", "description": "The MS-DRG description associted with the inpatient visit", "meta": {"terminology": "/terminology/conditions-and-procedures/ms-drg"}, "data_type": null, "quote": null, "tags": []}, "medical_surgical": {"name": "medical_surgical", "description": "Indicates whether the MS-DRG is medical or surgical in nature.", "meta": {"terminology": "/terminology/conditions-and-procedures/ms-drg"}, "data_type": null, "quote": null, "tags": []}, "apr_drg_code": {"name": "apr_drg_code", "description": "The APR-DRG code associted with the inpatient visit", "meta": {"terminology": "/terminology/conditions-and-procedures/apr-drg"}, "data_type": null, "quote": null, "tags": []}, "apr_drg_description": {"name": "apr_drg_description", "description": "The APR-DRG description associted with the inpatient visit", "meta": {"terminology": "/terminology/conditions-and-procedures/apr-drg"}, "data_type": null, "quote": null, "tags": []}, "admit_source_code": {"name": "admit_source_code", "description": "Admission source code for the encounter.", "meta": {"terminology": "/terminology/administrative-codes/admit-source"}, "data_type": null, "quote": null, "tags": []}, "admit_source_description": {"name": "admit_source_description", "description": "Admission source description for the encounter.", "meta": {"terminology": "/terminology/administrative-codes/admit-source"}, "data_type": null, "quote": null, "tags": []}, "admit_type_code": {"name": "admit_type_code", "description": "Admission type code for the encounter.", "meta": {"terminology": "/terminology/administrative-codes/admit-type"}, "data_type": null, "quote": null, "tags": []}, "admit_type_description": {"name": "admit_type_description", "description": "Admission type description for the encounter.", "meta": {"terminology": "/terminology/administrative-codes/admit-type"}, "data_type": null, "quote": null, "tags": []}, "discharge_disposition_code": {"name": "discharge_disposition_code", "description": "Discharge disposition code for the encounter.", "meta": {"terminology": "/terminology/administrative-codes/discharge-disposition"}, "data_type": null, "quote": null, "tags": []}, "discharge_disposition_description": {"name": "discharge_disposition_description", "description": "Discharge disposition description for the encounter.", "meta": {"terminology": "/terminology/administrative-codes/discharge-disposition"}, "data_type": null, "quote": null, "tags": []}, "total_paid_amount": {"name": "total_paid_amount", "description": "The total paid amount across all claims for the encounter.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "total_allowed_amount": {"name": "total_allowed_amount", "description": "The total allowed amount across all claims for the encounter.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "total_charge_amount": {"name": "total_charge_amount", "description": "The total charge amount across all claims for the encounter.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "length_of_stay": {"name": "length_of_stay", "description": "The length of stay for the encoujnter.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "mortality_flag": {"name": "mortality_flag", "description": "1 if a patient died during the encounter, 0 otherwise.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "data_source": {"name": "data_source", "description": "User-configured field that indicates the data source (e.g. typically named after the payer and state \"BCBS Tennessee\").", "meta": {}, "data_type": null, "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The time at with the model was materialized. Generated by `dbt_utils.pretty_time` as the local time of the `dbt run` environment. Timezone is configurable via the `tuva_last_run` var.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": "#0f3d0b"}, "patch_path": "the_tuva_project://models/claims_preprocessing/claims_preprocessing_models.yml", "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "acute_inpatient_summary", "tags": ["acute_inpatient", "claims_preprocessing"], "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#0f3d0b"}}, "created_at": 1701215339.887928}, "model.the_tuva_project.acute_inpatient__professional_encounter_id": {"resource_type": "model", "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.acute_inpatient__stg_service_category", "model.the_tuva_project.acute_inpatient__stg_medical_claim", "model.the_tuva_project.acute_inpatient__encounter_start_and_end_dates"]}, "config": {"enabled": true, "alias": "_int_acute_inpatient_professional_encounter_id", "schema": "claims_preprocessing", "database": null, "tags": ["acute_inpatient", "claims_preprocessing"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#0f3d0b"}, "bind": false, "post-hook": [], "pre-hook": []}, "database": "dev_sarah", "schema": "claims_preprocessing", "fqn": ["the_tuva_project", "claims_preprocessing", "acute_inpatient", "intermediate", "acute_inpatient__professional_encounter_id"], "unique_id": "model.the_tuva_project.acute_inpatient__professional_encounter_id", "raw_code": "{{ config(\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\n )\n}}\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 acute_inpatient_professional_claim_ids as (\nselect distinct \n claim_id\n , claim_line_number\nfrom {{ ref('acute_inpatient__stg_service_category') }} \nwhere claim_type = 'professional'\n and service_category_2 = 'Acute Inpatient'\n),\n\nacute_inpatient_professional_claim_lines as (\nselect\n mc.claim_id,\n mc.claim_line_number,\n mc.patient_id,\n mc.claim_start_date as start_date,\n mc.claim_end_date as end_date\t \nfrom {{ ref('acute_inpatient__stg_medical_claim') }} mc\ninner join acute_inpatient_professional_claim_ids prof\n on mc.claim_id = prof.claim_id\n and mc.claim_line_number = prof.claim_line_number\n),\n\n\nacute_inpatient_professional_claim_dates as (\nselect\n claim_id,\n claim_line_number,\n patient_id,\n min(start_date) as start_date,\n max(end_date) as end_date\nfrom acute_inpatient_professional_claim_lines\ngroup by claim_id, claim_line_number, patient_id\n),\n\n\nroll_up_professional_claims_to_institutional_claims as (\nselect\n aa.patient_id,\n aa.claim_id,\n aa.claim_line_number,\n aa.start_date,\n aa.end_date,\n bb.encounter_id,\n case\n when bb.encounter_id is null then 1\n else 0\n end as orphan_claim_flag\nfrom acute_inpatient_professional_claim_dates aa\nleft join {{ ref('acute_inpatient__encounter_start_and_end_dates') }} bb\n on aa.patient_id = bb.patient_id\n and (coalesce(aa.start_date, aa.end_date) between bb.encounter_start_date and bb.encounter_end_date)\n and (coalesce(aa.end_date, aa.start_date) between bb.encounter_start_date and bb.encounter_end_date)\n),\n\nprofessional_claims_in_more_than_one_encounter as (\nselect\n patient_id,\n claim_id,\n claim_line_number,\n min(start_date) as start_date,\n max(end_date) as end_date,\n count(distinct encounter_id) as encounter_count\nfrom roll_up_professional_claims_to_institutional_claims\ngroup by patient_id, claim_line_number, claim_id\nhaving count(distinct encounter_id) > 1\n),\n\n\nprofessional_claims_not_in_more_than_one_encounter as (\nselect\n aa.patient_id,\n aa.claim_id,\n aa.claim_line_number,\n aa.start_date,\n aa.end_date,\n aa.encounter_id,\n aa.orphan_claim_flag,\n case\n when (aa.orphan_claim_flag = 1) then 0\n else 1\n end as encounter_count\nfrom roll_up_professional_claims_to_institutional_claims aa\nleft join professional_claims_in_more_than_one_encounter bb\non aa.claim_id = bb.claim_id\nand aa.claim_line_number = bb.claim_line_number\nand aa.patient_id = bb.patient_id\nwhere (bb.patient_id is null) and (bb.claim_id is null)\n),\n\n\nall_acute_inpatient_professional_claims as (\nselect\n patient_id,\n claim_id,\n claim_line_number,\n start_date,\n end_date,\n encounter_id,\n orphan_claim_flag,\n encounter_count\nfrom professional_claims_not_in_more_than_one_encounter\n\nunion all\n\nselect\n patient_id,\n claim_id,\n claim_line_number,\n start_date,\n end_date,\n null as encounter_id,\n 0 as orphan_claim_count,\n encounter_count\nfrom professional_claims_in_more_than_one_encounter\n)\n\n\n\nselect *, '{{ var('tuva_last_run')}}' as tuva_last_run\nfrom all_acute_inpatient_professional_claims", "language": "sql", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/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", "name": "acute_inpatient__professional_encounter_id", "alias": "_int_acute_inpatient_professional_encounter_id", "checksum": {"name": "sha256", "checksum": "b4f528f3fe605f8db1790672e351bd86e8c560547d5e0a904a84c9699e4863f0"}, "tags": ["acute_inpatient", "claims_preprocessing"], "refs": [["acute_inpatient__stg_service_category"], ["acute_inpatient__stg_medical_claim"], ["acute_inpatient__encounter_start_and_end_dates"]], "sources": [], "metrics": [], "description": "Assigns encounter_id to every acute inpatient professional claim", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#0f3d0b"}, "patch_path": "the_tuva_project://models/claims_preprocessing/claims_preprocessing_models.yml", "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_acute_inpatient_professional_encounter_id", "tags": ["acute_inpatient", "claims_preprocessing"], "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#0f3d0b"}}, "created_at": 1701215339.897547}, "model.the_tuva_project.acute_inpatient__last_claim_values": {"resource_type": "model", "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.acute_inpatient__encounter_id", "model.input_layer.medical_claim"]}, "config": {"enabled": true, "alias": "_int_acute_inpatient_last_claim_values", "schema": "claims_preprocessing", "database": null, "tags": ["acute_inpatient", "claims_preprocessing"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#0f3d0b"}, "bind": false, "post-hook": [], "pre-hook": []}, "database": "dev_sarah", "schema": "claims_preprocessing", "fqn": ["the_tuva_project", "claims_preprocessing", "acute_inpatient", "intermediate", "acute_inpatient__last_claim_values"], "unique_id": "model.the_tuva_project.acute_inpatient__last_claim_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 first_claim_values as(\r\n select distinct\r\n e.encounter_id\r\n , coalesce(claim_start_date, admission_date) as claim_start\r\n , discharge_disposition_code\r\n from {{ ref('acute_inpatient__encounter_id')}} e\r\n inner join {{ ref('medical_claim') }} m\r\n on e.claim_id = m.claim_id\r\n where claim_type = 'institutional'\r\n)\r\n\r\nselect\r\n encounter_id\r\n , claim_start\r\n , discharge_disposition_code\r\n , row_number() over (partition by encounter_id order by claim_start desc) as claim_row\r\nfrom first_claim_values", "language": "sql", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/the_tuva_project", "path": "claims_preprocessing/acute_inpatient/intermediate/acute_inpatient__last_claim_values.sql", "original_file_path": "models/claims_preprocessing/acute_inpatient/intermediate/acute_inpatient__last_claim_values.sql", "name": "acute_inpatient__last_claim_values", "alias": "_int_acute_inpatient_last_claim_values", "checksum": {"name": "sha256", "checksum": "9230809de94464b7f37e8b30f0cb8a8cfbf550233db3519d89c09a1efc85d166"}, "tags": ["acute_inpatient", "claims_preprocessing"], "refs": [["acute_inpatient__encounter_id"], ["medical_claim"]], "sources": [], "metrics": [], "description": "Orders claims to pull out encounter details (admit type, drg, etc)", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#0f3d0b"}, "patch_path": "the_tuva_project://models/claims_preprocessing/claims_preprocessing_models.yml", "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_acute_inpatient_last_claim_values", "tags": ["acute_inpatient", "claims_preprocessing"], "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#0f3d0b"}}, "created_at": 1701215339.9071622}, "model.the_tuva_project.acute_inpatient__encounter_data_for_medical_claims": {"resource_type": "model", "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"]}, "config": {"enabled": true, "alias": "_int_encounter_data_for_medical_claims", "schema": "claims_preprocessing", "database": null, "tags": ["acute_inpatient", "claims_preprocessing"], "meta": {}, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#0f3d0b"}, "bind": false, "post-hook": [], "pre-hook": []}, "database": "dev_sarah", "schema": "claims_preprocessing", "fqn": ["the_tuva_project", "claims_preprocessing", "acute_inpatient", "intermediate", "acute_inpatient__encounter_data_for_medical_claims"], "unique_id": "model.the_tuva_project.acute_inpatient__encounter_data_for_medical_claims", "raw_code": "{{ config(\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\n )\n}}\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 {{ ref('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 {{ dbt.type_string() }}) 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 {{ dbt.type_string() }}) as encounter_admit_source_code,\n cast(null as {{ dbt.type_string() }}) as encounter_admit_type_code,\n cast(null as {{ dbt.type_string() }}) 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 {{ ref('acute_inpatient__professional_encounter_id') }}\nwhere (orphan_claim_flag = 1) or (encounter_count > 1)\n)\n\n\nselect *, '{{ var('tuva_last_run')}}' as tuva_last_run\nfrom acute_inpatient_claims_with_encounter_id\n\nunion all\n\nselect *, '{{ var('tuva_last_run')}}' as tuva_last_run\nfrom acute_inpatient_claims_without_encounter_id", "language": "sql", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/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", "name": "acute_inpatient__encounter_data_for_medical_claims", "alias": "_int_encounter_data_for_medical_claims", "checksum": {"name": "sha256", "checksum": "fe3d0e76699c5090ec2702da0044f101bb4a8b5106089058eef255c8d08cd741"}, "tags": ["acute_inpatient", "claims_preprocessing"], "refs": [["acute_inpatient__claims_with_encounter_data"], ["acute_inpatient__professional_encounter_id"]], "sources": [], "metrics": [], "description": "All encounter-related fields that will be added to medical_claim", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#0f3d0b"}, "patch_path": "the_tuva_project://models/claims_preprocessing/claims_preprocessing_models.yml", "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_encounter_data_for_medical_claims", "tags": ["acute_inpatient", "claims_preprocessing"], "materialized": "view", "enabled": true, "bind": false, "docs": {"node_color": "#0f3d0b"}}, "created_at": 1701215339.90325}, "model.the_tuva_project.acute_inpatient__data_quality_summary": {"resource_type": "model", "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"]}, "config": {"enabled": true, "alias": "_int_acute_inpatient_data_quality_summary", "schema": "claims_preprocessing", "database": null, "tags": ["acute_inpatient", "claims_preprocessing"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#0f3d0b"}, "bind": false, "post-hook": [], "pre-hook": []}, "database": "dev_sarah", "schema": "claims_preprocessing", "fqn": ["the_tuva_project", "claims_preprocessing", "acute_inpatient", "intermediate", "acute_inpatient__data_quality_summary"], "unique_id": "model.the_tuva_project.acute_inpatient__data_quality_summary", "raw_code": "{{ config(\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\n )\n}}\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 {{ ref('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 {{ ref('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 {{ ref('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 {{ ref('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 {{ ref('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 {{ ref('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 {{ ref('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 {{ ref('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 {{ ref('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 {{ ref('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 {{ ref('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 {{ ref('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 {{ ref('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 {{ ref('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 {{ ref('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 {{ ref('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 {{ ref('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 {{ ref('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 {{ ref('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 {{ ref('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 {{ ref('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 {{ ref('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 {{ ref('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 {{ ref('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 {{ ref('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 {{ ref('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 {{ ref('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 {{ ref('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 {{ ref('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 *, '{{ var('tuva_last_run')}}' as tuva_last_run\nfrom union_cte", "language": "sql", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/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", "name": "acute_inpatient__data_quality_summary", "alias": "_int_acute_inpatient_data_quality_summary", "checksum": {"name": "sha256", "checksum": "edc0f5b74b6e1561baa5941028f6c14f4eafe3c2e2dba669ae2e2ed7bba6e4d0"}, "tags": ["acute_inpatient", "claims_preprocessing"], "refs": [["acute_inpatient__institutional_claims"], ["acute_inpatient__institutional_claims"], ["acute_inpatient__institutional_claims"], ["acute_inpatient__institutional_claims"], ["acute_inpatient__institutional_claims"], ["acute_inpatient__institutional_claims"], ["acute_inpatient__institutional_claims"], ["acute_inpatient__institutional_claims"], ["acute_inpatient__institutional_claims"], ["acute_inpatient__institutional_claims"], ["acute_inpatient__institutional_claims"], ["acute_inpatient__institutional_claims"], ["acute_inpatient__institutional_claims"], ["acute_inpatient__institutional_claims"], ["acute_inpatient__institutional_claims"], ["acute_inpatient__institutional_claims"], ["acute_inpatient__institutional_claims"], ["acute_inpatient__institutional_claims"], ["acute_inpatient__institutional_claims"], ["acute_inpatient__institutional_claims"], ["acute_inpatient__institutional_claims"], ["acute_inpatient__institutional_claims"], ["acute_inpatient__institutional_claims"], ["acute_inpatient__institutional_claims"], ["acute_inpatient__institutional_claims"], ["acute_inpatient__institutional_claims"], ["acute_inpatient__institutional_claims"], ["acute_inpatient__institutional_claims"], ["acute_inpatient__institutional_claims"]], "sources": [], "metrics": [], "description": "Summary of data quality issues with acute inpatient claims", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#0f3d0b"}, "patch_path": "the_tuva_project://models/claims_preprocessing/claims_preprocessing_models.yml", "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_acute_inpatient_data_quality_summary", "tags": ["acute_inpatient", "claims_preprocessing"], "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#0f3d0b"}}, "created_at": 1701215339.891763}, "model.the_tuva_project.acute_inpatient__institutional_encounter_id": {"resource_type": "model", "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.acute_inpatient__institutional_claims"]}, "config": {"enabled": true, "alias": "_int_acute_inpatient_institutional_encounter_id", "schema": "claims_preprocessing", "database": null, "tags": ["acute_inpatient", "claims_preprocessing"], "meta": {}, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#0f3d0b"}, "bind": false, "post-hook": [], "pre-hook": []}, "database": "dev_sarah", "schema": "claims_preprocessing", "fqn": ["the_tuva_project", "claims_preprocessing", "acute_inpatient", "intermediate", "acute_inpatient__institutional_encounter_id"], "unique_id": "model.the_tuva_project.acute_inpatient__institutional_encounter_id", "raw_code": "{{ config(\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\n )\n}}\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 {{ ref('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 *, '{{ var('tuva_last_run')}}' as tuva_last_run\nfrom add_encounter_id", "language": "sql", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/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", "name": "acute_inpatient__institutional_encounter_id", "alias": "_int_acute_inpatient_institutional_encounter_id", "checksum": {"name": "sha256", "checksum": "773c3187c5d77c4733cfae2ee8c1709abe833e7c4261b8b1089a824fce4c99b5"}, "tags": ["acute_inpatient", "claims_preprocessing"], "refs": [["acute_inpatient__institutional_claims"]], "sources": [], "metrics": [], "description": "Assigns encounter_id to every acute inpatient institutional claim", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#0f3d0b"}, "patch_path": "the_tuva_project://models/claims_preprocessing/claims_preprocessing_models.yml", "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_acute_inpatient_institutional_encounter_id", "tags": ["acute_inpatient", "claims_preprocessing"], "enabled": true, "bind": false, "docs": {"node_color": "#0f3d0b"}}, "created_at": 1701215339.893703}, "model.the_tuva_project.acute_inpatient__encounter_start_and_end_dates": {"resource_type": "model", "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.acute_inpatient__institutional_claims", "model.the_tuva_project.acute_inpatient__institutional_encounter_id"]}, "config": {"enabled": true, "alias": "_int_acute_inpatient_encounter_start_and_end_dates", "schema": "claims_preprocessing", "database": null, "tags": ["acute_inpatient", "claims_preprocessing"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#0f3d0b"}, "bind": false, "post-hook": [], "pre-hook": []}, "database": "dev_sarah", "schema": "claims_preprocessing", "fqn": ["the_tuva_project", "claims_preprocessing", "acute_inpatient", "intermediate", "acute_inpatient__encounter_start_and_end_dates"], "unique_id": "model.the_tuva_project.acute_inpatient__encounter_start_and_end_dates", "raw_code": "{{ config(\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\n )\n}}\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 {{ ref('acute_inpatient__institutional_claims') }} aip\nleft join {{ ref('acute_inpatient__institutional_encounter_id') }} eid\n on aip.patient_id = eid.patient_id\n and aip.claim_id = eid.claim_id\n),\n\nencounter_start_and_end_dates as (\nselect\n patient_id,\n encounter_id,\n min(start_date) as encounter_start_date,\n max(end_date) as encounter_end_date\nfrom add_encounter_id_to_acute_inpatient_encounters\ngroup by patient_id, encounter_id\n)\n\nselect\n patient_id\n , encounter_id\n , encounter_start_date\n , encounter_end_date\n , '{{ var('tuva_last_run')}}' as tuva_last_run\nfrom encounter_start_and_end_dates", "language": "sql", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/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", "name": "acute_inpatient__encounter_start_and_end_dates", "alias": "_int_acute_inpatient_encounter_start_and_end_dates", "checksum": {"name": "sha256", "checksum": "00d8b121239396bf248e423eebd1778333289ae41b58ec73887aae231e6473a3"}, "tags": ["acute_inpatient", "claims_preprocessing"], "refs": [["acute_inpatient__institutional_claims"], ["acute_inpatient__institutional_encounter_id"]], "sources": [], "metrics": [], "description": "Defines encounter start and end dates for acute inpatient encounters", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#0f3d0b"}, "patch_path": "the_tuva_project://models/claims_preprocessing/claims_preprocessing_models.yml", "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_acute_inpatient_encounter_start_and_end_dates", "tags": ["acute_inpatient", "claims_preprocessing"], "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#0f3d0b"}}, "created_at": 1701215339.895555}, "model.the_tuva_project.acute_inpatient__claims_with_encounter_data": {"resource_type": "model", "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"]}, "config": {"enabled": true, "alias": "_int_acute_inpatient_claims_with_encounter_data", "schema": "claims_preprocessing", "database": null, "tags": ["acute_inpatient", "claims_preprocessing"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#0f3d0b"}, "bind": false, "post-hook": [], "pre-hook": []}, "database": "dev_sarah", "schema": "claims_preprocessing", "fqn": ["the_tuva_project", "claims_preprocessing", "acute_inpatient", "intermediate", "acute_inpatient__claims_with_encounter_data"], "unique_id": "model.the_tuva_project.acute_inpatient__claims_with_encounter_data", "raw_code": "{{ config(\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\n )\n}}\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 {{ ref('acute_inpatient__institutional_claims') }} aa\n\nleft join\n{{ ref('acute_inpatient__encounter_id') }} bb\non aa.claim_id = bb.claim_id\nand aa.patient_id = bb.patient_id\n\nleft join\n{{ ref('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 *, '{{ var('tuva_last_run')}}' as tuva_last_run\nfrom all_useful_fields_at_claim_id_level", "language": "sql", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/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", "name": "acute_inpatient__claims_with_encounter_data", "alias": "_int_acute_inpatient_claims_with_encounter_data", "checksum": {"name": "sha256", "checksum": "bc581de736de2e2ea6f4613588447286e9ddfa13f1527337c725918ede422636"}, "tags": ["acute_inpatient", "claims_preprocessing"], "refs": [["acute_inpatient__institutional_claims"], ["acute_inpatient__encounter_id"], ["acute_inpatient__encounter_start_and_end_dates"]], "sources": [], "metrics": [], "description": "Add all relevant encounter data to each acute inpatient claim_id", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#0f3d0b"}, "patch_path": "the_tuva_project://models/claims_preprocessing/claims_preprocessing_models.yml", "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_acute_inpatient_claims_with_encounter_data", "tags": ["acute_inpatient", "claims_preprocessing"], "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#0f3d0b"}}, "created_at": 1701215339.901369}, "model.the_tuva_project.acute_inpatient__first_claim_values": {"resource_type": "model", "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.acute_inpatient__encounter_id", "model.input_layer.medical_claim"]}, "config": {"enabled": true, "alias": "_int_acute_inpatient_first_claim_values", "schema": "claims_preprocessing", "database": null, "tags": ["acute_inpatient", "claims_preprocessing"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#0f3d0b"}, "bind": false, "post-hook": [], "pre-hook": []}, "database": "dev_sarah", "schema": "claims_preprocessing", "fqn": ["the_tuva_project", "claims_preprocessing", "acute_inpatient", "intermediate", "acute_inpatient__first_claim_values"], "unique_id": "model.the_tuva_project.acute_inpatient__first_claim_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 first_claim_values as(\r\n select distinct\r\n e.encounter_id\r\n , coalesce(claim_start_date, admission_date) as claim_start\r\n , diagnosis_code_1\r\n , diagnosis_code_type\r\n , admit_source_code\r\n , admit_type_code\r\n , facility_npi\r\n , ms_drg_code\r\n , apr_drg_code\r\n from {{ ref('acute_inpatient__encounter_id')}} e\r\n inner join {{ ref('medical_claim') }} m\r\n on e.claim_id = m.claim_id\r\n where claim_type = 'institutional'\r\n)\r\n\r\nselect\r\n encounter_id\r\n , claim_start\r\n , diagnosis_code_1\r\n , diagnosis_code_type\r\n , admit_source_code\r\n , admit_type_code\r\n , facility_npi\r\n , ms_drg_code\r\n , apr_drg_code\r\n , row_number() over (partition by encounter_id order by claim_start) as claim_row\r\nfrom first_claim_values", "language": "sql", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/the_tuva_project", "path": "claims_preprocessing/acute_inpatient/intermediate/acute_inpatient__first_claim_values.sql", "original_file_path": "models/claims_preprocessing/acute_inpatient/intermediate/acute_inpatient__first_claim_values.sql", "name": "acute_inpatient__first_claim_values", "alias": "_int_acute_inpatient_first_claim_values", "checksum": {"name": "sha256", "checksum": "5cf9e4c3ca2d2e978eb35a242daaa27a19ea2e5851a56b6d68b7ec9e3cd4a3eb"}, "tags": ["acute_inpatient", "claims_preprocessing"], "refs": [["acute_inpatient__encounter_id"], ["medical_claim"]], "sources": [], "metrics": [], "description": "Orders claims to pull out encounter details (admit type, drg, etc)", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#0f3d0b"}, "patch_path": "the_tuva_project://models/claims_preprocessing/claims_preprocessing_models.yml", "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_acute_inpatient_first_claim_values", "tags": ["acute_inpatient", "claims_preprocessing"], "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#0f3d0b"}}, "created_at": 1701215339.905303}, "model.the_tuva_project.acute_inpatient__encounter_id": {"resource_type": "model", "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.acute_inpatient__institutional_encounter_id", "model.input_layer.medical_claim", "model.the_tuva_project.acute_inpatient__professional_encounter_id"]}, "config": {"enabled": true, "alias": "_int_acute_inpatient_encounter_id", "schema": "claims_preprocessing", "database": null, "tags": ["acute_inpatient", "claims_preprocessing"], "meta": {}, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#0f3d0b"}, "bind": false, "post-hook": [], "pre-hook": []}, "database": "dev_sarah", "schema": "claims_preprocessing", "fqn": ["the_tuva_project", "claims_preprocessing", "acute_inpatient", "intermediate", "acute_inpatient__encounter_id"], "unique_id": "model.the_tuva_project.acute_inpatient__encounter_id", "raw_code": "{{ config(\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\n )\n}}\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 inst.patient_id,\n inst.claim_id,\n med.claim_line_number,\n inst.encounter_id,\n '{{ var('tuva_last_run')}}' as tuva_last_run\nfrom {{ ref('acute_inpatient__institutional_encounter_id') }} inst\nleft join {{ ref('medical_claim') }} med\n on inst.claim_id = med.claim_id\n\nunion distinct\n\nselect\n patient_id,\n claim_id,\n claim_line_number,\n encounter_id,\n '{{ var('tuva_last_run')}}' as tuva_last_run\nfrom {{ ref('acute_inpatient__professional_encounter_id') }}\nwhere (orphan_claim_flag = 0) and (encounter_count = 1)", "language": "sql", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/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", "name": "acute_inpatient__encounter_id", "alias": "_int_acute_inpatient_encounter_id", "checksum": {"name": "sha256", "checksum": "c3b8df66cacc33f29085df864e7b5e6b5d77e1e86d28372cb91f793688c615e6"}, "tags": ["acute_inpatient", "claims_preprocessing"], "refs": [["acute_inpatient__institutional_encounter_id"], ["medical_claim"], ["acute_inpatient__professional_encounter_id"]], "sources": [], "metrics": [], "description": "Fix encounter_id so each professional claim can only belong to one encounter", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#0f3d0b"}, "patch_path": "the_tuva_project://models/claims_preprocessing/claims_preprocessing_models.yml", "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_acute_inpatient_encounter_id", "tags": ["acute_inpatient", "claims_preprocessing"], "materialized": "view", "enabled": true, "bind": false, "docs": {"node_color": "#0f3d0b"}}, "created_at": 1701215339.899372}, "model.the_tuva_project.acute_inpatient__institutional_claims": {"resource_type": "model", "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.acute_inpatient__stg_medical_claim", "model.the_tuva_project.acute_inpatient__stg_service_category"]}, "config": {"enabled": true, "alias": "_int_acute_inpatient_institutional_claims", "schema": "claims_preprocessing", "database": null, "tags": ["acute_inpatient", "claims_preprocessing"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#0f3d0b"}, "bind": false, "post-hook": [], "pre-hook": []}, "database": "dev_sarah", "schema": "claims_preprocessing", "fqn": ["the_tuva_project", "claims_preprocessing", "acute_inpatient", "intermediate", "acute_inpatient__institutional_claims"], "unique_id": "model.the_tuva_project.acute_inpatient__institutional_claims", "raw_code": "{{ config(\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\n )\n}}\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 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 {{ ref('acute_inpatient__stg_medical_claim') }} mc\ninner join {{ ref('acute_inpatient__stg_service_category')}} sc\n on mc.claim_id = sc.claim_id\nwhere mc.claim_type = 'institutional'\n and sc.service_category_2 = 'Acute Inpatient'\n),\n\ndata_quality_flags as (\nselect\n claim_id,\n-- patient_id_not_unique:\n case\n when count(distinct patient_id) > 1 then 1\n else 0\n end as patient_id_not_unique,\n-- patient_id_missing: \n case\n when max(patient_id) is null then 1\n else 0\n end as patient_id_missing, \n-- claim_start_date_not_unique:\n case\n when count(distinct claim_start_date) > 1 then 1\n else 0\n end as claim_start_date_not_unique,\n-- claim_start_date_missing: \n case\n when max(claim_start_date) is null then 1\n else 0\n end as claim_start_date_missing,\n-- claim_end_date_not_unique:\n case\n when count(distinct claim_end_date) > 1 then 1\n else 0\n end as claim_end_date_not_unique,\n-- claim_end_date_missing: \n case\n when max(claim_end_date) is null then 1\n else 0\n end as claim_end_date_missing,\n-- claim_start_date_after_claim_end_date:\n case\n when min(claim_start_date) > max(claim_end_date) then 1\n else 0\n end as claim_start_date_after_claim_end_date,\n-- admission_date_not_unique:\n case\n when count(distinct admission_date) > 1 then 1\n else 0\n end as admission_date_not_unique,\n-- admission_date_missing: \n case\n when max(admission_date) is null then 1\n else 0\n end as admission_date_missing,\n-- discharge_date_not_unique:\n case\n when count(distinct discharge_date) > 1 then 1\n else 0\n end as discharge_date_not_unique,\n-- discharge_date_missing: \n case\n when max(discharge_date) is null then 1\n else 0\n end as discharge_date_missing,\n-- admission_date_after_discharge_date:\n case\n when min(admission_date) > max(discharge_date) then 1\n else 0\n end as admission_date_after_discharge_date,\n-- admit_type_code_not_unique:\n case\n when count(distinct admit_type_code) > 1 then 1\n else 0\n end as admit_type_code_not_unique,\n-- admit_type_code_missing: \n case\n when max(admit_type_code) is null then 1\n else 0\n end as admit_type_code_missing, \n-- admit_source_code_not_unique:\n case\n when count(distinct admit_source_code) > 1 then 1\n else 0\n end as admit_source_code_not_unique,\n-- admit_source_code_missing: \n case\n when max(admit_source_code) is null then 1\n else 0\n end as admit_source_code_missing, \n-- discharge_disposition_code_not_unique:\n case\n when count(distinct discharge_disposition_code) > 1 then 1\n else 0\n end as discharge_disposition_code_not_unique,\n-- discharge_disposition_code_missing: \n case\n when max(discharge_disposition_code) is null then 1\n else 0\n end as discharge_disposition_code_missing,\n-- facility_npi_not_unique:\n case\n when count(distinct facility_npi) > 1 then 1\n else 0\n end as facility_npi_not_unique,\n-- facility_npi_missing: \n case\n when max(facility_npi) is null then 1\n else 0\n end as facility_npi_missing,\n-- claim_type_not_unique:\n case\n when count(distinct claim_type) > 1 then 1\n else 0\n end as claim_type_not_unique,\n-- claim_type_missing: \n case\n when max(claim_type) is null then 1\n else 0\n end as claim_type_missing,\n-- claim_type_not_institutional:\n case\n when max(claim_type) <> 'institutional'\n and min(claim_type) <> 'institutional' then 1\n else 0\n end as claim_type_not_institutional\nfrom acute_inpatient_claim_lines\ngroup by claim_id\n),\n\n\nheader_level_values as (\nselect\n claim_id,\n max(patient_id) as patient_id,\n min(claim_start_date) as claim_start_date,\n max(claim_end_date) as claim_end_date,\n min(admission_date) as admission_date,\n max(discharge_date) as discharge_date,\n max(admit_source_code) as admit_source_code,\n max(admit_type_code) as admit_type_code,\n max(discharge_disposition_code) as discharge_disposition_code,\n max(facility_npi) as facility_npi,\n max(claim_type) as claim_type,\n coalesce(min(admission_date),\n min(claim_start_date)) as start_date,\n coalesce(max(discharge_date),\n max(claim_end_date)) as end_date,\n case\n when min(admission_date) is not null then 'admission_date'\n when min(claim_start_date) is not null then 'claim_start_date'\n else null\n end as date_used_as_start_date,\n case\n when max(discharge_date) is not null then 'discharge_date'\n when max(claim_end_date) is not null then 'claim_end_date'\n else null\n end as date_used_as_end_date,\n data_source\nfrom acute_inpatient_claim_lines\ngroup by claim_id, data_source\n)\n\nselect\n h.patient_id as patient_id,\n h.claim_id as claim_id, \n h.claim_start_date as claim_start_date,\n h.claim_end_date as claim_end_date,\n h.admission_date as admission_date,\n h.discharge_date as discharge_date,\n h.admit_source_code as admit_source_code,\n h.admit_type_code as admit_type_code,\n h.discharge_disposition_code as discharge_disposition_code,\n h.facility_npi as facility_npi,\n h.claim_type as claim_type,\n h.start_date as start_date,\n h.end_date as end_date,\n h.date_used_as_start_date,\n h.date_used_as_end_date, \n\n case\n when\n ( (dq.patient_id_not_unique = 1) or\n (dq.patient_id_missing = 1) or\n (dq.discharge_disposition_code_not_unique = 1) or\n (dq.discharge_disposition_code_missing = 1) or\n (dq.facility_npi_not_unique = 1) or\n (dq.facility_npi_missing = 1) or\n (h.date_used_as_start_date is null) or\n\t(h.date_used_as_end_date is null) or\n\t(h.start_date > h.end_date) ) then 1\n else 0\n end as dq_problem,\n\n case\n when\n ( (dq.claim_start_date_not_unique = 1) or\n\t(dq.claim_start_date_missing = 1) or\n (dq.claim_end_date_not_unique = 1) or\n (dq.claim_end_date_missing = 1) or\n (dq.claim_start_date_after_claim_end_date = 1) or\n (dq.admission_date_not_unique = 1) or\n (dq.admission_date_missing = 1) or\n (dq.discharge_date_not_unique = 1) or\n (dq.discharge_date_missing = 1) or\n (dq.admission_date_after_discharge_date = 1) or\n (dq.admit_type_code_not_unique = 1) or\n (dq.admit_type_code_missing = 1) or\n (dq.admit_source_code_not_unique = 1) or\n (dq.admit_source_code_missing = 1) or\t\n (dq.claim_type_not_unique = 1) or\n (dq.claim_type_missing = 1) or\n (dq.claim_type_not_institutional = 1) ) then 1\n else 0\n end as dq_insight,\n\n case\n when (h.date_used_as_start_date is null) then 1\n else 0\n end as start_date_not_determined,\n \n case\n when (h.date_used_as_end_date is null) then 1\n else 0\n end as end_date_not_determined,\n\n case\n when (h.start_date > h.end_date) then 1\n else 0\n end as start_date_after_end_date,\n \n dq.patient_id_not_unique as patient_id_not_unique,\n dq.patient_id_missing as patient_id_missing,\n dq.claim_start_date_not_unique as claim_start_date_not_unique,\n dq.claim_start_date_missing as claim_start_date_missing,\n dq.claim_end_date_not_unique as claim_end_date_not_unique,\n dq.claim_end_date_missing as claim_end_date_missing,\n dq.claim_start_date_after_claim_end_date\n as claim_start_date_after_claim_end_date,\n dq.admission_date_not_unique as admission_date_not_unique,\n dq.admission_date_missing as admission_date_missing,\n dq.discharge_date_not_unique as discharge_date_not_unique,\n dq.discharge_date_missing as discharge_date_missing,\n dq.admission_date_after_discharge_date\n as admission_date_after_discharge_date,\n dq.admit_type_code_not_unique\n as admit_type_code_not_unique,\n dq.admit_type_code_missing\n as admit_type_code_missing,\n dq.admit_source_code_not_unique\n as admit_source_code_not_unique,\n dq.admit_source_code_missing\n as admit_source_code_missing,\n dq.discharge_disposition_code_not_unique\n as discharge_disposition_code_not_unique,\n dq.discharge_disposition_code_missing\n as discharge_disposition_code_missing,\n dq.facility_npi_not_unique as facility_npi_not_unique,\n dq.facility_npi_missing as facility_npi_missing,\n dq.claim_type_not_unique as claim_type_not_unique,\n dq.claim_type_missing as claim_type_missing,\n dq.claim_type_not_institutional as claim_type_not_institutional,\n h.data_source,\n '{{ var('tuva_last_run')}}' as tuva_last_run\n\nfrom header_level_values h\nleft join data_quality_flags dq\n on h.claim_id = dq.claim_id", "language": "sql", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/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", "name": "acute_inpatient__institutional_claims", "alias": "_int_acute_inpatient_institutional_claims", "checksum": {"name": "sha256", "checksum": "7b8e75f9fad7f381b211d8d4378681e187564775bc783bada56831600ee68a25"}, "tags": ["acute_inpatient", "claims_preprocessing"], "refs": [["acute_inpatient__stg_medical_claim"], ["acute_inpatient__stg_service_category"]], "sources": [], "metrics": [], "description": "All acute inpatient institutional claim_ids with header values and data quality flags", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#0f3d0b"}, "patch_path": "the_tuva_project://models/claims_preprocessing/claims_preprocessing_models.yml", "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_acute_inpatient_institutional_claims", "tags": ["acute_inpatient", "claims_preprocessing"], "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#0f3d0b"}}, "created_at": 1701215339.889906}, "model.the_tuva_project.quality_measures__stg_medical_claim": {"resource_type": "model", "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.core__medical_claim"]}, "config": {"enabled": true, "alias": "_stg_medical_claim", "schema": "quality_measures", "database": null, "tags": ["quality_measures"], "meta": {}, "materialized": "ephemeral", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "bind": false, "post-hook": [], "pre-hook": []}, "database": "dev_sarah", "schema": "quality_measures", "fqn": ["the_tuva_project", "quality_measures", "staging", "quality_measures__stg_medical_claim"], "unique_id": "model.the_tuva_project.quality_measures__stg_medical_claim", "raw_code": "{{ config(\n enabled = var('quality_measures_enabled',var('claims_enabled',var('clinical_enabled',var('tuva_marts_enabled',False))))\n )\n}}\n\n{% if var('clinical_enabled', var('tuva_marts_enabled',False)) == true and var('claims_enabled', var('tuva_marts_enabled',False)) == true -%}\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 , '{{ var('tuva_last_run')}}' as tuva_last_run\nfrom {{ ref('core__medical_claim') }}\n\n{% elif var('claims_enabled', var('tuva_marts_enabled',False)) == true -%}\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 , '{{ var('tuva_last_run')}}' as tuva_last_run\nfrom {{ ref('core__medical_claim') }}\n\n{% elif var('clinical_enabled', var('tuva_marts_enabled',False)) == true -%}\n\nselect\n cast(null as {{ dbt.type_string() }} ) as patient_id\n , cast(null as {{ dbt.type_string() }} ) as claim_id\n , {{ try_to_cast_date('null', 'YYYY-MM-DD') }} as claim_start_date\n , {{ try_to_cast_date('null', 'YYYY-MM-DD') }} as claim_end_date\n , cast(null as {{ dbt.type_string() }} ) as place_of_service_code\n , cast(null as {{ dbt.type_string() }} ) as hcpcs_code\n , cast(null as {{ dbt.type_timestamp() }} ) as tuva_last_run\nlimit 0\n\n{%- endif %}", "language": "sql", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/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", "name": "quality_measures__stg_medical_claim", "alias": "_stg_medical_claim", "checksum": {"name": "sha256", "checksum": "2598a77f063c83df17e4263dd10147ee0914b36917186e3e35d51f4dae0a8756"}, "tags": ["quality_measures"], "refs": [["core__medical_claim"]], "sources": [], "metrics": [], "description": "Staging medical claims from the input layer. Creates an empty table if using clinical only.\n", "columns": {"patient_id": {"name": "patient_id", "description": "", "meta": {}, "data_type": null, "quote": null, "tags": []}, "claim_start_date": {"name": "claim_start_date", "description": "", "meta": {}, "data_type": null, "quote": null, "tags": []}, "claim_end_date": {"name": "claim_end_date", "description": "", "meta": {}, "data_type": null, "quote": null, "tags": []}, "place_of_service": {"name": "place_of_service", "description": "", "meta": {}, "data_type": null, "quote": null, "tags": []}, "hcpcs_code": {"name": "hcpcs_code", "description": "", "meta": {}, "data_type": null, "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://models/quality_measures/quality_measures_models.yml", "compiled_path": null, "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": 1701215340.139625}, "model.the_tuva_project.quality_measures__stg_core__patient": {"resource_type": "model", "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.core__patient"]}, "config": {"enabled": true, "alias": "_stg_patient", "schema": "quality_measures", "database": null, "tags": ["quality_measures"], "meta": {}, "materialized": "ephemeral", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "bind": false, "post-hook": [], "pre-hook": []}, "database": "dev_sarah", "schema": "quality_measures", "fqn": ["the_tuva_project", "quality_measures", "staging", "quality_measures__stg_core__patient"], "unique_id": "model.the_tuva_project.quality_measures__stg_core__patient", "raw_code": "{{ config(\n enabled = var('quality_measures_enabled',var('claims_enabled',var('clinical_enabled',var('tuva_marts_enabled',False))))\n )\n}}\nselect\n patient_id\n , sex\n , birth_date\n , death_date\n , '{{ var('tuva_last_run')}}' as tuva_last_run\nfrom {{ ref('core__patient') }}", "language": "sql", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/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", "name": "quality_measures__stg_core__patient", "alias": "_stg_patient", "checksum": {"name": "sha256", "checksum": "e450b5ec0c774f3e3624565aee8e99b0fb4638cb3bfa3fad3b1646ea49ad7795"}, "tags": ["quality_measures"], "refs": [["core__patient"]], "sources": [], "metrics": [], "description": "Staging eligibility from the input layer.", "columns": {"patient_id": {"name": "patient_id", "description": "", "meta": {}, "data_type": null, "quote": null, "tags": []}, "sex": {"name": "sex", "description": "", "meta": {}, "data_type": null, "quote": null, "tags": []}, "birth_date": {"name": "birth_date", "description": "", "meta": {}, "data_type": null, "quote": null, "tags": []}, "death_date": {"name": "death_date", "description": "", "meta": {}, "data_type": null, "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://models/quality_measures/quality_measures_models.yml", "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"schema": "quality_measures", "alias": "_stg_patient", "tags": "quality_measures", "materialized": "ephemeral", "enabled": true, "bind": false}, "created_at": 1701215340.134161}, "model.the_tuva_project.quality_measures__stg_core__observation": {"resource_type": "model", "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.core__observation"]}, "config": {"enabled": true, "alias": "_stg_observation", "schema": "quality_measures", "database": null, "tags": ["quality_measures"], "meta": {}, "materialized": "ephemeral", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "bind": false, "post-hook": [], "pre-hook": []}, "database": "dev_sarah", "schema": "quality_measures", "fqn": ["the_tuva_project", "quality_measures", "staging", "quality_measures__stg_core__observation"], "unique_id": "model.the_tuva_project.quality_measures__stg_core__observation", "raw_code": "{{ config(\n enabled = var('quality_measures_enabled',var('claims_enabled',var('clinical_enabled',var('tuva_marts_enabled',False))))\n )\n}}\n\n{% if var('clinical_enabled', var('tuva_marts_enabled',False)) == true and var('claims_enabled', var('tuva_marts_enabled',False)) == true -%}\n\nselect\n patient_id\n , observation_date\n , source_code_type\n , source_code\n , normalized_code_type\n , normalized_code\n , '{{ var('tuva_last_run')}}' as tuva_last_run\nfrom {{ ref('core__observation') }}\n\n{% elif var('clinical_enabled', var('tuva_marts_enabled',False)) == true -%}\n\nselect\n patient_id\n , observation_date\n , source_code_type\n , source_code\n , normalized_code_type\n , normalized_code\n , '{{ var('tuva_last_run')}}' as tuva_last_run\nfrom {{ ref('core__observation') }}\n\n{% elif var('claims_enabled', var('tuva_marts_enabled',False)) == true -%}\n\nselect\n cast(null as {{ dbt.type_string() }} ) as patient_id\n , {{ try_to_cast_date('null', 'YYYY-MM-DD') }} as observation_date\n , cast(null as {{ dbt.type_string() }} ) as source_code_type\n , cast(null as {{ dbt.type_string() }} ) as source_code\n , cast(null as {{ dbt.type_string() }} ) as normalized_code_type\n , cast(null as {{ dbt.type_string() }} ) as normalized_code\n , cast(null as {{ dbt.type_timestamp() }} ) as tuva_last_run\nlimit 0\n\n{%- endif %}", "language": "sql", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/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", "name": "quality_measures__stg_core__observation", "alias": "_stg_observation", "checksum": {"name": "sha256", "checksum": "6ac64920ae666a218eb2065d9d319b7ae7f5ec53c8cda0b870b9e8ac45f36505"}, "tags": ["quality_measures"], "refs": [["core__observation"]], "sources": [], "metrics": [], "description": "Staging medications from core. Creates an empty table if using claims only.\n", "columns": {"patient_id": {"name": "patient_id", "description": "", "meta": {}, "data_type": null, "quote": null, "tags": []}, "observation_date": {"name": "observation_date", "description": "", "meta": {}, "data_type": null, "quote": null, "tags": []}, "source_code_type": {"name": "source_code_type", "description": "", "meta": {}, "data_type": null, "quote": null, "tags": []}, "source_code": {"name": "source_code", "description": "", "meta": {}, "data_type": null, "quote": null, "tags": []}, "normalized_code_type": {"name": "normalized_code_type", "description": "", "meta": {}, "data_type": null, "quote": null, "tags": []}, "normalized_code": {"name": "normalized_code", "description": "", "meta": {}, "data_type": null, "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://models/quality_measures/quality_measures_models.yml", "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"schema": "quality_measures", "alias": "_stg_observation", "tags": "quality_measures", "materialized": "ephemeral", "enabled": true, "bind": false}, "created_at": 1701215340.1315289}, "model.the_tuva_project.quality_measures__stg_core__medication": {"resource_type": "model", "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.core__medication"]}, "config": {"enabled": true, "alias": "_stg_medication", "schema": "quality_measures", "database": null, "tags": ["quality_measures"], "meta": {}, "materialized": "ephemeral", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "bind": false, "post-hook": [], "pre-hook": []}, "database": "dev_sarah", "schema": "quality_measures", "fqn": ["the_tuva_project", "quality_measures", "staging", "quality_measures__stg_core__medication"], "unique_id": "model.the_tuva_project.quality_measures__stg_core__medication", "raw_code": "{{ config(\n enabled = var('quality_measures_enabled',var('claims_enabled',var('clinical_enabled',var('tuva_marts_enabled',False))))\n )\n}}\n\n{% if var('clinical_enabled', var('tuva_marts_enabled',False)) == true and var('claims_enabled', var('tuva_marts_enabled',False)) == true -%}\n\nselect\n patient_id\n , dispensing_date\n , source_code_type\n , source_code\n , ndc_code\n , rxnorm_code\n , '{{ var('tuva_last_run')}}' as tuva_last_run\nfrom {{ ref('core__medication') }}\n\n{% elif var('clinical_enabled', var('tuva_marts_enabled',False)) == true -%}\n\nselect\n patient_id\n , dispensing_date\n , source_code_type\n , source_code\n , ndc_code\n , rxnorm_code\n , '{{ var('tuva_last_run')}}' as tuva_last_run\nfrom {{ ref('core__medication') }}\n\n{% elif var('claims_enabled', var('tuva_marts_enabled',False)) == true -%}\n\nselect\n cast(null as {{ dbt.type_string() }} ) as patient_id\n , {{ try_to_cast_date('null', 'YYYY-MM-DD') }} as dispensing_date\n , cast(null as {{ dbt.type_string() }} ) as source_code_type\n , cast(null as {{ dbt.type_string() }} ) as source_code\n , cast(null as {{ dbt.type_string() }} ) as ndc_code\n , cast(null as {{ dbt.type_string() }} ) as rxnorm_code\n , cast(null as {{ dbt.type_timestamp() }} ) as tuva_last_run\nlimit 0\n\n{%- endif %}", "language": "sql", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/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", "name": "quality_measures__stg_core__medication", "alias": "_stg_medication", "checksum": {"name": "sha256", "checksum": "1d1eb6e4f6a76a6c0e528be64d6ffd0491eaeb5937e25f4801bc1a9600281693"}, "tags": ["quality_measures"], "refs": [["core__medication"]], "sources": [], "metrics": [], "description": "Staging medications from core. Creates an empty table if using claims only.\n", "columns": {"patient_id": {"name": "patient_id", "description": "", "meta": {}, "data_type": null, "quote": null, "tags": []}, "dispensing_date": {"name": "dispensing_date", "description": "", "meta": {}, "data_type": null, "quote": null, "tags": []}, "ndc_code": {"name": "ndc_code", "description": "", "meta": {}, "data_type": null, "quote": null, "tags": []}, "rxnorm_code": {"name": "rxnorm_code", "description": "", "meta": {}, "data_type": null, "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://models/quality_measures/quality_measures_models.yml", "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"schema": "quality_measures", "alias": "_stg_medication", "tags": "quality_measures", "materialized": "ephemeral", "enabled": true, "bind": false}, "created_at": 1701215340.128788}, "model.the_tuva_project.quality_measures__stg_core__condition": {"resource_type": "model", "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.core__condition"]}, "config": {"enabled": true, "alias": "_stg_condition", "schema": "quality_measures", "database": null, "tags": ["quality_measures"], "meta": {}, "materialized": "ephemeral", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "bind": false, "post-hook": [], "pre-hook": []}, "database": "dev_sarah", "schema": "quality_measures", "fqn": ["the_tuva_project", "quality_measures", "staging", "quality_measures__stg_core__condition"], "unique_id": "model.the_tuva_project.quality_measures__stg_core__condition", "raw_code": "{{ config(\n enabled = var('quality_measures_enabled',var('claims_enabled',var('clinical_enabled',var('tuva_marts_enabled',False))))\n )\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 , '{{ var('tuva_last_run')}}' as tuva_last_run\nfrom {{ ref('core__condition') }}", "language": "sql", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/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", "name": "quality_measures__stg_core__condition", "alias": "_stg_condition", "checksum": {"name": "sha256", "checksum": "7328c6608e112884137102e96a625ab72eded37772421ffec34e6d450faa0495"}, "tags": ["quality_measures"], "refs": [["core__condition"]], "sources": [], "metrics": [], "description": "Staging conditions from core.", "columns": {"patient_id": {"name": "patient_id", "description": "", "meta": {}, "data_type": null, "quote": null, "tags": []}, "recorded_date": {"name": "recorded_date", "description": "", "meta": {}, "data_type": null, "quote": null, "tags": []}, "source_code_type": {"name": "source_code_type", "description": "", "meta": {}, "data_type": null, "quote": null, "tags": []}, "source_code": {"name": "source_code", "description": "", "meta": {}, "data_type": null, "quote": null, "tags": []}, "normalized_code_type": {"name": "normalized_code_type", "description": "", "meta": {}, "data_type": null, "quote": null, "tags": []}, "normalized_code": {"name": "normalized_code", "description": "", "meta": {}, "data_type": null, "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://models/quality_measures/quality_measures_models.yml", "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"schema": "quality_measures", "alias": "_stg_condition", "tags": "quality_measures", "materialized": "ephemeral", "enabled": true, "bind": false}, "created_at": 1701215340.123758}, "model.the_tuva_project.quality_measures__stg_core__lab_result": {"resource_type": "model", "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.core__lab_result"]}, "config": {"enabled": true, "alias": "_stg_lab_result", "schema": "quality_measures", "database": null, "tags": ["quality_measures"], "meta": {}, "materialized": "ephemeral", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "bind": false, "post-hook": [], "pre-hook": []}, "database": "dev_sarah", "schema": "quality_measures", "fqn": ["the_tuva_project", "quality_measures", "staging", "quality_measures__stg_core__lab_result"], "unique_id": "model.the_tuva_project.quality_measures__stg_core__lab_result", "raw_code": "{{ config(\n enabled = var('quality_measures_enabled',var('claims_enabled',var('clinical_enabled',var('tuva_marts_enabled',False))))\n )\n}}\n\n{% if var('clinical_enabled', var('tuva_marts_enabled',False)) == true and var('claims_enabled', var('tuva_marts_enabled',False)) == true -%}\n\nselect\n patient_id\n , result_date\n , collection_date\n , source_code_type\n , source_code\n , normalized_code_type\n , normalized_code\n , '{{ var('tuva_last_run')}}' as tuva_last_run\nfrom {{ ref('core__lab_result') }}\n\n{% elif var('clinical_enabled', var('tuva_marts_enabled',False)) == true -%}\n\nselect\n patient_id\n , result_date\n , collection_date\n , source_code_type\n , source_code\n , normalized_code_type\n , normalized_code\n , '{{ var('tuva_last_run')}}' as tuva_last_run\nfrom {{ ref('core__lab_result') }}\n\n{% elif var('claims_enabled', var('tuva_marts_enabled',False)) == true -%}\n\nselect\n cast(null as {{ dbt.type_string() }} ) as patient_id\n , {{ try_to_cast_date('null', 'YYYY-MM-DD') }} as result_date\n , {{ try_to_cast_date('null', 'YYYY-MM-DD') }} as collection_date\n , cast(null as {{ dbt.type_string() }} ) as source_code_type\n , cast(null as {{ dbt.type_string() }} ) as source_code\n , cast(null as {{ dbt.type_string() }} ) as normalized_code_type\n , cast(null as {{ dbt.type_string() }} ) as normalized_code\n , cast(null as {{ dbt.type_timestamp() }} ) as tuva_last_run\nlimit 0\n\n{%- endif %}", "language": "sql", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/the_tuva_project", "path": "quality_measures/staging/quality_measures__stg_core__lab_result.sql", "original_file_path": "models/quality_measures/staging/quality_measures__stg_core__lab_result.sql", "name": "quality_measures__stg_core__lab_result", "alias": "_stg_lab_result", "checksum": {"name": "sha256", "checksum": "f3b89d9a06448320730322ce5e362792ab473fff9054bca3ab84afa01ec38fa2"}, "tags": ["quality_measures"], "refs": [["core__lab_result"]], "sources": [], "metrics": [], "description": "Staging lab results from the input layer. Creates an empty table if using claims only.\n", "columns": {"patient_id": {"name": "patient_id", "description": "", "meta": {}, "data_type": null, "quote": null, "tags": []}, "result_date": {"name": "result_date", "description": "", "meta": {}, "data_type": null, "quote": null, "tags": []}, "collection_date": {"name": "collection_date", "description": "", "meta": {}, "data_type": null, "quote": null, "tags": []}, "source_code_type": {"name": "source_code_type", "description": "", "meta": {}, "data_type": null, "quote": null, "tags": []}, "source_code": {"name": "source_code", "description": "", "meta": {}, "data_type": null, "quote": null, "tags": []}, "normalized_code_type": {"name": "normalized_code_type", "description": "", "meta": {}, "data_type": null, "quote": null, "tags": []}, "normalized_code": {"name": "normalized_code", "description": "", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://models/quality_measures/quality_measures_models.yml", "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"schema": "quality_measures", "alias": "_stg_lab_result", "tags": "quality_measures", "materialized": "ephemeral", "enabled": true, "bind": false}, "created_at": 1701215340.144789}, "model.the_tuva_project.quality_measures__stg_pharmacy_claim": {"resource_type": "model", "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.core__pharmacy_claim"]}, "config": {"enabled": true, "alias": "_stg_pharmacy_claim", "schema": "quality_measures", "database": null, "tags": ["quality_measures"], "meta": {}, "materialized": "ephemeral", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "bind": false, "post-hook": [], "pre-hook": []}, "database": "dev_sarah", "schema": "quality_measures", "fqn": ["the_tuva_project", "quality_measures", "staging", "quality_measures__stg_pharmacy_claim"], "unique_id": "model.the_tuva_project.quality_measures__stg_pharmacy_claim", "raw_code": "{{ config(\n enabled = var('quality_measures_enabled',var('claims_enabled',var('clinical_enabled',var('tuva_marts_enabled',False))))\n )\n}}\n\n{% if var('clinical_enabled', var('tuva_marts_enabled',False)) == true and var('claims_enabled', var('tuva_marts_enabled',False)) == true -%}\n\nselect\n patient_id\n , dispensing_date\n , ndc_code\n , paid_date\n , '{{ var('tuva_last_run')}}' as tuva_last_run\nfrom {{ ref('core__pharmacy_claim') }}\n\n{% elif var('claims_enabled', var('tuva_marts_enabled',False)) == true -%}\n\nselect\n patient_id\n , dispensing_date\n , ndc_code\n , paid_date\n , '{{ var('tuva_last_run')}}' as tuva_last_run\nfrom {{ ref('core__pharmacy_claim') }}\n\n{% elif var('clinical_enabled', var('tuva_marts_enabled',False)) == true -%}\n\nselect\n cast(null as {{ dbt.type_string() }} ) as patient_id\n , {{ try_to_cast_date('null', 'YYYY-MM-DD') }} as dispensing_date\n , cast(null as {{ dbt.type_string() }} ) as ndc_code\n , {{ try_to_cast_date('null', 'YYYY-MM-DD') }} as paid_date\n , cast(null as {{ dbt.type_timestamp() }} ) as tuva_last_run\nlimit 0\n\n{%- endif %}", "language": "sql", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/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", "name": "quality_measures__stg_pharmacy_claim", "alias": "_stg_pharmacy_claim", "checksum": {"name": "sha256", "checksum": "d3cc37b103a2cdce19944f7fff56a050f260fa91d716da4ba2be10fe4dddb001"}, "tags": ["quality_measures"], "refs": [["core__pharmacy_claim"]], "sources": [], "metrics": [], "description": "Staging pharmacy claims from the input layer. Creates an empty table if using clinical only.\n", "columns": {"patient_id": {"name": "patient_id", "description": "", "meta": {}, "data_type": null, "quote": null, "tags": []}, "dispensing_date": {"name": "dispensing_date", "description": "", "meta": {}, "data_type": null, "quote": null, "tags": []}, "ndc_code": {"name": "ndc_code", "description": "", "meta": {}, "data_type": null, "quote": null, "tags": []}, "paid_date": {"name": "paid_date", "description": "", "meta": {}, "data_type": null, "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://models/quality_measures/quality_measures_models.yml", "compiled_path": null, "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": 1701215340.142081}, "model.the_tuva_project.quality_measures__stg_core__procedure": {"resource_type": "model", "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.core__procedure"]}, "config": {"enabled": true, "alias": "_stg_procedure", "schema": "quality_measures", "database": null, "tags": ["quality_measures"], "meta": {}, "materialized": "ephemeral", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "bind": false, "post-hook": [], "pre-hook": []}, "database": "dev_sarah", "schema": "quality_measures", "fqn": ["the_tuva_project", "quality_measures", "staging", "quality_measures__stg_core__procedure"], "unique_id": "model.the_tuva_project.quality_measures__stg_core__procedure", "raw_code": "{{ config(\n enabled = var('quality_measures_enabled',var('claims_enabled',var('clinical_enabled',var('tuva_marts_enabled',False))))\n )\n}}\nselect\n patient_id\n , procedure_date\n , source_code_type\n , source_code\n , normalized_code_type\n , normalized_code\n , '{{ var('tuva_last_run')}}' as tuva_last_run\nfrom {{ ref('core__procedure') }}", "language": "sql", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/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", "name": "quality_measures__stg_core__procedure", "alias": "_stg_procedure", "checksum": {"name": "sha256", "checksum": "61025c6978615c6c9369fdb019207e0d5154cb47f90e696ba3bc9c2ea5c5db8c"}, "tags": ["quality_measures"], "refs": [["core__procedure"]], "sources": [], "metrics": [], "description": "Staging procedures from core.", "columns": {"patient_id": {"name": "patient_id", "description": "", "meta": {}, "data_type": null, "quote": null, "tags": []}, "procedure_date": {"name": "procedure_date", "description": "", "meta": {}, "data_type": null, "quote": null, "tags": []}, "source_code_type": {"name": "source_code_type", "description": "", "meta": {}, "data_type": null, "quote": null, "tags": []}, "source_code": {"name": "source_code", "description": "", "meta": {}, "data_type": null, "quote": null, "tags": []}, "normalized_code_type": {"name": "normalized_code_type", "description": "", "meta": {}, "data_type": null, "quote": null, "tags": []}, "normalized_code": {"name": "normalized_code", "description": "", "meta": {}, "data_type": null, "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://models/quality_measures/quality_measures_models.yml", "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"schema": "quality_measures", "alias": "_stg_procedure", "tags": "quality_measures", "materialized": "ephemeral", "enabled": true, "bind": false}, "created_at": 1701215340.136972}, "model.the_tuva_project.quality_measures__stg_core__encounter": {"resource_type": "model", "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.core__encounter"]}, "config": {"enabled": true, "alias": "_stg_encounter", "schema": "quality_measures", "database": null, "tags": ["quality_measures"], "meta": {}, "materialized": "ephemeral", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "bind": false, "post-hook": [], "pre-hook": []}, "database": "dev_sarah", "schema": "quality_measures", "fqn": ["the_tuva_project", "quality_measures", "staging", "quality_measures__stg_core__encounter"], "unique_id": "model.the_tuva_project.quality_measures__stg_core__encounter", "raw_code": "{{ config(\n enabled = var('quality_measures_enabled',var('claims_enabled',var('clinical_enabled',var('tuva_marts_enabled',False))))\n )\n}}\n\n{% if var('clinical_enabled', var('tuva_marts_enabled',False)) == true and var('claims_enabled', var('tuva_marts_enabled',False)) == true -%}\n\nselect\n patient_id\n , encounter_type\n , encounter_start_date\n , encounter_end_date\n , '{{ var('tuva_last_run')}}' as tuva_last_run\nfrom {{ ref('core__encounter') }}\n\n{% elif var('clinical_enabled', var('tuva_marts_enabled',False)) == true -%}\n\nselect\n patient_id\n , encounter_type\n , encounter_start_date\n , encounter_end_date\n , '{{ var('tuva_last_run')}}' as tuva_last_run\nfrom {{ ref('core__encounter') }}\n\n{% elif var('claims_enabled', var('tuva_marts_enabled',False)) == true -%}\n\nselect\n cast(null as {{ dbt.type_string() }} ) as patient_id\n , cast(null as {{ dbt.type_string() }} ) as encounter_type\n , {{ try_to_cast_date('null', 'YYYY-MM-DD') }} as encounter_start_date\n , {{ try_to_cast_date('null', 'YYYY-MM-DD') }} as encounter_end_date\n , cast(null as {{ dbt.type_timestamp() }} ) as tuva_last_run\nlimit 0\n\n{%- endif %}", "language": "sql", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/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", "name": "quality_measures__stg_core__encounter", "alias": "_stg_encounter", "checksum": {"name": "sha256", "checksum": "864a8d92e301fad08a8bd0a826182b58b7a475a968de05c347d34652df05acfb"}, "tags": ["quality_measures"], "refs": [["core__encounter"]], "sources": [], "metrics": [], "description": "Staging encounters from core. Creates an empty table if using claims only.\n", "columns": {"patient_id": {"name": "patient_id", "description": "", "meta": {}, "data_type": null, "quote": null, "tags": []}, "encounter_type": {"name": "encounter_type", "description": "", "meta": {}, "data_type": null, "quote": null, "tags": []}, "encounter_start_date": {"name": "encounter_start_date", "description": "", "meta": {}, "data_type": null, "quote": null, "tags": []}, "encounter_end_date": {"name": "encounter_end_date", "description": "", "meta": {}, "data_type": null, "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://models/quality_measures/quality_measures_models.yml", "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"schema": "quality_measures", "alias": "_stg_encounter", "tags": "quality_measures", "materialized": "ephemeral", "enabled": true, "bind": false}, "created_at": 1701215340.1262999}, "model.the_tuva_project.quality_measures__summary_wide": {"resource_type": "model", "depends_on": {"macros": ["macro.dbt.type_string"], "nodes": ["model.the_tuva_project.quality_measures__summary_long"]}, "config": {"enabled": true, "alias": "summary_wide", "schema": "quality_measures", "database": null, "tags": ["quality_measures"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "bind": false, "post-hook": [], "pre-hook": []}, "database": "dev_sarah", "schema": "quality_measures", "fqn": ["the_tuva_project", "quality_measures", "final", "quality_measures__summary_wide"], "unique_id": "model.the_tuva_project.quality_measures__summary_wide", "raw_code": "{{ config(\n enabled = var('quality_measures_enabled',var('claims_enabled',var('clinical_enabled',var('tuva_marts_enabled',False))))\n )\n}}\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 {{ ref('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, nqf_0034 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 = 'NQF0034'\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 left join nqf_0034\n on measures_long.patient_id = nqf_0034.patient_id\n\n)\n\n, add_data_types as (\n\n select\n cast(patient_id as {{ dbt.type_string() }}) 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 , '{{ var('tuva_last_run')}}' as tuva_last_run\nfrom add_data_types", "language": "sql", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/the_tuva_project", "path": "quality_measures/final/quality_measures__summary_wide.sql", "original_file_path": "models/quality_measures/final/quality_measures__summary_wide.sql", "name": "quality_measures__summary_wide", "alias": "summary_wide", "checksum": {"name": "sha256", "checksum": "61c333a891d6904be40f1f7f9a54199a70a442fe6a630820ee5801482e63e0e2"}, "tags": ["quality_measures"], "refs": [["quality_measures__summary_long"]], "sources": [], "metrics": [], "description": "Wide view of the results for the reporting version of all measures. This model pivots measures on the patient level (i.e. one row per patient with flags for each measure. The false flags can be treated as care gaps as exclusions have been included in the pivot logic.\n", "columns": {"patient_id": {"name": "patient_id", "description": "Unique patient_id for each person.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "nqf_2372": {"name": "nqf_2372", "description": "Each measure has a boolean flag which is the result of evaluating the denominator, numerator, and exclusion indicators for the patient. A null indicates that the measure was not applicable for the patient.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The date and timestamp of the dbt run.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://models/quality_measures/quality_measures_models.yml", "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"schema": "quality_measures", "alias": "summary_wide", "tags": "quality_measures", "materialized": "table", "enabled": true, "bind": false}, "created_at": 1701215340.0715342}, "model.the_tuva_project.quality_measures__summary_counts": {"resource_type": "model", "depends_on": {"macros": ["macro.dbt.type_numeric", "macro.dbt.type_string"], "nodes": ["model.the_tuva_project.quality_measures__summary_long"]}, "config": {"enabled": true, "alias": "summary_counts", "schema": "quality_measures", "database": null, "tags": ["quality_measures"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "bind": false, "post-hook": [], "pre-hook": []}, "database": "dev_sarah", "schema": "quality_measures", "fqn": ["the_tuva_project", "quality_measures", "final", "quality_measures__summary_counts"], "unique_id": "model.the_tuva_project.quality_measures__summary_counts", "raw_code": "{{ config(\n enabled = var('quality_measures_enabled',var('claims_enabled',var('clinical_enabled',var('tuva_marts_enabled',False))))\n )\n}}\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 {{ ref('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 {{ dbt.type_numeric() }}) /\n (cast(denominator_sum as {{ dbt.type_numeric() }}) - cast(exclusion_sum as {{ dbt.type_numeric() }}))\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 {{ dbt.type_string() }}) as measure_id\n , cast(measure_name as {{ dbt.type_string() }}) as measure_name\n , cast(measure_version as {{ dbt.type_string() }}) 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 {{ dbt.type_numeric() }}),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 , '{{ var('tuva_last_run')}}' as tuva_last_run\nfrom add_data_types", "language": "sql", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/the_tuva_project", "path": "quality_measures/final/quality_measures__summary_counts.sql", "original_file_path": "models/quality_measures/final/quality_measures__summary_counts.sql", "name": "quality_measures__summary_counts", "alias": "summary_counts", "checksum": {"name": "sha256", "checksum": "91b49f8943ab78947a3b1020ff7871d3f224495c0690ee1bb7382afebf9fb203"}, "tags": ["quality_measures"], "refs": [["quality_measures__summary_long"]], "sources": [], "metrics": [], "description": "Reporting measure counts with performance rates.", "columns": {"measure_id": {"name": "measure_id", "description": "Unique measure identification number.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "measure_name": {"name": "measure_name", "description": "Name of the measure.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "measure_version": {"name": "measure_version", "description": "Version of the measure.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "performance_period_begin": {"name": "performance_period_begin", "description": "Beginning date of the performance or measurement period.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "performance_period_end": {"name": "performance_period_end", "description": "Ending date of the performance or measurement period.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "denominator_sum": {"name": "denominator_sum", "description": "The denominator is associated with a given patient population that may be counted as eligible to meet a measure\u2019s inclusion requirements.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "numerator_sum": {"name": "numerator_sum", "description": "The numerator reflects the subset of patients in the denominator for whom a particular service has been provided or for whom a particular outcome has been achieved with exclusion logic applied.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "exclusion_sum": {"name": "exclusion_sum", "description": "Specifications of those characteristics that would cause groups of individuals to be removed from the numerator and/or denominator of a measure although they experience the denominator index event.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "performance_rate": {"name": "performance_rate", "description": "Calculated performance rate. The numerator sum divided by the denominator sum after exclusion logic applied and multiplied by 100.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The date and timestamp of the dbt run.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://models/quality_measures/quality_measures_models.yml", "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"schema": "quality_measures", "alias": "summary_counts", "tags": "quality_measures", "materialized": "table", "enabled": true, "bind": false}, "created_at": 1701215340.065569}, "model.the_tuva_project.quality_measures__summary_long": {"resource_type": "model", "depends_on": {"macros": ["macro.dbt.type_string"], "nodes": ["model.the_tuva_project.quality_measures__int_nqf2372_long", "model.the_tuva_project.quality_measures__int_nqf0034_long"]}, "config": {"enabled": true, "alias": "summary_long", "schema": "quality_measures", "database": null, "tags": ["quality_measures"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "bind": false, "post-hook": [], "pre-hook": []}, "database": "dev_sarah", "schema": "quality_measures", "fqn": ["the_tuva_project", "quality_measures", "final", "quality_measures__summary_long"], "unique_id": "model.the_tuva_project.quality_measures__summary_long", "raw_code": "{{ config(\n enabled = var('quality_measures_enabled',var('claims_enabled',var('clinical_enabled',var('tuva_marts_enabled',False))))\n )\n}}\n\n/* measures should already be at the full eligibility population grain */\nwith measures_unioned as (\n\n select * from {{ ref('quality_measures__int_nqf2372_long') }}\n union all\n\n select * from {{ ref('quality_measures__int_nqf0034_long') }}\n)\n\n, add_data_types as (\n\n select\n cast(patient_id as {{ dbt.type_string() }}) 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 {{ dbt.type_string() }}) 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 {{ dbt.type_string() }}) as measure_id\n , cast(measure_name as {{ dbt.type_string() }}) as measure_name\n , cast(measure_version as {{ dbt.type_string() }}) 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 , '{{ var('tuva_last_run')}}' as tuva_last_run\nfrom add_data_types", "language": "sql", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/the_tuva_project", "path": "quality_measures/final/quality_measures__summary_long.sql", "original_file_path": "models/quality_measures/final/quality_measures__summary_long.sql", "name": "quality_measures__summary_long", "alias": "summary_long", "checksum": {"name": "sha256", "checksum": "9987cbdfb8baf943faf031ce20586f5288e80a00e9f694a448d1edc9f9f7a570"}, "tags": ["quality_measures"], "refs": [["quality_measures__int_nqf2372_long"], ["quality_measures__int_nqf0034_long"]], "sources": [], "metrics": [], "description": "Long view of the results for the reporting version of all measures. Each row represents the results a measure per patient. A null for the denominator indicates that the patient was not eligible for that measure.\n", "columns": {"patient_id": {"name": "patient_id", "description": "Unique patient_id for each person.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "denominator_flag": {"name": "denominator_flag", "description": "The denominator is associated with a given patient population that may be counted as eligible to meet a measure\u2019s inclusion requirements.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "numerator_flag": {"name": "numerator_flag", "description": "The numerator reflects the subset of patients in the denominator for whom a particular service has been provided or for whom a particular outcome has been achieved.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "exclusion_flag": {"name": "exclusion_flag", "description": "Specifications of those characteristics that would cause groups of individuals to be removed from the numerator and/or denominator of a measure although they experience the denominator index event.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "evidence_date": {"name": "evidence_date", "description": "Date of event or service that places patient in the numerator.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "exclusion_date": {"name": "exclusion_date", "description": "Date of event or service that excludes patient from the measure.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "exclusion_reason": {"name": "exclusion_reason", "description": "Reason (usually the value set concept name) that excludes patient from the measure.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "performance_period_begin": {"name": "performance_period_begin", "description": "Beginning date of the performance or measurement period.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "performance_period_end": {"name": "performance_period_end", "description": "Ending date of the performance or measurement period.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "measure_id": {"name": "measure_id", "description": "Unique measure identification number.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "measure_name": {"name": "measure_name", "description": "Name of the measure.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "measure_version": {"name": "measure_version", "description": "Version of the measure.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The date and timestamp of the dbt run.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://models/quality_measures/quality_measures_models.yml", "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"schema": "quality_measures", "alias": "summary_long", "tags": "quality_measures", "materialized": "table", "enabled": true, "bind": false}, "created_at": 1701215340.069181}, "model.the_tuva_project.quality_measures__int_nqf2372_exclude_mastectomy": {"resource_type": "model", "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"]}, "config": {"enabled": true, "alias": "_int_nqf2372_exclude_mastectomy", "schema": "quality_measures", "database": null, "tags": ["quality_measures"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "bind": false, "post-hook": [], "pre-hook": []}, "database": "dev_sarah", "schema": "quality_measures", "fqn": ["the_tuva_project", "quality_measures", "intermediate", "nqf2372_breast_cancer_screening", "quality_measures__int_nqf2372_exclude_mastectomy"], "unique_id": "model.the_tuva_project.quality_measures__int_nqf2372_exclude_mastectomy", "raw_code": "{{ config(\n enabled = var('quality_measures_enabled',var('claims_enabled',var('clinical_enabled',var('tuva_marts_enabled',False))))\n )\n}}\n\n/*\n Women who had a bilateral mastectomy or who have a history of a bilateral\n mastectomy or for whom there is evidence of a right and a left\n unilateral mastectomy\n*/\n\nwith denominator as (\n\n select\n patient_id\n , performance_period_begin\n , performance_period_end\n from {{ ref('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 {{ ref('quality_measures__value_sets') }}\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 {{ ref('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 {{ ref('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 {{ ref('quality_measures__stg_core__procedure') }}\n\n)\n\n, condition_exclusions as (\n\n select\n conditions.patient_id\n , conditions.recorded_date\n , exclusion_codes.concept_name\n from conditions\n inner join exclusion_codes\n on conditions.code = exclusion_codes.code\n and conditions.code_type = exclusion_codes.code_system\n\n)\n\n, observation_exclusions as (\n\n select\n observations.patient_id\n , observations.observation_date\n , exclusion_codes.concept_name\n from observations\n inner join exclusion_codes\n on observations.code = exclusion_codes.code\n and observations.code_type = exclusion_codes.code_system\n\n)\n\n, procedure_exclusions as (\n\n select\n procedures.patient_id\n , procedures.procedure_date\n , exclusion_codes.concept_name\n from procedures\n inner join exclusion_codes\n on procedures.code = exclusion_codes.code\n and procedures.code_type = exclusion_codes.code_system\n\n)\n\n, all_mastectomy as (\n\n select\n denominator.patient_id\n , condition_exclusions.recorded_date as exclusion_date\n , condition_exclusions.concept_name as exclusion_reason\n from denominator\n inner join condition_exclusions\n on denominator.patient_id = condition_exclusions.patient_id\n\n union all\n\n select\n denominator.patient_id\n , observation_exclusions.observation_date as exclusion_date\n , observation_exclusions.concept_name as exclusion_reason\n from denominator\n inner join observation_exclusions\n on denominator.patient_id = observation_exclusions.patient_id\n\n union all\n\n select\n denominator.patient_id\n , procedure_exclusions.procedure_date as exclusion_date\n , procedure_exclusions.concept_name as exclusion_reason\n from denominator\n inner join procedure_exclusions\n on denominator.patient_id = procedure_exclusions.patient_id\n\n)\n\n/*\n Women who had a bilateral mastectomy or who have a history of a bilateral\n mastectomy\n*/\n, bilateral_mastectomy as (\n\n select\n patient_id\n , exclusion_date\n , exclusion_reason\n from all_mastectomy\n where exclusion_reason in (\n 'Bilateral Mastectomy'\n , 'History of bilateral mastectomy'\n )\n\n)\n\n, right_mastectomy as (\n\n select\n patient_id\n , exclusion_date\n , exclusion_reason\n from all_mastectomy\n where exclusion_reason in (\n 'Status Post Right Mastectomy'\n , 'Unilateral Mastectomy Right'\n )\n\n)\n\n, left_mastectomy as (\n\n select\n patient_id\n , exclusion_date\n , exclusion_reason\n from all_mastectomy\n where exclusion_reason in (\n 'Status Post Left Mastectomy'\n , 'Unilateral Mastectomy Left'\n )\n\n)\n\n, unspecified_mastectomy as (\n\n select\n patient_id\n , exclusion_date\n , exclusion_reason\n from all_mastectomy\n where exclusion_reason in (\n 'Unilateral Mastectomy, Unspecified Laterality'\n )\n\n)\n\n/*\n Women for whom there is evidence of a right AND a left unilateral mastectomy\n or unspecific mastectomies on different dates\n*/\n, unilateral_mastectomy as (\n\n select\n right_mastectomy.patient_id\n , right_mastectomy.exclusion_date\n , right_mastectomy.exclusion_reason\n from right_mastectomy\n inner join left_mastectomy\n on right_mastectomy.patient_id = left_mastectomy.patient_id\n\n union all\n\n select\n unspecified_mastectomy.patient_id\n , unspecified_mastectomy.exclusion_date\n , unspecified_mastectomy.exclusion_reason\n from unspecified_mastectomy\n inner join unspecified_mastectomy as self_join\n on unspecified_mastectomy.patient_id = self_join.patient_id\n and unspecified_mastectomy.exclusion_date <> self_join.exclusion_date\n\n)\n\n, unioned as (\n\n select * from bilateral_mastectomy\n union all\n select * from unilateral_mastectomy\n)\n\nselect\n patient_id\n , exclusion_date\n , exclusion_reason\n , '{{ var('tuva_last_run')}}' as tuva_last_run\nfrom unioned", "language": "sql", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/the_tuva_project", "path": "quality_measures/intermediate/nqf2372_breast_cancer_screening/quality_measures__int_nqf2372_exclude_mastectomy.sql", "original_file_path": "models/quality_measures/intermediate/nqf2372_breast_cancer_screening/quality_measures__int_nqf2372_exclude_mastectomy.sql", "name": "quality_measures__int_nqf2372_exclude_mastectomy", "alias": "_int_nqf2372_exclude_mastectomy", "checksum": {"name": "sha256", "checksum": "1d03b9f7580863adc845af8cd09d5287de5bcb9d1138260fafebf1a3cd035440"}, "tags": ["quality_measures"], "refs": [["quality_measures__int_nqf2372_denominator"], ["quality_measures__value_sets"], ["quality_measures__stg_core__condition"], ["quality_measures__stg_core__observation"], ["quality_measures__stg_core__procedure"]], "sources": [], "metrics": [], "description": "Exclusion logic for patients with a mastectomy for the reporting version of NQF 2372, Breast Cancer Screening.\n", "columns": {"patient_id": {"name": "patient_id", "description": "Unique patient_id for each person.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "exclusion_date": {"name": "exclusion_date", "description": "Date of event or service that excludes patient from the measure.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "exclusion_reason": {"name": "exclusion_reason", "description": "Reason (usually the value set concept name) that excludes patient from the measure.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://models/quality_measures/quality_measures_models.yml", "compiled_path": null, "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": 1701215340.089182}, "model.the_tuva_project.quality_measures__int_nqf2372__frailty": {"resource_type": "model", "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__observation", "model.the_tuva_project.quality_measures__stg_core__procedure"]}, "config": {"enabled": true, "alias": "_int_nqf2372__frailty", "schema": "quality_measures", "database": null, "tags": ["quality_measures"], "meta": {}, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "bind": false, "post-hook": [], "pre-hook": []}, "database": "dev_sarah", "schema": "quality_measures", "fqn": ["the_tuva_project", "quality_measures", "intermediate", "nqf2372_breast_cancer_screening", "quality_measures__int_nqf2372__frailty"], "unique_id": "model.the_tuva_project.quality_measures__int_nqf2372__frailty", "raw_code": "{{ config(\n enabled = var('quality_measures_enabled',var('claims_enabled',var('clinical_enabled',var('tuva_marts_enabled',False))))\n )\n}}\n/*\n This concept is used in multiple exclusions. Patients greater than\n or equal to 66 with at least one claim/encounter for frailty during\n the measurement period.\n*/\nwith denominator as (\n\n select\n patient_id\n , age\n , performance_period_begin\n , performance_period_end\n from {{ ref('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 {{ ref('quality_measures__value_sets') }}\n where concept_name in (\n 'Frailty Device'\n , 'Frailty Diagnosis'\n , 'Frailty Encounter'\n , 'Frailty Symptom'\n )\n\n)\n\n, conditions as (\n\n select\n patient_id\n , recorded_date\n , coalesce (\n normalized_code_type\n , case\n when lower(source_code_type) = 'snomed' then 'snomed-ct'\n else lower(source_code_type)\n end\n ) as code_type\n , coalesce (\n normalized_code\n , source_code\n ) as code\n from {{ ref('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 {{ ref('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 {{ ref('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 {{ ref('quality_measures__stg_core__procedure') }}\n\n)\n\n, condition_exclusions as (\n\n select\n conditions.patient_id\n , conditions.recorded_date\n , exclusion_codes.concept_name\n from conditions\n inner join exclusion_codes\n on conditions.code = exclusion_codes.code\n and conditions.code_type = exclusion_codes.code_system\n\n)\n\n, med_claim_exclusions as (\n\n select\n medical_claim.patient_id\n , medical_claim.claim_start_date\n , medical_claim.claim_end_date\n , medical_claim.hcpcs_code\n , exclusion_codes.concept_name\n from medical_claim\n inner join exclusion_codes\n on medical_claim.hcpcs_code = exclusion_codes.code\n where exclusion_codes.code_system = 'hcpcs'\n\n)\n\n, observation_exclusions as (\n\n select\n observations.patient_id\n , observations.observation_date\n , exclusion_codes.concept_name\n from observations\n inner join exclusion_codes\n on observations.code = exclusion_codes.code\n and observations.code_type = exclusion_codes.code_system\n\n)\n\n, procedure_exclusions as (\n\n select\n procedures.patient_id\n , procedures.procedure_date\n , exclusion_codes.concept_name\n from procedures\n inner join exclusion_codes\n on procedures.code = exclusion_codes.code\n and procedures.code_type = exclusion_codes.code_system\n\n)\n\n, patients_with_frailty as (\n\n select\n 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 as exclusion_reason\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 as exclusion_reason\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 as exclusion_reason\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 as exclusion_reason\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\nselect\n patient_id\n , performance_period_begin\n , performance_period_end\n , exclusion_date\n , exclusion_reason\n , '{{ var('tuva_last_run')}}' as tuva_last_run\nfrom patients_with_frailty", "language": "sql", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/the_tuva_project", "path": "quality_measures/intermediate/nqf2372_breast_cancer_screening/quality_measures__int_nqf2372__frailty.sql", "original_file_path": "models/quality_measures/intermediate/nqf2372_breast_cancer_screening/quality_measures__int_nqf2372__frailty.sql", "name": "quality_measures__int_nqf2372__frailty", "alias": "_int_nqf2372__frailty", "checksum": {"name": "sha256", "checksum": "03fec5d7df9045ff25d56ab1d0b5449b04371a917ac4c002ce589f1f69f3dd88"}, "tags": ["quality_measures"], "refs": [["quality_measures__int_nqf2372_denominator"], ["quality_measures__value_sets"], ["quality_measures__stg_core__condition"], ["quality_measures__stg_medical_claim"], ["quality_measures__stg_core__observation"], ["quality_measures__stg_core__procedure"]], "sources": [], "metrics": [], "description": "Exclusion logic for patients with frailty used by other exclusion models.\n", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://models/quality_measures/quality_measures_models.yml", "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"schema": "quality_measures", "alias": "_int_nqf2372__frailty", "tags": "quality_measures", "materialized": "view", "enabled": true, "bind": false}, "created_at": 1701215340.0749319}, "model.the_tuva_project.quality_measures__int_nqf2372_exclude_advanced_illness": {"resource_type": "model", "depends_on": {"macros": ["macro.dbt.dateadd"], "nodes": ["model.the_tuva_project.quality_measures__int_nqf2372__frailty", "seed.the_tuva_project.quality_measures__value_sets", "model.the_tuva_project.quality_measures__stg_core__condition", "model.the_tuva_project.quality_measures__stg_medical_claim", "model.the_tuva_project.quality_measures__stg_core__procedure"]}, "config": {"enabled": true, "alias": "_int_nqf2372_exclude_advanced_illness", "schema": "quality_measures", "database": null, "tags": ["quality_measures"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "bind": false, "post-hook": [], "pre-hook": []}, "database": "dev_sarah", "schema": "quality_measures", "fqn": ["the_tuva_project", "quality_measures", "intermediate", "nqf2372_breast_cancer_screening", "quality_measures__int_nqf2372_exclude_advanced_illness"], "unique_id": "model.the_tuva_project.quality_measures__int_nqf2372_exclude_advanced_illness", "raw_code": "{{ config(\n enabled = var('quality_measures_enabled',var('claims_enabled',var('clinical_enabled',var('tuva_marts_enabled',False))))\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 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 patients_with_frailty as (\n\n select\n patient_id\n , performance_period_begin\n , performance_period_end\n , exclusion_date\n , exclusion_reason\n from {{ ref('quality_measures__int_nqf2372__frailty') }}\n\n)\n\n, exclusion_codes as (\n\n select\n code\n , code_system\n , concept_name\n from {{ ref('quality_measures__value_sets') }}\n where concept_name in (\n 'Advanced Illness'\n , 'Acute Inpatient'\n , 'Encounter Inpatient'\n , 'Outpatient'\n , 'Observation'\n , 'Emergency Department Visit'\n , 'Nonacute Inpatient'\n )\n\n)\n\n, conditions as (\n\n select\n patient_id\n , claim_id\n , recorded_date\n , coalesce (\n normalized_code_type\n , case\n when lower(source_code_type) = 'snomed' then 'snomed-ct'\n else lower(source_code_type)\n end\n ) as code_type\n , coalesce (\n normalized_code\n , source_code\n ) as code\n from {{ ref('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 {{ ref('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 {{ ref('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, 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 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 , patients_with_frailty.exclusion_reason\n || ' with '\n || med_claim_exclusions.concept_name\n || ' and '\n || condition_exclusions.concept_name\n as exclusion_reason\n 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 {{ dbt.dateadd(datepart=\"year\", interval=-1, from_date_or_timestamp=\"patients_with_frailty.performance_period_begin\") }}\n and patients_with_frailty.performance_period_end\n or med_claim_exclusions.claim_end_date\n between {{ dbt.dateadd(datepart=\"year\", interval=-1, from_date_or_timestamp=\"patients_with_frailty.performance_period_begin\") }}\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 , patients_with_frailty.exclusion_reason\n || ' with '\n || procedure_exclusions.concept_name\n || ' and '\n || condition_exclusions.concept_name\n 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 {{ dbt.dateadd(datepart=\"year\", interval=-1, from_date_or_timestamp=\"patients_with_frailty.performance_period_begin\") }}\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 , patients_with_frailty.exclusion_reason\n || ' with '\n || med_claim_exclusions.concept_name\n || ' and '\n || condition_exclusions.concept_name\n as exclusion_reason\n 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 {{ dbt.dateadd(datepart=\"year\", interval=-1, from_date_or_timestamp=\"patients_with_frailty.performance_period_begin\") }}\n and patients_with_frailty.performance_period_end\n or med_claim_exclusions.claim_end_date\n between {{ dbt.dateadd(datepart=\"year\", interval=-1, from_date_or_timestamp=\"patients_with_frailty.performance_period_begin\") }}\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 , patients_with_frailty.exclusion_reason\n || ' with '\n || procedure_exclusions.concept_name\n || ' and '\n || condition_exclusions.concept_name\n 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 {{ dbt.dateadd(datepart=\"year\", interval=-1, from_date_or_timestamp=\"patients_with_frailty.performance_period_begin\") }}\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 , '{{ var('tuva_last_run')}}' as tuva_last_run\nfrom exclusions_unioned", "language": "sql", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/the_tuva_project", "path": "quality_measures/intermediate/nqf2372_breast_cancer_screening/quality_measures__int_nqf2372_exclude_advanced_illness.sql", "original_file_path": "models/quality_measures/intermediate/nqf2372_breast_cancer_screening/quality_measures__int_nqf2372_exclude_advanced_illness.sql", "name": "quality_measures__int_nqf2372_exclude_advanced_illness", "alias": "_int_nqf2372_exclude_advanced_illness", "checksum": {"name": "sha256", "checksum": "69f15f233f2b22bd757081acdbf4d64c06ae0f73f672873304396d22d2e01d41"}, "tags": ["quality_measures"], "refs": [["quality_measures__int_nqf2372__frailty"], ["quality_measures__value_sets"], ["quality_measures__stg_core__condition"], ["quality_measures__stg_medical_claim"], ["quality_measures__stg_core__procedure"]], "sources": [], "metrics": [], "description": "Exclusion logic for patients with frailty and advanced illness for the reporting version of NQF 2372, Breast Cancer Screening.\n", "columns": {"patient_id": {"name": "patient_id", "description": "Unique patient_id for each person.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "exclusion_date": {"name": "exclusion_date", "description": "Date of event or service that excludes patient from the measure.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "exclusion_reason": {"name": "exclusion_reason", "description": "Reason (usually the value set concept name) that excludes patient from the measure.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://models/quality_measures/quality_measures_models.yml", "compiled_path": null, "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": 1701215340.080228}, "model.the_tuva_project.quality_measures__int_nqf2372_exclude_institutional": {"resource_type": "model", "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"]}, "config": {"enabled": true, "alias": "_int_nqf2372_exclude_institutional", "schema": "quality_measures", "database": null, "tags": ["quality_measures"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "bind": false, "post-hook": [], "pre-hook": []}, "database": "dev_sarah", "schema": "quality_measures", "fqn": ["the_tuva_project", "quality_measures", "intermediate", "nqf2372_breast_cancer_screening", "quality_measures__int_nqf2372_exclude_institutional"], "unique_id": "model.the_tuva_project.quality_measures__int_nqf2372_exclude_institutional", "raw_code": "{{ config(\n enabled = var('quality_measures_enabled',var('claims_enabled',var('clinical_enabled',var('tuva_marts_enabled',False))))\n )\n}}\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 denominator as (\n\n select\n patient_id\n , age\n , performance_period_begin\n , performance_period_end\n from {{ ref('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 {{ ref('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('medical_claim.claim_start_date', 'medical_claim.claim_end_date', 'day') }} >= 90\n\n)\n\nselect\n patient_id\n , exclusion_date\n , exclusion_reason\n , '{{ var('tuva_last_run')}}' as tuva_last_run\nfrom exclusions", "language": "sql", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/the_tuva_project", "path": "quality_measures/intermediate/nqf2372_breast_cancer_screening/quality_measures__int_nqf2372_exclude_institutional.sql", "original_file_path": "models/quality_measures/intermediate/nqf2372_breast_cancer_screening/quality_measures__int_nqf2372_exclude_institutional.sql", "name": "quality_measures__int_nqf2372_exclude_institutional", "alias": "_int_nqf2372_exclude_institutional", "checksum": {"name": "sha256", "checksum": "d24105c7382317fb5122acf989e144582f62e850baa7350016e230782aeae1d6"}, "tags": ["quality_measures"], "refs": [["quality_measures__int_nqf2372_denominator"], ["quality_measures__stg_medical_claim"]], "sources": [], "metrics": [], "description": "Exclusion logic for patients staying in an institution for the reporting version of NQF 2372, Breast Cancer Screening.\n", "columns": {"patient_id": {"name": "patient_id", "description": "Unique patient_id for each person.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "exclusion_date": {"name": "exclusion_date", "description": "Date of event or service that excludes patient from the measure.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "exclusion_reason": {"name": "exclusion_reason", "description": "Reason (usually the value set concept name) that excludes patient from the measure.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://models/quality_measures/quality_measures_models.yml", "compiled_path": null, "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": 1701215340.0869188}, "model.the_tuva_project.quality_measures__int_nqf2372__performance_period": {"resource_type": "model", "depends_on": {"macros": ["macro.dbt.current_timestamp", "macro.dbt.last_day", "macro.dbt.dateadd", "macro.dbt.type_string"], "nodes": ["seed.the_tuva_project.quality_measures__measures", "seed.the_tuva_project.quality_measures__measures", "seed.the_tuva_project.quality_measures__measures"]}, "config": {"enabled": true, "alias": "_int_nqf2372__performance_period", "schema": "quality_measures", "database": null, "tags": ["quality_measures"], "meta": {}, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "bind": false, "post-hook": [], "pre-hook": []}, "database": "dev_sarah", "schema": "quality_measures", "fqn": ["the_tuva_project", "quality_measures", "intermediate", "nqf2372_breast_cancer_screening", "quality_measures__int_nqf2372__performance_period"], "unique_id": "model.the_tuva_project.quality_measures__int_nqf2372__performance_period", "raw_code": "{{ config(\n enabled = var('quality_measures_enabled',var('claims_enabled',var('clinical_enabled',var('tuva_marts_enabled',False))))\n )\n}}\n{%- set measure_id -%}\n(select id\nfrom {{ ref('quality_measures__measures') }}\nwhere id = 'NQF2372')\n{%- endset -%}\n\n{%- set measure_name -%}\n(select name\nfrom {{ ref('quality_measures__measures') }}\nwhere id = 'NQF2372')\n{%- endset -%}\n\n{%- set measure_version -%}\n(select version\nfrom {{ ref('quality_measures__measures') }}\nwhere id = 'NQF2372')\n{%- endset -%}\n\n/*\n set performance period end to the end of the current calendar year\n or use the quality_measures_period_end variable if provided\n*/\nwith period_end as (\n\n select\n {% if var('quality_measures_period_end',False) == False -%}\n {{ last_day(dbt.current_timestamp(), 'year') }}\n {% else -%}\n cast('{{ var('quality_measures_period_end') }}' as date)\n {%- endif %}\n as performance_period_end\n)\n\n/*\n set performance period begin to a year and a day prior\n for a complete calendar year\n*/\n, period_begin as (\n\n select\n performance_period_end\n , {{ dbt.dateadd (\n datepart = \"day\"\n , interval = +1\n , from_date_or_timestamp =\n dbt.dateadd (\n datepart = \"year\"\n , interval = -1\n , from_date_or_timestamp = \"performance_period_end\"\n )\n ) }} as performance_period_begin\n from period_end\n\n)\n\n/*\n set performance lookback period to 27 months prior to the end of the\n performance period\n*/\n, period_lookback as (\n\n select\n performance_period_end\n , performance_period_begin\n , {{ dbt.dateadd (\n datepart = \"month\"\n , interval = -27\n , from_date_or_timestamp = \"performance_period_end\"\n ) }} as performance_period_lookback\n from period_begin\n\n\n)\n\nselect\n cast({{ measure_id }} as {{ dbt.type_string() }}) as measure_id\n , cast({{ measure_name }} as {{ dbt.type_string() }}) as measure_name\n , cast({{ measure_version }} as {{ dbt.type_string() }}) as measure_version\n , cast(performance_period_end as date) as performance_period_end\n , cast(performance_period_begin as date) as performance_period_begin\n , cast(performance_period_lookback as date) as performance_period_lookback\nfrom period_lookback", "language": "sql", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/the_tuva_project", "path": "quality_measures/intermediate/nqf2372_breast_cancer_screening/quality_measures__int_nqf2372__performance_period.sql", "original_file_path": "models/quality_measures/intermediate/nqf2372_breast_cancer_screening/quality_measures__int_nqf2372__performance_period.sql", "name": "quality_measures__int_nqf2372__performance_period", "alias": "_int_nqf2372__performance_period", "checksum": {"name": "sha256", "checksum": "325f2b8405e1c308fe0ce98776cdda1da15e499c7ebfc1f7bad6e4731c12671e"}, "tags": ["quality_measures"], "refs": [["quality_measures__measures"], ["quality_measures__measures"], ["quality_measures__measures"]], "sources": [], "metrics": [], "description": "Performance Period definition for Breast Cancer screening.\n", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://models/quality_measures/quality_measures_models.yml", "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"schema": "quality_measures", "alias": "_int_nqf2372__performance_period", "tags": "quality_measures", "materialized": "view", "enabled": true, "bind": false}, "created_at": 1701215340.073258}, "model.the_tuva_project.quality_measures__int_nqf2372_numerator": {"resource_type": "model", "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"]}, "config": {"enabled": true, "alias": "_int_nqf2372_numerator", "schema": "quality_measures", "database": null, "tags": ["quality_measures"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "bind": false, "post-hook": [], "pre-hook": []}, "database": "dev_sarah", "schema": "quality_measures", "fqn": ["the_tuva_project", "quality_measures", "intermediate", "nqf2372_breast_cancer_screening", "quality_measures__int_nqf2372_numerator"], "unique_id": "model.the_tuva_project.quality_measures__int_nqf2372_numerator", "raw_code": "{{ config(\n enabled = var('quality_measures_enabled',var('claims_enabled',var('clinical_enabled',var('tuva_marts_enabled',False))))\n )\n}}\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 , performance_period_lookback\n , measure_id\n , measure_name\n , measure_version\n from {{ ref('quality_measures__int_nqf2372_denominator') }}\n\n)\n\n, mammography_codes as (\n\n select\n code\n , code_system\n from {{ ref('quality_measures__value_sets') }}\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 {{ ref('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 {{ ref('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 {{ ref('quality_measures__stg_core__procedure') }}\n\n)\n\n, qualifying_claims as (\n\n select\n medical_claim.patient_id\n , medical_claim.claim_start_date\n , medical_claim.claim_end_date\n from medical_claim\n inner join mammography_codes\n on medical_claim.hcpcs_code = mammography_codes.code\n where mammography_codes.code_system = 'hcpcs'\n\n)\n\n, qualifying_observations as (\n\n select\n observations.patient_id\n , observations.observation_date\n from observations\n inner join mammography_codes\n on observations.code = mammography_codes.code\n and observations.code_type = mammography_codes.code_system\n)\n\n, qualifying_procedures as (\n\n select\n procedures.patient_id\n , procedures.procedure_date\n from procedures\n inner join mammography_codes\n on procedures.code = mammography_codes.code\n and procedures.code_type = mammography_codes.code_system\n\n)\n\n/*\n Check if patients in the eligible population have had a screening,\n diagnostic, film, digital or digital breast tomosynthesis (3D)\n mammography results documented and reviewed.\n*/\n\n, patients_with_mammograms as (\n\n select\n denominator.patient_id\n , denominator.performance_period_begin\n , denominator.performance_period_end\n , denominator.performance_period_lookback\n , denominator.measure_id\n , denominator.measure_name\n , denominator.measure_version\n , case\n when qualifying_claims.claim_start_date\n between denominator.performance_period_lookback\n and denominator.performance_period_end\n then qualifying_claims.claim_start_date\n when qualifying_claims.claim_end_date\n between denominator.performance_period_lookback\n and denominator.performance_period_end\n then qualifying_claims.claim_end_date\n when qualifying_observations.observation_date\n between denominator.performance_period_lookback\n and denominator.performance_period_end\n then qualifying_observations.observation_date\n when qualifying_procedures.procedure_date\n between denominator.performance_period_lookback\n and denominator.performance_period_end\n then qualifying_procedures.procedure_date\n else null\n end as evidence_date\n , case\n when qualifying_claims.claim_start_date\n between denominator.performance_period_lookback\n and denominator.performance_period_end\n then 1\n when qualifying_claims.claim_end_date\n between denominator.performance_period_lookback\n and denominator.performance_period_end\n then 1\n when qualifying_observations.observation_date\n between denominator.performance_period_lookback\n and denominator.performance_period_end\n then 1\n when qualifying_procedures.procedure_date\n between denominator.performance_period_lookback\n and denominator.performance_period_end\n then 1\n else 0\n end as numerator_flag\n from denominator\n left join qualifying_claims\n on denominator.patient_id = qualifying_claims.patient_id\n left join qualifying_observations\n on denominator.patient_id = qualifying_observations.patient_id\n left join qualifying_procedures\n on denominator.patient_id = qualifying_procedures.patient_id\n\n)\n\n, add_data_types as (\n\n select distinct\n cast(patient_id as {{ dbt.type_string() }}) 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 {{ dbt.type_string() }}) as measure_id\n , cast(measure_name as {{ dbt.type_string() }}) as measure_name\n , cast(measure_version as {{ dbt.type_string() }}) 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 , '{{ var('tuva_last_run')}}' as tuva_last_run\nfrom add_data_types", "language": "sql", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/the_tuva_project", "path": "quality_measures/intermediate/nqf2372_breast_cancer_screening/quality_measures__int_nqf2372_numerator.sql", "original_file_path": "models/quality_measures/intermediate/nqf2372_breast_cancer_screening/quality_measures__int_nqf2372_numerator.sql", "name": "quality_measures__int_nqf2372_numerator", "alias": "_int_nqf2372_numerator", "checksum": {"name": "sha256", "checksum": "0cfdf5a2bf37c8de59fd04d624c654e0f3c50135ade5672540f56e99e316ad28"}, "tags": ["quality_measures"], "refs": [["quality_measures__int_nqf2372_denominator"], ["quality_measures__value_sets"], ["quality_measures__stg_medical_claim"], ["quality_measures__stg_core__observation"], ["quality_measures__stg_core__procedure"]], "sources": [], "metrics": [], "description": "Numerator logic for the reporting version of NQF 2372, Breast Cancer Screening.\n", "columns": {"patient_id": {"name": "patient_id", "description": "Unique patient_id for each person.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "performance_period_begin": {"name": "performance_period_begin", "description": "Beginning date of the performance or measurement period.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "performance_period_end": {"name": "performance_period_end", "description": "Ending date of the performance or measurement period.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "measure_id": {"name": "measure_id", "description": "Unique measure identification number.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "measure_name": {"name": "measure_name", "description": "Name of the measure.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "measure_version": {"name": "measure_version", "description": "Version of the measure.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "evidence_date": {"name": "evidence_date", "description": "Date of event or service that places patient in the numerator.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "numerator_flag": {"name": "numerator_flag", "description": "The numerator reflects the subset of patients in the denominator for whom a particular service has been provided or for whom a particular outcome has been achieved.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The date and timestamp of the dbt run.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://models/quality_measures/quality_measures_models.yml", "compiled_path": null, "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": 1701215340.101037}, "model.the_tuva_project.quality_measures__int_nqf2372_long": {"resource_type": "model", "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"]}, "config": {"enabled": true, "alias": "_int_nqf2372_long", "schema": "quality_measures", "database": null, "tags": ["quality_measures"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "bind": false, "post-hook": [], "pre-hook": []}, "database": "dev_sarah", "schema": "quality_measures", "fqn": ["the_tuva_project", "quality_measures", "intermediate", "nqf2372_breast_cancer_screening", "quality_measures__int_nqf2372_long"], "unique_id": "model.the_tuva_project.quality_measures__int_nqf2372_long", "raw_code": "{{ config(\n enabled = var('quality_measures_enabled',var('claims_enabled',var('clinical_enabled',var('tuva_marts_enabled',False))))\n )\n}}\n\n/* selecting the full patient population as the grain of this table */\nwith patient as (\n\n select distinct patient_id\n from {{ ref('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 {{ ref('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 {{ ref('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 {{ ref('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 {{ dbt.type_string() }}) 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 {{ dbt.type_string() }}) 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 {{ dbt.type_string() }}) as measure_id\n , cast(measure_name as {{ dbt.type_string() }}) as measure_name\n , cast(measure_version as {{ dbt.type_string() }}) 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 , '{{ var('tuva_last_run')}}' as tuva_last_run\nfrom add_data_types", "language": "sql", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/the_tuva_project", "path": "quality_measures/intermediate/nqf2372_breast_cancer_screening/quality_measures__int_nqf2372_long.sql", "original_file_path": "models/quality_measures/intermediate/nqf2372_breast_cancer_screening/quality_measures__int_nqf2372_long.sql", "name": "quality_measures__int_nqf2372_long", "alias": "_int_nqf2372_long", "checksum": {"name": "sha256", "checksum": "5154133f60202353f7f9e3ad89ff63f8a1361d30f21892a764b763b38717ec79"}, "tags": ["quality_measures"], "refs": [["quality_measures__stg_core__patient"], ["quality_measures__int_nqf2372_denominator"], ["quality_measures__int_nqf2372_numerator"], ["quality_measures__int_nqf2372_exclusions"]], "sources": [], "metrics": [], "description": "Final preparation of the reporting version of NQF 2372, Breast Cancer Screening before combining with other measures.\n", "columns": {"patient_id": {"name": "patient_id", "description": "Unique patient_id for each person.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "denominator_flag": {"name": "denominator_flag", "description": "The denominator is associated with a given patient population that may be counted as eligible to meet a measure\u2019s inclusion requirements.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "numerator_flag": {"name": "numerator_flag", "description": "The numerator reflects the subset of patients in the denominator for whom a particular service has been provided or for whom a particular outcome has been achieved.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "exclusion_flag": {"name": "exclusion_flag", "description": "Specifications of those characteristics that would cause groups of individuals to be removed from the numerator and/or denominator of a measure although they experience the denominator index event.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "evidence_date": {"name": "evidence_date", "description": "Date of event or service that places patient in the numerator.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "exclusion_date": {"name": "exclusion_date", "description": "Date of event or service that excludes patient from the measure.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "exclusion_reason": {"name": "exclusion_reason", "description": "Reason (usually the value set concept name) that excludes patient from the measure.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "performance_period_begin": {"name": "performance_period_begin", "description": "Beginning date of the performance or measurement period.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "performance_period_end": {"name": "performance_period_end", "description": "Ending date of the performance or measurement period.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "measure_id": {"name": "measure_id", "description": "Unique measure identification number.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "measure_name": {"name": "measure_name", "description": "Name of the measure.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "measure_version": {"name": "measure_version", "description": "Version of the measure.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The date and timestamp of the dbt run.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://models/quality_measures/quality_measures_models.yml", "compiled_path": null, "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": 1701215340.097982}, "model.the_tuva_project.quality_measures__int_nqf2372_exclude_dementia": {"resource_type": "model", "depends_on": {"macros": ["macro.dbt.dateadd"], "nodes": ["model.the_tuva_project.quality_measures__int_nqf2372__frailty", "seed.the_tuva_project.quality_measures__value_sets", "model.the_tuva_project.quality_measures__stg_core__medication", "model.the_tuva_project.quality_measures__stg_pharmacy_claim"]}, "config": {"enabled": true, "alias": "_int_nqf2372_exclude_dementia", "schema": "quality_measures", "database": null, "tags": ["quality_measures"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "bind": false, "post-hook": [], "pre-hook": []}, "database": "dev_sarah", "schema": "quality_measures", "fqn": ["the_tuva_project", "quality_measures", "intermediate", "nqf2372_breast_cancer_screening", "quality_measures__int_nqf2372_exclude_dementia"], "unique_id": "model.the_tuva_project.quality_measures__int_nqf2372_exclude_dementia", "raw_code": "{{ config(\n enabled = var('quality_measures_enabled',var('claims_enabled',var('clinical_enabled',var('tuva_marts_enabled',False))))\n )\n}}\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 patients_with_frailty as (\n\n select\n patient_id\n , performance_period_begin\n , performance_period_end\n , exclusion_date\n , exclusion_reason\n from {{ ref('quality_measures__int_nqf2372__frailty') }}\n\n)\n\n, exclusion_codes as (\n\n select\n code\n , code_system\n , concept_name\n from {{ ref('quality_measures__value_sets') }}\n where concept_name in (\n 'Dementia Medications'\n )\n\n)\n\n, medications as (\n\n select\n patient_id\n , dispensing_date\n , source_code_type\n , source_code\n , ndc_code\n , rxnorm_code\n from {{ ref('quality_measures__stg_core__medication') }}\n\n)\n\n, pharmacy_claim as (\n\n select\n patient_id\n , dispensing_date\n , ndc_code\n , paid_date\n from {{ ref('quality_measures__stg_pharmacy_claim') }}\n\n)\n\n, medication_exclusions as (\n\n select\n medications.patient_id\n , medications.dispensing_date\n , exclusion_codes.concept_name\n from medications\n inner join exclusion_codes\n on medications.ndc_code = exclusion_codes.code\n where exclusion_codes.code_system = 'ndc'\n\n union all\n\n select\n medications.patient_id\n , medications.dispensing_date\n , exclusion_codes.concept_name\n from medications\n inner join exclusion_codes\n on medications.rxnorm_code = exclusion_codes.code\n where exclusion_codes.code_system = 'rxnorm'\n\n union all\n\n select\n medications.patient_id\n , medications.dispensing_date\n , exclusion_codes.concept_name\n from medications\n inner join exclusion_codes\n on medications.source_code = exclusion_codes.code\n and medications.source_code_type = exclusion_codes.code_system\n\n)\n\n, pharmacy_claim_exclusions as (\n\n select\n pharmacy_claim.patient_id\n , pharmacy_claim.dispensing_date\n , pharmacy_claim.ndc_code\n , pharmacy_claim.paid_date\n , exclusion_codes.concept_name\n from pharmacy_claim\n inner join exclusion_codes\n on pharmacy_claim.ndc_code = exclusion_codes.code\n where exclusion_codes.code_system = 'ndc'\n\n)\n\n, frailty_with_dementia as (\n\n select\n patients_with_frailty.patient_id\n , patients_with_frailty.exclusion_date\n , patients_with_frailty.exclusion_reason\n || ' with '\n || pharmacy_claim_exclusions.concept_name\n as exclusion_reason\n 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 {{ dbt.dateadd(datepart=\"year\", interval=-1, from_date_or_timestamp=\"patients_with_frailty.performance_period_begin\") }}\n and patients_with_frailty.performance_period_end\n or pharmacy_claim_exclusions.paid_date\n between {{ dbt.dateadd(datepart=\"year\", interval=-1, from_date_or_timestamp=\"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.exclusion_reason\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 {{ dbt.dateadd(datepart=\"year\", interval=-1, from_date_or_timestamp=\"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 , '{{ var('tuva_last_run')}}' as tuva_last_run\nfrom frailty_with_dementia", "language": "sql", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/the_tuva_project", "path": "quality_measures/intermediate/nqf2372_breast_cancer_screening/quality_measures__int_nqf2372_exclude_dementia.sql", "original_file_path": "models/quality_measures/intermediate/nqf2372_breast_cancer_screening/quality_measures__int_nqf2372_exclude_dementia.sql", "name": "quality_measures__int_nqf2372_exclude_dementia", "alias": "_int_nqf2372_exclude_dementia", "checksum": {"name": "sha256", "checksum": "2961f61e7f5fd3fd5b44a73646dba576626654750cce2f3bb18c4e477a5c1e14"}, "tags": ["quality_measures"], "refs": [["quality_measures__int_nqf2372__frailty"], ["quality_measures__value_sets"], ["quality_measures__stg_core__medication"], ["quality_measures__stg_pharmacy_claim"]], "sources": [], "metrics": [], "description": "Exclusion logic for patients with frailty and taking dementia medications for the reporting version of NQF 2372, Breast Cancer Screening.\n", "columns": {"patient_id": {"name": "patient_id", "description": "Unique patient_id for each person.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "exclusion_date": {"name": "exclusion_date", "description": "Date of event or service that excludes patient from the measure.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "exclusion_reason": {"name": "exclusion_reason", "description": "Reason (usually the value set concept name) that excludes patient from the measure.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://models/quality_measures/quality_measures_models.yml", "compiled_path": null, "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": 1701215340.082439}, "model.the_tuva_project.quality_measures__int_nqf2372_exclude_palliative": {"resource_type": "model", "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"]}, "config": {"enabled": true, "alias": "_int_nqf2372_exclude_palliative", "schema": "quality_measures", "database": null, "tags": ["quality_measures"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "bind": false, "post-hook": [], "pre-hook": []}, "database": "dev_sarah", "schema": "quality_measures", "fqn": ["the_tuva_project", "quality_measures", "intermediate", "nqf2372_breast_cancer_screening", "quality_measures__int_nqf2372_exclude_palliative"], "unique_id": "model.the_tuva_project.quality_measures__int_nqf2372_exclude_palliative", "raw_code": "{{ config(\n enabled = var('quality_measures_enabled',var('claims_enabled',var('clinical_enabled',var('tuva_marts_enabled',False))))\n )\n}}\n\n/*\n Palliative care services used by patient any time during the measurement period\n*/\nwith denominator as (\n\n select\n patient_id\n , performance_period_begin\n , performance_period_end\n from {{ ref('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 {{ ref('quality_measures__value_sets') }}\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 {{ ref('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 {{ ref('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 {{ ref('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 , '{{ var('tuva_last_run')}}' as tuva_last_run\nfrom palliative_care", "language": "sql", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/the_tuva_project", "path": "quality_measures/intermediate/nqf2372_breast_cancer_screening/quality_measures__int_nqf2372_exclude_palliative.sql", "original_file_path": "models/quality_measures/intermediate/nqf2372_breast_cancer_screening/quality_measures__int_nqf2372_exclude_palliative.sql", "name": "quality_measures__int_nqf2372_exclude_palliative", "alias": "_int_nqf2372_exclude_palliative", "checksum": {"name": "sha256", "checksum": "c918c4c5bd88f84a06ba57d6bb47c5aa2ad66a028c856e6a11823c9615bed9f6"}, "tags": ["quality_measures"], "refs": [["quality_measures__int_nqf2372_denominator"], ["quality_measures__value_sets"], ["quality_measures__stg_medical_claim"], ["quality_measures__stg_core__observation"], ["quality_measures__stg_core__procedure"]], "sources": [], "metrics": [], "description": "Exclusion logic for patients using palliative services for the reporting version of NQF 2372, Breast Cancer Screening.\n", "columns": {"patient_id": {"name": "patient_id", "description": "Unique patient_id for each person.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "exclusion_date": {"name": "exclusion_date", "description": "Date of event or service that excludes patient from the measure.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "exclusion_reason": {"name": "exclusion_reason", "description": "Reason (usually the value set concept name) that excludes patient from the measure.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://models/quality_measures/quality_measures_models.yml", "compiled_path": null, "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": 1701215340.0913}, "model.the_tuva_project.quality_measures__int_nqf2372_exclusions": {"resource_type": "model", "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"]}, "config": {"enabled": true, "alias": "_int_nqf2372_exclusions", "schema": "quality_measures", "database": null, "tags": ["quality_measures"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "bind": false, "post-hook": [], "pre-hook": []}, "database": "dev_sarah", "schema": "quality_measures", "fqn": ["the_tuva_project", "quality_measures", "intermediate", "nqf2372_breast_cancer_screening", "quality_measures__int_nqf2372_exclusions"], "unique_id": "model.the_tuva_project.quality_measures__int_nqf2372_exclusions", "raw_code": "{{ config(\n enabled = var('quality_measures_enabled',var('claims_enabled',var('clinical_enabled',var('tuva_marts_enabled',False))))\n )\n}}\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 {{ ref('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 {{ ref('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 {{ ref('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 {{ ref('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 {{ ref('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 {{ ref('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 {{ ref('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 {{ dbt.type_string() }}) 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 {{ dbt.type_string() }}) as measure_id\n , cast(measure_name as {{ dbt.type_string() }}) as measure_name\n , cast(measure_version as {{ dbt.type_string() }}) as measure_version\n , cast(exclusion_date as date) as exclusion_date\n , cast(exclusion_reason as {{ dbt.type_string() }}) 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 , '{{ var('tuva_last_run')}}' as tuva_last_run\nfrom add_data_types", "language": "sql", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/the_tuva_project", "path": "quality_measures/intermediate/nqf2372_breast_cancer_screening/quality_measures__int_nqf2372_exclusions.sql", "original_file_path": "models/quality_measures/intermediate/nqf2372_breast_cancer_screening/quality_measures__int_nqf2372_exclusions.sql", "name": "quality_measures__int_nqf2372_exclusions", "alias": "_int_nqf2372_exclusions", "checksum": {"name": "sha256", "checksum": "c6a26a6b0fb05ea2806a8181b62d61e27d1ba02c27f21929481c879ebd33b1fb"}, "tags": ["quality_measures"], "refs": [["quality_measures__int_nqf2372_denominator"], ["quality_measures__int_nqf2372_exclude_advanced_illness"], ["quality_measures__int_nqf2372_exclude_dementia"], ["quality_measures__int_nqf2372_exclude_hospice"], ["quality_measures__int_nqf2372_exclude_institutional"], ["quality_measures__int_nqf2372_exclude_mastectomy"], ["quality_measures__int_nqf2372_exclude_palliative"]], "sources": [], "metrics": [], "description": "Combined exclusion logic for the reporting version of NQF 2372, Breast Cancer Screening.\n", "columns": {"patient_id": {"name": "patient_id", "description": "Unique patient_id for each person.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "performance_period_begin": {"name": "performance_period_begin", "description": "Beginning date of the performance or measurement period.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "performance_period_end": {"name": "performance_period_end", "description": "Ending date of the performance or measurement period.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "measure_id": {"name": "measure_id", "description": "Unique measure identification number.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "measure_name": {"name": "measure_name", "description": "Name of the measure.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "measure_version": {"name": "measure_version", "description": "Version of the measure.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "exclusion_date": {"name": "exclusion_date", "description": "Date of event or service that excludes patient from the measure.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "exclusion_reason": {"name": "exclusion_reason", "description": "Reason (usually the value set concept name) that excludes patient from the measure.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "exclusion_flag": {"name": "exclusion_flag", "description": "Specifications of those characteristics that would cause groups of individuals to be removed from the numerator and/or denominator of a measure although they experience the denominator index event.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The date and timestamp of the dbt run.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://models/quality_measures/quality_measures_models.yml", "compiled_path": null, "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": 1701215340.0944629}, "model.the_tuva_project.quality_measures__int_nqf2372_denominator": {"resource_type": "model", "depends_on": {"macros": ["macro.dbt.datediff", "macro.dbt.type_string"], "nodes": ["model.the_tuva_project.quality_measures__int_nqf2372__performance_period", "model.the_tuva_project.quality_measures__stg_core__patient", "model.the_tuva_project.quality_measures__stg_core__encounter", "model.the_tuva_project.quality_measures__stg_medical_claim", "model.the_tuva_project.quality_measures__stg_core__procedure", "seed.the_tuva_project.quality_measures__value_sets"]}, "config": {"enabled": true, "alias": "_int_nqf2372_denominator", "schema": "quality_measures", "database": null, "tags": ["quality_measures"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "bind": false, "post-hook": [], "pre-hook": []}, "database": "dev_sarah", "schema": "quality_measures", "fqn": ["the_tuva_project", "quality_measures", "intermediate", "nqf2372_breast_cancer_screening", "quality_measures__int_nqf2372_denominator"], "unique_id": "model.the_tuva_project.quality_measures__int_nqf2372_denominator", "raw_code": "{{ config(\n enabled = var('quality_measures_enabled',var('claims_enabled',var('clinical_enabled',var('tuva_marts_enabled',False))))\n )\n}}\n\nwith performance_period as (\n\n select\n measure_id\n , measure_name\n , measure_version\n , performance_period_end\n , performance_period_begin\n , performance_period_lookback\n from {{ ref('quality_measures__int_nqf2372__performance_period') }}\n\n)\n\n, patient as (\n\n select\n patient_id\n , sex\n , birth_date\n , death_date\n from {{ ref('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 {{ ref('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 {{ ref('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 {{ ref('quality_measures__stg_core__procedure') }}\n\n)\n\n, visit_codes as (\n\n select\n code\n , code_system\n from {{ ref('quality_measures__value_sets') }}\n where concept_name in (\n 'Office Visit'\n , 'Home Healthcare Services'\n , 'Preventive Care Services Established Office Visit, 18 and Up'\n , 'Preventive Care Services Initial Office Visit, 18 and Up'\n , 'Annual Wellness Visit'\n , 'Telephone Visits'\n , 'Online Assessments'\n )\n\n)\n\n, patient_with_age as (\n\n select\n patient.patient_id\n , patient.sex\n , patient.birth_date\n , patient.death_date\n , performance_period.measure_id\n , performance_period.measure_name\n , performance_period.measure_version\n , performance_period.performance_period_begin\n , performance_period.performance_period_end\n , performance_period.performance_period_lookback\n , floor({{ datediff('patient.birth_date', 'performance_period.performance_period_end', 'hour') }} / 8766.0) as age\n from patient\n cross join performance_period\n\n)\n\n/*\n Filter patient to living women 51 - 74 years of age\n at the beginning of the measurement period\n*/\n, patient_filtered as (\n\n select\n patient_id\n , age\n , measure_id\n , measure_name\n , measure_version\n , performance_period_begin\n , performance_period_end\n , performance_period_lookback\n , 1 as denominator_flag\n from patient_with_age\n where lower(sex) = 'female'\n and age between 51 and 74\n and death_date is null\n\n)\n\n/*\n Filter to qualifying visit types by claim procedures\n*/\n, visit_claims as (\n\n select\n medical_claim.patient_id\n , medical_claim.claim_start_date\n , medical_claim.claim_end_date\n , medical_claim.hcpcs_code\n from medical_claim\n inner join visit_codes\n on medical_claim.hcpcs_code = visit_codes.code\n where visit_codes.code_system = 'hcpcs'\n\n)\n\n/*\n Filter encounters to qualifying visit type\n*/\n, visit_encounters as (\n\n select\n patient_id\n , encounter_start_date\n from encounters\n where lower(encounter_type) in (\n 'home health'\n , 'office visit'\n , 'outpatient'\n , 'outpatient rehabilitation'\n , 'telehealth'\n )\n\n)\n\n/*\n Filter to qualifying visit types by procedure\n*/\n, visit_procedures as (\n\n select\n procedures.patient_id\n , procedures.procedure_date\n from procedures\n inner join visit_codes\n on procedures.code = visit_codes.code\n and procedures.code_type = visit_codes.code_system\n\n)\n\n/*\n Filter to final eligible population/denominator before exclusions\n with a qualifying visit during the measurement period\n*/\n, eligible_population as (\n\n select\n patient_filtered.patient_id\n , patient_filtered.age\n , patient_filtered.measure_id\n , patient_filtered.measure_name\n , patient_filtered.measure_version\n , patient_filtered.performance_period_begin\n , patient_filtered.performance_period_end\n , performance_period_lookback\n , patient_filtered.denominator_flag\n from patient_filtered\n left join visit_claims\n on patient_filtered.patient_id = visit_claims.patient_id\n left join visit_procedures\n on patient_filtered.patient_id = visit_procedures.patient_id\n left join visit_encounters\n on patient_filtered.patient_id = visit_encounters.patient_id\n where (\n visit_claims.claim_start_date\n between patient_filtered.performance_period_begin\n and patient_filtered.performance_period_end\n or visit_claims.claim_end_date\n between patient_filtered.performance_period_begin\n and patient_filtered.performance_period_end\n or visit_procedures.procedure_date\n between patient_filtered.performance_period_begin\n and patient_filtered.performance_period_end\n or visit_encounters.encounter_start_date\n between patient_filtered.performance_period_begin\n and patient_filtered.performance_period_end\n )\n\n)\n\n, add_data_types as (\n\n select distinct\n cast(patient_id as {{ dbt.type_string() }}) as patient_id\n , cast(age as integer) as age\n , cast(performance_period_begin as date) as performance_period_begin\n , cast(performance_period_end as date) as performance_period_end\n , cast(performance_period_lookback as date) as performance_period_lookback\n , cast(measure_id as {{ dbt.type_string() }}) as measure_id\n , cast(measure_name as {{ dbt.type_string() }}) as measure_name\n , cast(measure_version as {{ dbt.type_string() }}) as measure_version\n , cast(denominator_flag as integer) as denominator_flag\n from eligible_population\n\n)\n\n select distinct\n patient_id\n , age\n , performance_period_begin\n , performance_period_end\n , performance_period_lookback\n , measure_id\n , measure_name\n , measure_version\n , denominator_flag\n , '{{ var('tuva_last_run')}}' as tuva_last_run\nfrom add_data_types", "language": "sql", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/the_tuva_project", "path": "quality_measures/intermediate/nqf2372_breast_cancer_screening/quality_measures__int_nqf2372_denominator.sql", "original_file_path": "models/quality_measures/intermediate/nqf2372_breast_cancer_screening/quality_measures__int_nqf2372_denominator.sql", "name": "quality_measures__int_nqf2372_denominator", "alias": "_int_nqf2372_denominator", "checksum": {"name": "sha256", "checksum": "20d37b8969ab10d2558aaaacd61b8f468f2be15c0c811928d5392f7b0304e1e0"}, "tags": ["quality_measures"], "refs": [["quality_measures__int_nqf2372__performance_period"], ["quality_measures__stg_core__patient"], ["quality_measures__stg_core__encounter"], ["quality_measures__stg_medical_claim"], ["quality_measures__stg_core__procedure"], ["quality_measures__value_sets"]], "sources": [], "metrics": [], "description": "Denominator logic for the reporting version of NQF 2372, Breast Cancer Screening.\n", "columns": {"patient_id": {"name": "patient_id", "description": "Unique patient_id for each person.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "age": {"name": "age", "description": "Patient's age as of the performance_period_begin date.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "performance_period_begin": {"name": "performance_period_begin", "description": "Beginning date of the performance or measurement period.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "performance_period_end": {"name": "performance_period_end", "description": "Ending date of the performance or measurement period.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "measure_id": {"name": "measure_id", "description": "Unique measure identification number.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "measure_name": {"name": "measure_name", "description": "Name of the measure.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "measure_version": {"name": "measure_version", "description": "Version of the measure.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "denominator_flag": {"name": "denominator_flag", "description": "The denominator is associated with a given patient population that may be counted as eligible to meet a measure\u2019s inclusion requirements.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The date and timestamp of the dbt run.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://models/quality_measures/quality_measures_models.yml", "compiled_path": null, "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": 1701215340.077991}, "model.the_tuva_project.quality_measures__int_nqf2372_exclude_hospice": {"resource_type": "model", "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"]}, "config": {"enabled": true, "alias": "_int_nqf2372_exclude_hospice", "schema": "quality_measures", "database": null, "tags": ["quality_measures"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "bind": false, "post-hook": [], "pre-hook": []}, "database": "dev_sarah", "schema": "quality_measures", "fqn": ["the_tuva_project", "quality_measures", "intermediate", "nqf2372_breast_cancer_screening", "quality_measures__int_nqf2372_exclude_hospice"], "unique_id": "model.the_tuva_project.quality_measures__int_nqf2372_exclude_hospice", "raw_code": "{{ config(\n enabled = var('quality_measures_enabled',var('claims_enabled',var('clinical_enabled',var('tuva_marts_enabled',False))))\n )\n}}\n\n/*\n Hospice services used by patient any time during the measurement period\n*/\n\nwith denominator as (\n\n select\n patient_id\n , performance_period_begin\n , performance_period_end\n from {{ ref('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 {{ ref('quality_measures__value_sets') }}\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 {{ ref('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 {{ ref('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 {{ ref('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 , '{{ var('tuva_last_run')}}' as tuva_last_run\nfrom hospice", "language": "sql", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/the_tuva_project", "path": "quality_measures/intermediate/nqf2372_breast_cancer_screening/quality_measures__int_nqf2372_exclude_hospice.sql", "original_file_path": "models/quality_measures/intermediate/nqf2372_breast_cancer_screening/quality_measures__int_nqf2372_exclude_hospice.sql", "name": "quality_measures__int_nqf2372_exclude_hospice", "alias": "_int_nqf2372_exclude_hospice", "checksum": {"name": "sha256", "checksum": "cf39611efb8664f7c8a5873de910d5aa4642e4ab4a5e3774a868d6e40b444e8b"}, "tags": ["quality_measures"], "refs": [["quality_measures__int_nqf2372_denominator"], ["quality_measures__value_sets"], ["quality_measures__stg_core__observation"], ["quality_measures__stg_medical_claim"], ["quality_measures__stg_core__procedure"]], "sources": [], "metrics": [], "description": "Exclusion logic for patients using hospice services for the reporting version of NQF 2372, Breast Cancer Screening.\n", "columns": {"patient_id": {"name": "patient_id", "description": "Unique patient_id for each person.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "exclusion_date": {"name": "exclusion_date", "description": "Date of event or service that excludes patient from the measure.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "exclusion_reason": {"name": "exclusion_reason", "description": "Reason (usually the value set concept name) that excludes patient from the measure.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://models/quality_measures/quality_measures_models.yml", "compiled_path": null, "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": 1701215340.084571}, "model.the_tuva_project.quality_measures__int_nqf0034_denominator": {"resource_type": "model", "depends_on": {"macros": ["macro.dbt.type_string", "macro.dbt.datediff"], "nodes": ["seed.the_tuva_project.quality_measures__value_sets", "model.the_tuva_project.quality_measures__stg_core__encounter", "model.the_tuva_project.quality_measures__int_nqf0034__performance_period", "model.the_tuva_project.quality_measures__stg_core__procedure", "model.the_tuva_project.quality_measures__int_nqf0034__performance_period", "model.the_tuva_project.quality_measures__stg_medical_claim", "model.the_tuva_project.quality_measures__int_nqf0034__performance_period", "model.the_tuva_project.quality_measures__stg_core__patient"]}, "config": {"enabled": true, "alias": "_int_nqf0034_denominator", "schema": "quality_measures", "database": null, "tags": ["quality_measures"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "bind": false, "post-hook": [], "pre-hook": []}, "database": "dev_sarah", "schema": "quality_measures", "fqn": ["the_tuva_project", "quality_measures", "intermediate", "nqf0034_colorectal_cancer_screening", "quality_measures__int_nqf0034_denominator"], "unique_id": "model.the_tuva_project.quality_measures__int_nqf0034_denominator", "raw_code": "{{ config(\n enabled = var('quality_measures_enabled',var('claims_enabled',var('clinical_enabled',var('tuva_marts_enabled',False))))\n )\n}}\n\n/*\nDENOMINATOR:\nPatients 45-75 years of age with a visit during the measurement period\nDENOMINATOR NOTE: To assess the age for exclusions, the patient\u2019s age on the date of the encounter\nshould be used\n*Signifies that this CPT Category I code is a non-covered service under the Medicare Part B Physician Fee\nSchedule (PFS). These non-covered services should be counted in the denominator population for MIPS\nCQMs.\nDenominator Criteria (Eligible Cases):\nPatients 45 to 75 years of age on date of encounter\nAND\nPatient encounter during the performance period (CPT or HCPCS): 99202, 99203, 99204, 99205,\n99212, 99213, 99214, 99215, 99341, 99342, 99344, 99345, 99347, 99348, 99349, 99350, 99386*, 99387*,\n99396*, 99397*, G0438, G0439\n*/\n\nwith visit_codes as (\n\n select\n code\n , code_system\n from {{ ref('quality_measures__value_sets') }}\n where concept_name in (\n 'Office Visit'\n , 'Home Healthcare Services'\n , 'Preventive Care Services Established Office Visit, 18 and Up'\n , 'Preventive Care Services Initial Office Visit, 18 and Up'\n , 'Annual Wellness Visit'\n , 'Telephone Visits'\n , 'Online Assessments'\n )\n\n), visits_encounters as (\n select PATIENT_ID\n , coalesce(ENCOUNTER.ENCOUNTER_START_DATE,ENCOUNTER.ENCOUNTER_END_DATE) as min_date\n , coalesce(ENCOUNTER.ENCOUNTER_END_DATE,ENCOUNTER.ENCOUNTER_START_DATE) as max_date\n From {{ref('quality_measures__stg_core__encounter')}} encounter\n inner join {{ref('quality_measures__int_nqf0034__performance_period')}} as pp\n on coalesce(ENCOUNTER.ENCOUNTER_END_DATE,ENCOUNTER.ENCOUNTER_START_DATE) >= pp.performance_period_begin\n and coalesce(ENCOUNTER.ENCOUNTER_START_DATE,ENCOUNTER.ENCOUNTER_END_DATE) <= pp.performance_period_end\n where ENCOUNTER_TYPE in (\n 'home health'\n , 'office visit'\n , 'outpatient'\n , 'outpatient rehabilitation'\n , 'telehealth'\n )\n\n\n )\n\n,procedure_encounters as (\n select patient_id, PROCEDURE_DATE as min_date, PROCEDURE_DATE as max_date\n from {{ref('quality_measures__stg_core__procedure')}} proc\n inner join {{ref('quality_measures__int_nqf0034__performance_period')}} as pp\n on PROCEDURE_DATE between pp.performance_period_begin and pp.performance_period_end\n inner join visit_codes\n on coalesce(proc.normalized_code,proc.source_code) = visit_codes.code\n\n\n)\n,\nclaims_encounters as (\n select PATIENT_ID\n , coalesce(CLAIM_START_DATE,CLAIM_END_DATE) as min_date\n , coalesce(CLAIM_END_DATE,CLAIM_START_DATE) as max_date\n from {{ref('quality_measures__stg_medical_claim')}} medical_claim\n inner join {{ref('quality_measures__int_nqf0034__performance_period')}} as pp on\n coalesce(CLAIM_END_DATE,CLAIM_START_DATE) >= pp.performance_period_begin\n and coalesce(CLAIM_START_DATE,CLAIM_END_DATE) <= pp.performance_period_end\n inner join visit_codes\n on medical_claim.hcpcs_code= visit_codes.code\n\n\n)\n\n,all_encounters as (\n select *, 'v' as visit_enc,cast(null as {{ dbt.type_string() }}) as proc_enc, cast(null as {{ dbt.type_string() }}) as claim_enc\n from visits_encounters\n union all\n select *, cast(null as {{ dbt.type_string() }}) as visit_enc, 'p' as proc_enc, cast(null as {{ dbt.type_string() }}) as claim_enc\n from procedure_encounters\n union all\n select *, cast(null as {{ dbt.type_string() }}) as visit_enc,cast(null as {{ dbt.type_string() }}) as proc_enc, 'c' as claim_enc\n from claims_encounters\n)\n\n, encounters_by_patient as (\n select patient_id,min(min_date) min_date, max(max_date) max_date,\n concat(concat(\n coalesce(min(visit_enc),'')\n ,coalesce(min(proc_enc),''))\n ,coalesce(min(claim_enc),'')\n ) as qualifying_types\n from all_encounters\n group by patient_id\n)\n\n, patients_with_age as (\n select\n p.PATIENT_ID\n , min_date\n , floor({{ datediff('birth_date', 'e.min_date', 'hour') }} / 8766.0) as min_age\n , max_date\n ,floor({{ datediff('birth_date', 'e.max_date', 'hour') }} / 8766.0) as max_age\n , qualifying_types\n from {{ref('quality_measures__stg_core__patient')}} p\n inner join encounters_by_patient e\n on p.PATIENT_ID = e.PATIENT_ID\n where p.BIRTH_DATE is not null\n\n)\n\nselect PATIENT_ID,\n min_age,\n max_age,\n qualifying_types\nFrom patients_with_age\nwhere max_age >= 45 and min_age <= 75", "language": "sql", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/the_tuva_project", "path": "quality_measures/intermediate/nqf0034_colorectal_cancer_screening/quality_measures__int_nqf0034_denominator.sql", "original_file_path": "models/quality_measures/intermediate/nqf0034_colorectal_cancer_screening/quality_measures__int_nqf0034_denominator.sql", "name": "quality_measures__int_nqf0034_denominator", "alias": "_int_nqf0034_denominator", "checksum": {"name": "sha256", "checksum": "b4486f850648c72a9ab815fa10c71b5ecc8df95931bfce77674fcd68af5b7c9c"}, "tags": ["quality_measures"], "refs": [["quality_measures__value_sets"], ["quality_measures__stg_core__encounter"], ["quality_measures__int_nqf0034__performance_period"], ["quality_measures__stg_core__procedure"], ["quality_measures__int_nqf0034__performance_period"], ["quality_measures__stg_medical_claim"], ["quality_measures__int_nqf0034__performance_period"], ["quality_measures__stg_core__patient"]], "sources": [], "metrics": [], "description": "Denominator logic for the reporting version of NQF 0034, Colorectal Cancer Screening. \n", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://models/quality_measures/quality_measures_models.yml", "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"schema": "quality_measures", "alias": "_int_nqf0034_denominator", "tags": "quality_measures", "materialized": "table", "enabled": true, "bind": false}, "created_at": 1701215340.102838}, "model.the_tuva_project.quality_measures__int_nqf0034_exclude_dementia": {"resource_type": "model", "depends_on": {"macros": [], "nodes": ["seed.the_tuva_project.quality_measures__value_sets", "model.the_tuva_project.quality_measures__stg_core__medication", "model.the_tuva_project.quality_measures__stg_pharmacy_claim", "model.the_tuva_project.quality_measures__int_nqf0034__performance_period", "model.the_tuva_project.quality_measures__int_nqf0034__performance_period", "model.the_tuva_project.quality_measures__int_nqf0034__performance_period", "model.the_tuva_project.quality_measures__int_nqf0034__performance_period", "model.the_tuva_project.quality_measures__int_nqf0034__frailty"]}, "config": {"enabled": true, "alias": "_int_nqf0034_exclude_dementia", "schema": "quality_measures", "database": null, "tags": ["quality_measures"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "bind": false, "post-hook": [], "pre-hook": []}, "database": "dev_sarah", "schema": "quality_measures", "fqn": ["the_tuva_project", "quality_measures", "intermediate", "nqf0034_colorectal_cancer_screening", "quality_measures__int_nqf0034_exclude_dementia"], "unique_id": "model.the_tuva_project.quality_measures__int_nqf0034_exclude_dementia", "raw_code": "{{ config(\n enabled = var('quality_measures_enabled',var('claims_enabled',var('clinical_enabled',var('tuva_marts_enabled',False))))\n )\n}}\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\n exclusion_codes as (\n\n select\n code\n , code_system\n , concept_name\n from {{ ref('quality_measures__value_sets') }}\n where concept_name in (\n ( 'Dementia Medications')\n )\n\n)\n\n, medications as (\n\n select\n patient_id\n , dispensing_date\n , source_code_type\n , source_code\n , ndc_code\n , rxnorm_code\n from {{ ref('quality_measures__stg_core__medication') }}\n\n)\n\n, pharmacy_claim as (\n\n select\n patient_id\n , dispensing_date\n , ndc_code\n , paid_date\n from {{ ref('quality_measures__stg_pharmacy_claim') }}\n\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 {{ref('quality_measures__int_nqf0034__performance_period')}} pp\n on medications.dispensing_date between pp.performance_period_begin_1yp and pp.performance_period_end\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 {{ref('quality_measures__int_nqf0034__performance_period')}} pp\n on medications.dispensing_date between pp.performance_period_begin_1yp and pp.performance_period_end\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 {{ref('quality_measures__int_nqf0034__performance_period')}} pp\n on medications.dispensing_date between pp.performance_period_begin_1yp and pp.performance_period_end\n inner join exclusion_codes\n on medications.source_code = exclusion_codes.code\n and medications.source_code_type = exclusion_codes.code_system\n\n)\n\n, pharmacy_claim_exclusions as (\n\n select\n pharmacy_claim.patient_id\n , pharmacy_claim.dispensing_date\n , pharmacy_claim.ndc_code\n , pharmacy_claim.paid_date\n , exclusion_codes.concept_name\n from pharmacy_claim\n inner join {{ref('quality_measures__int_nqf0034__performance_period')}} pp\n on pharmacy_claim.dispensing_date between pp.performance_period_begin_1yp and pp.performance_period_end\n or pharmacy_claim.paid_date between pp.performance_period_begin_1yp and pp.performance_period_end\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\n\n, patients_with_frailty as (\n\n select\n patient_id\n , exclusion_date\n , concept_name\nfrom {{ref('quality_measures__int_nqf0034__frailty')}}\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\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\n\n)\n\nselect\n patient_id\n , exclusion_date\n , exclusion_reason\n , '{{ var('tuva_last_run')}}' as tuva_last_run\nfrom frailty_with_dementia d", "language": "sql", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/the_tuva_project", "path": "quality_measures/intermediate/nqf0034_colorectal_cancer_screening/quality_measures__int_nqf0034_exclude_dementia.sql", "original_file_path": "models/quality_measures/intermediate/nqf0034_colorectal_cancer_screening/quality_measures__int_nqf0034_exclude_dementia.sql", "name": "quality_measures__int_nqf0034_exclude_dementia", "alias": "_int_nqf0034_exclude_dementia", "checksum": {"name": "sha256", "checksum": "d2f02c3c35e222bc37544de648dbf0f068a98eccaff95634b79d4d4b51131d05"}, "tags": ["quality_measures"], "refs": [["quality_measures__value_sets"], ["quality_measures__stg_core__medication"], ["quality_measures__stg_pharmacy_claim"], ["quality_measures__int_nqf0034__performance_period"], ["quality_measures__int_nqf0034__performance_period"], ["quality_measures__int_nqf0034__performance_period"], ["quality_measures__int_nqf0034__performance_period"], ["quality_measures__int_nqf0034__frailty"]], "sources": [], "metrics": [], "description": "Exclusion logic for patients with frailty and taking dementia medications for the reporting version of NQF 0034, Colorectal Cancer Screening.\n", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://models/quality_measures/quality_measures_models.yml", "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"schema": "quality_measures", "alias": "_int_nqf0034_exclude_dementia", "tags": "quality_measures", "materialized": "table", "enabled": true, "bind": false}, "created_at": 1701215340.108602}, "model.the_tuva_project.quality_measures__int_nqf0034_long": {"resource_type": "model", "depends_on": {"macros": ["macro.dbt.type_string"], "nodes": ["seed.the_tuva_project.quality_measures__measures", "seed.the_tuva_project.quality_measures__measures", "seed.the_tuva_project.quality_measures__measures", "model.the_tuva_project.quality_measures__stg_core__patient", "model.the_tuva_project.quality_measures__int_nqf0034_denominator", "model.the_tuva_project.quality_measures__int_nqf0034_numerator", "model.the_tuva_project.quality_measures__int_nqf0034_exclusions", "model.the_tuva_project.quality_measures__int_nqf0034__performance_period"]}, "config": {"enabled": true, "alias": "_int_nqf0034_long", "schema": "quality_measures", "database": null, "tags": ["quality_measures"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "bind": false, "post-hook": [], "pre-hook": []}, "database": "dev_sarah", "schema": "quality_measures", "fqn": ["the_tuva_project", "quality_measures", "intermediate", "nqf0034_colorectal_cancer_screening", "quality_measures__int_nqf0034_long"], "unique_id": "model.the_tuva_project.quality_measures__int_nqf0034_long", "raw_code": "{{ config(\n enabled = var('quality_measures_enabled',var('claims_enabled',var('clinical_enabled',var('tuva_marts_enabled',False))))\n )\n}}\n\n\n{%- set measure_id -%}\n(\n select id\nfrom {{ ref('quality_measures__measures') }}\nwhere id = 'NQF0034'\n )\n{%- endset -%}\n\n{%- set measure_name -%}\n(\n\n select name\nfrom {{ ref('quality_measures__measures') }}\nwhere id = 'NQF0034'\n\n )\n{%- endset -%}\n\n{%- set measure_version -%}\n(\n select version\nfrom {{ ref('quality_measures__measures') }}\nwhere id = 'NQF0034'\n\n )\n{%- endset -%}\n\n\n\n/* selecting the full patient population as the grain of this table */\nwith patient as (\n\n select distinct patient_id\n from {{ ref('quality_measures__stg_core__patient') }}\n\n)\n\n, denominator as (\n\n select\n patient_id\n from {{ ref('quality_measures__int_nqf0034_denominator') }}\n\n)\n\n, numerator as (\n\n select\n patient_id\n , evidence_date\n from {{ ref('quality_measures__int_nqf0034_numerator') }}\n\n)\n\n, exclusions as (\n\n select\n patient_id\n , exclusion_date\n , exclusion_reason\n from {{ ref('quality_measures__int_nqf0034_exclusions') }}\n\n)\n\n, measure_flags as (\n\n select\n patient.patient_id\n , case\n when denominator.patient_id is not null\n then 1\n else null\n end as denominator_flag\n , case\n when numerator.patient_id is not null\n then 1\n else null\n end as numerator_flag\n , case\n when exclusions.patient_id is not null\n then 1\n else null\n end as exclusion_flag\n , numerator.evidence_date\n , exclusions.exclusion_date\n , exclusions.exclusion_reason\n , pp.performance_period_begin\n , pp.performance_period_end\n , {{ measure_id }} as measure_id\n , {{ measure_name }} as measure_name\n , {{ measure_version }} as measure_version\n from patient\n inner join {{ref('quality_measures__int_nqf0034__performance_period')}} pp\n on 1 = 1\n left join denominator\n on patient.patient_id = denominator.patient_id\n left join numerator\n on patient.patient_id = numerator.patient_id\n left join exclusions\n on patient.patient_id = exclusions.patient_id\n\n)\n\n/*\n Deduplicate measure rows by latest evidence date or exclusion date\n*/\n, add_rownum as (\n\n select\n patient_id\n , denominator_flag\n , numerator_flag\n , exclusion_flag\n , evidence_date\n , exclusion_date\n , exclusion_reason\n , performance_period_begin\n , performance_period_end\n , measure_id\n , measure_name\n , measure_version\n , row_number() over(\n partition by\n patient_id\n , performance_period_begin\n , performance_period_end\n , measure_id\n , measure_name\n order by\n evidence_date desc nulls last\n , exclusion_date desc nulls last\n ) as row_num\n from measure_flags\n\n)\n\n, deduped as (\n\n select\n patient_id\n , denominator_flag\n , numerator_flag\n , exclusion_flag\n , evidence_date\n , exclusion_date\n , exclusion_reason\n , performance_period_begin\n , performance_period_end\n , measure_id\n , measure_name\n , measure_version\n from add_rownum\n where row_num = 1\n\n)\n\n, add_data_types as (\n\n select\n cast(patient_id as {{ dbt.type_string() }}) 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 {{ dbt.type_string() }}) 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 {{ dbt.type_string() }}) as measure_id\n , cast(measure_name as {{ dbt.type_string() }}) as measure_name\n , cast(measure_version as {{ dbt.type_string() }}) 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 , '{{ var('tuva_last_run')}}' as tuva_last_run\nfrom add_data_types", "language": "sql", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/the_tuva_project", "path": "quality_measures/intermediate/nqf0034_colorectal_cancer_screening/quality_measures__int_nqf0034_long.sql", "original_file_path": "models/quality_measures/intermediate/nqf0034_colorectal_cancer_screening/quality_measures__int_nqf0034_long.sql", "name": "quality_measures__int_nqf0034_long", "alias": "_int_nqf0034_long", "checksum": {"name": "sha256", "checksum": "a3ab51077730e5b49bc36c4a59b9dbe807342cd820ca6ac3b23122681bbb9b54"}, "tags": ["quality_measures"], "refs": [["quality_measures__measures"], ["quality_measures__measures"], ["quality_measures__measures"], ["quality_measures__stg_core__patient"], ["quality_measures__int_nqf0034_denominator"], ["quality_measures__int_nqf0034_numerator"], ["quality_measures__int_nqf0034_exclusions"], ["quality_measures__int_nqf0034__performance_period"]], "sources": [], "metrics": [], "description": "Final preparation of the reporting version of NQF 0034, Colorectal Cancer Screening before combining with other measures. \n", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://models/quality_measures/quality_measures_models.yml", "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"schema": "quality_measures", "alias": "_int_nqf0034_long", "tags": "quality_measures", "materialized": "table", "enabled": true, "bind": false}, "created_at": 1701215340.115797}, "model.the_tuva_project.quality_measures__int_nqf0034__performance_period": {"resource_type": "model", "depends_on": {"macros": ["macro.dbt.current_timestamp", "macro.dbt.last_day", "macro.dbt.dateadd"], "nodes": []}, "config": {"enabled": true, "alias": "_int_nqf0034__performance_period", "schema": "quality_measures", "database": null, "tags": ["quality_measures"], "meta": {}, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "bind": false, "post-hook": [], "pre-hook": []}, "database": "dev_sarah", "schema": "quality_measures", "fqn": ["the_tuva_project", "quality_measures", "intermediate", "nqf0034_colorectal_cancer_screening", "quality_measures__int_nqf0034__performance_period"], "unique_id": "model.the_tuva_project.quality_measures__int_nqf0034__performance_period", "raw_code": "{{ config(\n enabled = var('quality_measures_enabled',var('claims_enabled',var('clinical_enabled',var('tuva_marts_enabled',False))))\n )\n}}\n/*\n set performance period end to the end of the current calendar year\n or use the quality_measures_period_end variable if provided\n*/\nwith period_end as (\n\n select\n {% if var('quality_measures_period_end',False) == False -%}\n {{ last_day(dbt.current_timestamp(), 'year') }}\n {% else -%}\n cast('{{ var('quality_measures_period_end') }}' as date)\n {%- endif %}\n as performance_period_end\n)\n\n/*\n set performance period begin to a year and a day prior\n for a complete calendar year\n*/\n, period_begin as (\n\n select\n performance_period_end\n , {{ dbt.dateadd (\n datepart = \"day\"\n , interval = +1\n , from_date_or_timestamp =\n dbt.dateadd (\n datepart = \"year\"\n , interval = -1\n , from_date_or_timestamp = \"performance_period_end\"\n )\n ) }} as performance_period_begin\n from period_end\n\n)\n\n/*\n set performance lookback periods for each type of test\n\n during the measurement period:\n - Fecal occult blood test (FOBT) during the measurement period\n\n during the measurement period or the two years prior:\n - Fecal immunochemical DNA test (FIT-DNA)\n\n during the measurement period or the four years prior:\n - Flexible sigmoidoscopy\n - Computed tomography (CT) colonography\n\n during the measurement period or the nine years prior:\n - Colonoscopy\n\n*/\n, period_lookback as (\n\n select\n performance_period_end\n , performance_period_begin\n , {{ dbt.dateadd(\n datepart = \"year\"\n , interval = -2\n , from_date_or_timestamp = \"performance_period_end\"\n ) }} as performance_period_begin_1yp\n , {{ dbt.dateadd(\n datepart = \"year\"\n , interval = -3\n , from_date_or_timestamp = \"performance_period_end\"\n ) }} as performance_period_begin_2yp\n , {{ dbt.dateadd(\n datepart = \"year\"\n , interval = -5\n , from_date_or_timestamp = \"performance_period_end\"\n ) }} as performance_period_begin_4yp\n , {{ dbt.dateadd(\n datepart = \"year\"\n , interval = -10\n , from_date_or_timestamp = \"performance_period_end\"\n ) }} as performance_period_begin_9yp\n from period_begin\n\n)\n\nselect\n cast(performance_period_begin as date) as performance_period_begin\n , cast(performance_period_end as date) as performance_period_end\n , cast(performance_period_begin_1yp as date) as performance_period_begin_1yp\n , cast(performance_period_begin_2yp as date) as performance_period_begin_2yp\n , cast(performance_period_begin_4yp as date) as performance_period_begin_4yp\n , cast(performance_period_begin_9yp as date) as performance_period_begin_9yp\nfrom period_lookback", "language": "sql", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/the_tuva_project", "path": "quality_measures/intermediate/nqf0034_colorectal_cancer_screening/quality_measures__int_nqf0034__performance_period.sql", "original_file_path": "models/quality_measures/intermediate/nqf0034_colorectal_cancer_screening/quality_measures__int_nqf0034__performance_period.sql", "name": "quality_measures__int_nqf0034__performance_period", "alias": "_int_nqf0034__performance_period", "checksum": {"name": "sha256", "checksum": "cca2e6986e8b7f77a62452621da6107ca7e54007c5d07495b7da112464495da7"}, "tags": ["quality_measures"], "refs": [], "sources": [], "metrics": [], "description": "Performance Period definition for NQF 0034 Colorectal Cancer screening.\n", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://models/quality_measures/quality_measures_models.yml", "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"schema": "quality_measures", "alias": "_int_nqf0034__performance_period", "tags": "quality_measures", "materialized": "view", "enabled": true, "bind": false}, "created_at": 1701215340.120985}, "model.the_tuva_project.quality_measures__int_nqf0034_exclusions": {"resource_type": "model", "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.quality_measures__int_nqf0034_exclude_advanced_illness", "model.the_tuva_project.quality_measures__int_nqf0034_exclude_colectomy_cancer", "model.the_tuva_project.quality_measures__int_nqf0034_exclude_dementia", "model.the_tuva_project.quality_measures__int_nqf0034_exclude_hospice_palliative", "model.the_tuva_project.quality_measures__int_nqf0034_exclude_institutional_snp", "model.the_tuva_project.quality_measures__int_nqf0034_denominator"]}, "config": {"enabled": true, "alias": "_int_nqf0034_exclusions", "schema": "quality_measures", "database": null, "tags": ["quality_measures"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "bind": false, "post-hook": [], "pre-hook": []}, "database": "dev_sarah", "schema": "quality_measures", "fqn": ["the_tuva_project", "quality_measures", "intermediate", "nqf0034_colorectal_cancer_screening", "quality_measures__int_nqf0034_exclusions"], "unique_id": "model.the_tuva_project.quality_measures__int_nqf0034_exclusions", "raw_code": "{{ config(\n enabled = var('quality_measures_enabled',var('claims_enabled',var('clinical_enabled',var('tuva_marts_enabled',False))))\n )\n}}\n\nwith exclusions as (\nselect *\nFrom {{ref('quality_measures__int_nqf0034_exclude_advanced_illness')}}\n\nunion all\n\nselect *\nFrom {{ref('quality_measures__int_nqf0034_exclude_colectomy_cancer')}}\n\nunion all\n\nselect *\nFrom {{ref('quality_measures__int_nqf0034_exclude_dementia')}}\n\nunion all\n\nselect *\nFrom {{ref('quality_measures__int_nqf0034_exclude_hospice_palliative')}}\n\nunion all\n\nselect *\nFrom {{ref('quality_measures__int_nqf0034_exclude_institutional_snp')}}\n)\n\nselect exclusions.*\nfrom exclusions\ninner join {{ref('quality_measures__int_nqf0034_denominator')}} p\n on exclusions.patient_id = p.patient_id", "language": "sql", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/the_tuva_project", "path": "quality_measures/intermediate/nqf0034_colorectal_cancer_screening/quality_measures__int_nqf0034_exclusions.sql", "original_file_path": "models/quality_measures/intermediate/nqf0034_colorectal_cancer_screening/quality_measures__int_nqf0034_exclusions.sql", "name": "quality_measures__int_nqf0034_exclusions", "alias": "_int_nqf0034_exclusions", "checksum": {"name": "sha256", "checksum": "6298ca02233276966995fda43fa85da02fcd4130dbcf384e4e46cbfd75b4504f"}, "tags": ["quality_measures"], "refs": [["quality_measures__int_nqf0034_exclude_advanced_illness"], ["quality_measures__int_nqf0034_exclude_colectomy_cancer"], ["quality_measures__int_nqf0034_exclude_dementia"], ["quality_measures__int_nqf0034_exclude_hospice_palliative"], ["quality_measures__int_nqf0034_exclude_institutional_snp"], ["quality_measures__int_nqf0034_denominator"]], "sources": [], "metrics": [], "description": "Combined exclusion logic for the reporting version of NQF 0034, Colorectal Cancer Screening. \n", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://models/quality_measures/quality_measures_models.yml", "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"schema": "quality_measures", "alias": "_int_nqf0034_exclusions", "tags": "quality_measures", "materialized": "table", "enabled": true, "bind": false}, "created_at": 1701215340.114084}, "model.the_tuva_project.quality_measures__int_nqf0034__frailty": {"resource_type": "model", "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.quality_measures__int_nqf0034_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", "model.the_tuva_project.quality_measures__int_nqf0034__performance_period", "model.the_tuva_project.quality_measures__int_nqf0034__performance_period", "model.the_tuva_project.quality_measures__int_nqf0034__performance_period", "model.the_tuva_project.quality_measures__int_nqf0034__performance_period"]}, "config": {"enabled": true, "alias": "_int_nqf0034__frailty", "schema": "quality_measures", "database": null, "tags": ["quality_measures"], "meta": {}, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "bind": false, "post-hook": [], "pre-hook": []}, "database": "dev_sarah", "schema": "quality_measures", "fqn": ["the_tuva_project", "quality_measures", "intermediate", "nqf0034_colorectal_cancer_screening", "quality_measures__int_nqf0034__frailty"], "unique_id": "model.the_tuva_project.quality_measures__int_nqf0034__frailty", "raw_code": "{{ config(\n enabled = var('quality_measures_enabled',var('claims_enabled',var('clinical_enabled',var('tuva_marts_enabled',False))))\n )\n}}\n\n/*\nDENOMINATOR EXCLUSIONS:\nPatients 66 years of age and older with at least one claim/encounter\nfor frailty during the measurement period (not full exclusion, used\nin conjunction with dementia medication or\n*/\n\n\nwith aged_patients as (\n select distinct patient_id\n from {{ref('quality_measures__int_nqf0034_denominator')}}\n where max_age >=66\n\n)\n\n, exclusion_codes as (\n select\n code\n , case code_system\n when 'SNOMEDCT' then 'snomed-ct'\n when 'ICD9CM' then 'icd-9-cm'\n when 'ICD10CM' then 'icd-10-cm'\n when 'CPT' then 'hcpcs'\n when 'ICD10PCS' then 'icd-10-pcs'\n else lower(code_system) end as code_system\n , concept_name\n , case when code in ('G2100','G2101') then 1 else 0 end as meets_all_criteria\n From {{ref('quality_measures__value_sets')}}\n where concept_name in (\n 'Frailty Device'\n , 'Frailty Diagnosis'\n , 'Frailty Encounter'\n , 'Frailty Symptom'\n )\n\n\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 {{ ref('quality_measures__stg_core__condition') }} )\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 {{ ref('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 {{ ref('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 {{ ref('quality_measures__stg_core__procedure') }}\n\n\n)\n\n, condition_exclusions as (\n\n select\n conditions.patient_id\n , conditions.claim_id\n , conditions.recorded_date\n , exclusion_codes.concept_name\n from conditions\n inner join aged_patients\n on conditions.patient_id = aged_patients.patient_id\n inner join exclusion_codes\n on conditions.code = exclusion_codes.code\n and conditions.code_type = exclusion_codes.code_system\n inner join {{ref('quality_measures__int_nqf0034__performance_period')}} as pp on\n recorded_date between pp.performance_period_begin and pp.performance_period_end\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 aged_patients\n on medical_claim.patient_id = aged_patients.patient_id\n inner join exclusion_codes\n on medical_claim.hcpcs_code = exclusion_codes.code\n inner join {{ref('quality_measures__int_nqf0034__performance_period')}} as pp\n on claim_start_date between pp.performance_period_begin and pp.performance_period_end\n where exclusion_codes.code_system = 'hcpcs'\n\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 aged_patients\n on observations.patient_id = aged_patients.patient_id\n inner join exclusion_codes\n on observations.code = exclusion_codes.code\n and observations.code_type = exclusion_codes.code_system\n inner join {{ref('quality_measures__int_nqf0034__performance_period')}} as pp\n on observation_date between pp.performance_period_begin and pp.performance_period_end\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 aged_patients\n on procedures.patient_id = aged_patients.patient_id\n inner join exclusion_codes\n on procedures.code = exclusion_codes.code\n and procedures.code_type = exclusion_codes.code_system\n inner join {{ref('quality_measures__int_nqf0034__performance_period')}} as pp on\n procedure_date between pp.performance_period_begin and pp.performance_period_end\n\n)\n\n, patients_with_exclusions as(\n select patient_id\n , recorded_date as exclusion_date\n , concept_name as concept_name\n from condition_exclusions\n\n union distinct\n\n select patient_id\n , coalesce(\n med_claim_exclusions.claim_start_date\n , med_claim_exclusions.claim_end_date\n ) as exclusion_date\n , concept_name as concept_name\n from med_claim_exclusions\n\n union distinct\n\n select patient_id\n , observation_date as exclusion_date\n , concept_name as concept_name\n from observation_exclusions\n\n union distinct\n\n select patient_id\n , procedure_date as exclusion_date\n , concept_name as concept_name\n from procedure_exclusions\n\n)\n, ordered_exclusions as (\n select patient_id\n , exclusion_date\n , concept_name\n , row_number() over (partition by patient_id order by exclusion_date) as exclusion_row\n from patients_with_exclusions\n )\n\nselect patient_id\n , exclusion_date\n , concept_name\nfrom ordered_exclusions", "language": "sql", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/the_tuva_project", "path": "quality_measures/intermediate/nqf0034_colorectal_cancer_screening/quality_measures__int_nqf0034__frailty.sql", "original_file_path": "models/quality_measures/intermediate/nqf0034_colorectal_cancer_screening/quality_measures__int_nqf0034__frailty.sql", "name": "quality_measures__int_nqf0034__frailty", "alias": "_int_nqf0034__frailty", "checksum": {"name": "sha256", "checksum": "64c3341f811ebbe1082f8146944799c29089899c8d4412fa6599817bafd65559"}, "tags": ["quality_measures"], "refs": [["quality_measures__int_nqf0034_denominator"], ["quality_measures__value_sets"], ["quality_measures__stg_core__condition"], ["quality_measures__stg_medical_claim"], ["quality_measures__stg_core__observation"], ["quality_measures__stg_core__procedure"], ["quality_measures__int_nqf0034__performance_period"], ["quality_measures__int_nqf0034__performance_period"], ["quality_measures__int_nqf0034__performance_period"], ["quality_measures__int_nqf0034__performance_period"]], "sources": [], "metrics": [], "description": "Frailty definition for nqf 0034 colorectal cancer screening used in multiple exclusions\n", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://models/quality_measures/quality_measures_models.yml", "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"schema": "quality_measures", "alias": "_int_nqf0034__frailty", "tags": "quality_measures", "materialized": "view", "enabled": true, "bind": false}, "created_at": 1701215340.1193001}, "model.the_tuva_project.quality_measures__int_nqf0034_exclude_hospice_palliative": {"resource_type": "model", "depends_on": {"macros": [], "nodes": ["seed.the_tuva_project.quality_measures__value_sets", "model.the_tuva_project.quality_measures__stg_core__condition", "model.the_tuva_project.quality_measures__stg_medical_claim", "model.the_tuva_project.quality_measures__stg_core__observation", "model.the_tuva_project.quality_measures__stg_core__procedure", "model.the_tuva_project.quality_measures__int_nqf0034__performance_period", "model.the_tuva_project.quality_measures__int_nqf0034__performance_period", "model.the_tuva_project.quality_measures__int_nqf0034__performance_period", "model.the_tuva_project.quality_measures__int_nqf0034__performance_period"]}, "config": {"enabled": true, "alias": "_int_nqf0034_exclude_hospice_palliative", "schema": "quality_measures", "database": null, "tags": ["quality_measures"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "bind": false, "post-hook": [], "pre-hook": []}, "database": "dev_sarah", "schema": "quality_measures", "fqn": ["the_tuva_project", "quality_measures", "intermediate", "nqf0034_colorectal_cancer_screening", "quality_measures__int_nqf0034_exclude_hospice_palliative"], "unique_id": "model.the_tuva_project.quality_measures__int_nqf0034_exclude_hospice_palliative", "raw_code": "{{ config(\n enabled = var('quality_measures_enabled',var('claims_enabled',var('clinical_enabled',var('tuva_marts_enabled',False))))\n )\n}}\n\n/*\nDENOMINATOR EXCLUSIONS:\nPatient was provided hospice services any time during the measurement period: G9710\n*/\n\n\nwith exclusion_codes as (\n select\n code\n , case code_system\n when 'SNOMEDCT' then 'snomed-ct'\n when 'ICD9CM' then 'icd-9-cm'\n when 'ICD10CM' then 'icd-10-cm'\n when 'CPT' then 'hcpcs'\n when 'ICD10PCS' then 'icd-10-pcs'\n else lower(code_system) end as code_system\n , concept_name\n From {{ref('quality_measures__value_sets')}}\n where concept_name in (\n 'Hospice Care Ambulatory'\n , 'Hospice Encounter'\n , 'Palliative Care Encounter'\n , 'Palliative Care Intervention'\n )\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 {{ ref('quality_measures__stg_core__condition') }} )\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 {{ ref('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 {{ ref('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 {{ ref('quality_measures__stg_core__procedure') }}\n\n)\n\n, condition_exclusions as (\n\n select\n conditions.patient_id\n , conditions.claim_id\n , conditions.recorded_date\n , exclusion_codes.concept_name as concept_name\n from conditions\n inner join exclusion_codes\n on conditions.code = exclusion_codes.code\n and conditions.code_type = exclusion_codes.code_system\n inner join {{ref('quality_measures__int_nqf0034__performance_period')}} as pp\n on recorded_date between pp.performance_period_begin and pp.performance_period_end\n\n)\n\n, med_claim_exclusions as (\n\n select\n medical_claim.patient_id\n , medical_claim.claim_id\n , medical_claim.claim_start_date\n , medical_claim.claim_end_date\n , medical_claim.hcpcs_code\n , exclusion_codes.concept_name as concept_name\n from medical_claim\n inner join exclusion_codes\n on medical_claim.hcpcs_code = exclusion_codes.code\n inner join {{ref('quality_measures__int_nqf0034__performance_period')}} as pp on 1=1\n where exclusion_codes.code_system = 'hcpcs'\n and claim_start_date between pp.performance_period_begin and pp.performance_period_end\n)\n\n, observation_exclusions as (\n\n select\n observations.patient_id\n , observations.observation_date\n , exclusion_codes.concept_name as concept_name\n from observations\n inner join exclusion_codes\n on observations.code = exclusion_codes.code\n and observations.code_type = exclusion_codes.code_system\n inner join {{ref('quality_measures__int_nqf0034__performance_period')}} as pp on 1=1\n where observation_date between pp.performance_period_begin and pp.performance_period_end\n\n)\n\n, procedure_exclusions as (\n\n select\n procedures.patient_id\n , procedures.procedure_date\n , exclusion_codes.concept_name as concept_name\n from procedures\n inner join exclusion_codes\n on procedures.code = exclusion_codes.code\n and procedures.code_type = exclusion_codes.code_system\n inner join {{ref('quality_measures__int_nqf0034__performance_period')}} as pp on 1=1\n where procedure_date between pp.performance_period_begin and pp.performance_period_end\n\n)\n\n, patients_with_exclusions as(\n select patient_id\n , recorded_date as exclusion_date\n , concept_name as exclusion_reason\n from condition_exclusions\n\n union all\n\n select patient_id\n , coalesce(claim_end_date, claim_start_date) as exclusion_date\n , concept_name as exclusion_reason\n from med_claim_exclusions\n\n union all\n\n select patient_id\n , observation_date as exclusion_date\n , concept_name as exclusion_reason\n from observation_exclusions\n\n union all\n\n select patient_id\n , procedure_date as exclusion_date\n , concept_name as exclusion_reason\n from procedure_exclusions\n\n)\n\n\n\nselect\n patient_id\n , exclusion_date\n , exclusion_reason\n , '{{ var('tuva_last_run')}}' as tuva_last_run\nfrom patients_with_exclusions", "language": "sql", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/the_tuva_project", "path": "quality_measures/intermediate/nqf0034_colorectal_cancer_screening/quality_measures__int_nqf0034_exclude_hospice_palliative.sql", "original_file_path": "models/quality_measures/intermediate/nqf0034_colorectal_cancer_screening/quality_measures__int_nqf0034_exclude_hospice_palliative.sql", "name": "quality_measures__int_nqf0034_exclude_hospice_palliative", "alias": "_int_nqf0034_exclude_hospice_palliative", "checksum": {"name": "sha256", "checksum": "3c6edbda4dde2dc317e096187c65b3e0e7c7a157154b2ca8e1a0b83f47f1dacc"}, "tags": ["quality_measures"], "refs": [["quality_measures__value_sets"], ["quality_measures__stg_core__condition"], ["quality_measures__stg_medical_claim"], ["quality_measures__stg_core__observation"], ["quality_measures__stg_core__procedure"], ["quality_measures__int_nqf0034__performance_period"], ["quality_measures__int_nqf0034__performance_period"], ["quality_measures__int_nqf0034__performance_period"], ["quality_measures__int_nqf0034__performance_period"]], "sources": [], "metrics": [], "description": "Exclusion logic for patients using hospice or palliative services for the reporting version of NQF 0034, Colorectal Cancer Screening. \n", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://models/quality_measures/quality_measures_models.yml", "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"schema": "quality_measures", "alias": "_int_nqf0034_exclude_hospice_palliative", "tags": "quality_measures", "materialized": "table", "enabled": true, "bind": false}, "created_at": 1701215340.110472}, "model.the_tuva_project.quality_measures__int_nqf0034_exclude_advanced_illness": {"resource_type": "model", "depends_on": {"macros": ["macro.dbt.type_string"], "nodes": ["seed.the_tuva_project.quality_measures__value_sets", "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", "model.the_tuva_project.quality_measures__int_nqf0034__performance_period", "model.the_tuva_project.quality_measures__int_nqf0034__performance_period", "model.the_tuva_project.quality_measures__int_nqf0034__performance_period", "model.the_tuva_project.quality_measures__int_nqf0034__performance_period", "model.the_tuva_project.quality_measures__int_nqf0034__performance_period", "model.the_tuva_project.quality_measures__int_nqf0034__frailty"]}, "config": {"enabled": true, "alias": "_int_nqf0034_exclude_advanced_illness", "schema": "quality_measures", "database": null, "tags": ["quality_measures"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "bind": false, "post-hook": [], "pre-hook": []}, "database": "dev_sarah", "schema": "quality_measures", "fqn": ["the_tuva_project", "quality_measures", "intermediate", "nqf0034_colorectal_cancer_screening", "quality_measures__int_nqf0034_exclude_advanced_illness"], "unique_id": "model.the_tuva_project.quality_measures__int_nqf0034_exclude_advanced_illness", "raw_code": "{{ config(\n enabled = var('quality_measures_enabled',var('claims_enabled',var('clinical_enabled',var('tuva_marts_enabled',False))))\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 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 encounter_exclusion_codes as (\n\n select\n code\n , code_system\n , concept_name\n , case when concept_name = 'Acute Inpatient' then 'Acute Inpatient'\n else 'Other Encounter' end as concept_category\n , case when concept_name = 'Acute Inpatient' then 1\n else 2 end as qualifying_count\n from {{ ref('quality_measures__value_sets') }}\n where concept_name in (\n 'Acute Inpatient'\n , 'Encounter Inpatient'\n , 'Outpatient'\n , 'Observation'\n , 'Emergency Department Visit'\n , 'Nonacute Inpatient'\n )\n\n)\n\n, condition_exclusion_codes as (\n\n select\n code\n , code_system\n , concept_name\n from {{ ref('quality_measures__value_sets') }}\n where concept_name in (\n 'Advanced Illness'\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 {{ ref('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 {{ ref('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 {{ ref('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 {{ ref('quality_measures__stg_core__procedure') }}\n\n)\n\n, condition_exclusions as (\n select\n conditions.patient_id\n , conditions.claim_id\n , conditions.recorded_date\n , condition_exclusion_codes.concept_name\n from conditions\n inner join {{ref('quality_measures__int_nqf0034__performance_period')}} pp\n on conditions.recorded_date between pp.performance_period_begin_1yp and pp.performance_period_end\n inner join condition_exclusion_codes\n on conditions.code = condition_exclusion_codes.code\n and conditions.code_type = condition_exclusion_codes.code_system\n\n union all\n select\n observations.patient_id\n , cast(null as {{ dbt.type_string() }}) as claim_id\n , observations.observation_date\n , condition_exclusion_codes.concept_name\n from observations\n inner join {{ref('quality_measures__int_nqf0034__performance_period')}} pp\n on observations.observation_date between pp.performance_period_begin_1yp and pp.performance_period_end\n\n inner join condition_exclusion_codes\n on observations.code = condition_exclusion_codes.code\n and observations.code_type = condition_exclusion_codes.code_system\n\n\n\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 , encounter_exclusion_codes.concept_name\n , encounter_exclusion_codes.concept_category\n , encounter_exclusion_codes.qualifying_count\n from medical_claim\n inner join {{ref('quality_measures__int_nqf0034__performance_period')}} pp\n on coalesce(medical_claim.claim_start_date,medical_claim.claim_end_date) between pp.performance_period_begin_1yp and pp.performance_period_end\n inner join encounter_exclusion_codes\n on medical_claim.hcpcs_code = encounter_exclusion_codes.code\n where encounter_exclusion_codes.code_system = 'hcpcs'\n\n)\n\n, observation_exclusions as (\n\n select\n observations.patient_id\n , observations.observation_date\n , encounter_exclusion_codes.concept_name\n , encounter_exclusion_codes.concept_category\n , encounter_exclusion_codes.qualifying_count\n from observations\n inner join {{ref('quality_measures__int_nqf0034__performance_period')}} pp\n on observations.observation_date between pp.performance_period_begin_1yp and pp.performance_period_end\n\n inner join encounter_exclusion_codes\n on observations.code = encounter_exclusion_codes.code\n and observations.code_type = encounter_exclusion_codes.code_system\n\n)\n\n, procedure_exclusions as (\n\n select\n procedures.patient_id\n , procedures.procedure_date\n , encounter_exclusion_codes.concept_name\n , encounter_exclusion_codes.concept_category\n , encounter_exclusion_codes.qualifying_count\n from procedures\n inner join {{ref('quality_measures__int_nqf0034__performance_period')}} pp\n on procedures.procedure_date between pp.performance_period_begin_1yp and pp.performance_period_end\n\n inner join encounter_exclusion_codes\n on procedures.code = encounter_exclusion_codes.code\n and procedures.code_type = encounter_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 patient_id\n , exclusion_date\n , concept_name\nfrom {{ref('quality_measures__int_nqf0034__frailty')}}\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 one acute inpatient encounter with a diagnosis of advanced illness\n during measurement period or the year prior to measurement period\n*/\n, encounters_with_conditions 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 , med_claim_exclusions.concept_category\n , med_claim_exclusions.qualifying_count\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\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 , observation_exclusions.concept_category\n , observation_exclusions.qualifying_count\n from patients_with_frailty\n inner join observation_exclusions\n on patients_with_frailty.patient_id = observation_exclusions.patient_id\n inner join condition_exclusions\n on observation_exclusions.patient_id = condition_exclusions.patient_id\n and observation_exclusions.observation_date = condition_exclusions.recorded_date\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 , procedure_exclusions.concept_category\n , procedure_exclusions.qualifying_count\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\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\n/*\n Filter to patients who have had one acute inpatient encounter or\n two nonacute outpatient encounters\n*/\n\n\n, qualifying_encounters as (\n\n select\n patient_id\n , exclusion_date\n , exclusion_reason\nfrom encounters_with_conditions e\nqualify dense_rank() over(partition by patient_id,concept_category order by exclusion_date) >= qualifying_count\n)\n\nselect\n patient_id\n , exclusion_date\n , exclusion_reason\n , '{{ var('tuva_last_run')}}' as tuva_last_run\nfrom qualifying_encounters", "language": "sql", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/the_tuva_project", "path": "quality_measures/intermediate/nqf0034_colorectal_cancer_screening/quality_measures__int_nqf0034_exclude_advanced_illness.sql", "original_file_path": "models/quality_measures/intermediate/nqf0034_colorectal_cancer_screening/quality_measures__int_nqf0034_exclude_advanced_illness.sql", "name": "quality_measures__int_nqf0034_exclude_advanced_illness", "alias": "_int_nqf0034_exclude_advanced_illness", "checksum": {"name": "sha256", "checksum": "37541d8634ae5dd3a86f82f9282cd75b3b575ed2a0a3b332a95e6c08830599cd"}, "tags": ["quality_measures"], "refs": [["quality_measures__value_sets"], ["quality_measures__value_sets"], ["quality_measures__stg_core__condition"], ["quality_measures__stg_medical_claim"], ["quality_measures__stg_core__observation"], ["quality_measures__stg_core__procedure"], ["quality_measures__int_nqf0034__performance_period"], ["quality_measures__int_nqf0034__performance_period"], ["quality_measures__int_nqf0034__performance_period"], ["quality_measures__int_nqf0034__performance_period"], ["quality_measures__int_nqf0034__performance_period"], ["quality_measures__int_nqf0034__frailty"]], "sources": [], "metrics": [], "description": "Exclusion logic for patients with frailty and advanced illness for the reporting version of NQF 0034, Colorectal Cancer Screening. \n", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://models/quality_measures/quality_measures_models.yml", "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"schema": "quality_measures", "alias": "_int_nqf0034_exclude_advanced_illness", "tags": "quality_measures", "materialized": "table", "enabled": true, "bind": false}, "created_at": 1701215340.104545}, "model.the_tuva_project.quality_measures__int_nqf0034_exclude_institutional_snp": {"resource_type": "model", "depends_on": {"macros": ["macro.dbt.datediff"], "nodes": ["model.the_tuva_project.quality_measures__int_nqf0034_denominator", "model.the_tuva_project.quality_measures__stg_medical_claim", "model.the_tuva_project.quality_measures__int_nqf0034__performance_period"]}, "config": {"enabled": true, "alias": "_int_nqf0034_exclude_institutional_snp", "schema": "quality_measures", "database": null, "tags": ["quality_measures"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "bind": false, "post-hook": [], "pre-hook": []}, "database": "dev_sarah", "schema": "quality_measures", "fqn": ["the_tuva_project", "quality_measures", "intermediate", "nqf0034_colorectal_cancer_screening", "quality_measures__int_nqf0034_exclude_institutional_snp"], "unique_id": "model.the_tuva_project.quality_measures__int_nqf0034_exclude_institutional_snp", "raw_code": "{{ config(\n enabled = var('quality_measures_enabled',var('claims_enabled',var('clinical_enabled',var('tuva_marts_enabled',False))))\n )\n}}\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 aged_patients as (\n select distinct patient_id\n from {{ref('quality_measures__int_nqf0034_denominator')}}\n where max_age >=66\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 {{ ref('quality_measures__stg_medical_claim') }}\n\n)\n\n, exclusions as (\n\n select\n aged_patients.patient_id\n , coalesce(\n medical_claim.claim_start_date\n , medical_claim.claim_end_date\n ) as exclusion_date\n , 'Institutional or Long Term Care' as exclusion_reason\n from aged_patients\n inner join medical_claim\n on aged_patients.patient_id = medical_claim.patient_id\n\n inner join {{ref('quality_measures__int_nqf0034__performance_period')}} pp\n on coalesce(\n medical_claim.claim_start_date\n , medical_claim.claim_end_date\n ) between pp.performance_period_begin and pp.performance_period_end\n\n where place_of_service_code in ('32', '33', '34', '54', '56')\n and {{ datediff('medical_claim.claim_start_date', 'medical_claim.claim_end_date', 'day') }} >= 90\n)\n\nselect\n patient_id\n , exclusion_date\n , exclusion_reason\n , '{{ var('tuva_last_run')}}' as tuva_last_run\nfrom exclusions", "language": "sql", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/the_tuva_project", "path": "quality_measures/intermediate/nqf0034_colorectal_cancer_screening/quality_measures__int_nqf0034_exclude_institutional_snp.sql", "original_file_path": "models/quality_measures/intermediate/nqf0034_colorectal_cancer_screening/quality_measures__int_nqf0034_exclude_institutional_snp.sql", "name": "quality_measures__int_nqf0034_exclude_institutional_snp", "alias": "_int_nqf0034_exclude_institutional_snp", "checksum": {"name": "sha256", "checksum": "5cb4e700829a5c7fa8a9e31905679350f6910351b1087788ef84a9ce6bf47366"}, "tags": ["quality_measures"], "refs": [["quality_measures__int_nqf0034_denominator"], ["quality_measures__stg_medical_claim"], ["quality_measures__int_nqf0034__performance_period"]], "sources": [], "metrics": [], "description": "Exclusion logic for patients staying in an institution for the reporting version of NQF 0034, Colorectal Cancer Screening. \n", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://models/quality_measures/quality_measures_models.yml", "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"schema": "quality_measures", "alias": "_int_nqf0034_exclude_institutional_snp", "tags": "quality_measures", "materialized": "table", "enabled": true, "bind": false}, "created_at": 1701215340.112169}, "model.the_tuva_project.quality_measures__int_nqf0034_exclude_colectomy_cancer": {"resource_type": "model", "depends_on": {"macros": [], "nodes": ["seed.the_tuva_project.quality_measures__value_sets", "model.the_tuva_project.quality_measures__stg_core__condition", "model.the_tuva_project.quality_measures__stg_medical_claim", "model.the_tuva_project.quality_measures__stg_core__observation", "model.the_tuva_project.quality_measures__stg_core__procedure"]}, "config": {"enabled": true, "alias": "_int_nqf0034_exclude_colectomy_cancer", "schema": "quality_measures", "database": null, "tags": ["quality_measures"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "bind": false, "post-hook": [], "pre-hook": []}, "database": "dev_sarah", "schema": "quality_measures", "fqn": ["the_tuva_project", "quality_measures", "intermediate", "nqf0034_colorectal_cancer_screening", "quality_measures__int_nqf0034_exclude_colectomy_cancer"], "unique_id": "model.the_tuva_project.quality_measures__int_nqf0034_exclude_colectomy_cancer", "raw_code": "{{ config(\n enabled = var('quality_measures_enabled',var('claims_enabled',var('clinical_enabled',var('tuva_marts_enabled',False))))\n )\n}}\n\n/*\nDENOMINATOR EXCLUSIONS:\nPatients with a diagnosis or past history of total colectomy or colorectal cancer: G9711\n*/\n\n\nwith exclusion_codes as (\n select\n code\n , case code_system\n when 'SNOMEDCT' then 'snomed-ct'\n when 'ICD9CM' then 'icd-9-cm'\n when 'ICD10CM' then 'icd-10-cm'\n when 'CPT' then 'hcpcs'\n when 'ICD10PCS' then 'icd-10-pcs'\n else lower(code_system) end as code_system\n , concept_name\n From {{ref('quality_measures__value_sets')}}\n where concept_name in (\n 'Malignant Neoplasm of Colon'\n , 'Total Colectomy'\n )\n\n)\n\n, conditions as (\n\n select\n patient_id\n , claim_id\n , recorded_date\n , coalesce (\n normalized_code_type\n , case\n when lower(source_code_type) = 'snomed' then 'snomed-ct'\n else lower(source_code_type)\n end\n ) as code_type\n , coalesce (\n normalized_code\n , source_code\n ) as code\n from {{ ref('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 {{ ref('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 {{ ref('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 {{ ref('quality_measures__stg_core__procedure') }}\n\n)\n\n, condition_exclusions as (\n\n select\n conditions.patient_id\n , conditions.claim_id\n , conditions.recorded_date\n , exclusion_codes.concept_name as concept_name\n from conditions\n inner join exclusion_codes\n on conditions.code = exclusion_codes.code\n and conditions.code_type = exclusion_codes.code_system\n\n)\n\n, med_claim_exclusions as (\n\n select\n medical_claim.patient_id\n , medical_claim.claim_id\n , medical_claim.claim_start_date\n , medical_claim.claim_end_date\n , medical_claim.hcpcs_code\n , exclusion_codes.concept_name as concept_name\n from medical_claim\n inner join exclusion_codes\n on medical_claim.hcpcs_code = exclusion_codes.code\n where exclusion_codes.code_system = 'hcpcs'\n\n)\n\n, observation_exclusions as (\n\n select\n observations.patient_id\n , observations.observation_date\n , exclusion_codes.concept_name as concept_name\n from observations\n inner join exclusion_codes\n on observations.code = exclusion_codes.code\n and observations.code_type = exclusion_codes.code_system\n\n)\n\n, procedure_exclusions as (\n\n select\n procedures.patient_id\n , procedures.procedure_date\n , exclusion_codes.concept_name as concept_name\n from procedures\n inner join exclusion_codes\n on procedures.code = exclusion_codes.code\n and procedures.code_type = exclusion_codes.code_system\n\n)\n\n, patients_with_exclusions as(\n select patient_id\n , recorded_date as exclusion_date\n , concept_name as exclusion_reason\n from condition_exclusions\n\n union all\n\n select patient_id\n , coalesce(claim_end_date, claim_start_date) as exclusion_date\n , concept_name as exclusion_reason\n from med_claim_exclusions\n\n union all\n\n select patient_id\n , observation_date as exclusion_date\n , concept_name as exclusion_reason\n from observation_exclusions\n\n union all\n\n select patient_id\n , procedure_date as exclusion_date\n , concept_name as exclusion_reason\n from procedure_exclusions\n\n)\n\n\n\nselect\n patient_id\n , exclusion_date\n , exclusion_reason\n , '{{ var('tuva_last_run')}}' as tuva_last_run\nfrom patients_with_exclusions", "language": "sql", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/the_tuva_project", "path": "quality_measures/intermediate/nqf0034_colorectal_cancer_screening/quality_measures__int_nqf0034_exclude_colectomy_cancer.sql", "original_file_path": "models/quality_measures/intermediate/nqf0034_colorectal_cancer_screening/quality_measures__int_nqf0034_exclude_colectomy_cancer.sql", "name": "quality_measures__int_nqf0034_exclude_colectomy_cancer", "alias": "_int_nqf0034_exclude_colectomy_cancer", "checksum": {"name": "sha256", "checksum": "e229d8f1e7f4e6a18d48fa5cd4b6638f4f6d4b4eaec10333d5a51bebf970ec65"}, "tags": ["quality_measures"], "refs": [["quality_measures__value_sets"], ["quality_measures__stg_core__condition"], ["quality_measures__stg_medical_claim"], ["quality_measures__stg_core__observation"], ["quality_measures__stg_core__procedure"]], "sources": [], "metrics": [], "description": "Exclusion logic for patients with frailty and advanced illness for the reporting version of NQF 0034, Colorectal Cancer Screening. \n", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://models/quality_measures/quality_measures_models.yml", "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"schema": "quality_measures", "alias": "_int_nqf0034_exclude_colectomy_cancer", "tags": "quality_measures", "materialized": "table", "enabled": true, "bind": false}, "created_at": 1701215340.106663}, "model.the_tuva_project.quality_measures__int_nqf0034_numerator": {"resource_type": "model", "depends_on": {"macros": ["macro.dbt.type_string"], "nodes": ["model.the_tuva_project.quality_measures__int_nqf0034_denominator", "seed.the_tuva_project.quality_measures__value_sets", "model.the_tuva_project.quality_measures__int_nqf0034__performance_period", "model.the_tuva_project.quality_measures__stg_medical_claim", "model.the_tuva_project.quality_measures__stg_core__observation", "model.the_tuva_project.quality_measures__stg_core__procedure", "model.the_tuva_project.quality_measures__stg_core__lab_result"]}, "config": {"enabled": true, "alias": "_int_nqf0034_numerator", "schema": "quality_measures", "database": null, "tags": ["quality_measures"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "bind": false, "post-hook": [], "pre-hook": []}, "database": "dev_sarah", "schema": "quality_measures", "fqn": ["the_tuva_project", "quality_measures", "intermediate", "nqf0034_colorectal_cancer_screening", "quality_measures__int_nqf0034_numerator"], "unique_id": "model.the_tuva_project.quality_measures__int_nqf0034_numerator", "raw_code": "{{ config(\n enabled = var('quality_measures_enabled',var('claims_enabled',var('clinical_enabled',var('tuva_marts_enabled',False))))\n )\n}}\n\n\n/*\nPatients with one or more screenings for colorectal cancer. Appropriate screenings are defined by any one of the\nfollowing criteria:\n- Fecal occult blood test (FOBT) during the measurement period\n- Flexible sigmoidoscopy during the measurement period or the four years prior to the measurement period\n- Colonoscopy during the measurement period or the nine years prior to the measurement period\n- Computed tomography (CT) colonography during the measurement period or the four years prior to the\nmeasurement period.\n- Fecal immunochemical DNA test (FIT-DNA) during the measurement period or the two years prior to the\nmeasurement period.\n\n*/\n\nwith denominator as (\n\n select\n patient_id\n\n from {{ ref('quality_measures__int_nqf0034_denominator') }}\n\n)\n, screening_codes as\n(\n select\n code\n , case code_system\n when 'SNOMEDCT' then 'snomed-ct'\n when 'ICD9CM' then 'icd-9-cm'\n when 'ICD10CM' then 'icd-10-cm'\n when 'CPT' then 'hcpcs'\n when 'ICD10PCS' then 'icd-10-pcs'\n else lower(code_system) end as code_system\n , concept_name\n From {{ref('quality_measures__value_sets')}}\n where concept_name in (\n 'Fecal Occult Blood Test (FOBT)' -- mp\n ,'Flexible Sigmoidoscopy' --mp+4\n ,'Colonoscopy' -- mp+9\n ,'CT Colonography' -- mp+4\n ,'sDNA FIT Test' -- mp+2\n )\n)\n, screening_periods as (\n select *,\n case concept_name\n when 'Fecal Occult Blood Test (FOBT)' then pp.performance_period_begin --mp\n when 'Flexible Sigmoidoscopy' then pp.performance_period_begin_4yp --mp+4\n when 'Colonoscopy' then pp.performance_period_begin_9yp -- mp+9\n when 'CT Colonography' then pp.performance_period_begin_4yp -- mp+4\n when 'sDNA FIT Test' then pp.performance_period_begin_2yp -- mp+2\n else pp.performance_period_begin end as effective_performance_period_begin\n\n from screening_codes\n inner join {{ref('quality_measures__int_nqf0034__performance_period')}} pp\n on 1 = 1\n )\n\n\n, medical_claim as (\n\n select\n patient_id\n , claim_start_date\n , claim_end_date\n , hcpcs_code\n from {{ ref('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 {{ ref('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 {{ ref('quality_measures__stg_core__procedure') }}\n\n)\n\n, labs as (\n select patient_id\n , result_date\n , collection_date\n , source_code_type\n , source_code\n , normalized_code_type\n , normalized_code\n from {{ ref('quality_measures__stg_core__lab_result')}}\n )\n\n\n, qualifying_claims as (\n\n select\n medical_claim.patient_id\n , coalesce( medical_claim.claim_start_date, medical_claim.claim_end_date) as claim_date\n , screening_codes.concept_name\n from medical_claim\n inner join screening_periods\n on medical_claim.claim_start_date between screening_periods.effective_performance_period_begin and screening_periods.performance_period_end\n or medical_claim.claim_end_date between screening_periods.effective_performance_period_begin and screening_periods.performance_period_end\n inner join screening_codes\n on medical_claim.hcpcs_code = screening_codes.code\n where screening_codes.code_system in ('hcpcs', 'cpt' )\n\n)\n\n, qualifying_observations as (\n\n select\n observations.patient_id\n , observations.observation_date\n , screening_codes.concept_name\n from observations\n inner join screening_periods\n on observations.observation_date between screening_periods.effective_performance_period_begin and screening_periods.performance_period_end\n inner join screening_codes\n on observations.code = screening_codes.code\n and observations.code_type = screening_codes.code_system\n)\n\n, qualifying_procedures as (\n\n select\n procedures.patient_id\n , procedures.procedure_date\n , screening_codes.concept_name\n from procedures\n inner join screening_periods\n on procedures.procedure_date between screening_periods.effective_performance_period_begin and screening_periods.performance_period_end\n inner join screening_codes\n on procedures.code = screening_codes.code\n and procedures.code_type = screening_codes.code_system\n\n)\n\n,qualifying_labs as (\n select\n patient_id\n , coalesce(collection_date,result_date) as lab_date\n , screening_codes.concept_name\n from labs\n inner join screening_periods\n on coalesce(labs.collection_date, labs.result_date) between screening_periods.effective_performance_period_begin and screening_periods.performance_period_end\n inner join screening_codes\n on ( labs.normalized_code = screening_codes.code\n and labs.normalized_code_type = screening_codes.code_system )\n or ( labs.source_code = screening_codes.code\n and labs.source_code_type = screening_codes.code_system )\n )\n\n,qualifying_events as (\n select\n patient_id\n , claim_date as evidence_date\n , concept_name as evidence\n from qualifying_claims\n\n union all\n\n select\n patient_id\n , observation_date as evidence_date\n , concept_name as evidence\n from qualifying_observations\n\n union all\n\n select\n patient_id\n , procedure_date as evidence_date\n , concept_name as evidence\n from qualifying_procedures\n\n union all\n\n select\n patient_id\n , lab_date as evidence_date\n , concept_name as evidence\n from qualifying_labs\n\n )\n\nselect\n cast (qualifying_events.patient_id as {{ dbt.type_string() }}) patient_id\n ,cast( evidence_date as date) as evidence_date\n ,cast( evidence as {{ dbt.type_string() }}) as evidence\n\nfrom qualifying_events\ninner join denominator\n on qualifying_events.patient_id = denominator.patient_id", "language": "sql", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/the_tuva_project", "path": "quality_measures/intermediate/nqf0034_colorectal_cancer_screening/quality_measures__int_nqf0034_numerator.sql", "original_file_path": "models/quality_measures/intermediate/nqf0034_colorectal_cancer_screening/quality_measures__int_nqf0034_numerator.sql", "name": "quality_measures__int_nqf0034_numerator", "alias": "_int_nqf0034_numerator", "checksum": {"name": "sha256", "checksum": "a052209de002644d9cd1fce8f6520b61c3a5c6fe9036a44a76bdd46ee28bc3e9"}, "tags": ["quality_measures"], "refs": [["quality_measures__int_nqf0034_denominator"], ["quality_measures__value_sets"], ["quality_measures__int_nqf0034__performance_period"], ["quality_measures__stg_medical_claim"], ["quality_measures__stg_core__observation"], ["quality_measures__stg_core__procedure"], ["quality_measures__stg_core__lab_result"]], "sources": [], "metrics": [], "description": "Numerator logic for the reporting version of NQF 0034, Colorectal Cancer Screening\n", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://models/quality_measures/quality_measures_models.yml", "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"schema": "quality_measures", "alias": "_int_nqf0034_numerator", "tags": "quality_measures", "materialized": "table", "enabled": true, "bind": false}, "created_at": 1701215340.1176152}, "model.the_tuva_project.ccsr__stg_core__condition": {"resource_type": "model", "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.core__condition"]}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["ccsr"], "meta": {}, "materialized": "ephemeral", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "bind": false, "post-hook": [], "pre-hook": []}, "database": "dev_sarah", "schema": "dbt_sarah", "fqn": ["the_tuva_project", "ccsr", "staging", "ccsr__stg_core__condition"], "unique_id": "model.the_tuva_project.ccsr__stg_core__condition", "raw_code": "{{ config(\n enabled = var('ccsr_enabled',var('claims_enabled',var('clinical_enabled',var('tuva_marts_enabled',False))))\n )\n}}\n\nselect *, '{{ var('tuva_last_run')}}' as tuva_last_run\nfrom {{ ref('core__condition') }}", "language": "sql", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/the_tuva_project", "path": "ccsr/staging/ccsr__stg_core__condition.sql", "original_file_path": "models/ccsr/staging/ccsr__stg_core__condition.sql", "name": "ccsr__stg_core__condition", "alias": "ccsr__stg_core__condition", "checksum": {"name": "sha256", "checksum": "78ec921275a66d41b635a6aeefefd4d677a906585cda02955be9bc4ad48f54d7"}, "tags": ["ccsr"], "refs": [["core__condition"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://models/ccsr/ccsr_models.yml", "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"tags": ["ccsr"], "materialized": "ephemeral", "enabled": true, "bind": false}, "created_at": 1701215340.176893}, "model.the_tuva_project.ccsr__stg_core__procedure": {"resource_type": "model", "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.core__procedure"]}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["ccsr"], "meta": {}, "materialized": "ephemeral", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "bind": false, "post-hook": [], "pre-hook": []}, "database": "dev_sarah", "schema": "dbt_sarah", "fqn": ["the_tuva_project", "ccsr", "staging", "ccsr__stg_core__procedure"], "unique_id": "model.the_tuva_project.ccsr__stg_core__procedure", "raw_code": "{{ config(\n enabled = var('ccsr_enabled',var('claims_enabled',var('clinical_enabled',var('tuva_marts_enabled',False))))\n )\n}}\n\nselect *, '{{ var('tuva_last_run')}}' as tuva_last_run\nfrom {{ ref('core__procedure') }}", "language": "sql", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/the_tuva_project", "path": "ccsr/staging/ccsr__stg_core__procedure.sql", "original_file_path": "models/ccsr/staging/ccsr__stg_core__procedure.sql", "name": "ccsr__stg_core__procedure", "alias": "ccsr__stg_core__procedure", "checksum": {"name": "sha256", "checksum": "4f867df3d4e43f41e54d7afa4c185d9ba187be688de1272437ae2d5ce81fddf2"}, "tags": ["ccsr"], "refs": [["core__procedure"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://models/ccsr/ccsr_models.yml", "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"tags": ["ccsr"], "materialized": "ephemeral", "enabled": true, "bind": false}, "created_at": 1701215340.178169}, "model.the_tuva_project.ccsr__singular_condition_category": {"resource_type": "model", "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.ccsr__long_condition_category"]}, "config": {"enabled": true, "alias": "singular_condition_category", "schema": "ccsr", "database": null, "tags": ["ccsr"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "bind": false, "post-hook": [], "pre-hook": []}, "database": "dev_sarah", "schema": "ccsr", "fqn": ["the_tuva_project", "ccsr", "final", "ccsr__singular_condition_category"], "unique_id": "model.the_tuva_project.ccsr__singular_condition_category", "raw_code": "{{ config(\n enabled = var('ccsr_enabled',var('claims_enabled',var('clinical_enabled',var('tuva_marts_enabled',False))))\n )\n}}\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 {{ var('dxccsr_version') }} as dxccsr_version,\n '{{ var('tuva_last_run')}}' as tuva_last_run\nfrom {{ref('ccsr__long_condition_category')}}\nwhere \n is_{{ var('record_type', 'ip') }}_default_category = true\n and condition_rank = 1", "language": "sql", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/the_tuva_project", "path": "ccsr/final/ccsr__singular_condition_category.sql", "original_file_path": "models/ccsr/final/ccsr__singular_condition_category.sql", "name": "ccsr__singular_condition_category", "alias": "singular_condition_category", "checksum": {"name": "sha256", "checksum": "08f710d6b4eef478aa581e199ed0a7f78744f26bb88f18b74cca4bb3ab129898"}, "tags": ["ccsr"], "refs": [["ccsr__long_condition_category"]], "sources": [], "metrics": [], "description": "This model contains only the CCSR's default category assignment for the ICD-10 code, and only for the first-listed ICD-10 code (`diagnosis_code = 1`).", "columns": {"encounter_id": {"name": "encounter_id", "description": "Unique identifier for an encounter.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "claim_id": {"name": "claim_id", "description": "Unique claim_id for each claim.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "patient_id": {"name": "patient_id", "description": "Unique identifier for each patient.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "body_system": {"name": "body_system", "description": "The body system to which each parent category belongs. The 22 body systems generally follow the structure of the ICD-10-CM diagnosis chapters. Note that the procedure tables don't have this column, but a conceptually related field in procedure models is `clinical_domain`.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "ccsr_parent_category": {"name": "ccsr_parent_category", "description": "The parent category code for each CCSR category. In practice, this is the three letter prefix to the category code.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "parent_category_description": {"name": "parent_category_description", "description": "A description of the parent category.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "ccsr_category": {"name": "ccsr_category", "description": "A CCSR category for the ICD-10-CM code. One ICD-10-CM code may have up 6 CCSR categories associated, ordinally ranked by the ccsr_category_rank. Will be null if a record has a `code` that isn't referenced in the CCSR seed file.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "ccsr_category_description": {"name": "ccsr_category_description", "description": "The human readable description of the `ccsr_category`.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "dxccsr_version": {"name": "dxccsr_version", "description": "The version number of the CCSR program from which the dbt model was derived.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The time at with the model was materialized. Generated by `dbt_utils.pretty_time` as the local time of the `dbt run` environment. Timezone is configurable via the `tuva_last_run` var.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://models/ccsr/ccsr_models.yml", "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"schema": "ccsr", "alias": "singular_condition_category", "tags": ["ccsr"], "materialized": "table", "enabled": true, "bind": false}, "created_at": 1701215340.172661}, "model.the_tuva_project.ccsr__long_condition_category": {"resource_type": "model", "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"]}, "config": {"enabled": true, "alias": "long_condition_category", "schema": "ccsr", "database": null, "tags": ["ccsr"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "bind": false, "post-hook": [], "pre-hook": []}, "database": "dev_sarah", "schema": "ccsr", "fqn": ["the_tuva_project", "ccsr", "final", "ccsr__long_condition_category"], "unique_id": "model.the_tuva_project.ccsr__long_condition_category", "raw_code": "{{ config(\n enabled = var('ccsr_enabled',var('claims_enabled',var('clinical_enabled',var('tuva_marts_enabled',False))))\n )\n}}\n\nwith ccsr__dx_vertical_pivot as (\n \n select * from {{ ref('ccsr__dx_vertical_pivot') }} \n\n), condition as (\n \n select * from {{ ref('ccsr__stg_core__condition') }}\n\n), dxccsr_body_systems as (\n\n select * from {{ ref('ccsr__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 {{ var('dxccsr_version') }} as dxccsr_version,\n '{{ var('tuva_last_run')}}' 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)", "language": "sql", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/the_tuva_project", "path": "ccsr/final/ccsr__long_condition_category.sql", "original_file_path": "models/ccsr/final/ccsr__long_condition_category.sql", "name": "ccsr__long_condition_category", "alias": "long_condition_category", "checksum": {"name": "sha256", "checksum": "172bfed9c6b34fdc92ff43062fbc87059d0dc224d46912270bc37481e63111f6"}, "tags": ["ccsr"], "refs": [["ccsr__dx_vertical_pivot"], ["ccsr__stg_core__condition"], ["ccsr__dxccsr_v2023_1_body_systems"]], "sources": [], "metrics": [], "description": "This model contains a mapping of individual condition ICD-10-CM diagnosis codes to the CCSR's clinically meaningful diagnosis categories. Each row represents a mapping of an ICD-10 code to a CCSR category. As each ICD-10 code may be mapped to up to 6 categories, it's expected that this table will output as many or more rows than the TUVA condition model. The model is equivalent to the CCSR's Output Option 1 - Vertical File Output.", "columns": {"encounter_id": {"name": "encounter_id", "description": "Unique identifier for each the encounter.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "claim_id": {"name": "claim_id", "description": "Unique identifier for each claim.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "patient_id": {"name": "patient_id", "description": "Unique identifier for each patient.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "normalized_code": {"name": "normalized_code", "description": "The ICD-10-CM code for the diagnosis.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "code_description": {"name": "code_description", "description": "The ICD-10-CM code description provided in the CCSR CSV seed file.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "condition_rank": {"name": "condition_rank", "description": "The numerical ranking of a diagnosis code in a claim.", "meta": {}, "data_type": "integer", "quote": null, "tags": []}, "body_system": {"name": "body_system", "description": "The body system to which each parent category belongs. The 22 body systems generally follow the structure of the ICD-10-CM diagnosis chapters. Note that the procedure tables don't have this column, but a conceptually related field in procedure models is `clinical_domain`.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "ccsr_parent_category": {"name": "ccsr_parent_category", "description": "The parent category code for each CCSR category. In practice, this is the three letter prefix to the category code.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "parent_category_description": {"name": "parent_category_description", "description": "A description of the parent category.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "ccsr_category": {"name": "ccsr_category", "description": "A CCSR category for the ICD-10-CM code. One ICD-10-CM code may have up 6 CCSR categories associated, ordinally ranked by the ccsr_category_rank. Will be null if a record has a `code` that isn't referenced in the CCSR seed file.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "ccsr_category_description": {"name": "ccsr_category_description", "description": "The description of the CCSR category as provided in the CCSR seed file.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "ccsr_category_rank": {"name": "ccsr_category_rank", "description": "The ordinal rank of a given CCSR category mapped to an ICD-10-CM code. The CCSR seed CSV has the order of categories assigned to each ICD-10-CM code.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "is_ip_default_category": {"name": "is_ip_default_category", "description": "For each ICD-10-CM code, this field will return true for the CCSR category that is the default value for the code if the underlying record is an inpatient encounter.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "is_op_default_category": {"name": "is_op_default_category", "description": "For each ICD-10-CM code, this field will return true for the CCSR category that is the default value for the code if the underlying record is an outpatient encounter.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "dxccsr_version": {"name": "dxccsr_version", "description": "The version number of the CCSR program from which the dbt model was derived.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The time at with the model was materialized. Generated by `dbt_utils.pretty_time` as the local time of the `dbt run` environment. Timezone is configurable via the `tuva_last_run` var.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://models/ccsr/ccsr_models.yml", "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"schema": "ccsr", "alias": "long_condition_category", "tags": ["ccsr"], "materialized": "table", "enabled": true, "bind": false}, "created_at": 1701215340.169413}, "model.the_tuva_project.ccsr__long_procedure_category": {"resource_type": "model", "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.ccsr__stg_core__procedure", "model.the_tuva_project.ccsr__procedure_category_map"]}, "config": {"enabled": true, "alias": "long_procedure_category", "schema": "ccsr", "database": null, "tags": ["ccsr"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "bind": false, "post-hook": [], "pre-hook": []}, "database": "dev_sarah", "schema": "ccsr", "fqn": ["the_tuva_project", "ccsr", "final", "ccsr__long_procedure_category"], "unique_id": "model.the_tuva_project.ccsr__long_procedure_category", "raw_code": "{{ config(\n enabled = var('ccsr_enabled',var('claims_enabled',var('clinical_enabled',var('tuva_marts_enabled',False))))\n )\n}}\n\nwith procedure as (\n \n select * from {{ ref('ccsr__stg_core__procedure') }}\n\n), ccsr__procedure_category_map as (\n\n select * from {{ ref ('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 {{ var('prccsr_version') }} as prccsr_version,\n '{{ var('tuva_last_run')}}' as tuva_last_run\nfrom procedure\nleft join ccsr__procedure_category_map\n on procedure.normalized_code = ccsr__procedure_category_map.code", "language": "sql", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/the_tuva_project", "path": "ccsr/final/ccsr__long_procedure_category.sql", "original_file_path": "models/ccsr/final/ccsr__long_procedure_category.sql", "name": "ccsr__long_procedure_category", "alias": "long_procedure_category", "checksum": {"name": "sha256", "checksum": "dbba55d2513c9c38777a479b9fad26a8d61fc7609f779c518b13bdfe8bed9bdb"}, "tags": ["ccsr"], "refs": [["ccsr__stg_core__procedure"], ["ccsr__procedure_category_map"]], "sources": [], "metrics": [], "description": "This model contains a mapping of individual condition ICD-10-PCS procedure codes to the CCSR's clinically meaningful procedure categories. Each row represents a mapping of an ICD-10 code to a CCSR category. The model is equivalent to the CCSR's Output Option 1 - Vertical File Output.", "columns": {"encounter_id": {"name": "encounter_id", "description": "The encounter_id for the encounter where this procedure was performed.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "patient_id": {"name": "patient_id", "description": "Unique identifier for each patient.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "normalized_code": {"name": "normalized_code", "description": "The ICD-10-PCS code for the procedure.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "code_description": {"name": "code_description", "description": "The ICD-10-PCS code description provided in the CCSR CSV seed file.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "ccsr_parent_category": {"name": "ccsr_parent_category", "description": "The parent category code for each CCSR category. In practice, this is the three letter prefix to the category code.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "clinical_domain": {"name": "clinical_domain", "description": "The ICD-10-PCS Clinical Domain that the CCSR parent category belongs to. Note that the condition models don't have this column, but the `body_system` is a conceptually related column in the condition tables.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "ccsr_category_description": {"name": "ccsr_category_description", "description": "A description of the clinical domain.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "ccsr_category": {"name": "ccsr_category", "description": "The CCSR category mapped to the ICD-10-PCS code.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "prccsr_version": {"name": "prccsr_version", "description": "The version number of the CCSR program from which the dbt model was derived.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The time at with the model was materialized. Generated by `dbt_utils.pretty_time` as the local time of the `dbt run` environment. Timezone is configurable via the `tuva_last_run` var.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://models/ccsr/ccsr_models.yml", "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"schema": "ccsr", "alias": "long_procedure_category", "tags": ["ccsr"], "materialized": "table", "enabled": true, "bind": false}, "created_at": 1701215340.175838}, "model.the_tuva_project.ccsr__dx_vertical_pivot": {"resource_type": "model", "depends_on": {"macros": [], "nodes": ["seed.the_tuva_project.ccsr__dxccsr_v2023_1_cleaned_map"]}, "config": {"enabled": true, "alias": "dx_vertical_pivot", "schema": "ccsr", "database": null, "tags": ["ccsr"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "bind": false, "post-hook": [], "pre-hook": []}, "database": "dev_sarah", "schema": "ccsr", "fqn": ["the_tuva_project", "ccsr", "intermediate", "ccsr__dx_vertical_pivot"], "unique_id": "model.the_tuva_project.ccsr__dx_vertical_pivot", "raw_code": "{{ config(\n enabled = var('ccsr_enabled',var('claims_enabled',var('clinical_enabled',var('tuva_marts_enabled',False))))\n )\n}}\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 {%- for i in range(1,7) %}\n ccsr_category_{{ i }},\n ccsr_category_{{ i }}_description,\n {%- endfor %}\n default_ccsr_category_ip,\n default_ccsr_category_op\n from {{ ref('ccsr__dxccsr_v2023_1_cleaned_map') }}\n\n), long_union as (\n -- generate select & union statements to pivot category columns to rows\n {% for i in range(1,7,1) %}\n select \n code,\n code_description,\n left(ccsr_category_{{ i }}, 3) as ccsr_parent_category,\n ccsr_category_{{ i }} as ccsr_category,\n ccsr_category_{{ i }}_description as ccsr_category_description,\n {{ i }} as ccsr_category_rank,\n (ccsr_category_{{ i }} = default_ccsr_category_ip) as is_ip_default_category,\n (ccsr_category_{{ i }} = default_ccsr_category_op) as is_op_default_category\n from codes \n {{ \"union all\" if not loop.last else \"\" }}\n {%- endfor %}\n\n)\n\nselect distinct\n *,\n '{{ var('tuva_last_run')}}' 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", "language": "sql", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/the_tuva_project", "path": "ccsr/intermediate/ccsr__dx_vertical_pivot.sql", "original_file_path": "models/ccsr/intermediate/ccsr__dx_vertical_pivot.sql", "name": "ccsr__dx_vertical_pivot", "alias": "dx_vertical_pivot", "checksum": {"name": "sha256", "checksum": "3e3719d1c3ca45862fb5fcad7a2d75993abc41c0c3d1b57f013d335ed5ab8e6c"}, "tags": ["ccsr"], "refs": [["ccsr__dxccsr_v2023_1_cleaned_map"]], "sources": [], "metrics": [], "description": "This is an intermediate model that pivots the DXCCSR's wide-format mapping CSV\ninto a long format table. While the seed uses 6 columns to represent the 6 CCSR codes that\nmay be present, this generates one row for each CCSR category per ICD code, so up to\n6 rows per code. \n\nThis model includes details and descriptions of the CCSR parent category and body systems that are inherited by the final models.\n\nThis model may also be useful in looking up CCSR condition category, body system, and parent category information.\n", "columns": {"code": {"name": "code", "description": "The ICD-10-CM code", "meta": {}, "data_type": null, "quote": null, "tags": []}, "code_description": {"name": "code_description", "description": "The description of the ICD-10-CM code included in the seed file.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "ccsr_category": {"name": "ccsr_category", "description": "A CCSR category for the ICD-10-CM code. One ICD-10-CM code may have up 6 CCSR categories associated, ordinally ranked by the ccsr_category_rank. Will be null if a record has a `code` that isn't referenced in the CCSR seed file.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "ccsr_category_rank": {"name": "ccsr_category_rank", "description": "The ordinal rank of a given CCSR category mapped to an ICD-10-CM code. The CCSR seed CSV has the order of categories assigned to each ICD-10-CM code.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "ccsr_category_description": {"name": "ccsr_category_description", "description": "The human readable description of the `ccsr_category`.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "ccsr_parent_category": {"name": "ccsr_parent_category", "description": "The CCSR parent category - the three letter prefix for each alphanumeric category.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "is_ip_default_category": {"name": "is_ip_default_category", "description": "For each ICD-10-CM code, this field will return true for the CCSR category that is the default value for the code if the underlying record is an inpatient encounter.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "is_op_default_category": {"name": "is_op_default_category", "description": "For each ICD-10-CM code, this field will return true for the CCSR category that is the default value for the code if the underlying record is an outpatient encounter.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The time at with the model was materialized. Generated by `dbt_utils.pretty_time` as the local time of the `dbt run` environment. Timezone is configurable via the `tuva_last_run` var.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://models/ccsr/ccsr_models.yml", "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"schema": "ccsr", "alias": "dx_vertical_pivot", "tags": ["ccsr"], "materialized": "table", "enabled": true, "bind": false}, "created_at": 1701215340.1625311}, "model.the_tuva_project.ccsr__procedure_category_map": {"resource_type": "model", "depends_on": {"macros": [], "nodes": ["seed.the_tuva_project.ccsr__prccsr_v2023_1_cleaned_map"]}, "config": {"enabled": true, "alias": "procedure_category_map", "schema": "ccsr", "database": null, "tags": ["ccsr"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "bind": false, "post-hook": [], "pre-hook": []}, "database": "dev_sarah", "schema": "ccsr", "fqn": ["the_tuva_project", "ccsr", "intermediate", "ccsr__procedure_category_map"], "unique_id": "model.the_tuva_project.ccsr__procedure_category_map", "raw_code": "{{ config(\n enabled = var('ccsr_enabled',var('claims_enabled',var('clinical_enabled',var('tuva_marts_enabled',False))))\n )\n}}\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 '{{ var('tuva_last_run')}}' as tuva_last_run\nfrom {{ ref('ccsr__prccsr_v2023_1_cleaned_map')}}", "language": "sql", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/the_tuva_project", "path": "ccsr/intermediate/ccsr__procedure_category_map.sql", "original_file_path": "models/ccsr/intermediate/ccsr__procedure_category_map.sql", "name": "ccsr__procedure_category_map", "alias": "procedure_category_map", "checksum": {"name": "sha256", "checksum": "9de066ce4bc064a683d44abe2552b778ec8ea2caa7aa7b62dfae61136ceaeb6d"}, "tags": ["ccsr"], "refs": [["ccsr__prccsr_v2023_1_cleaned_map"]], "sources": [], "metrics": [], "description": "This is an intermediate model that renames some PRCCSR columns to align with other TUVA models as well as the `ccsr__dx_vertical_pivot` model.", "columns": {"code": {"name": "code", "description": "The ICD-10-PCS code", "meta": {}, "data_type": null, "quote": null, "tags": []}, "code_description": {"name": "code_description", "description": "The description of the ICD-10-PCS code included in the seed file.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "ccsr_category": {"name": "ccsr_category", "description": "The CCSR category to which the ICD-10 code is mapped.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "ccsr_category_description": {"name": "ccsr_category_description", "description": "A description of the CCSR category.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "clinical_domain": {"name": "clinical_domain", "description": "The clinical domain to which the CCSR code belongs. Note that the condition models don't have this column, but the `body_system` is a conceptually related column in the condition tables.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "ccsr_parent_category": {"name": "ccsr_parent_category", "description": "The CCSR parent category - the three letter prefix for each alphanumeric category.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The time at with the model was materialized. Generated by `dbt_utils.pretty_time` as the local time of the `dbt run` environment. Timezone is configurable via the `tuva_last_run` var.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://models/ccsr/ccsr_models.yml", "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"schema": "ccsr", "alias": "procedure_category_map", "tags": ["ccsr"], "materialized": "table", "enabled": true, "bind": false}, "created_at": 1701215340.165216}, "model.the_tuva_project.financial_pmpm__stg_eligibility": {"resource_type": "model", "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.core__eligibility"]}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["financial_pmpm"], "meta": {}, "materialized": "ephemeral", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#abab26"}, "bind": false, "post-hook": [], "pre-hook": []}, "database": "dev_sarah", "schema": "dbt_sarah", "fqn": ["the_tuva_project", "financial_pmpm", "staging", "financial_pmpm__stg_eligibility"], "unique_id": "model.the_tuva_project.financial_pmpm__stg_eligibility", "raw_code": "{{ config(\n enabled = var('financial_pmpm_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\n )\n}}\n\nselect\n patient_id\n, enrollment_start_date\n, enrollment_end_date\n, payer\n, plan\n, data_source\n, '{{ var('tuva_last_run')}}' as tuva_last_run\nfrom {{ ref('core__eligibility') }}", "language": "sql", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/the_tuva_project", "path": "financial_pmpm/staging/financial_pmpm__stg_eligibility.sql", "original_file_path": "models/financial_pmpm/staging/financial_pmpm__stg_eligibility.sql", "name": "financial_pmpm__stg_eligibility", "alias": "financial_pmpm__stg_eligibility", "checksum": {"name": "sha256", "checksum": "a45c2fe0a0454895c148d91b4fdf40dc2865f267b4a259252d6fbc200ccfcbf2"}, "tags": ["financial_pmpm"], "refs": [["core__eligibility"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#abab26"}, "patch_path": "the_tuva_project://models/financial_pmpm/financial_pmpm_models.yml", "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"tags": ["financial_pmpm"], "materialized": "ephemeral", "enabled": true, "bind": false, "docs": {"node_color": "#abab26"}}, "created_at": 1701215340.211259}, "model.the_tuva_project.financial_pmpm__stg_medical_claim": {"resource_type": "model", "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.core__medical_claim"]}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["financial_pmpm"], "meta": {}, "materialized": "ephemeral", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#abab26"}, "bind": false, "post-hook": [], "pre-hook": []}, "database": "dev_sarah", "schema": "dbt_sarah", "fqn": ["the_tuva_project", "financial_pmpm", "staging", "financial_pmpm__stg_medical_claim"], "unique_id": "model.the_tuva_project.financial_pmpm__stg_medical_claim", "raw_code": "{{ config(\n enabled = var('financial_pmpm_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\n )\n}}\n\n\nSELECT\n patient_id\n, claim_id\n, claim_line_number\n, claim_start_date\n, claim_end_date\n, service_category_1\n, service_category_2\n, paid_amount\n, allowed_amount\n, payer\n, plan\n, data_source\n, '{{ var('tuva_last_run')}}' as tuva_last_run\nfrom {{ ref('core__medical_claim') }}", "language": "sql", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/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", "name": "financial_pmpm__stg_medical_claim", "alias": "financial_pmpm__stg_medical_claim", "checksum": {"name": "sha256", "checksum": "f1dce1c43ad38cefb74a3ecfe96f3f74d2715bcb29c6bb1a6dbe3dd8fa318793"}, "tags": ["financial_pmpm"], "refs": [["core__medical_claim"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#abab26"}, "patch_path": "the_tuva_project://models/financial_pmpm/financial_pmpm_models.yml", "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"tags": "financial_pmpm", "materialized": "ephemeral", "enabled": true, "bind": false, "docs": {"node_color": "#abab26"}}, "created_at": 1701215340.212482}, "model.the_tuva_project.financial_pmpm__stg_pharmacy_claim": {"resource_type": "model", "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.core__pharmacy_claim"]}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["financial_pmpm"], "meta": {}, "materialized": "ephemeral", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#abab26"}, "bind": false, "post-hook": [], "pre-hook": []}, "database": "dev_sarah", "schema": "dbt_sarah", "fqn": ["the_tuva_project", "financial_pmpm", "staging", "financial_pmpm__stg_pharmacy_claim"], "unique_id": "model.the_tuva_project.financial_pmpm__stg_pharmacy_claim", "raw_code": "{{ config(\n enabled = var('financial_pmpm_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\n )\n}}\n\n\nSELECT\n patient_id\n, dispensing_date\n, paid_amount\n, allowed_amount\n, payer\n, plan\n, data_source\n, '{{ var('tuva_last_run')}}' as tuva_last_run\nfrom {{ ref('core__pharmacy_claim') }}", "language": "sql", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/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", "name": "financial_pmpm__stg_pharmacy_claim", "alias": "financial_pmpm__stg_pharmacy_claim", "checksum": {"name": "sha256", "checksum": "cffd881a875dd7c499c0498fdf37b17a0fc623018b0b73fb175b2d9c3e3edd36"}, "tags": ["financial_pmpm"], "refs": [["core__pharmacy_claim"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#abab26"}, "patch_path": "the_tuva_project://models/financial_pmpm/financial_pmpm_models.yml", "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"tags": "financial_pmpm", "materialized": "ephemeral", "enabled": true, "bind": false, "docs": {"node_color": "#abab26"}}, "created_at": 1701215340.213553}, "model.the_tuva_project.financial_pmpm__pmpm": {"resource_type": "model", "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.financial_pmpm__pmpm_prep"]}, "config": {"enabled": true, "alias": "pmpm", "schema": "financial_pmpm", "database": null, "tags": ["financial_pmpm"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#abab26"}, "bind": false, "post-hook": [], "pre-hook": []}, "database": "dev_sarah", "schema": "financial_pmpm", "fqn": ["the_tuva_project", "financial_pmpm", "final", "financial_pmpm__pmpm"], "unique_id": "model.the_tuva_project.financial_pmpm__pmpm", "raw_code": "{{ config(\n enabled = var('financial_pmpm_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\n)}}\n\nSELECT \n year_month,\n payer,\n plan,\n data_source,\n count(1) as member_months,\n SUM(total_paid) / COUNT(1) AS total_paid,\n SUM(medical_paid) / COUNT(1) AS medical_paid,\n SUM(inpatient_paid) / COUNT(1) AS inpatient_paid,\n SUM(outpatient_paid) / COUNT(1) AS outpatient_paid,\n SUM(office_visit_paid) / COUNT(1) AS office_visit_paid,\n SUM(ancillary_paid) / COUNT(1) AS ancillary_paid,\n SUM(pharmacy_paid) / COUNT(1) AS pharmacy_paid,\n SUM(other_paid) / COUNT(1) AS other_paid,\n SUM(acute_inpatient_paid) / COUNT(1) AS acute_inpatient_paid,\n SUM(ambulance_paid) / COUNT(1) AS ambulance_paid,\n SUM(ambulatory_surgery_paid) / COUNT(1) AS ambulatory_surgery_paid,\n SUM(dialysis_paid) / COUNT(1) AS dialysis_paid,\n SUM(durable_medical_equipment_paid) / COUNT(1) AS durable_medical_equipment_paid,\n SUM(emergency_department_paid) / COUNT(1) AS emergency_department_paid,\n SUM(home_health_paid) / COUNT(1) AS home_health_paid,\n SUM(hospice_paid) / COUNT(1) AS hospice_paid,\n SUM(inpatient_psychiatric_paid) / COUNT(1) AS inpatient_psychiatric_paid,\n SUM(inpatient_rehabilitation_paid) / COUNT(1) AS inpatient_rehabilitation_paid,\n SUM(lab_paid) / COUNT(1) AS lab_paid,\n SUM(office_visit_paid_2) / COUNT(1) AS office_visit_paid_2,\n SUM(outpatient_hospital_or_clinic_paid) / COUNT(1) AS outpatient_hospital_or_clinic_paid,\n SUM(outpatient_psychiatric_paid) / COUNT(1) AS outpatient_psychiatric_paid,\n SUM(outpatient_rehabilitation_paid) / COUNT(1) AS outpatient_rehabilitation_paid,\n SUM(skilled_nursing_paid) / COUNT(1) AS skilled_nursing_paid,\n SUM(urgent_care_paid) / COUNT(1) AS urgent_care_paid,\n SUM(total_allowed) / COUNT(1) AS total_allowed,\n SUM(medical_allowed) / COUNT(1) AS medical_allowed,\n SUM(inpatient_allowed) / COUNT(1) AS inpatient_allowed,\n SUM(outpatient_allowed) / COUNT(1) AS outpatient_allowed,\n SUM(office_visit_allowed) / COUNT(1) AS office_visit_allowed,\n SUM(ancillary_allowed) / COUNT(1) AS ancillary_allowed,\n SUM(pharmacy_allowed) / COUNT(1) AS pharmacy_allowed,\n SUM(other_allowed) / COUNT(1) AS other_allowed,\n SUM(acute_inpatient_allowed) / COUNT(1) AS acute_inpatient_allowed,\n SUM(ambulance_allowed) / COUNT(1) AS ambulance_allowed,\n SUM(ambulatory_surgery_allowed) / COUNT(1) AS ambulatory_surgery_allowed,\n SUM(dialysis_allowed) / COUNT(1) AS dialysis_allowed,\n SUM(durable_medical_equipment_allowed) / COUNT(1) AS durable_medical_equipment_allowed,\n SUM(emergency_department_allowed) / COUNT(1) AS emergency_department_allowed,\n SUM(home_health_allowed) / COUNT(1) AS home_health_allowed,\n SUM(hospice_allowed) / COUNT(1) AS hospice_allowed,\n SUM(inpatient_psychiatric_allowed) / COUNT(1) AS inpatient_psychiatric_allowed,\n SUM(inpatient_rehabilitation_allowed) / COUNT(1) AS inpatient_rehabilitation_allowed,\n SUM(lab_allowed) / COUNT(1) AS lab_allowed,\n SUM(office_visit_allowed_2) / COUNT(1) AS office_visit_allowed_2,\n SUM(outpatient_hospital_or_clinic_allowed) / COUNT(1) AS outpatient_hospital_or_clinic_allowed,\n SUM(outpatient_psychiatric_allowed) / COUNT(1) AS outpatient_psychiatric_allowed,\n SUM(outpatient_rehabilitation_allowed) / COUNT(1) AS outpatient_rehabilitation_allowed,\n SUM(skilled_nursing_allowed) / COUNT(1) AS skilled_nursing_allowed,\n SUM(urgent_care_allowed) / COUNT(1) AS urgent_care_allowed,\n '{{ var('tuva_last_run')}}' as tuva_last_run\nFROM {{ ref('financial_pmpm__pmpm_prep') }} a\nGROUP BY 1,2,3,4", "language": "sql", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/the_tuva_project", "path": "financial_pmpm/final/financial_pmpm__pmpm.sql", "original_file_path": "models/financial_pmpm/final/financial_pmpm__pmpm.sql", "name": "financial_pmpm__pmpm", "alias": "pmpm", "checksum": {"name": "sha256", "checksum": "e456c62e3b8953eb085ab347d7d540717b0e067f9bc004998c1e5e29f05a998d"}, "tags": ["financial_pmpm"], "refs": [["financial_pmpm__pmpm_prep"]], "sources": [], "metrics": [], "description": "Computes per member per month statistics for every service category by aggregating across patients from pmpm_prep.\n", "columns": {"year_month": {"name": "year_month", "description": "Unique year-month of in the dataset computed from eligibility.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "member_months": {"name": "member_months", "description": "The sum of member months.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "total_paid": {"name": "total_paid", "description": "Total paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "medical_paid": {"name": "medical_paid", "description": "Total medical paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "inpatient_paid": {"name": "inpatient_paid", "description": "Total inpatient paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "outpatient_paid": {"name": "outpatient_paid", "description": "Total outpatient paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "office_visit_paid": {"name": "office_visit_paid", "description": "Total office visit paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "ancillary_paid": {"name": "ancillary_paid", "description": "Total ancillary paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "pharmacy_paid": {"name": "pharmacy_paid", "description": "Total pharmacy paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "other_paid": {"name": "other_paid", "description": "Total other paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "acute_inpatient_paid": {"name": "acute_inpatient_paid", "description": "Total acute inpatient paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "ambulance_paid": {"name": "ambulance_paid", "description": "Total ambulance paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "ambulatory_surgery_paid": {"name": "ambulatory_surgery_paid", "description": "Total ambulatory surgery paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "dialysis_paid": {"name": "dialysis_paid", "description": "Total dialysis paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "durable_medical_equipment_paid": {"name": "durable_medical_equipment_paid", "description": "Total durable medical equipment paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "emergency_department_paid": {"name": "emergency_department_paid", "description": "Total emergency department paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "home_health_paid": {"name": "home_health_paid", "description": "Total home health paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "hospice_paid": {"name": "hospice_paid", "description": "Total hospice paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "inpatient_psychiatric_paid": {"name": "inpatient_psychiatric_paid", "description": "Total inpatient psychiatric paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "inpatient_rehabilitation_paid": {"name": "inpatient_rehabilitation_paid", "description": "Total inpatient rehabilitation paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "lab_paid": {"name": "lab_paid", "description": "Total lab paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "office_visit_paid_2": {"name": "office_visit_paid_2", "description": "Total office visit paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "outpatient_hospital_or_clinic_paid": {"name": "outpatient_hospital_or_clinic_paid", "description": "Total outpatient hospital or clinic paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "outpatient_psychiatric_paid": {"name": "outpatient_psychiatric_paid", "description": "Total outpatient psychiatric paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "outpatient_rehabilitation_paid": {"name": "outpatient_rehabilitation_paid", "description": "Total outpatient rehabilitation paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "skilled_nursing_paid": {"name": "skilled_nursing_paid", "description": "Total skilled nursing paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "urgent_care_paid": {"name": "urgent_care_paid", "description": "Total urgent care paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "total_allowed": {"name": "total_allowed", "description": "Total allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "medical_allowed": {"name": "medical_allowed", "description": "Total medical allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "inpatient_allowed": {"name": "inpatient_allowed", "description": "Total inpatient allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "outpatient_allowed": {"name": "outpatient_allowed", "description": "Total outpatient allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "office_visit_allowed": {"name": "office_visit_allowed", "description": "Total office visit allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "ancillary_allowed": {"name": "ancillary_allowed", "description": "Total ancillary allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "pharmacy_allowed": {"name": "pharmacy_allowed", "description": "Total pharmacy allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "other_allowed": {"name": "other_allowed", "description": "Total other allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "acute_inpatient_allowed": {"name": "acute_inpatient_allowed", "description": "Total acute inpatient allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "ambulance_allowed": {"name": "ambulance_allowed", "description": "Total ambulance allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "ambulatory_surgery_allowed": {"name": "ambulatory_surgery_allowed", "description": "Total ambulatory surgery allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "dialysis_allowed": {"name": "dialysis_allowed", "description": "Total dialysis allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "durable_medical_equipment_allowed": {"name": "durable_medical_equipment_allowed", "description": "Total durable medical equipment allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "emergency_department_allowed": {"name": "emergency_department_allowed", "description": "Total emergency department allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "home_health_allowed": {"name": "home_health_allowed", "description": "Total home health allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "hospice_allowed": {"name": "hospice_allowed", "description": "Total hospice allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "inpatient_psychiatric_allowed": {"name": "inpatient_psychiatric_allowed", "description": "Total inpatient psychiatric allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "inpatient_rehabilitation_allowed": {"name": "inpatient_rehabilitation_allowed", "description": "Total inpatient rehabilitation allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "lab_allowed": {"name": "lab_allowed", "description": "Total lab allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "office_visit_allowed_2": {"name": "office_visit_allowed_2", "description": "Total office visit allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "outpatient_hospital_or_clinic_allowed": {"name": "outpatient_hospital_or_clinic_allowed", "description": "Total outpatient hospital or clinic allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "outpatient_psychiatric_allowed": {"name": "outpatient_psychiatric_allowed", "description": "Total outpatient psychiatric allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "outpatient_rehabilitation_allowed": {"name": "outpatient_rehabilitation_allowed", "description": "Total outpatient rehabilitation allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "skilled_nursing_allowed": {"name": "skilled_nursing_allowed", "description": "Total skilled nursing allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "urgent_care_allowed": {"name": "urgent_care_allowed", "description": "Total urgent care allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The time at with the model was materialized. Generated by `dbt_utils.pretty_time` as the local time of the `dbt run` environment. Timezone is configurable via the `tuva_last_run` var.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": "#abab26"}, "patch_path": "the_tuva_project://models/financial_pmpm/financial_pmpm_models.yml", "compiled_path": null, "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": 1701215340.2013068}, "model.the_tuva_project.financial_pmpm__pmpm_prep": {"resource_type": "model", "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.financial_pmpm__member_months", "model.the_tuva_project.financial_pmpm__service_category_1_paid_pivot", "model.the_tuva_project.financial_pmpm__service_category_2_paid_pivot", "model.the_tuva_project.financial_pmpm__service_category_1_allowed_pivot", "model.the_tuva_project.financial_pmpm__service_category_2_allowed_pivot"]}, "config": {"enabled": true, "alias": "pmpm_prep", "schema": "financial_pmpm", "database": null, "tags": ["financial_pmpm"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#abab26"}, "bind": false, "post-hook": [], "pre-hook": []}, "database": "dev_sarah", "schema": "financial_pmpm", "fqn": ["the_tuva_project", "financial_pmpm", "final", "financial_pmpm__pmpm_prep"], "unique_id": "model.the_tuva_project.financial_pmpm__pmpm_prep", "raw_code": "{{ config(\n enabled = var('financial_pmpm_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\n )\n}}\n\nwith combine as (\nSELECT\n a.patient_id,\n a.year_month,\n a.payer,\n a.plan, \n a.data_source,\n \n -- service cat 1 paid\n COALESCE(b.inpatient_paid, 0) AS inpatient_paid,\n COALESCE(b.outpatient_paid, 0) AS outpatient_paid,\n COALESCE(b.office_visit_paid, 0) AS office_visit_paid,\n COALESCE(b.ancillary_paid, 0) AS ancillary_paid,\n COALESCE(b.pharmacy_paid, 0) AS pharmacy_paid,\n COALESCE(b.other_paid, 0) AS other_paid,\n \n -- service cat 2 paid\n COALESCE(c.acute_inpatient_paid, 0) AS acute_inpatient_paid,\n COALESCE(c.ambulance_paid, 0) AS ambulance_paid,\n COALESCE(c.ambulatory_surgery_paid, 0) AS ambulatory_surgery_paid,\n COALESCE(c.dialysis_paid, 0) AS dialysis_paid,\n COALESCE(c.durable_medical_equipment_paid, 0) AS durable_medical_equipment_paid,\n COALESCE(c.emergency_department_paid, 0) AS emergency_department_paid,\n COALESCE(c.home_health_paid, 0) AS home_health_paid,\n COALESCE(c.hospice_paid, 0) AS hospice_paid,\n COALESCE(c.inpatient_psychiatric_paid, 0) AS inpatient_psychiatric_paid,\n COALESCE(c.inpatient_rehabilitation_paid, 0) AS inpatient_rehabilitation_paid,\n COALESCE(c.lab_paid, 0) AS lab_paid,\n COALESCE(c.office_visit_paid, 0) AS office_visit_paid_2,\n COALESCE(c.outpatient_hospital_or_clinic_paid, 0) AS outpatient_hospital_or_clinic_paid,\n COALESCE(c.outpatient_psychiatric_paid, 0) AS outpatient_psychiatric_paid,\n COALESCE(c.outpatient_rehabilitation_paid, 0) AS outpatient_rehabilitation_paid,\n COALESCE(c.skilled_nursing_paid, 0) AS skilled_nursing_paid,\n COALESCE(c.urgent_care_paid, 0) AS urgent_care_paid,\n \n -- service cat 1 allowed\n COALESCE(d.inpatient_allowed, 0) AS inpatient_allowed,\n COALESCE(d.outpatient_allowed, 0) AS outpatient_allowed,\n COALESCE(d.office_visit_allowed, 0) AS office_visit_allowed,\n COALESCE(d.ancillary_allowed, 0) AS ancillary_allowed,\n COALESCE(d.pharmacy_allowed, 0) AS pharmacy_allowed,\n COALESCE(d.other_allowed, 0) AS other_allowed,\n \n -- service cat 2 allowed\n COALESCE(e.acute_inpatient_allowed, 0) AS acute_inpatient_allowed,\n COALESCE(e.ambulance_allowed, 0) AS ambulance_allowed,\n COALESCE(e.ambulatory_surgery_allowed, 0) AS ambulatory_surgery_allowed,\n COALESCE(e.dialysis_allowed, 0) AS dialysis_allowed,\n COALESCE(e.durable_medical_equipment_allowed, 0) AS durable_medical_equipment_allowed,\n COALESCE(e.emergency_department_allowed, 0) AS emergency_department_allowed,\n COALESCE(e.home_health_allowed, 0) AS home_health_allowed,\n COALESCE(e.hospice_allowed, 0) AS hospice_allowed,\n COALESCE(e.inpatient_psychiatric_allowed, 0) AS inpatient_psychiatric_allowed,\n COALESCE(e.inpatient_rehabilitation_allowed, 0) AS inpatient_rehabilitation_allowed,\n COALESCE(e.lab_allowed, 0) AS lab_allowed,\n COALESCE(e.office_visit_allowed, 0) AS office_visit_allowed_2,\n COALESCE(e.outpatient_hospital_or_clinic_allowed, 0) AS outpatient_hospital_or_clinic_allowed,\n COALESCE(e.outpatient_psychiatric_allowed, 0) AS outpatient_psychiatric_allowed,\n COALESCE(e.outpatient_rehabilitation_allowed, 0) AS outpatient_rehabilitation_allowed,\n COALESCE(e.skilled_nursing_allowed, 0) AS skilled_nursing_allowed,\n COALESCE(e.urgent_care_allowed, 0) AS urgent_care_allowed\nFROM {{ ref('financial_pmpm__member_months') }} a\nleft join {{ ref('financial_pmpm__service_category_1_paid_pivot') }} b\n on a.patient_id = b.patient_id\n and a.year_month = b.year_month\n and a.payer = b.payer\n and a.plan = b.plan\nleft join {{ ref('financial_pmpm__service_category_2_paid_pivot') }} c\n on a.patient_id = c.patient_id\n and a.year_month = c.year_month\n and a.payer = c.payer\n and a.plan = c.plan\nleft join {{ ref('financial_pmpm__service_category_1_allowed_pivot') }} d\n on a.patient_id = d.patient_id\n and a.year_month = d.year_month\n and a.payer = d.payer\n and a.plan = d.plan\nleft join {{ ref('financial_pmpm__service_category_2_allowed_pivot') }} e\n on a.patient_id = e.patient_id\n and a.year_month = e.year_month\n and a.payer = e.payer\n and a.plan = e.plan \n)\n\nselect *\n, inpatient_paid + outpatient_paid + office_visit_paid + ancillary_paid + other_paid + pharmacy_paid as total_paid\n, inpatient_paid + outpatient_paid + office_visit_paid + ancillary_paid + other_paid as medical_paid\n, inpatient_allowed + outpatient_allowed + office_visit_allowed + ancillary_allowed + other_allowed + pharmacy_allowed as total_allowed\n, inpatient_allowed + outpatient_allowed + office_visit_allowed + ancillary_allowed + other_allowed as medical_allowed\n, '{{ var('tuva_last_run')}}' as tuva_last_run\nfrom combine", "language": "sql", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/the_tuva_project", "path": "financial_pmpm/final/financial_pmpm__pmpm_prep.sql", "original_file_path": "models/financial_pmpm/final/financial_pmpm__pmpm_prep.sql", "name": "financial_pmpm__pmpm_prep", "alias": "pmpm_prep", "checksum": {"name": "sha256", "checksum": "04f4a81f4ccd3261af1b60263f314ecb6ef920c7ce85e9ec5a12e969410967b4"}, "tags": ["financial_pmpm"], "refs": [["financial_pmpm__member_months"], ["financial_pmpm__service_category_1_paid_pivot"], ["financial_pmpm__service_category_2_paid_pivot"], ["financial_pmpm__service_category_1_allowed_pivot"], ["financial_pmpm__service_category_2_allowed_pivot"]], "sources": [], "metrics": [], "description": "Computes all the paid and allowed statistics for every patient_id and year_month combination. \n", "columns": {"patient_id": {"name": "patient_id", "description": "Unique identifier for each patient in the dataset.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "year_month": {"name": "year_month", "description": "Unique year-month of in the dataset computed from eligibility.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "member_months": {"name": "member_months", "description": "The sum of member months.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "total_paid": {"name": "total_paid", "description": "Total paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "medical_paid": {"name": "medical_paid", "description": "Total medical paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "inpatient_paid": {"name": "inpatient_paid", "description": "Total inpatient paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "outpatient_paid": {"name": "outpatient_paid", "description": "Total outpatient paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "office_visit_paid": {"name": "office_visit_paid", "description": "Total office visit paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "ancillary_paid": {"name": "ancillary_paid", "description": "Total ancillary paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "pharmacy_paid": {"name": "pharmacy_paid", "description": "Total pharmacy paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "other_paid": {"name": "other_paid", "description": "Total other paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "acute_inpatient_paid": {"name": "acute_inpatient_paid", "description": "Total acute inpatient paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "ambulance_paid": {"name": "ambulance_paid", "description": "Total ambulance paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "ambulatory_surgery_paid": {"name": "ambulatory_surgery_paid", "description": "Total ambulatory surgery paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "dialysis_paid": {"name": "dialysis_paid", "description": "Total dialysis paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "durable_medical_equipment_paid": {"name": "durable_medical_equipment_paid", "description": "Total durable medical equipment paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "emergency_department_paid": {"name": "emergency_department_paid", "description": "Total emergency department paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "home_health_paid": {"name": "home_health_paid", "description": "Total home health paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "hospice_paid": {"name": "hospice_paid", "description": "Total hospice paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "inpatient_psychiatric_paid": {"name": "inpatient_psychiatric_paid", "description": "Total inpatient psychiatric paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "inpatient_rehabilitation_paid": {"name": "inpatient_rehabilitation_paid", "description": "Total inpatient rehabilitation paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "lab_paid": {"name": "lab_paid", "description": "Total lab paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "office_visit_paid_2": {"name": "office_visit_paid_2", "description": "Total office visit paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "outpatient_hospital_or_clinic_paid": {"name": "outpatient_hospital_or_clinic_paid", "description": "Total outpatient hospital or clinic paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "outpatient_psychiatric_paid": {"name": "outpatient_psychiatric_paid", "description": "Total outpatient psychiatric paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "outpatient_rehabilitation_paid": {"name": "outpatient_rehabilitation_paid", "description": "Total outpatient rehabilitation paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "skilled_nursing_paid": {"name": "skilled_nursing_paid", "description": "Total skilled nursing paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "urgent_care_paid": {"name": "urgent_care_paid", "description": "Total urgent care paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "total_allowed": {"name": "total_allowed", "description": "Total allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "medical_allowed": {"name": "medical_allowed", "description": "Total medical allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "inpatient_allowed": {"name": "inpatient_allowed", "description": "Total inpatient allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "outpatient_allowed": {"name": "outpatient_allowed", "description": "Total outpatient allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "office_visit_allowed": {"name": "office_visit_allowed", "description": "Total office visit allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "ancillary_allowed": {"name": "ancillary_allowed", "description": "Total ancillary allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "pharmacy_allowed": {"name": "pharmacy_allowed", "description": "Total pharmacy allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "other_allowed": {"name": "other_allowed", "description": "Total other allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "acute_inpatient_allowed": {"name": "acute_inpatient_allowed", "description": "Total acute inpatient allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "ambulance_allowed": {"name": "ambulance_allowed", "description": "Total ambulance allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "ambulatory_surgery_allowed": {"name": "ambulatory_surgery_allowed", "description": "Total ambulatory surgery allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "dialysis_allowed": {"name": "dialysis_allowed", "description": "Total dialysis allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "durable_medical_equipment_allowed": {"name": "durable_medical_equipment_allowed", "description": "Total durable medical equipment allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "emergency_department_allowed": {"name": "emergency_department_allowed", "description": "Total emergency department allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "home_health_allowed": {"name": "home_health_allowed", "description": "Total home health allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "hospice_allowed": {"name": "hospice_allowed", "description": "Total hospice allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "inpatient_psychiatric_allowed": {"name": "inpatient_psychiatric_allowed", "description": "Total inpatient psychiatric allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "inpatient_rehabilitation_allowed": {"name": "inpatient_rehabilitation_allowed", "description": "Total inpatient rehabilitation allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "lab_allowed": {"name": "lab_allowed", "description": "Total lab allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "office_visit_allowed_2": {"name": "office_visit_allowed_2", "description": "Total office visit allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "outpatient_hospital_or_clinic_allowed": {"name": "outpatient_hospital_or_clinic_allowed", "description": "Total outpatient hospital or clinic allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "outpatient_psychiatric_allowed": {"name": "outpatient_psychiatric_allowed", "description": "Total outpatient psychiatric allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "outpatient_rehabilitation_allowed": {"name": "outpatient_rehabilitation_allowed", "description": "Total outpatient rehabilitation allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "skilled_nursing_allowed": {"name": "skilled_nursing_allowed", "description": "Total skilled nursing allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "urgent_care_allowed": {"name": "urgent_care_allowed", "description": "Total urgent care allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The time at with the model was materialized. Generated by `dbt_utils.pretty_time` as the local time of the `dbt run` environment. Timezone is configurable via the `tuva_last_run` var.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": "#abab26"}, "patch_path": "the_tuva_project://models/financial_pmpm/financial_pmpm_models.yml", "compiled_path": null, "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": 1701215340.192008}, "model.the_tuva_project.financial_pmpm__member_months": {"resource_type": "model", "depends_on": {"macros": ["macro.dbt.type_string"], "nodes": ["seed.the_tuva_project.terminology__calendar", "model.the_tuva_project.financial_pmpm__stg_eligibility"]}, "config": {"enabled": true, "alias": "member_months", "schema": "financial_pmpm", "database": null, "tags": ["financial_pmpm"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#abab26"}, "bind": false, "post-hook": [], "pre-hook": []}, "database": "dev_sarah", "schema": "financial_pmpm", "fqn": ["the_tuva_project", "financial_pmpm", "final", "financial_pmpm__member_months"], "unique_id": "model.the_tuva_project.financial_pmpm__member_months", "raw_code": "{{ config(\n enabled = var('financial_pmpm_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\n )\n}}\n\nwith month_start_and_end_dates as (\nselect \n concat(cast(year as {{ dbt.type_string() }} ),lpad(cast(month as {{ dbt.type_string() }}),2,'0')) as year_month\n, min(full_date) as month_start_date\n, max(full_date) as month_end_date\nfrom {{ ref('terminology__calendar')}}\ngroup by 1\n)\n\nselect distinct\n a.patient_id\n, year_month\n, a.payer\n, a.plan\n, data_source\n, '{{ var('tuva_last_run')}}' as tuva_last_run\nfrom {{ ref('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", "language": "sql", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/the_tuva_project", "path": "financial_pmpm/final/financial_pmpm__member_months.sql", "original_file_path": "models/financial_pmpm/final/financial_pmpm__member_months.sql", "name": "financial_pmpm__member_months", "alias": "member_months", "checksum": {"name": "sha256", "checksum": "640a656029af8d65a24b31b9e64142f01e19b092f84abed92d2ed9907bba748d"}, "tags": ["financial_pmpm"], "refs": [["terminology__calendar"], ["financial_pmpm__stg_eligibility"]], "sources": [], "metrics": [], "description": "Creates member months from eligibility data", "columns": {"patient_id": {"name": "patient_id", "description": "Unique identifier for each patient in the dataset.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "year_month": {"name": "year_month", "description": "Unique year-month of in the dataset computed from eligibility.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "payer": {"name": "payer", "description": "The payer covering the patient's eligibility", "meta": {}, "data_type": null, "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The time at with the model was materialized. Generated by `dbt_utils.pretty_time` as the local time of the `dbt run` environment. Timezone is configurable via the `tuva_last_run` var.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": "#abab26"}, "patch_path": "the_tuva_project://models/financial_pmpm/financial_pmpm_models.yml", "compiled_path": null, "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": 1701215340.182765}, "model.the_tuva_project.financial_pmpm__service_category_1_paid_pivot": {"resource_type": "model", "depends_on": {"macros": ["macro.dbt_utils.pivot"], "nodes": ["model.the_tuva_project.financial_pmpm__patient_spend_with_service_categories"]}, "config": {"enabled": true, "alias": "_int_service_category_1_paid_pivot", "schema": "financial_pmpm", "database": null, "tags": ["financial_pmpm"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#abab26"}, "bind": false, "post-hook": [], "pre-hook": []}, "database": "dev_sarah", "schema": "financial_pmpm", "fqn": ["the_tuva_project", "financial_pmpm", "intermediate", "financial_pmpm__service_category_1_paid_pivot"], "unique_id": "model.the_tuva_project.financial_pmpm__service_category_1_paid_pivot", "raw_code": "{{ config(\n enabled = var('financial_pmpm_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\n )\n}}\n\nwith service_cat_1 as (\nselect\n patient_id\n, year_month\n, payer\n, plan\n, service_category_1\n, data_source\n, sum(total_paid) as total_paid\nfrom {{ ref('financial_pmpm__patient_spend_with_service_categories') }}\ngroup by 1,2,3,4,5,6\n)\n\nselect\n patient_id\n, year_month\n, payer\n, plan\n, data_source\n, {{ dbt_utils.pivot(\n column='service_category_1'\n , values=('Inpatient','Outpatient','Office Visit','Ancillary','Other','Pharmacy')\n , agg='sum'\n , then_value='total_paid'\n , else_value= 0\n , quote_identifiers = False\n , suffix='_paid'\n ) }}\n, '{{ var('tuva_last_run')}}' as tuva_last_run\nfrom service_cat_1\ngroup by 1,2,3,4,5", "language": "sql", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/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", "name": "financial_pmpm__service_category_1_paid_pivot", "alias": "_int_service_category_1_paid_pivot", "checksum": {"name": "sha256", "checksum": "5c83171e5342693b8305b79a63726b663389895e0288bd93840c7aaf19a37399"}, "tags": ["financial_pmpm"], "refs": [["financial_pmpm__patient_spend_with_service_categories"]], "sources": [], "metrics": [], "description": "Pivots out paid amounts into columns by service category level 1.\n", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#abab26"}, "patch_path": "the_tuva_project://models/financial_pmpm/financial_pmpm_models.yml", "compiled_path": null, "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": 1701215340.208433}, "model.the_tuva_project.financial_pmpm__service_category_2_paid_pivot": {"resource_type": "model", "depends_on": {"macros": ["macro.dbt_utils.pivot"], "nodes": ["model.the_tuva_project.financial_pmpm__patient_spend_with_service_categories"]}, "config": {"enabled": true, "alias": "_int_service_category_2_paid_pivot", "schema": "financial_pmpm", "database": null, "tags": ["financial_pmpm"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#abab26"}, "bind": false, "post-hook": [], "pre-hook": []}, "database": "dev_sarah", "schema": "financial_pmpm", "fqn": ["the_tuva_project", "financial_pmpm", "intermediate", "financial_pmpm__service_category_2_paid_pivot"], "unique_id": "model.the_tuva_project.financial_pmpm__service_category_2_paid_pivot", "raw_code": "{{ config(\n enabled = var('financial_pmpm_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\n )\n}}\n\nwith service_cat_2 as (\nselect\n patient_id\n, year_month\n, payer\n, plan\n, service_category_2\n, data_source\n, sum(total_paid) as total_paid\nfrom {{ ref('financial_pmpm__patient_spend_with_service_categories') }}\ngroup by 1,2,3,4,5,6\n)\n\nselect\n patient_id\n, year_month\n, payer\n, plan\n, data_source\n, {{ dbt_utils.pivot(\n column='service_category_2'\n , values=('Acute Inpatient',\n 'Ambulance',\n 'Ambulatory Surgery',\n 'Dialysis',\n 'Durable Medical Equipment',\n 'Emergency Department',\n 'Home Health',\n 'Hospice',\n 'Inpatient Psychiatric',\n 'Inpatient Rehabilitation',\n 'Lab',\n 'Office Visit',\n 'Outpatient Hospital or Clinic',\n 'Outpatient Psychiatric',\n 'Outpatient Rehabilitation',\n 'Skilled Nursing',\n 'Urgent Care' \n )\n , agg='sum'\n , then_value='total_paid'\n , else_value= 0\n , quote_identifiers = False\n , suffix='_paid'\n ) }}\n, '{{ var('tuva_last_run')}}' as tuva_last_run\nfrom service_cat_2\ngroup by 1,2,3,4,5", "language": "sql", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/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", "name": "financial_pmpm__service_category_2_paid_pivot", "alias": "_int_service_category_2_paid_pivot", "checksum": {"name": "sha256", "checksum": "0f3b24231c00e77f69ad45cc88394eb6e5f7de10dc760507883630d4541dae30"}, "tags": ["financial_pmpm"], "refs": [["financial_pmpm__patient_spend_with_service_categories"]], "sources": [], "metrics": [], "description": "Pivots out paid amounts into columns by service category level 2.\n", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#abab26"}, "patch_path": "the_tuva_project://models/financial_pmpm/financial_pmpm_models.yml", "compiled_path": null, "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": 1701215340.210162}, "model.the_tuva_project.financial_pmpm__patient_spend_with_service_categories": {"resource_type": "model", "depends_on": {"macros": ["macro.the_tuva_project.date_part", "macro.dbt.type_string", "macro.the_tuva_project.try_to_cast_date"], "nodes": ["model.the_tuva_project.financial_pmpm__stg_medical_claim", "model.the_tuva_project.financial_pmpm__stg_pharmacy_claim"]}, "config": {"enabled": true, "alias": "_int_patient_spend_with_service_categories", "schema": "financial_pmpm", "database": null, "tags": ["financial_pmpm"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#abab26"}, "bind": false, "post-hook": [], "pre-hook": []}, "database": "dev_sarah", "schema": "financial_pmpm", "fqn": ["the_tuva_project", "financial_pmpm", "intermediate", "financial_pmpm__patient_spend_with_service_categories"], "unique_id": "model.the_tuva_project.financial_pmpm__patient_spend_with_service_categories", "raw_code": "{{ config(\n enabled = var('financial_pmpm_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\n )\n}}\n\nwith claims_with_service_categories as (\n select\n a.patient_id\n , a.payer\n , a.plan\n , a.service_category_1\n , a.service_category_2\n , coalesce(a.claim_start_date,a.claim_end_date) as claim_date\n , a.paid_amount\n , a.allowed_amount\n , data_source\n from {{ ref('financial_pmpm__stg_medical_claim') }} a\n)\n\n, medical_claims_year_month as (\n select\n patient_id\n , payer\n , plan\n , service_category_1\n , service_category_2\n , cast({{ date_part(\"year\", \"claim_date\" ) }} as {{ dbt.type_string() }} ) || lpad(cast({{ date_part(\"month\", \"claim_date\" ) }} as {{ dbt.type_string() }} ),2,'0') AS year_month\n , paid_amount\n , allowed_amount\n , data_source\n from claims_with_service_categories\n)\n\n, rx_claims as (\n select\n patient_id\n , payer\n , plan\n , 'Pharmacy' as service_category_1\n , cast(null as {{ dbt.type_string() }}) as service_category_2\n , {{try_to_cast_date('dispensing_date','YYYMMDD') }} as claim_date\n , paid_amount\n , allowed_amount\n , data_source\n from {{ ref('financial_pmpm__stg_pharmacy_claim') }}\n)\n\n, rx_claims_year_month as (\n select\n patient_id\n , payer\n , plan\n , service_category_1\n , service_category_2\n , cast({{ date_part(\"year\", \"claim_date\" ) }} as {{ dbt.type_string() }} ) || lpad(cast({{ date_part(\"month\", \"claim_date\" ) }} as {{ dbt.type_string() }} ),2,'0') AS year_month\n , paid_amount\n , allowed_amount\n , data_source\n from rx_claims\n)\n\n, combine_medical_and_rx as (\nselect *\nfrom medical_claims_year_month\n\nunion all\n\nselect *\nfrom rx_claims_year_month\n)\n\nselect\n patient_id\n , year_month\n , payer\n , plan\n , service_category_1\n , service_category_2\n , sum(paid_amount) as total_paid\n , sum(allowed_amount) as total_allowed\n , data_source\n , '{{ var('tuva_last_run')}}' as tuva_last_run\n from combine_medical_and_rx\ngroup by 1,2,3,4,5,6,9", "language": "sql", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/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", "name": "financial_pmpm__patient_spend_with_service_categories", "alias": "_int_patient_spend_with_service_categories", "checksum": {"name": "sha256", "checksum": "9edc612350f50178fffa597eaf30f96d41df1a22f2d9ec577b83d63f77c8c72a"}, "tags": ["financial_pmpm"], "refs": [["financial_pmpm__stg_medical_claim"], ["financial_pmpm__stg_pharmacy_claim"]], "sources": [], "metrics": [], "description": "Adds service categories to claims and sums paid and allowed amounts to the year-month level.\n", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#abab26"}, "patch_path": "the_tuva_project://models/financial_pmpm/financial_pmpm_models.yml", "compiled_path": null, "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": 1701215340.203061}, "model.the_tuva_project.financial_pmpm__service_category_1_allowed_pivot": {"resource_type": "model", "depends_on": {"macros": ["macro.dbt_utils.pivot"], "nodes": ["model.the_tuva_project.financial_pmpm__patient_spend_with_service_categories"]}, "config": {"enabled": true, "alias": "_int_service_category_1_allowed_pivot", "schema": "financial_pmpm", "database": null, "tags": ["financial_pmpm"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#abab26"}, "bind": false, "post-hook": [], "pre-hook": []}, "database": "dev_sarah", "schema": "financial_pmpm", "fqn": ["the_tuva_project", "financial_pmpm", "intermediate", "financial_pmpm__service_category_1_allowed_pivot"], "unique_id": "model.the_tuva_project.financial_pmpm__service_category_1_allowed_pivot", "raw_code": "{{ config(\n enabled = var('financial_pmpm_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\n )\n}}\n\nwith service_cat_1 as (\nselect\n patient_id\n, year_month\n, payer\n, plan\n, service_category_1\n, data_source\n, sum(total_allowed) as total_allowed\nfrom {{ ref('financial_pmpm__patient_spend_with_service_categories') }}\ngroup by 1,2,3,4,5,6\n)\n\nselect\n patient_id\n, year_month\n, payer\n, plan\n, data_source\n, {{ dbt_utils.pivot(\n column='service_category_1'\n , values=('Inpatient','Outpatient','Office Visit','Ancillary','Other','Pharmacy')\n , agg='sum'\n , then_value='total_allowed'\n , else_value= 0\n , quote_identifiers = False\n , suffix='_allowed'\n ) }}\n, '{{ var('tuva_last_run')}}' as tuva_last_run\nfrom service_cat_1\ngroup by 1,2,3,4,5", "language": "sql", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/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", "name": "financial_pmpm__service_category_1_allowed_pivot", "alias": "_int_service_category_1_allowed_pivot", "checksum": {"name": "sha256", "checksum": "a32238dd008b18a73a454870086c4b6e4e7f2628d8a010e374f4ac0df2a35390"}, "tags": ["financial_pmpm"], "refs": [["financial_pmpm__patient_spend_with_service_categories"]], "sources": [], "metrics": [], "description": "Pivots out allowed amounts into columns by service category level 1.\n", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#abab26"}, "patch_path": "the_tuva_project://models/financial_pmpm/financial_pmpm_models.yml", "compiled_path": null, "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": 1701215340.204907}, "model.the_tuva_project.financial_pmpm__service_category_2_allowed_pivot": {"resource_type": "model", "depends_on": {"macros": ["macro.dbt_utils.pivot"], "nodes": ["model.the_tuva_project.financial_pmpm__patient_spend_with_service_categories"]}, "config": {"enabled": true, "alias": "_int_service_category_2_allowed_pivot", "schema": "financial_pmpm", "database": null, "tags": ["financial_pmpm"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#abab26"}, "bind": false, "post-hook": [], "pre-hook": []}, "database": "dev_sarah", "schema": "financial_pmpm", "fqn": ["the_tuva_project", "financial_pmpm", "intermediate", "financial_pmpm__service_category_2_allowed_pivot"], "unique_id": "model.the_tuva_project.financial_pmpm__service_category_2_allowed_pivot", "raw_code": "{{ config(\n enabled = var('financial_pmpm_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\n )\n}}\n\nwith service_cat_2 as (\nselect\n patient_id\n, year_month\n, payer\n, plan\n, service_category_2\n, data_source\n, sum(total_allowed) as total_allowed\nfrom {{ ref('financial_pmpm__patient_spend_with_service_categories') }}\ngroup by 1,2,3,4,5,6\n)\n\nselect\n patient_id \n, year_month \n, payer\n, plan\n, data_source\n, {{ dbt_utils.pivot(\n column='service_category_2'\n , values=('Acute Inpatient',\n 'Ambulance',\n 'Ambulatory Surgery',\n 'Dialysis',\n 'Durable Medical Equipment',\n 'Emergency Department',\n 'Home Health',\n 'Hospice',\n 'Inpatient Psychiatric',\n 'Inpatient Rehabilitation',\n 'Lab',\n 'Office Visit',\n 'Outpatient Hospital or Clinic',\n 'Outpatient Psychiatric',\n 'Outpatient Rehabilitation',\n 'Skilled Nursing',\n 'Urgent Care' \n )\n , agg='sum'\n , then_value='total_allowed'\n , else_value= 0\n , quote_identifiers = False\n , suffix='_allowed'\n) }}\n, '{{ var('tuva_last_run')}}' as tuva_last_run\nfrom service_cat_2\ngroup by 1,2,3,4,5", "language": "sql", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/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", "name": "financial_pmpm__service_category_2_allowed_pivot", "alias": "_int_service_category_2_allowed_pivot", "checksum": {"name": "sha256", "checksum": "ad30c2f5dedc08e138b411667752bb70744c4445a2713c81b1341cc65dfdc18a"}, "tags": ["financial_pmpm"], "refs": [["financial_pmpm__patient_spend_with_service_categories"]], "sources": [], "metrics": [], "description": "Pivots out allowed amounts into columns by service category level 2.\n", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#abab26"}, "patch_path": "the_tuva_project://models/financial_pmpm/financial_pmpm_models.yml", "compiled_path": null, "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": 1701215340.206613}, "model.the_tuva_project.cms_chronic_conditions__stg_pharmacy_claim": {"resource_type": "model", "depends_on": {"macros": [], "nodes": ["model.input_layer.pharmacy_claim"]}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["cms_chronic_conditions", "chronic_conditions"], "meta": {}, "materialized": "ephemeral", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#2e0e0e"}, "bind": false, "post-hook": [], "pre-hook": []}, "database": "dev_sarah", "schema": "dbt_sarah", "fqn": ["the_tuva_project", "chronic_conditions", "staging", "cms_chronic_conditions__stg_pharmacy_claim"], "unique_id": "model.the_tuva_project.cms_chronic_conditions__stg_pharmacy_claim", "raw_code": "{{ config(\n enabled = var('cms_chronic_conditions_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\n )\n}}\n\nselect\n claim_id\n , patient_id\n , paid_date\n , ndc_code\n , data_source\n , '{{ var('tuva_last_run')}}' as tuva_last_run\nfrom {{ ref('pharmacy_claim') }}", "language": "sql", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/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", "name": "cms_chronic_conditions__stg_pharmacy_claim", "alias": "cms_chronic_conditions__stg_pharmacy_claim", "checksum": {"name": "sha256", "checksum": "c6fe56463f4b344bf02158e45e7a72b2d6ab6c0a76ba098090302bf04fb6acb0"}, "tags": ["cms_chronic_conditions", "chronic_conditions"], "refs": [["pharmacy_claim"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#2e0e0e"}, "patch_path": "the_tuva_project://models/chronic_conditions/cms_chronic_conditions_models.yml", "compiled_path": null, "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": 1701215340.255918}, "model.the_tuva_project.tuva_chronic_conditions__stg_core__patient": {"resource_type": "model", "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.core__patient"]}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["tuva_chronic_conditions"], "meta": {}, "materialized": "ephemeral", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#2e0e0e"}, "bind": false, "post-hook": [], "pre-hook": []}, "database": "dev_sarah", "schema": "dbt_sarah", "fqn": ["the_tuva_project", "chronic_conditions", "staging", "tuva_chronic_conditions__stg_core__patient"], "unique_id": "model.the_tuva_project.tuva_chronic_conditions__stg_core__patient", "raw_code": "{{ config(\n enabled = var('tuva_chronic_conditions_enabled',var('claims_enabled',var('clinical_enabled',var('tuva_marts_enabled',False))))\n )\n}}\n\nselect \n patient_id\n , '{{ var('tuva_last_run')}}' as tuva_last_run\nfrom {{ ref('core__patient') }}", "language": "sql", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/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", "name": "tuva_chronic_conditions__stg_core__patient", "alias": "tuva_chronic_conditions__stg_core__patient", "checksum": {"name": "sha256", "checksum": "052d4e09d81b4d13b6e6e574982ac9530f20a832c69ed9ee201dfac4739a30ec"}, "tags": ["tuva_chronic_conditions"], "refs": [["core__patient"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#2e0e0e"}, "patch_path": "the_tuva_project://models/chronic_conditions/tuva_chronic_conditions_models.yml", "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"tags": "tuva_chronic_conditions", "materialized": "ephemeral", "enabled": true, "bind": false, "docs": {"node_color": "#2e0e0e"}}, "created_at": 1701215340.2912881}, "model.the_tuva_project.cms_chronic_conditions__stg_core__procedure": {"resource_type": "model", "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.core__procedure"]}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["cms_chronic_conditions", "chronic_conditions"], "meta": {}, "materialized": "ephemeral", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#2e0e0e"}, "bind": false, "post-hook": [], "pre-hook": []}, "database": "dev_sarah", "schema": "dbt_sarah", "fqn": ["the_tuva_project", "chronic_conditions", "staging", "cms_chronic_conditions__stg_core__procedure"], "unique_id": "model.the_tuva_project.cms_chronic_conditions__stg_core__procedure", "raw_code": "{{ config(\n enabled = var('cms_chronic_conditions_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\n )\n}}\n\nselect\n claim_id\n , patient_id\n , procedure_date\n , normalized_code_type\n , normalized_code\n , data_source\n , '{{ var('tuva_last_run')}}' as tuva_last_run\nfrom {{ ref('core__procedure') }}", "language": "sql", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/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", "name": "cms_chronic_conditions__stg_core__procedure", "alias": "cms_chronic_conditions__stg_core__procedure", "checksum": {"name": "sha256", "checksum": "bd66a457c679034c78d2096d5f11fa56ee836c475deb61f5799031d50ae88a8d"}, "tags": ["cms_chronic_conditions", "chronic_conditions"], "refs": [["core__procedure"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#2e0e0e"}, "patch_path": "the_tuva_project://models/chronic_conditions/cms_chronic_conditions_models.yml", "compiled_path": null, "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": 1701215340.2534661}, "model.the_tuva_project.tuva_chronic_conditions__stg_core__condition": {"resource_type": "model", "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.core__condition"]}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["tuva_chronic_conditions"], "meta": {}, "materialized": "ephemeral", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#2e0e0e"}, "bind": false, "post-hook": [], "pre-hook": []}, "database": "dev_sarah", "schema": "dbt_sarah", "fqn": ["the_tuva_project", "chronic_conditions", "staging", "tuva_chronic_conditions__stg_core__condition"], "unique_id": "model.the_tuva_project.tuva_chronic_conditions__stg_core__condition", "raw_code": "{{ config(\n enabled = var('tuva_chronic_conditions_enabled',var('claims_enabled',var('clinical_enabled',var('tuva_marts_enabled',False))))\n )\n}}\n\nselect \n patient_id\n , normalized_code\n , recorded_date\n , '{{ var('tuva_last_run')}}' as tuva_last_run\nfrom {{ ref('core__condition')}}", "language": "sql", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/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", "name": "tuva_chronic_conditions__stg_core__condition", "alias": "tuva_chronic_conditions__stg_core__condition", "checksum": {"name": "sha256", "checksum": "fc63071aa65724d7ccfce9f7c7807511c9d21eefa4c401a5ef1df54e3a329f6e"}, "tags": ["tuva_chronic_conditions"], "refs": [["core__condition"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#2e0e0e"}, "patch_path": "the_tuva_project://models/chronic_conditions/tuva_chronic_conditions_models.yml", "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"tags": "tuva_chronic_conditions", "materialized": "ephemeral", "enabled": true, "bind": false, "docs": {"node_color": "#2e0e0e"}}, "created_at": 1701215340.290208}, "model.the_tuva_project.cms_chronic_conditions__stg_core__patient": {"resource_type": "model", "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.core__patient"]}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["cms_chronic_conditions", "chronic_conditions"], "meta": {}, "materialized": "ephemeral", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#2e0e0e"}, "bind": false, "post-hook": [], "pre-hook": []}, "database": "dev_sarah", "schema": "dbt_sarah", "fqn": ["the_tuva_project", "chronic_conditions", "staging", "cms_chronic_conditions__stg_core__patient"], "unique_id": "model.the_tuva_project.cms_chronic_conditions__stg_core__patient", "raw_code": "{{ config(\n enabled = var('cms_chronic_conditions_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\n )\n}}\n\nselect \n patient_id\n , '{{ var('tuva_last_run')}}' as tuva_last_run\nfrom {{ ref('core__patient') }}", "language": "sql", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/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", "name": "cms_chronic_conditions__stg_core__patient", "alias": "cms_chronic_conditions__stg_core__patient", "checksum": {"name": "sha256", "checksum": "f42e0eb8c7fd94e710385294473ff4cbb48b9efa056e20015005b21a20e56ed0"}, "tags": ["cms_chronic_conditions", "chronic_conditions"], "refs": [["core__patient"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#2e0e0e"}, "patch_path": "the_tuva_project://models/chronic_conditions/cms_chronic_conditions_models.yml", "compiled_path": null, "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": 1701215340.252148}, "model.the_tuva_project.cms_chronic_conditions__stg_medical_claim": {"resource_type": "model", "depends_on": {"macros": [], "nodes": ["model.input_layer.medical_claim"]}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["cms_chronic_conditions", "chronic_conditions"], "meta": {}, "materialized": "ephemeral", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#2e0e0e"}, "bind": false, "post-hook": [], "pre-hook": []}, "database": "dev_sarah", "schema": "dbt_sarah", "fqn": ["the_tuva_project", "chronic_conditions", "staging", "cms_chronic_conditions__stg_medical_claim"], "unique_id": "model.the_tuva_project.cms_chronic_conditions__stg_medical_claim", "raw_code": "{{ config(\n enabled = var('cms_chronic_conditions_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\n )\n}}\n\nselect\n claim_id\n , patient_id\n , claim_start_date\n , ms_drg_code\n , data_source\n , '{{ var('tuva_last_run')}}' as tuva_last_run\nfrom {{ ref('medical_claim') }}", "language": "sql", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/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", "name": "cms_chronic_conditions__stg_medical_claim", "alias": "cms_chronic_conditions__stg_medical_claim", "checksum": {"name": "sha256", "checksum": "0217a4751ee97a1188a358e17dffcbb600d006dd50effdd5c3597cfef4a5de7a"}, "tags": ["cms_chronic_conditions", "chronic_conditions"], "refs": [["medical_claim"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#2e0e0e"}, "patch_path": "the_tuva_project://models/chronic_conditions/cms_chronic_conditions_models.yml", "compiled_path": null, "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": 1701215340.2547169}, "model.the_tuva_project.cms_chronic_conditions__stg_core__condition": {"resource_type": "model", "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.core__condition"]}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["cms_chronic_conditions", "chronic_conditions"], "meta": {}, "materialized": "ephemeral", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#2e0e0e"}, "bind": false, "post-hook": [], "pre-hook": []}, "database": "dev_sarah", "schema": "dbt_sarah", "fqn": ["the_tuva_project", "chronic_conditions", "staging", "cms_chronic_conditions__stg_core__condition"], "unique_id": "model.the_tuva_project.cms_chronic_conditions__stg_core__condition", "raw_code": "{{ config(\n enabled = var('cms_chronic_conditions_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\n )\n}}\n\nselect\n claim_id\n , patient_id\n , recorded_date\n , normalized_code_type\n , normalized_code\n , data_source\n , '{{ var('tuva_last_run')}}' as tuva_last_run\nfrom {{ ref('core__condition') }}", "language": "sql", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/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", "name": "cms_chronic_conditions__stg_core__condition", "alias": "cms_chronic_conditions__stg_core__condition", "checksum": {"name": "sha256", "checksum": "af31a34e0ee8accd286630da04ee6154aac827c689e518e66eca2e696eaaafa7"}, "tags": ["cms_chronic_conditions", "chronic_conditions"], "refs": [["core__condition"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#2e0e0e"}, "patch_path": "the_tuva_project://models/chronic_conditions/cms_chronic_conditions_models.yml", "compiled_path": null, "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": 1701215340.250954}, "model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_long": {"resource_type": "model", "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.tuva_chronic_conditions__stg_core__condition", "seed.the_tuva_project.chronic_conditions__tuva_chronic_conditions_hierarchy"]}, "config": {"enabled": true, "alias": "tuva_chronic_conditions_long", "schema": "chronic_conditions", "database": null, "tags": ["tuva_chronic_conditions", "chronic_conditions"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#2e0e0e"}, "bind": false, "post-hook": [], "pre-hook": []}, "database": "dev_sarah", "schema": "chronic_conditions", "fqn": ["the_tuva_project", "chronic_conditions", "final", "chronic_conditions__tuva_chronic_conditions_long"], "unique_id": "model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_long", "raw_code": "{{ config(\n enabled = var('tuva_chronic_conditions_enabled',var('claims_enabled',var('clinical_enabled',var('tuva_marts_enabled',False))))\n )\n}}\n\nwith 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 {{ ref('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 , '{{ var('tuva_last_run')}}' as tuva_last_run\nfrom {{ ref('chronic_conditions__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", "language": "sql", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/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", "name": "chronic_conditions__tuva_chronic_conditions_long", "alias": "tuva_chronic_conditions_long", "checksum": {"name": "sha256", "checksum": "a9f319a429001c1a239554868a1c13bb2b61199699162591772b1bb9cc8f0579"}, "tags": ["tuva_chronic_conditions", "chronic_conditions"], "refs": [["tuva_chronic_conditions__stg_core__condition"], ["chronic_conditions__tuva_chronic_conditions_hierarchy"]], "sources": [], "metrics": [], "description": "This model creates one record per patient per condition using the tuva chronic conditions hierarchy as the grouper. The model pulls in the first and last date of the diagnosis that flagged the patient for this condition group.\n", "columns": {"patient_id": {"name": "patient_id", "description": "The unique identifier for a patient", "meta": {}, "data_type": null, "quote": null, "tags": []}, "condition_family": {"name": "condition_family", "description": "A higher level rollup grouping of conditions from the condition column\n", "meta": {"terminology": "/value-sets/chronic-conditions/tuva-chronic-conditions"}, "data_type": null, "quote": null, "tags": []}, "condition": {"name": "condition", "description": "The name of the condition that each diagnosis code rolls up to\n", "meta": {"terminology": "/value-sets/chronic-conditions/tuva-chronic-conditions"}, "data_type": null, "quote": null, "tags": []}, "first_diagnosis_date": {"name": "first_diagnosis_date", "description": "The first date when a diagnosis code that rolls up to this condition was coded to this patient\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "last_diagnosis_date": {"name": "last_diagnosis_date", "description": "The last date when a diagnosis code that rolls up to this condition was coded to this patient\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The time at with the model was materialized. Generated by `dbt_utils.pretty_time` as the local time of the `dbt run` environment. Timezone is configurable via the `tuva_last_run` var.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": "#2e0e0e"}, "patch_path": "the_tuva_project://models/chronic_conditions/tuva_chronic_conditions_models.yml", "compiled_path": null, "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": 1701215340.276278}, "model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_wide": {"resource_type": "model", "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"]}, "config": {"enabled": true, "alias": "tuva_chronic_conditions_wide", "schema": "chronic_conditions", "database": null, "tags": ["tuva_chronic_conditions", "chronic_conditions"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#2e0e0e"}, "bind": false, "post-hook": [], "pre-hook": []}, "database": "dev_sarah", "schema": "chronic_conditions", "fqn": ["the_tuva_project", "chronic_conditions", "final", "chronic_conditions__tuva_chronic_conditions_wide"], "unique_id": "model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_wide", "raw_code": "{{ config(\n enabled = var('tuva_chronic_conditions_enabled',var('claims_enabled',var('clinical_enabled',var('tuva_marts_enabled',False))))\n )\n}}\n\nwith condition_columns as (\n\n select distinct\n condition\n , condition_column_name\n from {{ ref('chronic_conditions__tuva_chronic_conditions_hierarchy') }}\n\n)\n\nselect\n p.patient_id\n , {{ dbt_utils.pivot(\n column='cc.condition_column_name'\n , values=dbt_utils.get_column_values(\n ref('chronic_conditions__tuva_chronic_conditions_hierarchy')\n , 'condition_column_name'\n ,'condition_column_name'\n )\n , agg='max'\n , then_value= 1\n , else_value= 0\n , quote_identifiers = False\n ) }}\n , '{{ var('tuva_last_run')}}' as tuva_last_run\nfrom {{ ref('tuva_chronic_conditions__stg_core__patient') }} p\n left join {{ ref('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", "language": "sql", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/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", "name": "chronic_conditions__tuva_chronic_conditions_wide", "alias": "tuva_chronic_conditions_wide", "checksum": {"name": "sha256", "checksum": "fd544808dd511e5b9ad485a51b7a5a6dcc399cf116583db8c5b89c71878ae284"}, "tags": ["tuva_chronic_conditions", "chronic_conditions"], "refs": [["chronic_conditions__tuva_chronic_conditions_hierarchy"], ["chronic_conditions__tuva_chronic_conditions_hierarchy"], ["tuva_chronic_conditions__stg_core__patient"], ["chronic_conditions__tuva_chronic_conditions_long"]], "sources": [], "metrics": [], "description": "This model creates one record per patient with flags for all the conditions in the tuva chronic conditions hierarchy. A patient will have a 1 in the column for a certain condition if they have every been coded with a diagnosis that rolls up to that condition and a 0 if not.\n", "columns": {"patient_id": {"name": "patient_id", "description": "ID of the patient", "meta": {}, "data_type": null, "quote": null, "tags": []}, "acute_myocardial_infarction": {"name": "acute_myocardial_infarction", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "alcohol": {"name": "alcohol", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "alzheimers_disease": {"name": "alzheimers_disease", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "amyotrophic_lateral_sclerosis": {"name": "amyotrophic_lateral_sclerosis", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "anxiety": {"name": "anxiety", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "asthma": {"name": "asthma", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "atherosclerosis": {"name": "atherosclerosis", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "atrial_fibrillation": {"name": "atrial_fibrillation", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "attention_deficit_hyperactivity_disorder": {"name": "attention_deficit_hyperactivity_disorder", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "bipolar": {"name": "bipolar", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "breast_cancer": {"name": "breast_cancer", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "chronic_kidney_disease": {"name": "chronic_kidney_disease", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "chronic_obstructive_pulmonary_disease": {"name": "chronic_obstructive_pulmonary_disease", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "cocaine": {"name": "cocaine", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "colorectal_cancer": {"name": "colorectal_cancer", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "crohns_disease": {"name": "crohns_disease", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "cystic_fibrosis": {"name": "cystic_fibrosis", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "dementia": {"name": "dementia", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "depression": {"name": "depression", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "heart_failure": {"name": "heart_failure", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "hyperlipidemia": {"name": "hyperlipidemia", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "hypertension": {"name": "hypertension", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "lung_cancer": {"name": "lung_cancer", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "lupus": {"name": "lupus", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "metabolic_syndrome": {"name": "metabolic_syndrome", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "multiple_sclerosis": {"name": "multiple_sclerosis", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "muscular_dystrophy": {"name": "muscular_dystrophy", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "obesity": {"name": "obesity", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "obsessive_compulsive_disorder": {"name": "obsessive_compulsive_disorder", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "opioid": {"name": "opioid", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "parkinsons_disease": {"name": "parkinsons_disease", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "personality_disorder": {"name": "personality_disorder", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "post_traumatic_stress_disorder": {"name": "post_traumatic_stress_disorder", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "rheumatoid_arthritis": {"name": "rheumatoid_arthritis", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "schizophrenia": {"name": "schizophrenia", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "stroke": {"name": "stroke", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "tobacco": {"name": "tobacco", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "type_1_diabetes": {"name": "type_1_diabetes", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "type_2_diabetes": {"name": "type_2_diabetes", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "ulcerative_colitis": {"name": "ulcerative_colitis", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The time at with the model was materialized. Generated by `dbt_utils.pretty_time` as the local time of the `dbt run` environment. Timezone is configurable via the `tuva_last_run` var.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": "#2e0e0e"}, "patch_path": "the_tuva_project://models/chronic_conditions/tuva_chronic_conditions_models.yml", "compiled_path": null, "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": 1701215340.289084}, "model.the_tuva_project.chronic_conditions__cms_chronic_conditions_long": {"resource_type": "model", "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"]}, "config": {"enabled": true, "alias": "cms_chronic_conditions_long", "schema": "chronic_conditions", "database": null, "tags": ["cms_chronic_conditions", "chronic_conditions"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#2e0e0e"}, "bind": false, "post-hook": [], "pre-hook": []}, "database": "dev_sarah", "schema": "chronic_conditions", "fqn": ["the_tuva_project", "chronic_conditions", "final", "chronic_conditions__cms_chronic_conditions_long"], "unique_id": "model.the_tuva_project.chronic_conditions__cms_chronic_conditions_long", "raw_code": "{{ config(\n enabled = var('cms_chronic_conditions_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\n )\n}}\n\nwith conditions_unioned as (\n\n select * from {{ ref('chronic_conditions__cms_chronic_conditions_all') }}\n union distinct\n select * from {{ ref('chronic_conditions__cms_chronic_conditions_hiv_aids') }}\n union distinct\n select * from {{ ref('chronic_conditions__cms_chronic_conditions_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 , '{{ var('tuva_last_run')}}' as tuva_last_run\nfrom conditions_unioned", "language": "sql", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/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", "name": "chronic_conditions__cms_chronic_conditions_long", "alias": "cms_chronic_conditions_long", "checksum": {"name": "sha256", "checksum": "5480b81efb388b47f7d122d3916336072eb751447b8e5f72fb35dd5f3c50a9eb"}, "tags": ["cms_chronic_conditions", "chronic_conditions"], "refs": [["chronic_conditions__cms_chronic_conditions_all"], ["chronic_conditions__cms_chronic_conditions_hiv_aids"], ["chronic_conditions__cms_chronic_conditions_oud"]], "sources": [], "metrics": [], "description": "This model unions condition flags from the 3 upstream stage models that calculate them.\n", "columns": {"patient_id": {"name": "patient_id", "description": "Unique ID for the patient.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "claim_id": {"name": "claim_id", "description": "Unique identifier for each claim.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "start_date": {"name": "start_date", "description": "Start date of the chronic condition derived from diagnosis, procedure, or medication.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "chronic_condition_type": {"name": "chronic_condition_type", "description": "The type of chronic condition as defined by CMS. ('Common' or 'Other chronic or potentially disabling conditions')\n", "meta": {"terminology": "/value-sets/chronic-conditions/cms-chronic-conditions"}, "data_type": null, "quote": null, "tags": []}, "condition_category": {"name": "condition_category", "description": "The category of the condition (e.g. Cardiovascular Disease).\n", "meta": {"terminology": "/value-sets/chronic-conditions/cms-chronic-conditions"}, "data_type": null, "quote": null, "tags": []}, "condition": {"name": "condition", "description": "The name of the chronic condition.", "meta": {"terminology": "/value-sets/chronic-conditions/cms-chronic-conditions"}, "data_type": null, "quote": null, "tags": []}, "data_source": {"name": "data_source", "description": "Indicates the name of the source dataset (e.g. Medicare Claims).\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The time at with the model was materialized. Generated by `dbt_utils.pretty_time` as the local time of the `dbt run` environment. Timezone is configurable via the `tuva_last_run` var.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": "#2e0e0e"}, "patch_path": "the_tuva_project://models/chronic_conditions/cms_chronic_conditions_models.yml", "compiled_path": null, "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": 1701215340.240405}, "model.the_tuva_project.chronic_conditions__cms_chronic_conditions_hiv_aids": {"resource_type": "model", "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"]}, "config": {"enabled": true, "alias": "_int_cms_chronic_condition_hiv_aids", "schema": "chronic_conditions", "database": null, "tags": ["cms_chronic_conditions", "chronic_conditions"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#2e0e0e"}, "bind": false, "post-hook": [], "pre-hook": []}, "database": "dev_sarah", "schema": "chronic_conditions", "fqn": ["the_tuva_project", "chronic_conditions", "intermediate", "chronic_conditions__cms_chronic_conditions_hiv_aids"], "unique_id": "model.the_tuva_project.chronic_conditions__cms_chronic_conditions_hiv_aids", "raw_code": "{{ config(\n enabled = var('cms_chronic_conditions_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\n )\n}}\n\n{%- set condition_filter = 'Human Immunodeficiency Virus and/or Acquired Immunodeficiency Syndrome (HIV/AIDS)' -%}\n\nwith chronic_conditions as (\n\n select * from {{ ref('chronic_conditions__cms_chronic_conditions_hierarchy') }}\n where condition = '{{ condition_filter }}'\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 {{ ref('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 {{ ref('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 {{ dbt.type_string() }}) as patient_id\n , cast(inclusions_unioned.claim_id as {{ dbt.type_string() }}) as claim_id\n , cast(inclusions_unioned.start_date as date) as start_date\n , cast(inclusions_unioned.chronic_condition_type as {{ dbt.type_string() }}) as chronic_condition_type\n , cast(inclusions_unioned.condition_category as {{ dbt.type_string() }}) as condition_category\n , cast(inclusions_unioned.condition as {{ dbt.type_string() }}) as condition\n , cast(inclusions_unioned.data_source as {{ dbt.type_string() }}) as data_source\n , '{{ var('tuva_last_run')}}' as tuva_last_run\nfrom inclusions_unioned", "language": "sql", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/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", "name": "chronic_conditions__cms_chronic_conditions_hiv_aids", "alias": "_int_cms_chronic_condition_hiv_aids", "checksum": {"name": "sha256", "checksum": "a3837d2c0d39ae64d0f7b672e04c21444e53d1c6eed81327169977b0f1ef3034"}, "tags": ["cms_chronic_conditions", "chronic_conditions"], "refs": [["chronic_conditions__cms_chronic_conditions_hierarchy"], ["cms_chronic_conditions__stg_core__condition"], ["cms_chronic_conditions__stg_medical_claim"]], "sources": [], "metrics": [], "description": "This model contains logic for the chronic condition Human Immunodeficiency Virus and/or Acquired Immunodeficiency Syndrome (HIV/AIDS). This model maps ICD-10-CM diagnosis codes and MS DRG codes to the chronic condition.\n", "columns": {"patient_id": {"name": "patient_id", "description": "Unique ID for the patient.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "claim_id": {"name": "claim_id", "description": "Unique identifier for each claim.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "start_date": {"name": "start_date", "description": "Start date of the chronic condition derived from diagnosis, procedure, or medication.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "chronic_condition_type": {"name": "chronic_condition_type", "description": "The type of chronic condition as defined by CMS. ('Common' or 'Other chronic or potentially disabling conditions')\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "condition_category": {"name": "condition_category", "description": "The category of the condition (e.g. Other).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "condition": {"name": "condition", "description": "The name of the chronic condition.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "data_source": {"name": "data_source", "description": "Indicates the name of the source dataset (e.g. Medicare Claims).\n", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": "#2e0e0e"}, "patch_path": "the_tuva_project://models/chronic_conditions/cms_chronic_conditions_models.yml", "compiled_path": null, "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": 1701215340.246625}, "model.the_tuva_project.chronic_conditions__cms_chronic_conditions_oud": {"resource_type": "model", "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"]}, "config": {"enabled": true, "alias": "_int_cms_chronic_condition_oud", "schema": "chronic_conditions", "database": null, "tags": ["cms_chronic_conditions", "chronic_conditions"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#2e0e0e"}, "bind": false, "post-hook": [], "pre-hook": []}, "database": "dev_sarah", "schema": "chronic_conditions", "fqn": ["the_tuva_project", "chronic_conditions", "intermediate", "chronic_conditions__cms_chronic_conditions_oud"], "unique_id": "model.the_tuva_project.chronic_conditions__cms_chronic_conditions_oud", "raw_code": "{{ config(\n enabled = var('cms_chronic_conditions_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\n )\n}}\n\n{%- set condition_filter = 'Opioid Use Disorder (OUD)' -%}\n\n{%- set naltrexone_ndcs = (\n '00056001122', '00056001130', '00056001170', '00056007950', '00056008050',\n '00185003901', '00185003930', '00406009201', '00406009203', '00406117001',\n '00406117003', '00555090201', '00555090202', '00904703604', '16729008101',\n '16729008110', '42291063230', '43063059115', '47335032683', '47335032688',\n '50090286600', '50436010501', '51224020630', '51224020650', '51285027501',\n '51285027502', '52152010502', '52152010504', '52152010530', '54868557400',\n '63459030042', '63629104601', '63629104701', '65694010003', '65694010010',\n '65757030001', '65757030202', '68084029111', '68084029121', '68094085362',\n '68115068030'\n )\n-%}\n\nwith chronic_conditions as (\n\n select * from {{ ref('chronic_conditions__cms_chronic_conditions_hierarchy') }}\n where condition = '{{ condition_filter }}'\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 {{ ref('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 {{ ref('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 {{ ref('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 {{ naltrexone_ndcs }}\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 {{ ref('chronic_conditions__cms_chronic_conditions_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 {{ naltrexone_ndcs }}\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 {{ dbt.type_string() }}) as patient_id\n , cast(inclusions_unioned.claim_id as {{ dbt.type_string() }}) as claim_id\n , cast(inclusions_unioned.start_date as date) as start_date\n , cast(inclusions_unioned.chronic_condition_type as {{ dbt.type_string() }}) as chronic_condition_type\n , cast(inclusions_unioned.condition_category as {{ dbt.type_string() }}) as condition_category\n , cast(inclusions_unioned.condition as {{ dbt.type_string() }}) as condition\n , cast(inclusions_unioned.data_source as {{ dbt.type_string() }}) as data_source\n , '{{ var('tuva_last_run')}}' 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", "language": "sql", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/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", "name": "chronic_conditions__cms_chronic_conditions_oud", "alias": "_int_cms_chronic_condition_oud", "checksum": {"name": "sha256", "checksum": "ec9c2f386fb92e3792534e624e8ff4dfc5e241ad8dd409f6f685e0e193600352"}, "tags": ["cms_chronic_conditions", "chronic_conditions"], "refs": [["chronic_conditions__cms_chronic_conditions_hierarchy"], ["cms_chronic_conditions__stg_core__condition"], ["cms_chronic_conditions__stg_pharmacy_claim"], ["cms_chronic_conditions__stg_core__procedure"], ["chronic_conditions__cms_chronic_conditions_all"]], "sources": [], "metrics": [], "description": "This model contains logic for the chronic condition Opioid Use Disorder (OUD). This model maps ICD-10-CM diagnosis codes, ICD-10-PCS procedure codes, HCPCS codes, and NDC codes to the chronic condition.\n", "columns": {"patient_id": {"name": "patient_id", "description": "Unique ID for the patient.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "claim_id": {"name": "claim_id", "description": "Unique identifier for each claim.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "start_date": {"name": "start_date", "description": "Start date of the chronic condition derived from diagnosis, procedure, or medication.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "chronic_condition_type": {"name": "chronic_condition_type", "description": "The type of chronic condition as defined by CMS. ('Common' or 'Other chronic or potentially disabling conditions')\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "condition_category": {"name": "condition_category", "description": "The category of the condition (e.g. Substance Abuse).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "condition": {"name": "condition", "description": "The name of the chronic condition.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "data_source": {"name": "data_source", "description": "Indicates the name of the source dataset (e.g. Medicare Claims).\n", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": "#2e0e0e"}, "patch_path": "the_tuva_project://models/chronic_conditions/cms_chronic_conditions_models.yml", "compiled_path": null, "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": 1701215340.249632}, "model.the_tuva_project.chronic_conditions__cms_chronic_conditions_all": {"resource_type": "model", "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"]}, "config": {"enabled": true, "alias": "_int_cms_chronic_condition_all", "schema": "chronic_conditions", "database": null, "tags": ["cms_chronic_conditions", "chronic_conditions"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#2e0e0e"}, "bind": false, "post-hook": [], "pre-hook": []}, "database": "dev_sarah", "schema": "chronic_conditions", "fqn": ["the_tuva_project", "chronic_conditions", "intermediate", "chronic_conditions__cms_chronic_conditions_all"], "unique_id": "model.the_tuva_project.chronic_conditions__cms_chronic_conditions_all", "raw_code": "{{ config(\n enabled = var('cms_chronic_conditions_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\n )\n}}\n\nwith chronic_conditions as (\n\n select * from {{ ref('chronic_conditions__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 {{ ref('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 {{ ref('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 {{ ref('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 {{ dbt.type_string() }}) as patient_id\n , cast(inclusions_unioned.claim_id as {{ dbt.type_string() }}) as claim_id\n , cast(inclusions_unioned.start_date as date) as start_date\n , cast(inclusions_unioned.chronic_condition_type as {{ dbt.type_string() }}) as chronic_condition_type\n , cast(inclusions_unioned.condition_category as {{ dbt.type_string() }}) as condition_category\n , cast(inclusions_unioned.condition as {{ dbt.type_string() }}) as condition\n , cast(inclusions_unioned.data_source as {{ dbt.type_string() }}) as data_source\n , '{{ var('tuva_last_run')}}' 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", "language": "sql", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/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", "name": "chronic_conditions__cms_chronic_conditions_all", "alias": "_int_cms_chronic_condition_all", "checksum": {"name": "sha256", "checksum": "6c143e25459a2df431c6c4fa586a685b63c26f6d6c08632bc1d75b6a7f089d10"}, "tags": ["cms_chronic_conditions", "chronic_conditions"], "refs": [["chronic_conditions__cms_chronic_conditions_hierarchy"], ["cms_chronic_conditions__stg_core__condition"], ["cms_chronic_conditions__stg_medical_claim"], ["cms_chronic_conditions__stg_core__procedure"]], "sources": [], "metrics": [], "description": "This model contains logic for all chronic conditions where additional_logic is not 'None'. This model includes standard exclusions and maps ICD-10-CM diagnosis codes, ICD-10-PCS procedure codes, HCPCS codes, and MS DRG codes to chronic conditions.\n", "columns": {"patient_id": {"name": "patient_id", "description": "Unique ID for the patient.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "claim_id": {"name": "claim_id", "description": "Unique identifier for each claim.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "start_date": {"name": "start_date", "description": "Start date of the chronic condition derived from diagnosis, procedure, or medication.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "chronic_condition_type": {"name": "chronic_condition_type", "description": "The type of chronic condition as defined by CMS. ('Common' or 'Other chronic or potentially disabling conditions')\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "condition_category": {"name": "condition_category", "description": "The category of the condition (e.g. Cardiovascular Disease).\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "condition": {"name": "condition", "description": "The name of the chronic condition.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "data_source": {"name": "data_source", "description": "Indicates the name of the source dataset (e.g. Medicare Claims).\n", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": "#2e0e0e"}, "patch_path": "the_tuva_project://models/chronic_conditions/cms_chronic_conditions_models.yml", "compiled_path": null, "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": 1701215340.243553}, "seed.the_tuva_project.terminology__admit_type": {"resource_type": "seed", "depends_on": {"macros": [], "nodes": []}, "config": {"enabled": true, "alias": "admit_type", "schema": "terminology", "database": null, "tags": ["terminology", "claims_preprocessing", "data_profiling"], "meta": {}, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"admit_type_code": "varchar", "admit_type_description": "varchar"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#460d4f"}, "quote_columns": null, "post-hook": [], "pre-hook": []}, "database": "dev_sarah", "schema": "terminology", "fqn": ["the_tuva_project", "terminology", "terminology__admit_type"], "unique_id": "seed.the_tuva_project.terminology__admit_type", "raw_code": "", "language": "sql", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/the_tuva_project", "path": "terminology/terminology__admit_type.csv", "original_file_path": "seeds/terminology/terminology__admit_type.csv", "name": "terminology__admit_type", "alias": "admit_type", "checksum": {"name": "sha256", "checksum": "0fba96cde9676541c9205364a2e2285efa0e9500507a4bcc7b790a982c9482ac"}, "tags": ["terminology", "claims_preprocessing", "data_profiling"], "refs": [], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#460d4f"}, "patch_path": "the_tuva_project://seeds/terminology/terminology_seeds.yml", "compiled_path": null, "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": 1701215340.300202}, "seed.the_tuva_project.terminology__ssa_fips_state": {"resource_type": "seed", "depends_on": {"macros": [], "nodes": []}, "config": {"enabled": true, "alias": "ssa_fips_state", "schema": "terminology", "database": null, "tags": ["terminology"], "meta": {}, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"ssa_fips_state_code": "varchar", "ssa_fips_state_name": "varchar"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#460d4f"}, "quote_columns": null, "post-hook": [], "pre-hook": []}, "database": "dev_sarah", "schema": "terminology", "fqn": ["the_tuva_project", "terminology", "terminology__ssa_fips_state"], "unique_id": "seed.the_tuva_project.terminology__ssa_fips_state", "raw_code": "", "language": "sql", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/the_tuva_project", "path": "terminology/terminology__ssa_fips_state.csv", "original_file_path": "seeds/terminology/terminology__ssa_fips_state.csv", "name": "terminology__ssa_fips_state", "alias": "ssa_fips_state", "checksum": {"name": "sha256", "checksum": "b7a044865449a537d2f4289133d1356d001cc5198de9051a5cc090052b42eed4"}, "tags": ["terminology"], "refs": [], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#460d4f"}, "patch_path": "the_tuva_project://seeds/terminology/terminology_seeds.yml", "compiled_path": null, "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": 1701215340.382812}, "seed.the_tuva_project.terminology__medicare_orec": {"resource_type": "seed", "depends_on": {"macros": [], "nodes": []}, "config": {"enabled": true, "alias": "medicare_orec", "schema": "terminology", "database": null, "tags": ["terminology", "claims_preprocessing", "data_profiling"], "meta": {}, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"original_reason_entitlement_code": "varchar", "original_reason_entitlement_description": "varchar"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#460d4f"}, "quote_columns": null, "post-hook": [], "pre-hook": []}, "database": "dev_sarah", "schema": "terminology", "fqn": ["the_tuva_project", "terminology", "terminology__medicare_orec"], "unique_id": "seed.the_tuva_project.terminology__medicare_orec", "raw_code": "", "language": "sql", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/the_tuva_project", "path": "terminology/terminology__medicare_orec.csv", "original_file_path": "seeds/terminology/terminology__medicare_orec.csv", "name": "terminology__medicare_orec", "alias": "medicare_orec", "checksum": {"name": "sha256", "checksum": "ff425893ec0ec8d7e3eb1911d3c979540d02a8853efa2af0676ccd9c954a50f4"}, "tags": ["terminology", "claims_preprocessing", "data_profiling"], "refs": [], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#460d4f"}, "patch_path": "the_tuva_project://seeds/terminology/terminology_seeds.yml", "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"schema": "terminology", "alias": "medicare_orec", "tags": ["terminology", "claims_preprocessing", "data_profiling"], "column_types": {"original_reason_entitlement_code": "varchar", "original_reason_entitlement_description": "varchar"}, "docs": {"node_color": "#460d4f"}}, "created_at": 1701215340.380057}, "seed.the_tuva_project.terminology__gender": {"resource_type": "seed", "depends_on": {"macros": [], "nodes": []}, "config": {"enabled": true, "alias": "gender", "schema": "terminology", "database": null, "tags": ["terminology", "data_profiling"], "meta": {}, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"description": "varchar"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#460d4f"}, "quote_columns": null, "post-hook": [], "pre-hook": []}, "database": "dev_sarah", "schema": "terminology", "fqn": ["the_tuva_project", "terminology", "terminology__gender"], "unique_id": "seed.the_tuva_project.terminology__gender", "raw_code": "", "language": "sql", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/the_tuva_project", "path": "terminology/terminology__gender.csv", "original_file_path": "seeds/terminology/terminology__gender.csv", "name": "terminology__gender", "alias": "gender", "checksum": {"name": "sha256", "checksum": "49caad564a6d46cabcbbaa25857984aa1f7d4426ed5927989cdeddc1539d6fb6"}, "tags": ["terminology", "data_profiling"], "refs": [], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#460d4f"}, "patch_path": "the_tuva_project://seeds/terminology/terminology_seeds.yml", "compiled_path": null, "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": 1701215340.328879}, "seed.the_tuva_project.terminology__ethnicity": {"resource_type": "seed", "depends_on": {"macros": [], "nodes": []}, "config": {"enabled": true, "alias": "ethnicity", "schema": "terminology", "database": null, "tags": ["terminology"], "meta": {}, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"code": "varchar", "description": "varchar"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#460d4f"}, "quote_columns": null, "post-hook": [], "pre-hook": []}, "database": "dev_sarah", "schema": "terminology", "fqn": ["the_tuva_project", "terminology", "terminology__ethnicity"], "unique_id": "seed.the_tuva_project.terminology__ethnicity", "raw_code": "", "language": "sql", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/the_tuva_project", "path": "terminology/terminology__ethnicity.csv", "original_file_path": "seeds/terminology/terminology__ethnicity.csv", "name": "terminology__ethnicity", "alias": "ethnicity", "checksum": {"name": "sha256", "checksum": "d23c1e3d7417d569bbb1e11cd0a493cfd60f60e231756adb2f7b6160ca2f93e6"}, "tags": ["terminology"], "refs": [], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#460d4f"}, "patch_path": "the_tuva_project://seeds/terminology/terminology_seeds.yml", "compiled_path": null, "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": 1701215340.3210292}, "seed.the_tuva_project.terminology__ms_drg": {"resource_type": "seed", "depends_on": {"macros": [], "nodes": []}, "config": {"enabled": true, "alias": "ms_drg", "schema": "terminology", "database": null, "tags": ["terminology", "readmissions", "data_profiling", "claims_preprocessing"], "meta": {}, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"ms_drg_code": "varchar", "mdc_code": "varchar", "medical_surgical": "varchar", "ms_drg_description": "varchar", "deprecated": "integer", "deprecated_date": "date"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#460d4f"}, "quote_columns": null, "post-hook": [], "pre-hook": []}, "database": "dev_sarah", "schema": "terminology", "fqn": ["the_tuva_project", "terminology", "terminology__ms_drg"], "unique_id": "seed.the_tuva_project.terminology__ms_drg", "raw_code": "", "language": "sql", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/the_tuva_project", "path": "terminology/terminology__ms_drg.csv", "original_file_path": "seeds/terminology/terminology__ms_drg.csv", "name": "terminology__ms_drg", "alias": "ms_drg", "checksum": {"name": "sha256", "checksum": "63740ef5cb6d40d8b4f261a59de820df7f8d80ca96989194348b1874f65861d6"}, "tags": ["terminology", "readmissions", "data_profiling", "claims_preprocessing"], "refs": [], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#460d4f"}, "patch_path": "the_tuva_project://seeds/terminology/terminology_seeds.yml", "compiled_path": null, "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": 1701215340.389833}, "seed.the_tuva_project.terminology__revenue_center": {"resource_type": "seed", "depends_on": {"macros": [], "nodes": []}, "config": {"enabled": true, "alias": "revenue_center", "schema": "terminology", "database": null, "tags": ["terminology", "claims_preprocessing", "data_profiling"], "meta": {}, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"revenue_center_code": "varchar", "revenue_center_description": "varchar"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#460d4f"}, "quote_columns": null, "post-hook": [], "pre-hook": []}, "database": "dev_sarah", "schema": "terminology", "fqn": ["the_tuva_project", "terminology", "terminology__revenue_center"], "unique_id": "seed.the_tuva_project.terminology__revenue_center", "raw_code": "", "language": "sql", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/the_tuva_project", "path": "terminology/terminology__revenue_center.csv", "original_file_path": "seeds/terminology/terminology__revenue_center.csv", "name": "terminology__revenue_center", "alias": "revenue_center", "checksum": {"name": "sha256", "checksum": "6d630994900478a2efc0f63fa4045b387bd020cb519fac04ba16b32fb11a1647"}, "tags": ["terminology", "claims_preprocessing", "data_profiling"], "refs": [], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#460d4f"}, "patch_path": "the_tuva_project://seeds/terminology/terminology_seeds.yml", "compiled_path": null, "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": 1701215340.419266}, "seed.the_tuva_project.terminology__icd_9_cm": {"resource_type": "seed", "depends_on": {"macros": [], "nodes": []}, "config": {"enabled": true, "alias": "icd_9_cm", "schema": "terminology", "database": null, "tags": ["terminology", "claims_preprocessing", "readmissions", "data_profiling"], "meta": {}, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"icd_9_cm": "varchar", "long_description": "varchar", "short_description": "varchar"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#460d4f"}, "quote_columns": null, "post-hook": [], "pre-hook": []}, "database": "dev_sarah", "schema": "terminology", "fqn": ["the_tuva_project", "terminology", "terminology__icd_9_cm"], "unique_id": "seed.the_tuva_project.terminology__icd_9_cm", "raw_code": "", "language": "sql", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/the_tuva_project", "path": "terminology/terminology__icd_9_cm.csv", "original_file_path": "seeds/terminology/terminology__icd_9_cm.csv", "name": "terminology__icd_9_cm", "alias": "icd_9_cm", "checksum": {"name": "path", "checksum": "seeds/terminology/terminology__icd_9_cm.csv"}, "tags": ["terminology", "claims_preprocessing", "readmissions", "data_profiling"], "refs": [], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#460d4f"}, "patch_path": "the_tuva_project://seeds/terminology/terminology_seeds.yml", "compiled_path": null, "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": 1701215340.344343}, "seed.the_tuva_project.terminology__race": {"resource_type": "seed", "depends_on": {"macros": [], "nodes": []}, "config": {"enabled": true, "alias": "race", "schema": "terminology", "database": null, "tags": ["terminology", "data_profiling"], "meta": {}, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"race_code": "varchar", "race_description": "varchar"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#460d4f"}, "quote_columns": null, "post-hook": [], "pre-hook": []}, "database": "dev_sarah", "schema": "terminology", "fqn": ["the_tuva_project", "terminology", "terminology__race"], "unique_id": "seed.the_tuva_project.terminology__race", "raw_code": "", "language": "sql", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/the_tuva_project", "path": "terminology/terminology__race.csv", "original_file_path": "seeds/terminology/terminology__race.csv", "name": "terminology__race", "alias": "race", "checksum": {"name": "sha256", "checksum": "b4c3900253da42bc9d2a2333c8d774e3c0aa2402af6a4493c268d551779e1daa"}, "tags": ["terminology", "data_profiling"], "refs": [], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#460d4f"}, "patch_path": "the_tuva_project://seeds/terminology/terminology_seeds.yml", "compiled_path": null, "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": 1701215340.416557}, "seed.the_tuva_project.terminology__medicare_status": {"resource_type": "seed", "depends_on": {"macros": [], "nodes": []}, "config": {"enabled": true, "alias": "medicare_status", "schema": "terminology", "database": null, "tags": ["terminology", "claims_preprocessing", "data_profiling"], "meta": {}, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"medicare_status_code": "varchar", "medicare_status_description": "varchar"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#460d4f"}, "quote_columns": null, "post-hook": [], "pre-hook": []}, "database": "dev_sarah", "schema": "terminology", "fqn": ["the_tuva_project", "terminology", "terminology__medicare_status"], "unique_id": "seed.the_tuva_project.terminology__medicare_status", "raw_code": "", "language": "sql", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/the_tuva_project", "path": "terminology/terminology__medicare_status.csv", "original_file_path": "seeds/terminology/terminology__medicare_status.csv", "name": "terminology__medicare_status", "alias": "medicare_status", "checksum": {"name": "sha256", "checksum": "2bd1a8a081fceb69bf91287c8a56c370ea1544a1fbbe12829566955012c04c97"}, "tags": ["terminology", "claims_preprocessing", "data_profiling"], "refs": [], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#460d4f"}, "patch_path": "the_tuva_project://seeds/terminology/terminology_seeds.yml", "compiled_path": null, "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": 1701215340.38582}, "seed.the_tuva_project.terminology__loinc_deprecated_mapping": {"resource_type": "seed", "depends_on": {"macros": ["macro.the_tuva_project.load_seed"], "nodes": []}, "config": {"enabled": true, "alias": "loinc_deprecated_mapping", "schema": "terminology", "database": null, "tags": ["terminology"], "meta": {}, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"loinc": "varchar", "map_to": "varchar", "comment": "varchar", "final_map_to": "varchar", "all_comments": "varchar", "depth": "varchar"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#460d4f"}, "quote_columns": null, "columns": [{"name": "loinc", "description": "The deprecated term to which the replacement term(s) apply."}, {"name": "map_to", "description": "A replacement term that is to be used in place of the deprecated or discouraged term."}, {"name": "comment", "description": "Narrative text that explains the rational for using the recommended replacement term."}, {"name": "final_map_to", "description": "If there are multiple steps of deprecated codes, this is the final (active) code"}, {"name": "all_comments", "description": "An aggregation of comments for any mapping steps between the deprecated code and the active code"}, {"name": "depth", "description": "How many steps this mapping is to the active code"}], "post-hook": [{"sql": "{{ load_seed('tuva-public-resources/terminology','loinc_deprecated_mapping.csv',compression=true,null_marker=true) }}", "transaction": true, "index": null}], "pre-hook": []}, "database": "dev_sarah", "schema": "terminology", "fqn": ["the_tuva_project", "terminology", "terminology__loinc_deprecated_mapping"], "unique_id": "seed.the_tuva_project.terminology__loinc_deprecated_mapping", "raw_code": "", "language": "sql", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/the_tuva_project", "path": "terminology/terminology__loinc_deprecated_mapping.csv", "original_file_path": "seeds/terminology/terminology__loinc_deprecated_mapping.csv", "name": "terminology__loinc_deprecated_mapping", "alias": "loinc_deprecated_mapping", "checksum": {"name": "sha256", "checksum": "eecd52c3944bc1abd373c557a286ee386438733c6daf2fbb844e86623f7af119"}, "tags": ["terminology"], "refs": [], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#460d4f"}, "patch_path": "the_tuva_project://seeds/terminology/terminology_seeds.yml", "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"post-hook": "{{ load_seed('tuva-public-resources/terminology','loinc_deprecated_mapping.csv',compression=true,null_marker=true) }}", "schema": "terminology", "alias": "loinc_deprecated_mapping", "tags": ["terminology"], "columns": [{"name": "loinc", "description": "The deprecated term to which the replacement term(s) apply."}, {"name": "map_to", "description": "A replacement term that is to be used in place of the deprecated or discouraged term."}, {"name": "comment", "description": "Narrative text that explains the rational for using the recommended replacement term."}, {"name": "final_map_to", "description": "If there are multiple steps of deprecated codes, this is the final (active) code"}, {"name": "all_comments", "description": "An aggregation of comments for any mapping steps between the deprecated code and the active code"}, {"name": "depth", "description": "How many steps this mapping is to the active code"}], "column_types": {"loinc": "varchar", "map_to": "varchar", "comment": "varchar", "final_map_to": "varchar", "all_comments": "varchar", "depth": "varchar"}, "docs": {"node_color": "#460d4f"}}, "created_at": 1701215340.370943}, "seed.the_tuva_project.terminology__place_of_service": {"resource_type": "seed", "depends_on": {"macros": [], "nodes": []}, "config": {"enabled": true, "alias": "place_of_service", "schema": "terminology", "database": null, "tags": ["terminology", "claims_preprocessing", "data_profiling"], "meta": {}, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"place_of_service_code": "varchar", "place_of_service_description": "varchar"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#460d4f"}, "quote_columns": null, "post-hook": [], "pre-hook": []}, "database": "dev_sarah", "schema": "terminology", "fqn": ["the_tuva_project", "terminology", "terminology__place_of_service"], "unique_id": "seed.the_tuva_project.terminology__place_of_service", "raw_code": "", "language": "sql", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/the_tuva_project", "path": "terminology/terminology__place_of_service.csv", "original_file_path": "seeds/terminology/terminology__place_of_service.csv", "name": "terminology__place_of_service", "alias": "place_of_service", "checksum": {"name": "sha256", "checksum": "760955a3ad21bd2c8f4257881e8f713276eda10623bb05f373634ff186ea8592"}, "tags": ["terminology", "claims_preprocessing", "data_profiling"], "refs": [], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#460d4f"}, "patch_path": "the_tuva_project://seeds/terminology/terminology_seeds.yml", "compiled_path": null, "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": 1701215340.4010592}, "seed.the_tuva_project.terminology__discharge_disposition": {"resource_type": "seed", "depends_on": {"macros": [], "nodes": []}, "config": {"enabled": true, "alias": "discharge_disposition", "schema": "terminology", "database": null, "tags": [], "meta": {}, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"discharge_disposition_code": "varchar", "discharge_disposition_description": "varchar"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#460d4f"}, "quote_columns": null, "post-hook": [], "pre-hook": []}, "database": "dev_sarah", "schema": "terminology", "fqn": ["the_tuva_project", "terminology", "terminology__discharge_disposition"], "unique_id": "seed.the_tuva_project.terminology__discharge_disposition", "raw_code": "", "language": "sql", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/the_tuva_project", "path": "terminology/terminology__discharge_disposition.csv", "original_file_path": "seeds/terminology/terminology__discharge_disposition.csv", "name": "terminology__discharge_disposition", "alias": "discharge_disposition", "checksum": {"name": "sha256", "checksum": "992cf51c8d6a2dfe3d3f54e65bf618e68599ed2f48bcf75d59ee8bdd48d1aa0e"}, "tags": [], "refs": [], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#460d4f"}, "patch_path": "the_tuva_project://seeds/terminology/terminology_seeds.yml", "compiled_path": null, "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": 1701215340.3163111}, "seed.the_tuva_project.terminology__icd_9_pcs": {"resource_type": "seed", "depends_on": {"macros": [], "nodes": []}, "config": {"enabled": true, "alias": "icd_9_pcs", "schema": "terminology", "database": null, "tags": ["terminology", "claims_preprocessing", "readmissions", "data_profiling"], "meta": {}, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"icd_9_pcs": "varchar", "long_description": "varchar", "short_description": "varchar"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#460d4f"}, "quote_columns": null, "post-hook": [], "pre-hook": []}, "database": "dev_sarah", "schema": "terminology", "fqn": ["the_tuva_project", "terminology", "terminology__icd_9_pcs"], "unique_id": "seed.the_tuva_project.terminology__icd_9_pcs", "raw_code": "", "language": "sql", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/the_tuva_project", "path": "terminology/terminology__icd_9_pcs.csv", "original_file_path": "seeds/terminology/terminology__icd_9_pcs.csv", "name": "terminology__icd_9_pcs", "alias": "icd_9_pcs", "checksum": {"name": "sha256", "checksum": "dc97df38ffbff5dddcd6e0160d41f76c3d29b7d740b583faaac1a5de86698fab"}, "tags": ["terminology", "claims_preprocessing", "readmissions", "data_profiling"], "refs": [], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#460d4f"}, "patch_path": "the_tuva_project://seeds/terminology/terminology_seeds.yml", "compiled_path": null, "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": 1701215340.34753}, "seed.the_tuva_project.terminology__present_on_admission": {"resource_type": "seed", "depends_on": {"macros": [], "nodes": []}, "config": {"enabled": true, "alias": "present_on_admission", "schema": "terminology", "database": null, "tags": ["terminology", "data_profiling", "claims_preprocessing"], "meta": {}, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"present_on_admit_code": "varchar", "description": "varchar"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#460d4f"}, "quote_columns": null, "post-hook": [], "pre-hook": []}, "database": "dev_sarah", "schema": "terminology", "fqn": ["the_tuva_project", "terminology", "terminology__present_on_admission"], "unique_id": "seed.the_tuva_project.terminology__present_on_admission", "raw_code": "", "language": "sql", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/the_tuva_project", "path": "terminology/terminology__present_on_admission.csv", "original_file_path": "seeds/terminology/terminology__present_on_admission.csv", "name": "terminology__present_on_admission", "alias": "present_on_admission", "checksum": {"name": "sha256", "checksum": "4a0669b7aed638378b8cde6a1e4d0202071923c695ecba93cf266d7c1b206d8e"}, "tags": ["terminology", "data_profiling", "claims_preprocessing"], "refs": [], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#460d4f"}, "patch_path": "the_tuva_project://seeds/terminology/terminology_seeds.yml", "compiled_path": null, "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": 1701215340.404211}, "seed.the_tuva_project.terminology__mdc": {"resource_type": "seed", "depends_on": {"macros": [], "nodes": []}, "config": {"enabled": true, "alias": "mdc", "schema": "terminology", "database": null, "tags": ["terminology"], "meta": {}, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"mdc_code": "varchar", "mcd_description": "varchar"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#460d4f"}, "quote_columns": null, "post-hook": [], "pre-hook": []}, "database": "dev_sarah", "schema": "terminology", "fqn": ["the_tuva_project", "terminology", "terminology__mdc"], "unique_id": "seed.the_tuva_project.terminology__mdc", "raw_code": "", "language": "sql", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/the_tuva_project", "path": "terminology/terminology__mdc.csv", "original_file_path": "seeds/terminology/terminology__mdc.csv", "name": "terminology__mdc", "alias": "mdc", "checksum": {"name": "sha256", "checksum": "c941d78a6e4de2c32b546a46f0b0c429bb209a9e1a7049a803cf8c447c73d0d6"}, "tags": ["terminology"], "refs": [], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#460d4f"}, "patch_path": "the_tuva_project://seeds/terminology/terminology_seeds.yml", "compiled_path": null, "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": 1701215340.373656}, "seed.the_tuva_project.terminology__admit_source": {"resource_type": "seed", "depends_on": {"macros": [], "nodes": []}, "config": {"enabled": true, "alias": "admit_source", "schema": "terminology", "database": null, "tags": ["terminology", "claims_preprocessing", "data_profiling"], "meta": {}, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"admit_source_code": "varchar", "admit_source_description": "varchar", "newborn_description": "varchar"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#460d4f"}, "quote_columns": null, "post-hook": [], "pre-hook": []}, "database": "dev_sarah", "schema": "terminology", "fqn": ["the_tuva_project", "terminology", "terminology__admit_source"], "unique_id": "seed.the_tuva_project.terminology__admit_source", "raw_code": "", "language": "sql", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/the_tuva_project", "path": "terminology/terminology__admit_source.csv", "original_file_path": "seeds/terminology/terminology__admit_source.csv", "name": "terminology__admit_source", "alias": "admit_source", "checksum": {"name": "sha256", "checksum": "392e0c1935973dbea2e96030db856a8ccfa660cbd51f45c92d51d121aa432a8b"}, "tags": ["terminology", "claims_preprocessing", "data_profiling"], "refs": [], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#460d4f"}, "patch_path": "the_tuva_project://seeds/terminology/terminology_seeds.yml", "compiled_path": null, "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": 1701215340.297088}, "seed.the_tuva_project.terminology__calendar": {"resource_type": "seed", "depends_on": {"macros": ["macro.the_tuva_project.load_seed"], "nodes": []}, "config": {"enabled": true, "alias": "calendar", "schema": "terminology", "database": null, "tags": ["terminology", "pmpm"], "meta": {}, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"full_date": "date", "year": "integer", "month": "integer", "day": "integer", "month_name": "varchar", "day_of_week_number": "integer", "day_of_week_name": "varchar", "week_of_year": "integer", "day_of_year": "integer", "year_month": "varchar", "first_day_of_month": "date", "last_day_of_month": "date"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#460d4f"}, "quote_columns": null, "post-hook": [{"sql": "{{ load_seed('tuva-public-resources/terminology','calendar.csv',compression=true,null_marker=true) }}", "transaction": true, "index": null}], "pre-hook": []}, "database": "dev_sarah", "schema": "terminology", "fqn": ["the_tuva_project", "terminology", "terminology__calendar"], "unique_id": "seed.the_tuva_project.terminology__calendar", "raw_code": "", "language": "sql", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/the_tuva_project", "path": "terminology/terminology__calendar.csv", "original_file_path": "seeds/terminology/terminology__calendar.csv", "name": "terminology__calendar", "alias": "calendar", "checksum": {"name": "sha256", "checksum": "c81e72363dd6699bc5bf3f6b3699e3613992b33cea3b02dc292033740f03b697"}, "tags": ["terminology", "pmpm"], "refs": [], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#460d4f"}, "patch_path": "the_tuva_project://seeds/terminology/terminology_seeds.yml", "compiled_path": null, "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": 1701215340.309171}, "seed.the_tuva_project.terminology__other_provider_taxonomy": {"resource_type": "seed", "depends_on": {"macros": ["macro.the_tuva_project.load_seed"], "nodes": []}, "config": {"enabled": true, "alias": "other_provider_taxonomy", "schema": "terminology", "database": null, "tags": ["terminology", "claims_preprocessing"], "meta": {}, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"npi": "varchar(35)", "taxonomy_code": "varchar(35)", "medicare_specialty_code": "varchar(173)", "description": "varchar(101)", "primary_flag": "integer"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#460d4f"}, "quote_columns": null, "post-hook": [{"sql": "{{ load_seed('tuva-public-resources/provider_data','other_provider_taxonomy.csv',compression=true,null_marker=true) }}", "transaction": true, "index": null}], "pre-hook": []}, "database": "dev_sarah", "schema": "terminology", "fqn": ["the_tuva_project", "terminology", "terminology__other_provider_taxonomy"], "unique_id": "seed.the_tuva_project.terminology__other_provider_taxonomy", "raw_code": "", "language": "sql", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/the_tuva_project", "path": "terminology/terminology__other_provider_taxonomy.csv", "original_file_path": "seeds/terminology/terminology__other_provider_taxonomy.csv", "name": "terminology__other_provider_taxonomy", "alias": "other_provider_taxonomy", "checksum": {"name": "sha256", "checksum": "ea344ae188db60f0f75e52a39114af49b7828fe050d3f761db03d4d07039cccf"}, "tags": ["terminology", "claims_preprocessing"], "refs": [], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#460d4f"}, "patch_path": "the_tuva_project://seeds/terminology/terminology_seeds.yml", "compiled_path": null, "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": 1701215340.395854}, "seed.the_tuva_project.terminology__icd_10_cm": {"resource_type": "seed", "depends_on": {"macros": ["macro.the_tuva_project.load_seed"], "nodes": []}, "config": {"enabled": true, "alias": "icd_10_cm", "schema": "terminology", "database": null, "tags": ["terminology", "claims_preprocessing", "readmissions", "data_profiling"], "meta": {}, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"icd_10_cm": "varchar", "description": "varchar"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#460d4f"}, "quote_columns": null, "post-hook": [{"sql": "{{ load_seed('tuva-public-resources/terminology','icd_10_cm.csv',compression=true,null_marker=true) }}", "transaction": true, "index": null}], "pre-hook": []}, "database": "dev_sarah", "schema": "terminology", "fqn": ["the_tuva_project", "terminology", "terminology__icd_10_cm"], "unique_id": "seed.the_tuva_project.terminology__icd_10_cm", "raw_code": "", "language": "sql", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/the_tuva_project", "path": "terminology/terminology__icd_10_cm.csv", "original_file_path": "seeds/terminology/terminology__icd_10_cm.csv", "name": "terminology__icd_10_cm", "alias": "icd_10_cm", "checksum": {"name": "sha256", "checksum": "08903dd5b951cfdd2dc1e2d92406571ab08c2fa401c2f951a6190b38af1dbf61"}, "tags": ["terminology", "claims_preprocessing", "readmissions", "data_profiling"], "refs": [], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#460d4f"}, "patch_path": "the_tuva_project://seeds/terminology/terminology_seeds.yml", "compiled_path": null, "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": 1701215340.336859}, "seed.the_tuva_project.terminology__claim_type": {"resource_type": "seed", "depends_on": {"macros": [], "nodes": []}, "config": {"enabled": true, "alias": "claim_type", "schema": "terminology", "database": null, "tags": ["terminology", "data_profiling"], "meta": {}, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"claim_type_code": "varchar", "claim_type_description": "varchar"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#460d4f"}, "quote_columns": null, "post-hook": [], "pre-hook": []}, "database": "dev_sarah", "schema": "terminology", "fqn": ["the_tuva_project", "terminology", "terminology__claim_type"], "unique_id": "seed.the_tuva_project.terminology__claim_type", "raw_code": "", "language": "sql", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/the_tuva_project", "path": "terminology/terminology__claim_type.csv", "original_file_path": "seeds/terminology/terminology__claim_type.csv", "name": "terminology__claim_type", "alias": "claim_type", "checksum": {"name": "sha256", "checksum": "da35be4c432144ba8003d5ef8f2d815d8afce6ed215d6aa065e305ad11f7552c"}, "tags": ["terminology", "data_profiling"], "refs": [], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#460d4f"}, "patch_path": "the_tuva_project://seeds/terminology/terminology_seeds.yml", "compiled_path": null, "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": 1701215340.3118248}, "seed.the_tuva_project.terminology__hcpcs_level_2": {"resource_type": "seed", "depends_on": {"macros": [], "nodes": []}, "config": {"enabled": true, "alias": "hcpcs_level_2", "schema": "terminology", "database": null, "tags": ["terminology"], "meta": {}, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"hcpcs": "varchar", "seqnum": "varchar", "recid": "varchar", "long_description": "varchar(2000)", "short_description": "varchar"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#460d4f"}, "quote_columns": null, "post-hook": [], "pre-hook": []}, "database": "dev_sarah", "schema": "terminology", "fqn": ["the_tuva_project", "terminology", "terminology__hcpcs_level_2"], "unique_id": "seed.the_tuva_project.terminology__hcpcs_level_2", "raw_code": "", "language": "sql", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/the_tuva_project", "path": "terminology/terminology__hcpcs_level_2.csv", "original_file_path": "seeds/terminology/terminology__hcpcs_level_2.csv", "name": "terminology__hcpcs_level_2", "alias": "hcpcs_level_2", "checksum": {"name": "path", "checksum": "seeds/terminology/terminology__hcpcs_level_2.csv"}, "tags": ["terminology"], "refs": [], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#460d4f"}, "patch_path": "the_tuva_project://seeds/terminology/terminology_seeds.yml", "compiled_path": null, "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": 1701215340.332455}, "seed.the_tuva_project.terminology__fips_county": {"resource_type": "seed", "depends_on": {"macros": [], "nodes": []}, "config": {"enabled": true, "alias": "fips_county", "schema": "terminology", "database": null, "tags": ["terminology"], "meta": {}, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"fips_code": "varchar", "county": "varchar", "state": "varchar"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#460d4f"}, "quote_columns": null, "post-hook": [], "pre-hook": []}, "database": "dev_sarah", "schema": "terminology", "fqn": ["the_tuva_project", "terminology", "terminology__fips_county"], "unique_id": "seed.the_tuva_project.terminology__fips_county", "raw_code": "", "language": "sql", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/the_tuva_project", "path": "terminology/terminology__fips_county.csv", "original_file_path": "seeds/terminology/terminology__fips_county.csv", "name": "terminology__fips_county", "alias": "fips_county", "checksum": {"name": "sha256", "checksum": "51c80da82ec1f20665fbd65379796c53f724781fa3833396cba093c89004bfb5"}, "tags": ["terminology"], "refs": [], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#460d4f"}, "patch_path": "the_tuva_project://seeds/terminology/terminology_seeds.yml", "compiled_path": null, "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": 1701215340.32374}, "seed.the_tuva_project.terminology__ansi_fips_state": {"resource_type": "seed", "depends_on": {"macros": [], "nodes": []}, "config": {"enabled": true, "alias": "ansi_fips_state", "schema": "terminology", "database": null, "tags": ["terminology", "medicare_cclf_connector"], "meta": {}, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"ansi_fips_state_code": "varchar", "ansi_fips_state_abbreviation": "varchar", "ansi_fips_state_name": "varchar"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#460d4f"}, "quote_columns": null, "post-hook": [], "pre-hook": []}, "database": "dev_sarah", "schema": "terminology", "fqn": ["the_tuva_project", "terminology", "terminology__ansi_fips_state"], "unique_id": "seed.the_tuva_project.terminology__ansi_fips_state", "raw_code": "", "language": "sql", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/the_tuva_project", "path": "terminology/terminology__ansi_fips_state.csv", "original_file_path": "seeds/terminology/terminology__ansi_fips_state.csv", "name": "terminology__ansi_fips_state", "alias": "ansi_fips_state", "checksum": {"name": "sha256", "checksum": "188188b26f055c7e4d3a36d9d6b4bf1673842a691ba07cf1cfa9cacb0507b7de"}, "tags": ["terminology", "medicare_cclf_connector"], "refs": [], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#460d4f"}, "patch_path": "the_tuva_project://seeds/terminology/terminology_seeds.yml", "compiled_path": null, "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": 1701215340.326765}, "seed.the_tuva_project.terminology__encounter_type": {"resource_type": "seed", "depends_on": {"macros": [], "nodes": []}, "config": {"enabled": true, "alias": "encounter_type", "schema": "terminology", "database": null, "tags": ["terminology", "claims_preprocessing"], "meta": {}, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"description": "varchar"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#460d4f"}, "quote_columns": null, "post-hook": [], "pre-hook": []}, "database": "dev_sarah", "schema": "terminology", "fqn": ["the_tuva_project", "terminology", "terminology__encounter_type"], "unique_id": "seed.the_tuva_project.terminology__encounter_type", "raw_code": "", "language": "sql", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/the_tuva_project", "path": "terminology/terminology__encounter_type.csv", "original_file_path": "seeds/terminology/terminology__encounter_type.csv", "name": "terminology__encounter_type", "alias": "encounter_type", "checksum": {"name": "sha256", "checksum": "d75ee477d89a9d8d679a9fcc64ce29975b9fe6eea1ad094d2e60d62e5b011c3c"}, "tags": ["terminology", "claims_preprocessing"], "refs": [], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#460d4f"}, "patch_path": "the_tuva_project://seeds/terminology/terminology_seeds.yml", "compiled_path": null, "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": 1701215340.31852}, "seed.the_tuva_project.terminology__provider": {"resource_type": "seed", "depends_on": {"macros": ["macro.the_tuva_project.load_seed"], "nodes": []}, "config": {"enabled": true, "alias": "provider", "schema": "terminology", "database": null, "tags": ["terminology", "claims_preprocessing"], "meta": {}, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"npi": "varchar(35)", "entity_type_code": "varchar(26)", "entity_type_description": "varchar(37)", "primary_taxonomy_code": "varchar(35)", "primary_specialty_description": "varchar(173)", "provider_first_name": "varchar(95)", "provider_last_name": "varchar(95)", "provider_organization_name": "varchar(95)", "parent_organization_name": "varchar(95)", "practice_address_line_1": "varchar(80)", "practice_address_line_2": "varchar(80)", "practice_city": "varchar(65)", "practice_state": "varchar(65)", "practice_zip_code": "varchar(42)", "last_updated": "date", "deactivation_date": "date", "deactivation_flag": "varchar(80)"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#460d4f"}, "quote_columns": null, "post-hook": [{"sql": "{{ load_seed('tuva-public-resources/provider_data','provider.csv',compression=true,null_marker=true) }}", "transaction": true, "index": null}], "pre-hook": []}, "database": "dev_sarah", "schema": "terminology", "fqn": ["the_tuva_project", "terminology", "terminology__provider"], "unique_id": "seed.the_tuva_project.terminology__provider", "raw_code": "", "language": "sql", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/the_tuva_project", "path": "terminology/terminology__provider.csv", "original_file_path": "seeds/terminology/terminology__provider.csv", "name": "terminology__provider", "alias": "provider", "checksum": {"name": "sha256", "checksum": "f88950a046cf237eda0f4b60cd8284961c4b9c59742960a8e63f7305fe89ed05"}, "tags": ["terminology", "claims_preprocessing"], "refs": [], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#460d4f"}, "patch_path": "the_tuva_project://seeds/terminology/terminology_seeds.yml", "compiled_path": null, "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": 1701215340.41381}, "seed.the_tuva_project.terminology__payer_type": {"resource_type": "seed", "depends_on": {"macros": [], "nodes": []}, "config": {"enabled": true, "alias": "payer_type", "schema": "terminology", "database": null, "tags": ["terminology", "data_profiling"], "meta": {}, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"payer_type": "varchar"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#460d4f"}, "quote_columns": null, "post-hook": [], "pre-hook": []}, "database": "dev_sarah", "schema": "terminology", "fqn": ["the_tuva_project", "terminology", "terminology__payer_type"], "unique_id": "seed.the_tuva_project.terminology__payer_type", "raw_code": "", "language": "sql", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/the_tuva_project", "path": "terminology/terminology__payer_type.csv", "original_file_path": "seeds/terminology/terminology__payer_type.csv", "name": "terminology__payer_type", "alias": "payer_type", "checksum": {"name": "sha256", "checksum": "74352b381c969e38fbc490a236b9bc0c1568e2eea0aefc3c0cd16e910afde78b"}, "tags": ["terminology", "data_profiling"], "refs": [], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#460d4f"}, "patch_path": "the_tuva_project://seeds/terminology/terminology_seeds.yml", "compiled_path": null, "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": 1701215340.3983161}, "seed.the_tuva_project.terminology__apr_drg": {"resource_type": "seed", "depends_on": {"macros": [], "nodes": []}, "config": {"enabled": true, "alias": "apr_drg", "schema": "terminology", "database": null, "tags": ["terminology", "data_profiling"], "meta": {}, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"apr_drg_code": "varchar", "severity": "varchar", "apr_drg_description": "varchar"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#460d4f"}, "quote_columns": null, "post-hook": [], "pre-hook": []}, "database": "dev_sarah", "schema": "terminology", "fqn": ["the_tuva_project", "terminology", "terminology__apr_drg"], "unique_id": "seed.the_tuva_project.terminology__apr_drg", "raw_code": "", "language": "sql", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/the_tuva_project", "path": "terminology/terminology__apr_drg.csv", "original_file_path": "seeds/terminology/terminology__apr_drg.csv", "name": "terminology__apr_drg", "alias": "apr_drg", "checksum": {"name": "sha256", "checksum": "94501c652f60afe149c260de5366ee6b588101871a639f980fc9e04d28e443b3"}, "tags": ["terminology", "data_profiling"], "refs": [], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#460d4f"}, "patch_path": "the_tuva_project://seeds/terminology/terminology_seeds.yml", "compiled_path": null, "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": 1701215340.422462}, "seed.the_tuva_project.terminology__icd_10_pcs": {"resource_type": "seed", "depends_on": {"macros": ["macro.the_tuva_project.load_seed"], "nodes": []}, "config": {"enabled": true, "alias": "icd_10_pcs", "schema": "terminology", "database": null, "tags": ["terminology", "claims_preprocessing", "readmissions"], "meta": {}, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"icd_10_pcs": "varchar", "description": "varchar"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#460d4f"}, "quote_columns": null, "post-hook": [{"sql": "{{ load_seed('tuva-public-resources/terminology','icd_10_pcs.csv',compression=true,null_marker=true) }}", "transaction": true, "index": null}], "pre-hook": []}, "database": "dev_sarah", "schema": "terminology", "fqn": ["the_tuva_project", "terminology", "terminology__icd_10_pcs"], "unique_id": "seed.the_tuva_project.terminology__icd_10_pcs", "raw_code": "", "language": "sql", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/the_tuva_project", "path": "terminology/terminology__icd_10_pcs.csv", "original_file_path": "seeds/terminology/terminology__icd_10_pcs.csv", "name": "terminology__icd_10_pcs", "alias": "icd_10_pcs", "checksum": {"name": "sha256", "checksum": "a9b6e92f3a466f9a20d9fc7bc43bcec893a6f5139d9c8a93f7d4c40ffb48f289"}, "tags": ["terminology", "claims_preprocessing", "readmissions"], "refs": [], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#460d4f"}, "patch_path": "the_tuva_project://seeds/terminology/terminology_seeds.yml", "compiled_path": null, "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": 1701215340.341136}, "seed.the_tuva_project.terminology__code_type": {"resource_type": "seed", "depends_on": {"macros": [], "nodes": []}, "config": {"enabled": true, "alias": "code_type", "schema": "terminology", "database": null, "tags": ["terminology", "data_profiling"], "meta": {}, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"description": "varchar"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#460d4f"}, "quote_columns": null, "post-hook": [], "pre-hook": []}, "database": "dev_sarah", "schema": "terminology", "fqn": ["the_tuva_project", "terminology", "terminology__code_type"], "unique_id": "seed.the_tuva_project.terminology__code_type", "raw_code": "", "language": "sql", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/the_tuva_project", "path": "terminology/terminology__code_type.csv", "original_file_path": "seeds/terminology/terminology__code_type.csv", "name": "terminology__code_type", "alias": "code_type", "checksum": {"name": "sha256", "checksum": "5fe9aa562e036ca6f98866fe29d85c1f2351f53d00fdde631ad8dce183ce5788"}, "tags": ["terminology", "data_profiling"], "refs": [], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#460d4f"}, "patch_path": "the_tuva_project://seeds/terminology/terminology_seeds.yml", "compiled_path": null, "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": 1701215340.31395}, "seed.the_tuva_project.terminology__medicare_dual_eligibility": {"resource_type": "seed", "depends_on": {"macros": [], "nodes": []}, "config": {"enabled": true, "alias": "medicare_dual_eligibility", "schema": "terminology", "database": null, "tags": ["terminology", "claims_preprocessing", "data_profiling"], "meta": {}, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"dual_status_code": "varchar", "dual_status_description": "varchar"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#460d4f"}, "quote_columns": null, "post-hook": [], "pre-hook": []}, "database": "dev_sarah", "schema": "terminology", "fqn": ["the_tuva_project", "terminology", "terminology__medicare_dual_eligibility"], "unique_id": "seed.the_tuva_project.terminology__medicare_dual_eligibility", "raw_code": "", "language": "sql", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/the_tuva_project", "path": "terminology/terminology__medicare_dual_eligibility.csv", "original_file_path": "seeds/terminology/terminology__medicare_dual_eligibility.csv", "name": "terminology__medicare_dual_eligibility", "alias": "medicare_dual_eligibility", "checksum": {"name": "sha256", "checksum": "e7fbf770fe2201cc1c256fa1dfd04d9edb053a34a9409293a0e76f0efcadbe97"}, "tags": ["terminology", "claims_preprocessing", "data_profiling"], "refs": [], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#460d4f"}, "patch_path": "the_tuva_project://seeds/terminology/terminology_seeds.yml", "compiled_path": null, "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": 1701215340.3765619}, "seed.the_tuva_project.terminology__bill_type": {"resource_type": "seed", "depends_on": {"macros": [], "nodes": []}, "config": {"enabled": true, "alias": "bill_type", "schema": "terminology", "database": null, "tags": ["terminology", "data_profiling"], "meta": {}, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"bill_type_code": "varchar", "bill_type_description": "varchar", "deprecated": "integer", "deprecated_date": "date"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#460d4f"}, "quote_columns": null, "post-hook": [], "pre-hook": []}, "database": "dev_sarah", "schema": "terminology", "fqn": ["the_tuva_project", "terminology", "terminology__bill_type"], "unique_id": "seed.the_tuva_project.terminology__bill_type", "raw_code": "", "language": "sql", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/the_tuva_project", "path": "terminology/terminology__bill_type.csv", "original_file_path": "seeds/terminology/terminology__bill_type.csv", "name": "terminology__bill_type", "alias": "bill_type", "checksum": {"name": "sha256", "checksum": "8b363106ed8e54488d71b8f4ccfca6e371692e836ef77b335621df6bf63b9a8a"}, "tags": ["terminology", "data_profiling"], "refs": [], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#460d4f"}, "patch_path": "the_tuva_project://seeds/terminology/terminology_seeds.yml", "compiled_path": null, "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": 1701215340.3031628}, "seed.the_tuva_project.terminology__loinc": {"resource_type": "seed", "depends_on": {"macros": ["macro.the_tuva_project.load_seed"], "nodes": []}, "config": {"enabled": true, "alias": "loinc", "schema": "terminology", "database": null, "tags": ["terminology"], "meta": {}, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"loinc": "varchar", "short_name": "varchar", "long_common_name": "varchar", "component": "varchar", "property": "varchar", "time_aspect": "varchar", "system": "varchar", "scale_type": "varchar", "method_type": "varchar", "class_code": "varchar", "class_description": "varchar", "class_type_code": "varchar", "class_type_description": "varchar", "external_copyright_notice": "varchar(3000)", "status": "varchar", "version_first_released": "varchar", "version_last_changed": "varchar"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#460d4f"}, "quote_columns": null, "columns": [{"name": "loinc", "description": "The LOINC code"}, {"name": "short_name", "description": "If exists, the short human readable version of the LOINC description"}, {"name": "long_common_name", "description": "Clinician-friendly full loinc description"}, {"name": "component", "description": "The substance or entity being measured or observed. Also called the Analyte. The first of six loinc parts."}, {"name": "property", "description": "The characteristic or attribute of the analyte. The second of six loinc parts."}, {"name": "time_aspect", "description": "The interval of time over which an observation was made. The third of six loinc parts."}, {"name": "system", "description": "The thing upon which the observation was made. Also called specimen for laboratory tests. The fourth of six loinc parts."}, {"name": "scale_type", "description": "How the observation value is quantified or expressed (e.g. quantitative, ordinal, nominal, etc). The fifth of six loinc parts."}, {"name": "method_type", "description": "A high-level classification of how the observation was made. Optional; only needed when the technique affects the clinical interpretation of the results. The sixth of six loinc parts."}, {"name": "class_code", "description": "A code representing the general category of the loinc term"}, {"name": "class_description", "description": "The general category of the LOINC term"}, {"name": "class_type_code", "description": "A code representing the top level category for the test"}, {"name": "class_type_description", "description": "The top level category for the test; Laboratory, Clincal, Claims attachments, or Surveys"}, {"name": "external_copyright_notice", "description": "External copyright holders copyright notice for this LOINC code"}, {"name": "status", "description": "The status of the LOINC code concept. Active, Trial (experimental), Discouraged (not recommended), or Deprecated (should not be used)"}, {"name": "version_first_released", "description": "The first release version of LOINC that included this code"}, {"name": "version_last_changed", "description": "The last LOINC version in which this record was changed"}], "post-hook": [{"sql": "{{ load_seed('tuva-public-resources/terminology','loinc.csv',compression=true,null_marker=true) }}", "transaction": true, "index": null}], "pre-hook": []}, "database": "dev_sarah", "schema": "terminology", "fqn": ["the_tuva_project", "terminology", "terminology__loinc"], "unique_id": "seed.the_tuva_project.terminology__loinc", "raw_code": "", "language": "sql", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/the_tuva_project", "path": "terminology/terminology__loinc.csv", "original_file_path": "seeds/terminology/terminology__loinc.csv", "name": "terminology__loinc", "alias": "loinc", "checksum": {"name": "sha256", "checksum": "374101e8b4e4fd5038c5bcae0dca2e5fcf2992883068619e2cbadad7ea3a8e7b"}, "tags": ["terminology"], "refs": [], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#460d4f"}, "patch_path": "the_tuva_project://seeds/terminology/terminology_seeds.yml", "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"post-hook": "{{ load_seed('tuva-public-resources/terminology','loinc.csv',compression=true,null_marker=true) }}", "schema": "terminology", "alias": "loinc", "tags": ["terminology"], "columns": [{"name": "loinc", "description": "The LOINC code"}, {"name": "short_name", "description": "If exists, the short human readable version of the LOINC description"}, {"name": "long_common_name", "description": "Clinician-friendly full loinc description"}, {"name": "component", "description": "The substance or entity being measured or observed. Also called the Analyte. The first of six loinc parts."}, {"name": "property", "description": "The characteristic or attribute of the analyte. The second of six loinc parts."}, {"name": "time_aspect", "description": "The interval of time over which an observation was made. The third of six loinc parts."}, {"name": "system", "description": "The thing upon which the observation was made. Also called specimen for laboratory tests. The fourth of six loinc parts."}, {"name": "scale_type", "description": "How the observation value is quantified or expressed (e.g. quantitative, ordinal, nominal, etc). The fifth of six loinc parts."}, {"name": "method_type", "description": "A high-level classification of how the observation was made. Optional; only needed when the technique affects the clinical interpretation of the results. The sixth of six loinc parts."}, {"name": "class_code", "description": "A code representing the general category of the loinc term"}, {"name": "class_description", "description": "The general category of the LOINC term"}, {"name": "class_type_code", "description": "A code representing the top level category for the test"}, {"name": "class_type_description", "description": "The top level category for the test; Laboratory, Clincal, Claims attachments, or Surveys"}, {"name": "external_copyright_notice", "description": "External copyright holders copyright notice for this LOINC code"}, {"name": "status", "description": "The status of the LOINC code concept. Active, Trial (experimental), Discouraged (not recommended), or Deprecated (should not be used)"}, {"name": "version_first_released", "description": "The first release version of LOINC that included this code"}, {"name": "version_last_changed", "description": "The last LOINC version in which this record was changed"}], "column_types": {"loinc": "varchar", "short_name": "varchar", "long_common_name": "varchar", "component": "varchar", "property": "varchar", "time_aspect": "varchar", "system": "varchar", "scale_type": "varchar", "method_type": "varchar", "class_code": "varchar", "class_description": "varchar", "class_type_code": "varchar", "class_type_description": "varchar", "external_copyright_notice": "varchar(3000)", "status": "varchar", "version_first_released": "varchar", "version_last_changed": "varchar"}, "docs": {"node_color": "#460d4f"}}, "created_at": 1701215340.3628922}, "seed.the_tuva_project.data_profiling__test_catalog": {"resource_type": "seed", "depends_on": {"macros": [], "nodes": []}, "config": {"enabled": true, "alias": "_value_set_test_catalog", "schema": "claims_preprocessing", "database": null, "tags": ["data_profiling", "claims_preprocessing"], "meta": {}, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"source_table": "varchar", "test_category": "varchar", "test_name": "varchar", "medical_claim_type": "varchar"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#141161"}, "quote_columns": null, "post-hook": [], "pre-hook": []}, "database": "dev_sarah", "schema": "claims_preprocessing", "fqn": ["the_tuva_project", "value_sets", "data_profiling", "data_profiling__test_catalog"], "unique_id": "seed.the_tuva_project.data_profiling__test_catalog", "raw_code": "", "language": "sql", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/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", "name": "data_profiling__test_catalog", "alias": "_value_set_test_catalog", "checksum": {"name": "sha256", "checksum": "3864035f82f5449b90d4d3d65e01b147fa8888a7475ba9cbf7d5f040f15afddb"}, "tags": ["data_profiling", "claims_preprocessing"], "refs": [], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#141161"}, "patch_path": "the_tuva_project://seeds/value_sets/data_profiling/data_profiling__seeds.yml", "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_value_set_test_catalog", "tags": ["data_profiling", "claims_preprocessing"], "enabled": true, "column_types": {"source_table": "varchar", "test_category": "varchar", "test_name": "varchar", "medical_claim_type": "varchar"}, "docs": {"node_color": "#141161"}}, "created_at": 1701215340.426216}, "seed.the_tuva_project.service_category__service_categories": {"resource_type": "seed", "depends_on": {"macros": [], "nodes": []}, "config": {"enabled": true, "alias": "_value_set_service_categories", "schema": "claims_preprocessing", "database": null, "tags": ["service_category", "claims_preprocessing"], "meta": {}, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "quote_columns": null, "post-hook": [], "pre-hook": []}, "database": "dev_sarah", "schema": "claims_preprocessing", "fqn": ["the_tuva_project", "value_sets", "service_categories", "service_category__service_categories"], "unique_id": "seed.the_tuva_project.service_category__service_categories", "raw_code": "", "language": "sql", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/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", "name": "service_category__service_categories", "alias": "_value_set_service_categories", "checksum": {"name": "sha256", "checksum": "b7910d8215b5c32579dae7ee4f0093377703b1961f99a4b0a231090bb5b3da15"}, "tags": ["service_category", "claims_preprocessing"], "refs": [], "sources": [], "metrics": [], "description": "List of service categories and sub-categories", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://seeds/value_sets/service_categories/service_categories_seeds.yml", "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_value_set_service_categories", "tags": ["service_category", "claims_preprocessing"], "enabled": true}, "created_at": 1701215340.428842}, "seed.the_tuva_project.ed_classification__johnston_icd9": {"resource_type": "seed", "depends_on": {"macros": [], "nodes": []}, "config": {"enabled": true, "alias": "_value_set_johnston_icd9", "schema": "ed_classification", "database": null, "tags": ["ed_classification"], "meta": {}, "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}, "quote_columns": null, "post-hook": [], "pre-hook": []}, "database": "dev_sarah", "schema": "ed_classification", "fqn": ["the_tuva_project", "value_sets", "ed_classification", "ed_classification__johnston_icd9"], "unique_id": "seed.the_tuva_project.ed_classification__johnston_icd9", "raw_code": "", "language": "sql", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/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", "name": "ed_classification__johnston_icd9", "alias": "_value_set_johnston_icd9", "checksum": {"name": "sha256", "checksum": "761355cb2e9e5ced2d46e98ff354ba8e0f93efa08ed67fc366ac1078368d4da7"}, "tags": ["ed_classification"], "refs": [], "sources": [], "metrics": [], "description": "A probabilistic mapping of icd9 codes to ed classification categories", "columns": {"icd9": {"name": "icd9", "description": "", "meta": {}, "data_type": null, "quote": null, "tags": []}, "edcnnpa": {"name": "edcnnpa", "description": "", "meta": {}, "data_type": null, "quote": null, "tags": []}, "edcnpa": {"name": "edcnpa", "description": "", "meta": {}, "data_type": null, "quote": null, "tags": []}, "epct": {"name": "epct", "description": "", "meta": {}, "data_type": null, "quote": null, "tags": []}, "noner": {"name": "noner", "description": "", "meta": {}, "data_type": null, "quote": null, "tags": []}, "injury": {"name": "injury", "description": "", "meta": {}, "data_type": null, "quote": null, "tags": []}, "psych": {"name": "psych", "description": "", "meta": {}, "data_type": null, "quote": null, "tags": []}, "alcohol": {"name": "alcohol", "description": "", "meta": {}, "data_type": null, "quote": null, "tags": []}, "drug": {"name": "drug", "description": "", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://seeds/value_sets/ed_classification/ed_classification_seeds.yml", "compiled_path": null, "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": 1701215340.441633}, "seed.the_tuva_project.ed_classification__icd_10_cm_to_ccs": {"resource_type": "seed", "depends_on": {"macros": ["macro.the_tuva_project.load_seed"], "nodes": []}, "config": {"enabled": true, "alias": "_value_set_icd_10_cm_to_ccs", "schema": "ed_classification", "database": null, "tags": ["ed_classification"], "meta": {}, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"icd_10_cm": "varchar", "description": "varchar", "ccs_diagnosis_category": "varchar", "ccs_description": "varchar"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "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": []}, "database": "dev_sarah", "schema": "ed_classification", "fqn": ["the_tuva_project", "value_sets", "ed_classification", "ed_classification__icd_10_cm_to_ccs"], "unique_id": "seed.the_tuva_project.ed_classification__icd_10_cm_to_ccs", "raw_code": "", "language": "sql", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/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", "name": "ed_classification__icd_10_cm_to_ccs", "alias": "_value_set_icd_10_cm_to_ccs", "checksum": {"name": "sha256", "checksum": "2179b7310d7d12968dab5eed9efabf25e3a272c2e444e772e6c225b520c24236"}, "tags": ["ed_classification"], "refs": [], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://seeds/value_sets/ed_classification/ed_classification_seeds.yml", "compiled_path": null, "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": "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": 1701215340.4374511}, "seed.the_tuva_project.ed_classification__johnston_icd10": {"resource_type": "seed", "depends_on": {"macros": [], "nodes": []}, "config": {"enabled": true, "alias": "_value_set_johnston_icd10", "schema": "ed_classification", "database": null, "tags": ["ed_classification"], "meta": {}, "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}, "quote_columns": null, "post-hook": [], "pre-hook": []}, "database": "dev_sarah", "schema": "ed_classification", "fqn": ["the_tuva_project", "value_sets", "ed_classification", "ed_classification__johnston_icd10"], "unique_id": "seed.the_tuva_project.ed_classification__johnston_icd10", "raw_code": "", "language": "sql", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/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", "name": "ed_classification__johnston_icd10", "alias": "_value_set_johnston_icd10", "checksum": {"name": "path", "checksum": "seeds/value_sets/ed_classification/ed_classification__johnston_icd10.csv"}, "tags": ["ed_classification"], "refs": [], "sources": [], "metrics": [], "description": "A probabilistic mapping of icd9 codes to ed classification categories", "columns": {"icd10": {"name": "icd10", "description": "", "meta": {}, "data_type": null, "quote": null, "tags": []}, "edcnnpa": {"name": "edcnnpa", "description": "", "meta": {}, "data_type": null, "quote": null, "tags": []}, "edcnpa": {"name": "edcnpa", "description": "", "meta": {}, "data_type": null, "quote": null, "tags": []}, "epct": {"name": "epct", "description": "", "meta": {}, "data_type": null, "quote": null, "tags": []}, "noner": {"name": "noner", "description": "", "meta": {}, "data_type": null, "quote": null, "tags": []}, "injury": {"name": "injury", "description": "", "meta": {}, "data_type": null, "quote": null, "tags": []}, "psych": {"name": "psych", "description": "", "meta": {}, "data_type": null, "quote": null, "tags": []}, "alcohol": {"name": "alcohol", "description": "", "meta": {}, "data_type": null, "quote": null, "tags": []}, "drug": {"name": "drug", "description": "", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://seeds/value_sets/ed_classification/ed_classification_seeds.yml", "compiled_path": null, "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": 1701215340.4453928}, "seed.the_tuva_project.ed_classification__categories": {"resource_type": "seed", "depends_on": {"macros": [], "nodes": []}, "config": {"enabled": true, "alias": "_value_set_categories", "schema": "ed_classification", "database": null, "tags": ["ed_classification"], "meta": {}, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "quote_columns": null, "post-hook": [], "pre-hook": []}, "database": "dev_sarah", "schema": "ed_classification", "fqn": ["the_tuva_project", "value_sets", "ed_classification", "ed_classification__categories"], "unique_id": "seed.the_tuva_project.ed_classification__categories", "raw_code": "", "language": "sql", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/the_tuva_project", "path": "value_sets/ed_classification/ed_classification__categories.csv", "original_file_path": "seeds/value_sets/ed_classification/ed_classification__categories.csv", "name": "ed_classification__categories", "alias": "_value_set_categories", "checksum": {"name": "sha256", "checksum": "c66c612a2c9e77348a2ed2d58ec2271fe106ac932f6ae8b3fe918720c03b2795"}, "tags": ["ed_classification"], "refs": [], "sources": [], "metrics": [], "description": "A mapping of ED Classifications to human readable names", "columns": {"classification": {"name": "classification", "description": "code for classification", "meta": {}, "data_type": null, "quote": null, "tags": []}, "classification_name": {"name": "classification_name", "description": "human readable name for classification", "meta": {}, "data_type": null, "quote": null, "tags": []}, "classification_order": {"name": "classification_order", "description": "Sortable column that organizes the ED classes", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://seeds/value_sets/ed_classification/ed_classification_seeds.yml", "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"schema": "ed_classification", "alias": "_value_set_categories", "tags": "ed_classification", "enabled": true}, "created_at": 1701215340.4316669}, "seed.the_tuva_project.readmissions__potentially_planned_ccs_procedure_category": {"resource_type": "seed", "depends_on": {"macros": [], "nodes": []}, "config": {"enabled": true, "alias": "_value_set_potentially_planned_ccs_procedure_category", "schema": "readmissions", "database": null, "tags": ["readmissions"], "meta": {}, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"ccs_procedure_category": "varchar", "description": "varchar"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#161a7d"}, "quote_columns": null, "post-hook": [], "pre-hook": []}, "database": "dev_sarah", "schema": "readmissions", "fqn": ["the_tuva_project", "value_sets", "readmissions", "readmissions__potentially_planned_ccs_procedure_category"], "unique_id": "seed.the_tuva_project.readmissions__potentially_planned_ccs_procedure_category", "raw_code": "", "language": "sql", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/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", "name": "readmissions__potentially_planned_ccs_procedure_category", "alias": "_value_set_potentially_planned_ccs_procedure_category", "checksum": {"name": "sha256", "checksum": "7b9db975327ccef9eb004256f6dac2d16248422f0c189d1c79b19826f793afd5"}, "tags": ["readmissions"], "refs": [], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#161a7d"}, "patch_path": "the_tuva_project://seeds/value_sets/readmissions/readmissions_seeds.yml", "compiled_path": null, "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": 1701215340.476863}, "seed.the_tuva_project.readmissions__icd_10_cm_to_ccs": {"resource_type": "seed", "depends_on": {"macros": ["macro.the_tuva_project.load_seed"], "nodes": []}, "config": {"enabled": true, "alias": "_value_set_icd_10_cm_to_ccs", "schema": "readmissions", "database": null, "tags": ["readmissions"], "meta": {}, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"icd_10_cm": "varchar", "description": "varchar", "ccs_diagnosis_category": "varchar", "ccs_description": "varchar"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#161a7d"}, "quote_columns": null, "post-hook": [{"sql": "{{ load_seed('tuva-public-resources/value-sets','icd_10_cm_to_ccs.csv',compression=true,null_marker=true) }}", "transaction": true, "index": null}], "pre-hook": []}, "database": "dev_sarah", "schema": "readmissions", "fqn": ["the_tuva_project", "value_sets", "readmissions", "readmissions__icd_10_cm_to_ccs"], "unique_id": "seed.the_tuva_project.readmissions__icd_10_cm_to_ccs", "raw_code": "", "language": "sql", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/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", "name": "readmissions__icd_10_cm_to_ccs", "alias": "_value_set_icd_10_cm_to_ccs", "checksum": {"name": "sha256", "checksum": "4f60ea7457c3c868df672eed94da01a1ca7d25d551f230734a44dea070b258fe"}, "tags": ["readmissions"], "refs": [], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#161a7d"}, "patch_path": "the_tuva_project://seeds/value_sets/readmissions/readmissions_seeds.yml", "compiled_path": null, "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": 1701215340.468786}, "seed.the_tuva_project.readmissions__potentially_planned_icd_10_pcs": {"resource_type": "seed", "depends_on": {"macros": [], "nodes": []}, "config": {"enabled": true, "alias": "_value_set_potentially_planned_icd_10_pcs", "schema": "readmissions", "database": null, "tags": ["readmissions"], "meta": {}, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"icd_10_pcs": "varchar", "description": "varchar"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#161a7d"}, "quote_columns": null, "post-hook": [], "pre-hook": []}, "database": "dev_sarah", "schema": "readmissions", "fqn": ["the_tuva_project", "value_sets", "readmissions", "readmissions__potentially_planned_icd_10_pcs"], "unique_id": "seed.the_tuva_project.readmissions__potentially_planned_icd_10_pcs", "raw_code": "", "language": "sql", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/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", "name": "readmissions__potentially_planned_icd_10_pcs", "alias": "_value_set_potentially_planned_icd_10_pcs", "checksum": {"name": "sha256", "checksum": "d3b577c57486f9fa6d12cd8b7da4c54d8f2f6996d19d35ca169e5861f12c031f"}, "tags": ["readmissions"], "refs": [], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#161a7d"}, "patch_path": "the_tuva_project://seeds/value_sets/readmissions/readmissions_seeds.yml", "compiled_path": null, "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": 1701215340.479678}, "seed.the_tuva_project.readmissions__acute_diagnosis_ccs": {"resource_type": "seed", "depends_on": {"macros": [], "nodes": []}, "config": {"enabled": true, "alias": "_value_set_acute_diagnosis_ccs", "schema": "readmissions", "database": null, "tags": ["readmissions"], "meta": {}, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"ccs_diagnosis_category": "varchar", "description": "varchar"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#161a7d"}, "quote_columns": null, "post-hook": [], "pre-hook": []}, "database": "dev_sarah", "schema": "readmissions", "fqn": ["the_tuva_project", "value_sets", "readmissions", "readmissions__acute_diagnosis_ccs"], "unique_id": "seed.the_tuva_project.readmissions__acute_diagnosis_ccs", "raw_code": "", "language": "sql", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/the_tuva_project", "path": "value_sets/readmissions/readmissions__acute_diagnosis_ccs.csv", "original_file_path": "seeds/value_sets/readmissions/readmissions__acute_diagnosis_ccs.csv", "name": "readmissions__acute_diagnosis_ccs", "alias": "_value_set_acute_diagnosis_ccs", "checksum": {"name": "sha256", "checksum": "654779d4a8e08465f9037d8e544b7a4c96053a6daefaa6d7fe56496b31ef25e4"}, "tags": ["readmissions"], "refs": [], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#161a7d"}, "patch_path": "the_tuva_project://seeds/value_sets/readmissions/readmissions_seeds.yml", "compiled_path": null, "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": 1701215340.451664}, "seed.the_tuva_project.readmissions__specialty_cohort": {"resource_type": "seed", "depends_on": {"macros": [], "nodes": []}, "config": {"enabled": true, "alias": "_value_set_specialty_cohort", "schema": "readmissions", "database": null, "tags": ["readmissions"], "meta": {}, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"ccs": "varchar", "description": "varchar", "specialty_cohort": "varchar", "procedure_or_diagnosis": "varchar"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#161a7d"}, "quote_columns": null, "post-hook": [], "pre-hook": []}, "database": "dev_sarah", "schema": "readmissions", "fqn": ["the_tuva_project", "value_sets", "readmissions", "readmissions__specialty_cohort"], "unique_id": "seed.the_tuva_project.readmissions__specialty_cohort", "raw_code": "", "language": "sql", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/the_tuva_project", "path": "value_sets/readmissions/readmissions__specialty_cohort.csv", "original_file_path": "seeds/value_sets/readmissions/readmissions__specialty_cohort.csv", "name": "readmissions__specialty_cohort", "alias": "_value_set_specialty_cohort", "checksum": {"name": "sha256", "checksum": "f4c090fe63477ea354c6a36dd54816fe76cdead723bbb39aeeba640a319c6d8d"}, "tags": ["readmissions"], "refs": [], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#161a7d"}, "patch_path": "the_tuva_project://seeds/value_sets/readmissions/readmissions_seeds.yml", "compiled_path": null, "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": 1701215340.4833941}, "seed.the_tuva_project.readmissions__exclusion_ccs_diagnosis_category": {"resource_type": "seed", "depends_on": {"macros": [], "nodes": []}, "config": {"enabled": true, "alias": "_value_set_exclusion_ccs_diagnosis_category", "schema": "readmissions", "database": null, "tags": ["readmissions"], "meta": {}, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"ccs_diagnosis_category": "varchar", "description": "varchar", "exclusion_category": "varchar"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#161a7d"}, "quote_columns": null, "post-hook": [], "pre-hook": []}, "database": "dev_sarah", "schema": "readmissions", "fqn": ["the_tuva_project", "value_sets", "readmissions", "readmissions__exclusion_ccs_diagnosis_category"], "unique_id": "seed.the_tuva_project.readmissions__exclusion_ccs_diagnosis_category", "raw_code": "", "language": "sql", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/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", "name": "readmissions__exclusion_ccs_diagnosis_category", "alias": "_value_set_exclusion_ccs_diagnosis_category", "checksum": {"name": "sha256", "checksum": "4bacd904ef0767100c7371e367970c9b25139aae994d3b020ceee61a7aa1e0a7"}, "tags": ["readmissions"], "refs": [], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#161a7d"}, "patch_path": "the_tuva_project://seeds/value_sets/readmissions/readmissions_seeds.yml", "compiled_path": null, "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": 1701215340.463573}, "seed.the_tuva_project.readmissions__acute_diagnosis_icd_10_cm": {"resource_type": "seed", "depends_on": {"macros": [], "nodes": []}, "config": {"enabled": true, "alias": "_value_set_acute_diagnosis_icd_10_cm", "schema": "readmissions", "database": null, "tags": ["readmissions"], "meta": {}, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"icd_10_cm": "varchar", "description": "varchar"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#161a7d"}, "quote_columns": null, "post-hook": [], "pre-hook": []}, "database": "dev_sarah", "schema": "readmissions", "fqn": ["the_tuva_project", "value_sets", "readmissions", "readmissions__acute_diagnosis_icd_10_cm"], "unique_id": "seed.the_tuva_project.readmissions__acute_diagnosis_icd_10_cm", "raw_code": "", "language": "sql", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/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", "name": "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"}, "tags": ["readmissions"], "refs": [], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#161a7d"}, "patch_path": "the_tuva_project://seeds/value_sets/readmissions/readmissions_seeds.yml", "compiled_path": null, "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": 1701215340.454634}, "seed.the_tuva_project.readmissions__surgery_gynecology_cohort": {"resource_type": "seed", "depends_on": {"macros": [], "nodes": []}, "config": {"enabled": true, "alias": "_value_set_surgery_gynecology_cohort", "schema": "readmissions", "database": null, "tags": ["readmissions"], "meta": {}, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"icd_10_pcs": "varchar", "description": "varchar", "ccs_code_and_description": "varchar", "specialty_cohort": "varchar"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#161a7d"}, "quote_columns": null, "post-hook": [], "pre-hook": []}, "database": "dev_sarah", "schema": "readmissions", "fqn": ["the_tuva_project", "value_sets", "readmissions", "readmissions__surgery_gynecology_cohort"], "unique_id": "seed.the_tuva_project.readmissions__surgery_gynecology_cohort", "raw_code": "", "language": "sql", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/the_tuva_project", "path": "value_sets/readmissions/readmissions__surgery_gynecology_cohort.csv", "original_file_path": "seeds/value_sets/readmissions/readmissions__surgery_gynecology_cohort.csv", "name": "readmissions__surgery_gynecology_cohort", "alias": "_value_set_surgery_gynecology_cohort", "checksum": {"name": "sha256", "checksum": "aebcfa4c5a82d3af091d8d223b26ca9349da581228f32f0d59a7754343199a58"}, "tags": ["readmissions"], "refs": [], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#161a7d"}, "patch_path": "the_tuva_project://seeds/value_sets/readmissions/readmissions_seeds.yml", "compiled_path": null, "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": 1701215340.487328}, "seed.the_tuva_project.readmissions__always_planned_ccs_procedure_category": {"resource_type": "seed", "depends_on": {"macros": [], "nodes": []}, "config": {"enabled": true, "alias": "_value_set_always_planned_ccs_procedure_category", "schema": "readmissions", "database": null, "tags": ["readmissions"], "meta": {}, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"ccs_procedure_category": "varchar", "description": "varchar"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#161a7d"}, "quote_columns": null, "post-hook": [], "pre-hook": []}, "database": "dev_sarah", "schema": "readmissions", "fqn": ["the_tuva_project", "value_sets", "readmissions", "readmissions__always_planned_ccs_procedure_category"], "unique_id": "seed.the_tuva_project.readmissions__always_planned_ccs_procedure_category", "raw_code": "", "language": "sql", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/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", "name": "readmissions__always_planned_ccs_procedure_category", "alias": "_value_set_always_planned_ccs_procedure_category", "checksum": {"name": "sha256", "checksum": "af9918830532c9dd37924853c29502d8c9f14bbb1a380de74cfcc740b0ba48b7"}, "tags": ["readmissions"], "refs": [], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#161a7d"}, "patch_path": "the_tuva_project://seeds/value_sets/readmissions/readmissions_seeds.yml", "compiled_path": null, "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": 1701215340.4603462}, "seed.the_tuva_project.readmissions__icd_10_pcs_to_ccs": {"resource_type": "seed", "depends_on": {"macros": ["macro.the_tuva_project.load_seed"], "nodes": []}, "config": {"enabled": true, "alias": "_value_set_icd_10_pcs_to_ccs", "schema": "readmissions", "database": null, "tags": ["readmissions"], "meta": {}, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"icd_10_pcs": "varchar", "description": "varchar", "ccs_procedure_category": "varchar", "ccs_description": "varchar"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#161a7d"}, "quote_columns": null, "post-hook": [{"sql": "{{ load_seed('tuva-public-resources/value-sets','icd_10_pcs_to_ccs.csv',compression=true,null_marker=true) }}", "transaction": true, "index": null}], "pre-hook": []}, "database": "dev_sarah", "schema": "readmissions", "fqn": ["the_tuva_project", "value_sets", "readmissions", "readmissions__icd_10_pcs_to_ccs"], "unique_id": "seed.the_tuva_project.readmissions__icd_10_pcs_to_ccs", "raw_code": "", "language": "sql", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/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", "name": "readmissions__icd_10_pcs_to_ccs", "alias": "_value_set_icd_10_pcs_to_ccs", "checksum": {"name": "sha256", "checksum": "b152259e1a13057a37cf15ae765f61c7c9559340b5469fa93909ad910929fd0e"}, "tags": ["readmissions"], "refs": [], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#161a7d"}, "patch_path": "the_tuva_project://seeds/value_sets/readmissions/readmissions_seeds.yml", "compiled_path": null, "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": 1701215340.473919}, "seed.the_tuva_project.readmissions__always_planned_ccs_diagnosis_category": {"resource_type": "seed", "depends_on": {"macros": [], "nodes": []}, "config": {"enabled": true, "alias": "_value_set_always_planned_ccs_diagnosis_category", "schema": "readmissions", "database": null, "tags": ["readmissions"], "meta": {}, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"ccs_diagnosis_category": "varchar", "description": "varchar"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#161a7d"}, "quote_columns": null, "post-hook": [], "pre-hook": []}, "database": "dev_sarah", "schema": "readmissions", "fqn": ["the_tuva_project", "value_sets", "readmissions", "readmissions__always_planned_ccs_diagnosis_category"], "unique_id": "seed.the_tuva_project.readmissions__always_planned_ccs_diagnosis_category", "raw_code": "", "language": "sql", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/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", "name": "readmissions__always_planned_ccs_diagnosis_category", "alias": "_value_set_always_planned_ccs_diagnosis_category", "checksum": {"name": "sha256", "checksum": "3ec5bc59c274f64708e2b16e9eff3db72230522289dd3f21567956d2070b3be2"}, "tags": ["readmissions"], "refs": [], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#161a7d"}, "patch_path": "the_tuva_project://seeds/value_sets/readmissions/readmissions_seeds.yml", "compiled_path": null, "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": 1701215340.4574158}, "seed.the_tuva_project.cms_hcc__disabled_interaction_factors": {"resource_type": "seed", "depends_on": {"macros": [], "nodes": []}, "config": {"enabled": true, "alias": "_value_set_disabled_interaction_factors", "schema": "cms_hcc", "database": null, "tags": ["cms_hcc"], "meta": {}, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"hcc_code": "varchar", "coefficient": "float"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "quote_columns": null, "post-hook": [], "pre-hook": []}, "database": "dev_sarah", "schema": "cms_hcc", "fqn": ["the_tuva_project", "value_sets", "cms_hcc", "cms_hcc__disabled_interaction_factors"], "unique_id": "seed.the_tuva_project.cms_hcc__disabled_interaction_factors", "raw_code": "", "language": "sql", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/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", "name": "cms_hcc__disabled_interaction_factors", "alias": "_value_set_disabled_interaction_factors", "checksum": {"name": "sha256", "checksum": "757502fc0be72f9b65adb6e58de6bc46332a1f46730b4cd586759665cc47162d"}, "tags": ["cms_hcc"], "refs": [], "sources": [], "metrics": [], "description": "Disease and disabled interaction factors by model version and risk segment. Extracted from rate announcement documents on cms.gov.\n", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://seeds/value_sets/cms_hcc/cms_hcc_seeds.yml", "compiled_path": null, "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": 1701215340.497002}, "seed.the_tuva_project.cms_hcc__disease_hierarchy": {"resource_type": "seed", "depends_on": {"macros": [], "nodes": []}, "config": {"enabled": true, "alias": "_value_set_disease_hierarchy", "schema": "cms_hcc", "database": null, "tags": ["cms_hcc"], "meta": {}, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"hcc_code": "varchar", "hccs_to_exclude": "varchar"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "quote_columns": null, "post-hook": [], "pre-hook": []}, "database": "dev_sarah", "schema": "cms_hcc", "fqn": ["the_tuva_project", "value_sets", "cms_hcc", "cms_hcc__disease_hierarchy"], "unique_id": "seed.the_tuva_project.cms_hcc__disease_hierarchy", "raw_code": "", "language": "sql", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/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", "name": "cms_hcc__disease_hierarchy", "alias": "_value_set_disease_hierarchy", "checksum": {"name": "sha256", "checksum": "0b15c71ea485269e3a2d833c3e651678e3d554596d7abcbe75f8c3e169b71191"}, "tags": ["cms_hcc"], "refs": [], "sources": [], "metrics": [], "description": "Disease hierarchies by model version. Extracted from rate announcement documents on cms.gov.\n", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://seeds/value_sets/cms_hcc/cms_hcc_seeds.yml", "compiled_path": null, "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": 1701215340.502421}, "seed.the_tuva_project.cms_hcc__icd_10_cm_mappings": {"resource_type": "seed", "depends_on": {"macros": [], "nodes": []}, "config": {"enabled": true, "alias": "_value_set_icd_10_cm_mappings", "schema": "cms_hcc", "database": null, "tags": ["cms_hcc"], "meta": {}, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"payment_year": "integer", "diagnosis_code": "varchar", "cms_hcc_v24": "varchar", "cms_hcc_v24_flag": "varchar"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "quote_columns": null, "post-hook": [], "pre-hook": []}, "database": "dev_sarah", "schema": "cms_hcc", "fqn": ["the_tuva_project", "value_sets", "cms_hcc", "cms_hcc__icd_10_cm_mappings"], "unique_id": "seed.the_tuva_project.cms_hcc__icd_10_cm_mappings", "raw_code": "", "language": "sql", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/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", "name": "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"}, "tags": ["cms_hcc"], "refs": [], "sources": [], "metrics": [], "description": "ICD-10 to HCC mapping by payment year and model version. Combined and cleaned version of code files on cms.gov.\n", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://seeds/value_sets/cms_hcc/cms_hcc_seeds.yml", "compiled_path": null, "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": 1701215340.510793}, "seed.the_tuva_project.cms_hcc__disease_factors": {"resource_type": "seed", "depends_on": {"macros": [], "nodes": []}, "config": {"enabled": true, "alias": "_value_set_disease_factors", "schema": "cms_hcc", "database": null, "tags": ["cms_hcc"], "meta": {}, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"hcc_code": "varchar", "coefficient": "float"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "quote_columns": null, "post-hook": [], "pre-hook": []}, "database": "dev_sarah", "schema": "cms_hcc", "fqn": ["the_tuva_project", "value_sets", "cms_hcc", "cms_hcc__disease_factors"], "unique_id": "seed.the_tuva_project.cms_hcc__disease_factors", "raw_code": "", "language": "sql", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/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", "name": "cms_hcc__disease_factors", "alias": "_value_set_disease_factors", "checksum": {"name": "sha256", "checksum": "60df59ceb99dacdbc8b05c418424b6a266bb7919f90f39c52f960c605276cc0a"}, "tags": ["cms_hcc"], "refs": [], "sources": [], "metrics": [], "description": "Disease factors by model version and risk segment. Extracted from rate announcement documents on cms.gov.\n", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://seeds/value_sets/cms_hcc/cms_hcc_seeds.yml", "compiled_path": null, "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": 1701215340.499489}, "seed.the_tuva_project.cms_hcc__disease_interaction_factors": {"resource_type": "seed", "depends_on": {"macros": [], "nodes": []}, "config": {"enabled": true, "alias": "_value_set_disease_interaction_factors", "schema": "cms_hcc", "database": null, "tags": ["cms_hcc"], "meta": {}, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"hcc_code_1": "varchar", "hcc_code_2": "varchar", "coefficient": "float"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "quote_columns": null, "post-hook": [], "pre-hook": []}, "database": "dev_sarah", "schema": "cms_hcc", "fqn": ["the_tuva_project", "value_sets", "cms_hcc", "cms_hcc__disease_interaction_factors"], "unique_id": "seed.the_tuva_project.cms_hcc__disease_interaction_factors", "raw_code": "", "language": "sql", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/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", "name": "cms_hcc__disease_interaction_factors", "alias": "_value_set_disease_interaction_factors", "checksum": {"name": "sha256", "checksum": "2a846d76ff9ac6f97b15da6b0082cc6e5ee8b06dd84fa35c5e14ae977c7f1881"}, "tags": ["cms_hcc"], "refs": [], "sources": [], "metrics": [], "description": "Disease interaction factors by model version and risk segment. Extracted from rate announcement documents on cms.gov.\n", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://seeds/value_sets/cms_hcc/cms_hcc_seeds.yml", "compiled_path": null, "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": 1701215340.5053818}, "seed.the_tuva_project.cms_hcc__cpt_hcpcs": {"resource_type": "seed", "depends_on": {"macros": [], "nodes": []}, "config": {"enabled": true, "alias": "_value_set_cpt_hcpcs", "schema": "cms_hcc", "database": null, "tags": ["cms_hcc"], "meta": {}, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"payment_year": "integer", "hcpcs_cpt_code": "varchar", "included_flag": "varchar"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "quote_columns": null, "post-hook": [], "pre-hook": []}, "database": "dev_sarah", "schema": "cms_hcc", "fqn": ["the_tuva_project", "value_sets", "cms_hcc", "cms_hcc__cpt_hcpcs"], "unique_id": "seed.the_tuva_project.cms_hcc__cpt_hcpcs", "raw_code": "", "language": "sql", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/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", "name": "cms_hcc__cpt_hcpcs", "alias": "_value_set_cpt_hcpcs", "checksum": {"name": "sha256", "checksum": "aca2760b1820c1f60170d5ee7bf046668d57124bb104a731d088c91929cb4eb0"}, "tags": ["cms_hcc"], "refs": [], "sources": [], "metrics": [], "description": "CPT/HCPCS encounter filtering included list by payment year. Combined and cleaned version of code files on cms.gov.\n", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://seeds/value_sets/cms_hcc/cms_hcc_seeds.yml", "compiled_path": null, "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": 1701215340.492407}, "seed.the_tuva_project.cms_hcc__adjustment_rates": {"resource_type": "seed", "depends_on": {"macros": [], "nodes": []}, "config": {"enabled": true, "alias": "_value_set_adjustment_rates", "schema": "cms_hcc", "database": null, "tags": ["cms_hcc"], "meta": {}, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"coefficient": "float"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "quote_columns": null, "post-hook": [], "pre-hook": []}, "database": "dev_sarah", "schema": "cms_hcc", "fqn": ["the_tuva_project", "value_sets", "cms_hcc", "cms_hcc__adjustment_rates"], "unique_id": "seed.the_tuva_project.cms_hcc__adjustment_rates", "raw_code": "", "language": "sql", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/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", "name": "cms_hcc__adjustment_rates", "alias": "_value_set_adjustment_rates", "checksum": {"name": "sha256", "checksum": "b04e9b46c651f17c76c76a61ae62c2502fd13bc48bc3841e64f1b42f53c98369"}, "tags": ["cms_hcc"], "refs": [], "sources": [], "metrics": [], "description": "Adjustment rates by payment year. Extracted from rate announcement documents on cms.gov.\n", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://seeds/value_sets/cms_hcc/cms_hcc_seeds.yml", "compiled_path": null, "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": 1701215340.489483}, "seed.the_tuva_project.cms_hcc__enrollment_interaction_factors": {"resource_type": "seed", "depends_on": {"macros": [], "nodes": []}, "config": {"enabled": true, "alias": "_value_set_enrollment_interaction_factors", "schema": "cms_hcc", "database": null, "tags": ["cms_hcc"], "meta": {}, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"coefficient": "float"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "quote_columns": null, "post-hook": [], "pre-hook": []}, "database": "dev_sarah", "schema": "cms_hcc", "fqn": ["the_tuva_project", "value_sets", "cms_hcc", "cms_hcc__enrollment_interaction_factors"], "unique_id": "seed.the_tuva_project.cms_hcc__enrollment_interaction_factors", "raw_code": "", "language": "sql", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/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", "name": "cms_hcc__enrollment_interaction_factors", "alias": "_value_set_enrollment_interaction_factors", "checksum": {"name": "sha256", "checksum": "ac4f859523a7a137c15906d056c934d587421dd46130b5af64da6f96090944af"}, "tags": ["cms_hcc"], "refs": [], "sources": [], "metrics": [], "description": "Enrollment interaction factors by model version and risk segment. Extracted from rate announcement documents on cms.gov.\n", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://seeds/value_sets/cms_hcc/cms_hcc_seeds.yml", "compiled_path": null, "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": 1701215340.507493}, "seed.the_tuva_project.cms_hcc__payment_hcc_count_factors": {"resource_type": "seed", "depends_on": {"macros": [], "nodes": []}, "config": {"enabled": true, "alias": "_value_set_payment_hcc_count_factors", "schema": "cms_hcc", "database": null, "tags": ["cms_hcc"], "meta": {}, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"coefficient": "float"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "quote_columns": null, "post-hook": [], "pre-hook": []}, "database": "dev_sarah", "schema": "cms_hcc", "fqn": ["the_tuva_project", "value_sets", "cms_hcc", "cms_hcc__payment_hcc_count_factors"], "unique_id": "seed.the_tuva_project.cms_hcc__payment_hcc_count_factors", "raw_code": "", "language": "sql", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/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", "name": "cms_hcc__payment_hcc_count_factors", "alias": "_value_set_payment_hcc_count_factors", "checksum": {"name": "sha256", "checksum": "5935ce8a101aa461274f5e2cc1e42a94c88651391ba8c7c7c39f40e8b9a28bbd"}, "tags": ["cms_hcc"], "refs": [], "sources": [], "metrics": [], "description": "Payment HCC count factors by model version and risk segment. Extracted from rate announcement documents on cms.gov.\n", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://seeds/value_sets/cms_hcc/cms_hcc_seeds.yml", "compiled_path": null, "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": 1701215340.512854}, "seed.the_tuva_project.cms_hcc__demographic_factors": {"resource_type": "seed", "depends_on": {"macros": [], "nodes": []}, "config": {"enabled": true, "alias": "_value_set_demographic_factors", "schema": "cms_hcc", "database": null, "tags": ["cms_hcc"], "meta": {}, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"coefficient": "float"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "quote_columns": null, "post-hook": [], "pre-hook": []}, "database": "dev_sarah", "schema": "cms_hcc", "fqn": ["the_tuva_project", "value_sets", "cms_hcc", "cms_hcc__demographic_factors"], "unique_id": "seed.the_tuva_project.cms_hcc__demographic_factors", "raw_code": "", "language": "sql", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/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", "name": "cms_hcc__demographic_factors", "alias": "_value_set_demographic_factors", "checksum": {"name": "sha256", "checksum": "f142060654f2f520ab61805f804b209ae498cb597f1db8749185cd5c52b9cee8"}, "tags": ["cms_hcc"], "refs": [], "sources": [], "metrics": [], "description": "Demographic factors by model version and risk segment. Extracted from rate announcement documents on cms.gov.\n", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://seeds/value_sets/cms_hcc/cms_hcc_seeds.yml", "compiled_path": null, "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": 1701215340.4944692}, "seed.the_tuva_project.quality_measures__value_sets": {"resource_type": "seed", "depends_on": {"macros": [], "nodes": []}, "config": {"enabled": true, "alias": "_value_set_codes", "schema": "quality_measures", "database": null, "tags": ["quality_measures"], "meta": {}, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"code": "varchar"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "quote_columns": null, "post-hook": [], "pre-hook": []}, "database": "dev_sarah", "schema": "quality_measures", "fqn": ["the_tuva_project", "value_sets", "quality_measures", "quality_measures__value_sets"], "unique_id": "seed.the_tuva_project.quality_measures__value_sets", "raw_code": "", "language": "sql", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/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", "name": "quality_measures__value_sets", "alias": "_value_set_codes", "checksum": {"name": "sha256", "checksum": "ccf04d2ac1f7304567f472688af5ea8eef9dfecc0b35e3504edbccb95e577286"}, "tags": ["quality_measures"], "refs": [], "sources": [], "metrics": [], "description": "Concepts to value sets crosswalk. List of codes in each concept.", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://seeds/value_sets/quality_measures/quality_measures_seeds.yml", "compiled_path": null, "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": 1701215340.520564}, "seed.the_tuva_project.quality_measures__measures": {"resource_type": "seed", "depends_on": {"macros": [], "nodes": []}, "config": {"enabled": true, "alias": "_value_set_measures", "schema": "quality_measures", "database": null, "tags": ["quality_measures"], "meta": {}, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "quote_columns": null, "post-hook": [], "pre-hook": []}, "database": "dev_sarah", "schema": "quality_measures", "fqn": ["the_tuva_project", "value_sets", "quality_measures", "quality_measures__measures"], "unique_id": "seed.the_tuva_project.quality_measures__measures", "raw_code": "", "language": "sql", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/the_tuva_project", "path": "value_sets/quality_measures/quality_measures__measures.csv", "original_file_path": "seeds/value_sets/quality_measures/quality_measures__measures.csv", "name": "quality_measures__measures", "alias": "_value_set_measures", "checksum": {"name": "sha256", "checksum": "0aa6c965d4abaffc195ed58d712cad699c23ded4467077c64c5ca3fd53854d9d"}, "tags": ["quality_measures"], "refs": [], "sources": [], "metrics": [], "description": "Overview of reporting measures.", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://seeds/value_sets/quality_measures/quality_measures_seeds.yml", "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"schema": "quality_measures", "alias": "_value_set_measures", "tags": "quality_measures", "enabled": true}, "created_at": 1701215340.514984}, "seed.the_tuva_project.quality_measures__concepts": {"resource_type": "seed", "depends_on": {"macros": [], "nodes": []}, "config": {"enabled": true, "alias": "_value_set_concepts", "schema": "quality_measures", "database": null, "tags": ["quality_measures"], "meta": {}, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "quote_columns": null, "post-hook": [], "pre-hook": []}, "database": "dev_sarah", "schema": "quality_measures", "fqn": ["the_tuva_project", "value_sets", "quality_measures", "quality_measures__concepts"], "unique_id": "seed.the_tuva_project.quality_measures__concepts", "raw_code": "", "language": "sql", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/the_tuva_project", "path": "value_sets/quality_measures/quality_measures__concepts.csv", "original_file_path": "seeds/value_sets/quality_measures/quality_measures__concepts.csv", "name": "quality_measures__concepts", "alias": "_value_set_concepts", "checksum": {"name": "sha256", "checksum": "b1e6ca83a550bd6b9735cba4f24c2bd0af33491e0e1f0338fd9a7fb2e6242372"}, "tags": ["quality_measures"], "refs": [], "sources": [], "metrics": [], "description": "Measures to concepts crosswalk. List of concepts used in each reporting measure.", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://seeds/value_sets/quality_measures/quality_measures_seeds.yml", "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"schema": "quality_measures", "alias": "_value_set_concepts", "tags": "quality_measures", "enabled": true}, "created_at": 1701215340.517014}, "seed.the_tuva_project.ccsr__dxccsr_v2023_1_cleaned_map": {"resource_type": "seed", "depends_on": {"macros": ["macro.the_tuva_project.load_seed"], "nodes": []}, "config": {"enabled": true, "alias": "_value_set_dxccsr_v2023_1_cleaned_map", "schema": "ccsr", "database": null, "tags": ["ccsr"], "meta": {}, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"icd_10_cm_code": "varchar", "icd_10_cm_code_description": "varchar", "default_ccsr_category_ip": "varchar", "default_ccsr_category_description_ip": "varchar", "default_ccsr_category_op": "varchar", "default_ccsr_category_description_op": "varchar", "ccsr_category_1": "varchar", "ccsr_category_1_description": "varchar", "ccsr_category_2": "varchar", "ccsr_category_2_description": "varchar", "ccsr_category_3": "varchar", "ccsr_category_3_description": "varchar", "ccsr_category_4": "varchar", "ccsr_category_4_description": "varchar", "ccsr_category_5": "varchar", "ccsr_category_5_description": "varchar", "ccsr_category_6": "varchar", "ccsr_category_6_description": "varchar"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "quote_columns": null, "post-hook": [{"sql": "{{ load_seed('tuva-public-resources/value-sets','dxccsr_v2023_1_cleaned_map.csv',compression=true,null_marker=true) }}", "transaction": true, "index": null}], "pre-hook": []}, "database": "dev_sarah", "schema": "ccsr", "fqn": ["the_tuva_project", "value_sets", "ccsr", "ccsr__dxccsr_v2023_1_cleaned_map"], "unique_id": "seed.the_tuva_project.ccsr__dxccsr_v2023_1_cleaned_map", "raw_code": "", "language": "sql", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/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", "name": "ccsr__dxccsr_v2023_1_cleaned_map", "alias": "_value_set_dxccsr_v2023_1_cleaned_map", "checksum": {"name": "sha256", "checksum": "cce1c4661615e89299e601fb26d3e3060b140864507858e5d0e8b61ea9b70c12"}, "tags": ["ccsr"], "refs": [], "sources": [], "metrics": [], "description": "A table containing the CSV mapping file included with the DXCCSR SAS program. The original CSV was not natively seedable, and the file was transformed with the coded included in the README. For each ICD-10-CM code, the table contains up to six CCSR category codes and a default CCSR category code.", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://seeds/value_sets/ccsr/ccsr_seeds.yml", "compiled_path": null, "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": 1701215340.531771}, "seed.the_tuva_project.ccsr__prccsr_v2023_1_cleaned_map": {"resource_type": "seed", "depends_on": {"macros": ["macro.the_tuva_project.load_seed"], "nodes": []}, "config": {"enabled": true, "alias": "_value_set_prccsr_v2023_1_cleaned_map", "schema": "ccsr", "database": null, "tags": ["ccsr"], "meta": {}, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"icd_10_pcs": "varchar", "icd_10_pcs_description": "varchar", "prccsr": "varchar", "prccsr_description": "varchar", "clinical_domain": "varchar"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "quote_columns": null, "post-hook": [{"sql": "{{ load_seed('tuva-public-resources/value-sets','prccsr_v2023_1_cleaned_map.csv',compression=true,null_marker=true) }}", "transaction": true, "index": null}], "pre-hook": []}, "database": "dev_sarah", "schema": "ccsr", "fqn": ["the_tuva_project", "value_sets", "ccsr", "ccsr__prccsr_v2023_1_cleaned_map"], "unique_id": "seed.the_tuva_project.ccsr__prccsr_v2023_1_cleaned_map", "raw_code": "", "language": "sql", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/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", "name": "ccsr__prccsr_v2023_1_cleaned_map", "alias": "_value_set_prccsr_v2023_1_cleaned_map", "checksum": {"name": "sha256", "checksum": "88f9e9588fa30ba312478b9dc9fab7c5e3530525e083539a604d559acd800dae"}, "tags": ["ccsr"], "refs": [], "sources": [], "metrics": [], "description": "A table containing the CSV mapping file included with the PRCCSR SAS program. The original CSV was not natively seedable, and the file was transformed with the coded included in the README.", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://seeds/value_sets/ccsr/ccsr_seeds.yml", "compiled_path": null, "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": 1701215340.538035}, "seed.the_tuva_project.ccsr__dxccsr_v2023_1_body_systems": {"resource_type": "seed", "depends_on": {"macros": [], "nodes": []}, "config": {"enabled": true, "alias": "_value_set_dxccsr_v2023_1_body_systems", "schema": "ccsr", "database": null, "tags": ["ccsr"], "meta": {}, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "quote_columns": null, "post-hook": [], "pre-hook": []}, "database": "dev_sarah", "schema": "ccsr", "fqn": ["the_tuva_project", "value_sets", "ccsr", "ccsr__dxccsr_v2023_1_body_systems"], "unique_id": "seed.the_tuva_project.ccsr__dxccsr_v2023_1_body_systems", "raw_code": "", "language": "sql", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/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", "name": "ccsr__dxccsr_v2023_1_body_systems", "alias": "_value_set_dxccsr_v2023_1_body_systems", "checksum": {"name": "sha256", "checksum": "dd8b64d00c38d7a99174fa8d2b6b82f2eae2b039e7ef0cd00da36d3233d6b326"}, "tags": ["ccsr"], "refs": [], "sources": [], "metrics": [], "description": "A table containing descriptions of the top level categories used in the CCSR condition mapper.\nThis was manually exctracted from the User Guide PDF included with the DXCCSR SAS program.\n", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://seeds/value_sets/ccsr/ccsr_seeds.yml", "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"schema": "ccsr", "alias": "_value_set_dxccsr_v2023_1_body_systems", "tags": ["ccsr"], "enabled": true}, "created_at": 1701215340.540378}, "seed.the_tuva_project.chronic_conditions__tuva_chronic_conditions_hierarchy": {"resource_type": "seed", "depends_on": {"macros": [], "nodes": []}, "config": {"enabled": true, "alias": "_value_set_tuva_chronic_conditions_hierarchy", "schema": "chronic_conditions", "database": null, "tags": ["tuva_chronic_conditions", "chronic_conditions"], "meta": {}, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#804912"}, "quote_columns": null, "post-hook": [], "pre-hook": []}, "database": "dev_sarah", "schema": "chronic_conditions", "fqn": ["the_tuva_project", "value_sets", "chronic_conditions", "chronic_conditions__tuva_chronic_conditions_hierarchy"], "unique_id": "seed.the_tuva_project.chronic_conditions__tuva_chronic_conditions_hierarchy", "raw_code": "", "language": "sql", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/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", "name": "chronic_conditions__tuva_chronic_conditions_hierarchy", "alias": "_value_set_tuva_chronic_conditions_hierarchy", "checksum": {"name": "sha256", "checksum": "15ce75a34050c084ac8f8cfa265f100db069114a3dd0f9a55c8db01150733453"}, "tags": ["tuva_chronic_conditions", "chronic_conditions"], "refs": [], "sources": [], "metrics": [], "description": "A list of the diagnoses codes and their long and short names along with grouping logic classifying each code into a condition group and a condition family group.", "columns": {"condition_family": {"name": "condition_family", "description": "A higher level rollup grouping of conditions from the condition column", "meta": {}, "data_type": null, "quote": null, "tags": []}, "condition": {"name": "condition", "description": "The name of the condition that each diagnosis code rolls up into", "meta": {}, "data_type": null, "quote": null, "tags": []}, "icd_10_cm_code": {"name": "icd_10_cm_code", "description": "The icd10 code", "meta": {}, "data_type": null, "quote": null, "tags": []}, "icd_10_cm_description": {"name": "icd_10_cm_description", "description": "The description for the icd10 code", "meta": {}, "data_type": null, "quote": null, "tags": []}, "condition_column_name": {"name": "condition_column_name", "description": "The name of the column as it will appear in chronic_conditions_wide", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": "#804912"}, "patch_path": "the_tuva_project://seeds/value_sets/chronic_conditions/tuva_chronic_conditions_seeds.yml", "compiled_path": null, "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": 1701215340.5444648}, "seed.the_tuva_project.chronic_conditions__cms_chronic_conditions_hierarchy": {"resource_type": "seed", "depends_on": {"macros": [], "nodes": []}, "config": {"enabled": true, "alias": "_value_set_cms_chronic_conditions_hierarchy", "schema": "chronic_conditions", "database": null, "tags": ["cms_chronic_conditions", "chronic_conditions"], "meta": {}, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#804912"}, "quote_columns": null, "post-hook": [], "pre-hook": []}, "database": "dev_sarah", "schema": "chronic_conditions", "fqn": ["the_tuva_project", "value_sets", "chronic_conditions", "chronic_conditions__cms_chronic_conditions_hierarchy"], "unique_id": "seed.the_tuva_project.chronic_conditions__cms_chronic_conditions_hierarchy", "raw_code": "", "language": "sql", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/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", "name": "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"}, "tags": ["cms_chronic_conditions", "chronic_conditions"], "refs": [], "sources": [], "metrics": [], "description": "CMS generated grouping of ICD 10 codes into chronic conditions groups", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#804912"}, "patch_path": "the_tuva_project://seeds/value_sets/chronic_conditions/cms_chronic_conditions_seeds.yml", "compiled_path": null, "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": 1701215340.547039}, "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}, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_unique"], "nodes": ["model.the_tuva_project.cms_hcc__patient_risk_scores"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dev_sarah", "schema": "dbt_test__audit", "fqn": ["the_tuva_project", "cms_hcc", "unique_cms_hcc__patient_risk_scores_patient_id"], "unique_id": "test.the_tuva_project.unique_cms_hcc__patient_risk_scores_patient_id.05b154e126", "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "language": "sql", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/the_tuva_project", "path": "unique_cms_hcc__patient_risk_scores_patient_id.sql", "original_file_path": "models/cms_hcc/cms_hcc_models.yml", "name": "unique_cms_hcc__patient_risk_scores_patient_id", "alias": "unique_cms_hcc__patient_risk_scores_patient_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["cms_hcc__patient_risk_scores"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1701215339.876694, "column_name": "patient_id", "file_key_name": "models.cms_hcc__patient_risk_scores"}, "test.the_tuva_project.unique_cms_hcc__int_demographic_factors_patient_id.1e7ac0d681": {"test_metadata": {"name": "unique", "kwargs": {"column_name": "patient_id", "model": "{{ get_where_subquery(ref('cms_hcc__int_demographic_factors')) }}"}, "namespace": null}, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_unique"], "nodes": ["model.the_tuva_project.cms_hcc__int_demographic_factors"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dev_sarah", "schema": "dbt_test__audit", "fqn": ["the_tuva_project", "cms_hcc", "unique_cms_hcc__int_demographic_factors_patient_id"], "unique_id": "test.the_tuva_project.unique_cms_hcc__int_demographic_factors_patient_id.1e7ac0d681", "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "language": "sql", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/the_tuva_project", "path": "unique_cms_hcc__int_demographic_factors_patient_id.sql", "original_file_path": "models/cms_hcc/cms_hcc_models.yml", "name": "unique_cms_hcc__int_demographic_factors_patient_id", "alias": "unique_cms_hcc__int_demographic_factors_patient_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["cms_hcc__int_demographic_factors"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1701215339.877504, "column_name": "patient_id", "file_key_name": "models.cms_hcc__int_demographic_factors"}, "test.the_tuva_project.not_null_cms_hcc__int_eligible_conditions_condition_code.e811a078bc": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "condition_code", "model": "{{ get_where_subquery(ref('cms_hcc__int_eligible_conditions')) }}"}, "namespace": null}, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.the_tuva_project.cms_hcc__int_eligible_conditions"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dev_sarah", "schema": "dbt_test__audit", "fqn": ["the_tuva_project", "cms_hcc", "not_null_cms_hcc__int_eligible_conditions_condition_code"], "unique_id": "test.the_tuva_project.not_null_cms_hcc__int_eligible_conditions_condition_code.e811a078bc", "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/the_tuva_project", "path": "not_null_cms_hcc__int_eligible_conditions_condition_code.sql", "original_file_path": "models/cms_hcc/cms_hcc_models.yml", "name": "not_null_cms_hcc__int_eligible_conditions_condition_code", "alias": "not_null_cms_hcc__int_eligible_conditions_condition_code", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["cms_hcc__int_eligible_conditions"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1701215339.878287, "column_name": "condition_code", "file_key_name": "models.cms_hcc__int_eligible_conditions"}, "test.the_tuva_project.not_null_cms_hcc__int_members_patient_id.75e528329b": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "patient_id", "model": "{{ get_where_subquery(ref('cms_hcc__int_members')) }}"}, "namespace": null}, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.the_tuva_project.cms_hcc__int_members"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dev_sarah", "schema": "dbt_test__audit", "fqn": ["the_tuva_project", "cms_hcc", "not_null_cms_hcc__int_members_patient_id"], "unique_id": "test.the_tuva_project.not_null_cms_hcc__int_members_patient_id.75e528329b", "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/the_tuva_project", "path": "not_null_cms_hcc__int_members_patient_id.sql", "original_file_path": "models/cms_hcc/cms_hcc_models.yml", "name": "not_null_cms_hcc__int_members_patient_id", "alias": "not_null_cms_hcc__int_members_patient_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["cms_hcc__int_members"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1701215339.879201, "column_name": "patient_id", "file_key_name": "models.cms_hcc__int_members"}, "test.the_tuva_project.unique_cms_hcc__int_members_patient_id.4d202f2bbb": {"test_metadata": {"name": "unique", "kwargs": {"column_name": "patient_id", "model": "{{ get_where_subquery(ref('cms_hcc__int_members')) }}"}, "namespace": null}, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_unique"], "nodes": ["model.the_tuva_project.cms_hcc__int_members"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dev_sarah", "schema": "dbt_test__audit", "fqn": ["the_tuva_project", "cms_hcc", "unique_cms_hcc__int_members_patient_id"], "unique_id": "test.the_tuva_project.unique_cms_hcc__int_members_patient_id.4d202f2bbb", "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "language": "sql", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/the_tuva_project", "path": "unique_cms_hcc__int_members_patient_id.sql", "original_file_path": "models/cms_hcc/cms_hcc_models.yml", "name": "unique_cms_hcc__int_members_patient_id", "alias": "unique_cms_hcc__int_members_patient_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["cms_hcc__int_members"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1701215339.879977, "column_name": "patient_id", "file_key_name": "models.cms_hcc__int_members"}, "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}, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.the_tuva_project.quality_measures__stg_core__condition"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "WARN", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dev_sarah", "schema": "dbt_test__audit", "fqn": ["the_tuva_project", "quality_measures", "not_null_quality_measures__stg_core__condition_patient_id"], "unique_id": "test.the_tuva_project.not_null_quality_measures__stg_core__condition_patient_id.1f1222e348", "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(severity=\"warn\") }}", "language": "sql", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/the_tuva_project", "path": "not_null_quality_measures__stg_core__condition_patient_id.sql", "original_file_path": "models/quality_measures/quality_measures_models.yml", "name": "not_null_quality_measures__stg_core__condition_patient_id", "alias": "not_null_quality_measures__stg_core__condition_patient_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["quality_measures__stg_core__condition"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"severity": "WARN"}, "created_at": 1701215340.145441, "column_name": "patient_id", "file_key_name": "models.quality_measures__stg_core__condition"}, "test.the_tuva_project.not_null_quality_measures__stg_core__encounter_patient_id.a0d82e2159": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "patient_id", "model": "{{ get_where_subquery(ref('quality_measures__stg_core__encounter')) }}"}, "namespace": null}, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.the_tuva_project.quality_measures__stg_core__encounter"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "WARN", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dev_sarah", "schema": "dbt_test__audit", "fqn": ["the_tuva_project", "quality_measures", "not_null_quality_measures__stg_core__encounter_patient_id"], "unique_id": "test.the_tuva_project.not_null_quality_measures__stg_core__encounter_patient_id.a0d82e2159", "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(severity=\"warn\") }}", "language": "sql", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/the_tuva_project", "path": "not_null_quality_measures__stg_core__encounter_patient_id.sql", "original_file_path": "models/quality_measures/quality_measures_models.yml", "name": "not_null_quality_measures__stg_core__encounter_patient_id", "alias": "not_null_quality_measures__stg_core__encounter_patient_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["quality_measures__stg_core__encounter"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"severity": "WARN"}, "created_at": 1701215340.146413, "column_name": "patient_id", "file_key_name": "models.quality_measures__stg_core__encounter"}, "test.the_tuva_project.not_null_quality_measures__stg_core__medication_patient_id.0aaf3a0652": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "patient_id", "model": "{{ get_where_subquery(ref('quality_measures__stg_core__medication')) }}"}, "namespace": null}, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.the_tuva_project.quality_measures__stg_core__medication"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "WARN", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dev_sarah", "schema": "dbt_test__audit", "fqn": ["the_tuva_project", "quality_measures", "not_null_quality_measures__stg_core__medication_patient_id"], "unique_id": "test.the_tuva_project.not_null_quality_measures__stg_core__medication_patient_id.0aaf3a0652", "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(severity=\"warn\") }}", "language": "sql", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/the_tuva_project", "path": "not_null_quality_measures__stg_core__medication_patient_id.sql", "original_file_path": "models/quality_measures/quality_measures_models.yml", "name": "not_null_quality_measures__stg_core__medication_patient_id", "alias": "not_null_quality_measures__stg_core__medication_patient_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["quality_measures__stg_core__medication"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"severity": "WARN"}, "created_at": 1701215340.1473541, "column_name": "patient_id", "file_key_name": "models.quality_measures__stg_core__medication"}, "test.the_tuva_project.not_null_quality_measures__stg_core__observation_patient_id.31e33f2d7e": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "patient_id", "model": "{{ get_where_subquery(ref('quality_measures__stg_core__observation')) }}"}, "namespace": null}, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.the_tuva_project.quality_measures__stg_core__observation"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "WARN", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dev_sarah", "schema": "dbt_test__audit", "fqn": ["the_tuva_project", "quality_measures", "not_null_quality_measures__stg_core__observation_patient_id"], "unique_id": "test.the_tuva_project.not_null_quality_measures__stg_core__observation_patient_id.31e33f2d7e", "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(severity=\"warn\") }}", "language": "sql", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/the_tuva_project", "path": "not_null_quality_measures__stg_core__observation_patient_id.sql", "original_file_path": "models/quality_measures/quality_measures_models.yml", "name": "not_null_quality_measures__stg_core__observation_patient_id", "alias": "not_null_quality_measures__stg_core__observation_patient_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["quality_measures__stg_core__observation"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"severity": "WARN"}, "created_at": 1701215340.148472, "column_name": "patient_id", "file_key_name": "models.quality_measures__stg_core__observation"}, "test.the_tuva_project.not_null_quality_measures__stg_core__patient_patient_id.5510e1a0fd": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "patient_id", "model": "{{ get_where_subquery(ref('quality_measures__stg_core__patient')) }}"}, "namespace": null}, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.the_tuva_project.quality_measures__stg_core__patient"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "WARN", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dev_sarah", "schema": "dbt_test__audit", "fqn": ["the_tuva_project", "quality_measures", "not_null_quality_measures__stg_core__patient_patient_id"], "unique_id": "test.the_tuva_project.not_null_quality_measures__stg_core__patient_patient_id.5510e1a0fd", "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(severity=\"warn\") }}", "language": "sql", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/the_tuva_project", "path": "not_null_quality_measures__stg_core__patient_patient_id.sql", "original_file_path": "models/quality_measures/quality_measures_models.yml", "name": "not_null_quality_measures__stg_core__patient_patient_id", "alias": "not_null_quality_measures__stg_core__patient_patient_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["quality_measures__stg_core__patient"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"severity": "WARN"}, "created_at": 1701215340.149416, "column_name": "patient_id", "file_key_name": "models.quality_measures__stg_core__patient"}, "test.the_tuva_project.not_null_quality_measures__stg_core__patient_sex.e2f34cab69": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "sex", "model": "{{ get_where_subquery(ref('quality_measures__stg_core__patient')) }}"}, "namespace": null}, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.the_tuva_project.quality_measures__stg_core__patient"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "WARN", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dev_sarah", "schema": "dbt_test__audit", "fqn": ["the_tuva_project", "quality_measures", "not_null_quality_measures__stg_core__patient_sex"], "unique_id": "test.the_tuva_project.not_null_quality_measures__stg_core__patient_sex.e2f34cab69", "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(severity=\"warn\") }}", "language": "sql", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/the_tuva_project", "path": "not_null_quality_measures__stg_core__patient_sex.sql", "original_file_path": "models/quality_measures/quality_measures_models.yml", "name": "not_null_quality_measures__stg_core__patient_sex", "alias": "not_null_quality_measures__stg_core__patient_sex", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["quality_measures__stg_core__patient"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"severity": "WARN"}, "created_at": 1701215340.150364, "column_name": "sex", "file_key_name": "models.quality_measures__stg_core__patient"}, "test.the_tuva_project.accepted_values_quality_measures__stg_core__patient_sex__female__male.47cbdf864b": {"test_metadata": {"name": "accepted_values", "kwargs": {"values": ["female", "male"], "column_name": "sex", "model": "{{ get_where_subquery(ref('quality_measures__stg_core__patient')) }}"}, "namespace": null}, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_accepted_values", "macro.dbt.get_where_subquery"], "nodes": ["model.the_tuva_project.quality_measures__stg_core__patient"]}, "config": {"enabled": true, "alias": "accepted_values_quality_measur_12782dbc4c931575c089a8978147a897", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "warn", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dev_sarah", "schema": "dbt_test__audit", "fqn": ["the_tuva_project", "quality_measures", "accepted_values_quality_measures__stg_core__patient_sex__female__male"], "unique_id": "test.the_tuva_project.accepted_values_quality_measures__stg_core__patient_sex__female__male.47cbdf864b", "raw_code": "{{ test_accepted_values(**_dbt_generic_test_kwargs) }}{{ config(severity=\"warn\",alias=\"accepted_values_quality_measur_12782dbc4c931575c089a8978147a897\") }}", "language": "sql", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/the_tuva_project", "path": "accepted_values_quality_measur_12782dbc4c931575c089a8978147a897.sql", "original_file_path": "models/quality_measures/quality_measures_models.yml", "name": "accepted_values_quality_measures__stg_core__patient_sex__female__male", "alias": "accepted_values_quality_measur_12782dbc4c931575c089a8978147a897", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["quality_measures__stg_core__patient"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"severity": "warn", "alias": "accepted_values_quality_measur_12782dbc4c931575c089a8978147a897"}, "created_at": 1701215340.151424, "column_name": "sex", "file_key_name": "models.quality_measures__stg_core__patient"}, "test.the_tuva_project.not_null_quality_measures__stg_core__patient_birth_date.4b3a2e74e6": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "birth_date", "model": "{{ get_where_subquery(ref('quality_measures__stg_core__patient')) }}"}, "namespace": null}, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.the_tuva_project.quality_measures__stg_core__patient"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "WARN", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dev_sarah", "schema": "dbt_test__audit", "fqn": ["the_tuva_project", "quality_measures", "not_null_quality_measures__stg_core__patient_birth_date"], "unique_id": "test.the_tuva_project.not_null_quality_measures__stg_core__patient_birth_date.4b3a2e74e6", "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(severity=\"warn\") }}", "language": "sql", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/the_tuva_project", "path": "not_null_quality_measures__stg_core__patient_birth_date.sql", "original_file_path": "models/quality_measures/quality_measures_models.yml", "name": "not_null_quality_measures__stg_core__patient_birth_date", "alias": "not_null_quality_measures__stg_core__patient_birth_date", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["quality_measures__stg_core__patient"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"severity": "WARN"}, "created_at": 1701215340.157726, "column_name": "birth_date", "file_key_name": "models.quality_measures__stg_core__patient"}, "test.the_tuva_project.not_null_quality_measures__stg_core__procedure_patient_id.0b52ff75d9": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "patient_id", "model": "{{ get_where_subquery(ref('quality_measures__stg_core__procedure')) }}"}, "namespace": null}, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.the_tuva_project.quality_measures__stg_core__procedure"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "WARN", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dev_sarah", "schema": "dbt_test__audit", "fqn": ["the_tuva_project", "quality_measures", "not_null_quality_measures__stg_core__procedure_patient_id"], "unique_id": "test.the_tuva_project.not_null_quality_measures__stg_core__procedure_patient_id.0b52ff75d9", "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(severity=\"warn\") }}", "language": "sql", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/the_tuva_project", "path": "not_null_quality_measures__stg_core__procedure_patient_id.sql", "original_file_path": "models/quality_measures/quality_measures_models.yml", "name": "not_null_quality_measures__stg_core__procedure_patient_id", "alias": "not_null_quality_measures__stg_core__procedure_patient_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["quality_measures__stg_core__procedure"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"severity": "WARN"}, "created_at": 1701215340.158689, "column_name": "patient_id", "file_key_name": "models.quality_measures__stg_core__procedure"}, "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}, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.the_tuva_project.ccsr__singular_condition_category"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "WARN", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dev_sarah", "schema": "dbt_test__audit", "fqn": ["the_tuva_project", "ccsr", "not_null_ccsr__singular_condition_category_claim_id"], "unique_id": "test.the_tuva_project.not_null_ccsr__singular_condition_category_claim_id.41e0e51ac8", "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(severity=\"warn\") }}", "language": "sql", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/the_tuva_project", "path": "not_null_ccsr__singular_condition_category_claim_id.sql", "original_file_path": "models/ccsr/ccsr_models.yml", "name": "not_null_ccsr__singular_condition_category_claim_id", "alias": "not_null_ccsr__singular_condition_category_claim_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["ccsr__singular_condition_category"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"severity": "WARN"}, "created_at": 1701215340.178766, "column_name": "claim_id", "file_key_name": "models.ccsr__singular_condition_category"}, "test.the_tuva_project.unique_ccsr__singular_condition_category_claim_id.21b76e504b": {"test_metadata": {"name": "unique", "kwargs": {"column_name": "claim_id", "model": "{{ get_where_subquery(ref('ccsr__singular_condition_category')) }}"}, "namespace": null}, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_unique"], "nodes": ["model.the_tuva_project.ccsr__singular_condition_category"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "WARN", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dev_sarah", "schema": "dbt_test__audit", "fqn": ["the_tuva_project", "ccsr", "unique_ccsr__singular_condition_category_claim_id"], "unique_id": "test.the_tuva_project.unique_ccsr__singular_condition_category_claim_id.21b76e504b", "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}{{ config(severity=\"warn\") }}", "language": "sql", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/the_tuva_project", "path": "unique_ccsr__singular_condition_category_claim_id.sql", "original_file_path": "models/ccsr/ccsr_models.yml", "name": "unique_ccsr__singular_condition_category_claim_id", "alias": "unique_ccsr__singular_condition_category_claim_id", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["ccsr__singular_condition_category"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"severity": "WARN"}, "created_at": 1701215340.1797462, "column_name": "claim_id", "file_key_name": "models.ccsr__singular_condition_category"}, "test.the_tuva_project.unique_financial_pmpm__pmpm_prep__patient_id___year_month___plan_.b941ddaf9e": {"test_metadata": {"name": "unique", "kwargs": {"column_name": "(patient_id || '_' || year_month || '_' || plan)", "model": "{{ get_where_subquery(ref('financial_pmpm__pmpm_prep')) }}"}, "namespace": null}, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_unique"], "nodes": ["model.the_tuva_project.financial_pmpm__pmpm_prep"]}, "config": {"enabled": true, "alias": "unique_financial_pmpm__pmpm_pr_c36fcd8dfb24026167eeab878c3dd5cf", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dev_sarah", "schema": "dbt_test__audit", "fqn": ["the_tuva_project", "financial_pmpm", "unique_financial_pmpm__pmpm_prep__patient_id___year_month___plan_"], "unique_id": "test.the_tuva_project.unique_financial_pmpm__pmpm_prep__patient_id___year_month___plan_.b941ddaf9e", "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}{{ config(alias=\"unique_financial_pmpm__pmpm_pr_c36fcd8dfb24026167eeab878c3dd5cf\") }}", "language": "sql", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/the_tuva_project", "path": "unique_financial_pmpm__pmpm_pr_c36fcd8dfb24026167eeab878c3dd5cf.sql", "original_file_path": "models/financial_pmpm/financial_pmpm_models.yml", "name": "unique_financial_pmpm__pmpm_prep__patient_id___year_month___plan_", "alias": "unique_financial_pmpm__pmpm_pr_c36fcd8dfb24026167eeab878c3dd5cf", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["financial_pmpm__pmpm_prep"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"alias": "unique_financial_pmpm__pmpm_pr_c36fcd8dfb24026167eeab878c3dd5cf"}, "created_at": 1701215340.214005, "column_name": null, "file_key_name": "models.financial_pmpm__pmpm_prep"}, "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}, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.the_tuva_project.chronic_conditions__cms_chronic_conditions_long"]}, "config": {"enabled": true, "alias": "not_null_chronic_conditions__c_49a2bb666f68dc10cb37814113581b53", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dev_sarah", "schema": "dbt_test__audit", "fqn": ["the_tuva_project", "chronic_conditions", "not_null_chronic_conditions__cms_chronic_conditions_long_patient_id"], "unique_id": "test.the_tuva_project.not_null_chronic_conditions__cms_chronic_conditions_long_patient_id.551c145c85", "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"not_null_chronic_conditions__c_49a2bb666f68dc10cb37814113581b53\") }}", "language": "sql", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/the_tuva_project", "path": "not_null_chronic_conditions__c_49a2bb666f68dc10cb37814113581b53.sql", "original_file_path": "models/chronic_conditions/cms_chronic_conditions_models.yml", "name": "not_null_chronic_conditions__cms_chronic_conditions_long_patient_id", "alias": "not_null_chronic_conditions__c_49a2bb666f68dc10cb37814113581b53", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["chronic_conditions__cms_chronic_conditions_long"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"alias": "not_null_chronic_conditions__c_49a2bb666f68dc10cb37814113581b53"}, "created_at": 1701215340.2581341, "column_name": "patient_id", "file_key_name": "models.chronic_conditions__cms_chronic_conditions_long"}, "test.the_tuva_project.not_null_chronic_conditions__cms_chronic_conditions_long_claim_id.74242d2abc": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "claim_id", "model": "{{ get_where_subquery(ref('chronic_conditions__cms_chronic_conditions_long')) }}"}, "namespace": null}, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.the_tuva_project.chronic_conditions__cms_chronic_conditions_long"]}, "config": {"enabled": true, "alias": "not_null_chronic_conditions__c_6cb109fc60fe56040c1e9a18e4e77fd4", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dev_sarah", "schema": "dbt_test__audit", "fqn": ["the_tuva_project", "chronic_conditions", "not_null_chronic_conditions__cms_chronic_conditions_long_claim_id"], "unique_id": "test.the_tuva_project.not_null_chronic_conditions__cms_chronic_conditions_long_claim_id.74242d2abc", "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"not_null_chronic_conditions__c_6cb109fc60fe56040c1e9a18e4e77fd4\") }}", "language": "sql", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/the_tuva_project", "path": "not_null_chronic_conditions__c_6cb109fc60fe56040c1e9a18e4e77fd4.sql", "original_file_path": "models/chronic_conditions/cms_chronic_conditions_models.yml", "name": "not_null_chronic_conditions__cms_chronic_conditions_long_claim_id", "alias": "not_null_chronic_conditions__c_6cb109fc60fe56040c1e9a18e4e77fd4", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["chronic_conditions__cms_chronic_conditions_long"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"alias": "not_null_chronic_conditions__c_6cb109fc60fe56040c1e9a18e4e77fd4"}, "created_at": 1701215340.258921, "column_name": "claim_id", "file_key_name": "models.chronic_conditions__cms_chronic_conditions_long"}, "test.the_tuva_project.not_null_chronic_conditions__cms_chronic_conditions_long_condition.e794460ae3": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "condition", "model": "{{ get_where_subquery(ref('chronic_conditions__cms_chronic_conditions_long')) }}"}, "namespace": null}, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.the_tuva_project.chronic_conditions__cms_chronic_conditions_long"]}, "config": {"enabled": true, "alias": "not_null_chronic_conditions__c_9ae72d56fe6849d0aacc73d604c5b0cf", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dev_sarah", "schema": "dbt_test__audit", "fqn": ["the_tuva_project", "chronic_conditions", "not_null_chronic_conditions__cms_chronic_conditions_long_condition"], "unique_id": "test.the_tuva_project.not_null_chronic_conditions__cms_chronic_conditions_long_condition.e794460ae3", "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"not_null_chronic_conditions__c_9ae72d56fe6849d0aacc73d604c5b0cf\") }}", "language": "sql", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/the_tuva_project", "path": "not_null_chronic_conditions__c_9ae72d56fe6849d0aacc73d604c5b0cf.sql", "original_file_path": "models/chronic_conditions/cms_chronic_conditions_models.yml", "name": "not_null_chronic_conditions__cms_chronic_conditions_long_condition", "alias": "not_null_chronic_conditions__c_9ae72d56fe6849d0aacc73d604c5b0cf", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["chronic_conditions__cms_chronic_conditions_long"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"alias": "not_null_chronic_conditions__c_9ae72d56fe6849d0aacc73d604c5b0cf"}, "created_at": 1701215340.259705, "column_name": "condition", "file_key_name": "models.chronic_conditions__cms_chronic_conditions_long"}, "test.the_tuva_project.unique_chronic_conditions__cms_chronic_conditions_long__patient_id_claim_id_start_date_condition_.fba1518320": {"test_metadata": {"name": "unique", "kwargs": {"column_name": "(patient_id || claim_id || start_date || condition)", "model": "{{ get_where_subquery(ref('chronic_conditions__cms_chronic_conditions_long')) }}"}, "namespace": null}, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_unique"], "nodes": ["model.the_tuva_project.chronic_conditions__cms_chronic_conditions_long"]}, "config": {"enabled": true, "alias": "unique_chronic_conditions__cms_a604d2d2a2cdd1e22a6855beff37d57b", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dev_sarah", "schema": "dbt_test__audit", "fqn": ["the_tuva_project", "chronic_conditions", "unique_chronic_conditions__cms_chronic_conditions_long__patient_id_claim_id_start_date_condition_"], "unique_id": "test.the_tuva_project.unique_chronic_conditions__cms_chronic_conditions_long__patient_id_claim_id_start_date_condition_.fba1518320", "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}{{ config(alias=\"unique_chronic_conditions__cms_a604d2d2a2cdd1e22a6855beff37d57b\") }}", "language": "sql", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/the_tuva_project", "path": "unique_chronic_conditions__cms_a604d2d2a2cdd1e22a6855beff37d57b.sql", "original_file_path": "models/chronic_conditions/cms_chronic_conditions_models.yml", "name": "unique_chronic_conditions__cms_chronic_conditions_long__patient_id_claim_id_start_date_condition_", "alias": "unique_chronic_conditions__cms_a604d2d2a2cdd1e22a6855beff37d57b", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["chronic_conditions__cms_chronic_conditions_long"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"alias": "unique_chronic_conditions__cms_a604d2d2a2cdd1e22a6855beff37d57b"}, "created_at": 1701215340.260609, "column_name": null, "file_key_name": "models.chronic_conditions__cms_chronic_conditions_long"}, "test.the_tuva_project.not_null_chronic_conditions__cms_chronic_conditions_all_patient_id.95fc066008": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "patient_id", "model": "{{ get_where_subquery(ref('chronic_conditions__cms_chronic_conditions_all')) }}"}, "namespace": null}, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.the_tuva_project.chronic_conditions__cms_chronic_conditions_all"]}, "config": {"enabled": true, "alias": "not_null_chronic_conditions__c_409ab6a82d1b97c996f87af7f330605c", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dev_sarah", "schema": "dbt_test__audit", "fqn": ["the_tuva_project", "chronic_conditions", "not_null_chronic_conditions__cms_chronic_conditions_all_patient_id"], "unique_id": "test.the_tuva_project.not_null_chronic_conditions__cms_chronic_conditions_all_patient_id.95fc066008", "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"not_null_chronic_conditions__c_409ab6a82d1b97c996f87af7f330605c\") }}", "language": "sql", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/the_tuva_project", "path": "not_null_chronic_conditions__c_409ab6a82d1b97c996f87af7f330605c.sql", "original_file_path": "models/chronic_conditions/cms_chronic_conditions_models.yml", "name": "not_null_chronic_conditions__cms_chronic_conditions_all_patient_id", "alias": "not_null_chronic_conditions__c_409ab6a82d1b97c996f87af7f330605c", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["chronic_conditions__cms_chronic_conditions_all"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"alias": "not_null_chronic_conditions__c_409ab6a82d1b97c996f87af7f330605c"}, "created_at": 1701215340.261394, "column_name": "patient_id", "file_key_name": "models.chronic_conditions__cms_chronic_conditions_all"}, "test.the_tuva_project.not_null_chronic_conditions__cms_chronic_conditions_all_claim_id.84015aec48": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "claim_id", "model": "{{ get_where_subquery(ref('chronic_conditions__cms_chronic_conditions_all')) }}"}, "namespace": null}, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.the_tuva_project.chronic_conditions__cms_chronic_conditions_all"]}, "config": {"enabled": true, "alias": "not_null_chronic_conditions__c_b541fb9d33a4f06d5fea55b9a24aa3a9", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dev_sarah", "schema": "dbt_test__audit", "fqn": ["the_tuva_project", "chronic_conditions", "not_null_chronic_conditions__cms_chronic_conditions_all_claim_id"], "unique_id": "test.the_tuva_project.not_null_chronic_conditions__cms_chronic_conditions_all_claim_id.84015aec48", "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"not_null_chronic_conditions__c_b541fb9d33a4f06d5fea55b9a24aa3a9\") }}", "language": "sql", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/the_tuva_project", "path": "not_null_chronic_conditions__c_b541fb9d33a4f06d5fea55b9a24aa3a9.sql", "original_file_path": "models/chronic_conditions/cms_chronic_conditions_models.yml", "name": "not_null_chronic_conditions__cms_chronic_conditions_all_claim_id", "alias": "not_null_chronic_conditions__c_b541fb9d33a4f06d5fea55b9a24aa3a9", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["chronic_conditions__cms_chronic_conditions_all"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"alias": "not_null_chronic_conditions__c_b541fb9d33a4f06d5fea55b9a24aa3a9"}, "created_at": 1701215340.262167, "column_name": "claim_id", "file_key_name": "models.chronic_conditions__cms_chronic_conditions_all"}, "test.the_tuva_project.not_null_chronic_conditions__cms_chronic_conditions_all_condition.bb780b4840": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "condition", "model": "{{ get_where_subquery(ref('chronic_conditions__cms_chronic_conditions_all')) }}"}, "namespace": null}, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.the_tuva_project.chronic_conditions__cms_chronic_conditions_all"]}, "config": {"enabled": true, "alias": "not_null_chronic_conditions__c_c4a0f280255574fa8bab0a3d8629b09c", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dev_sarah", "schema": "dbt_test__audit", "fqn": ["the_tuva_project", "chronic_conditions", "not_null_chronic_conditions__cms_chronic_conditions_all_condition"], "unique_id": "test.the_tuva_project.not_null_chronic_conditions__cms_chronic_conditions_all_condition.bb780b4840", "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"not_null_chronic_conditions__c_c4a0f280255574fa8bab0a3d8629b09c\") }}", "language": "sql", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/the_tuva_project", "path": "not_null_chronic_conditions__c_c4a0f280255574fa8bab0a3d8629b09c.sql", "original_file_path": "models/chronic_conditions/cms_chronic_conditions_models.yml", "name": "not_null_chronic_conditions__cms_chronic_conditions_all_condition", "alias": "not_null_chronic_conditions__c_c4a0f280255574fa8bab0a3d8629b09c", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["chronic_conditions__cms_chronic_conditions_all"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"alias": "not_null_chronic_conditions__c_c4a0f280255574fa8bab0a3d8629b09c"}, "created_at": 1701215340.262934, "column_name": "condition", "file_key_name": "models.chronic_conditions__cms_chronic_conditions_all"}, "test.the_tuva_project.not_null_chronic_conditions__cms_chronic_conditions_hiv_aids_patient_id.b6c58add4b": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "patient_id", "model": "{{ get_where_subquery(ref('chronic_conditions__cms_chronic_conditions_hiv_aids')) }}"}, "namespace": null}, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.the_tuva_project.chronic_conditions__cms_chronic_conditions_hiv_aids"]}, "config": {"enabled": true, "alias": "not_null_chronic_conditions__c_6da0dbac3eab9746301bed2ab3f2d52d", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dev_sarah", "schema": "dbt_test__audit", "fqn": ["the_tuva_project", "chronic_conditions", "not_null_chronic_conditions__cms_chronic_conditions_hiv_aids_patient_id"], "unique_id": "test.the_tuva_project.not_null_chronic_conditions__cms_chronic_conditions_hiv_aids_patient_id.b6c58add4b", "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"not_null_chronic_conditions__c_6da0dbac3eab9746301bed2ab3f2d52d\") }}", "language": "sql", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/the_tuva_project", "path": "not_null_chronic_conditions__c_6da0dbac3eab9746301bed2ab3f2d52d.sql", "original_file_path": "models/chronic_conditions/cms_chronic_conditions_models.yml", "name": "not_null_chronic_conditions__cms_chronic_conditions_hiv_aids_patient_id", "alias": "not_null_chronic_conditions__c_6da0dbac3eab9746301bed2ab3f2d52d", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["chronic_conditions__cms_chronic_conditions_hiv_aids"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"alias": "not_null_chronic_conditions__c_6da0dbac3eab9746301bed2ab3f2d52d"}, "created_at": 1701215340.2638268, "column_name": "patient_id", "file_key_name": "models.chronic_conditions__cms_chronic_conditions_hiv_aids"}, "test.the_tuva_project.not_null_chronic_conditions__cms_chronic_conditions_hiv_aids_claim_id.9baa48027d": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "claim_id", "model": "{{ get_where_subquery(ref('chronic_conditions__cms_chronic_conditions_hiv_aids')) }}"}, "namespace": null}, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.the_tuva_project.chronic_conditions__cms_chronic_conditions_hiv_aids"]}, "config": {"enabled": true, "alias": "not_null_chronic_conditions__c_075c29078cdfc99a6fe124f31746e827", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dev_sarah", "schema": "dbt_test__audit", "fqn": ["the_tuva_project", "chronic_conditions", "not_null_chronic_conditions__cms_chronic_conditions_hiv_aids_claim_id"], "unique_id": "test.the_tuva_project.not_null_chronic_conditions__cms_chronic_conditions_hiv_aids_claim_id.9baa48027d", "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"not_null_chronic_conditions__c_075c29078cdfc99a6fe124f31746e827\") }}", "language": "sql", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/the_tuva_project", "path": "not_null_chronic_conditions__c_075c29078cdfc99a6fe124f31746e827.sql", "original_file_path": "models/chronic_conditions/cms_chronic_conditions_models.yml", "name": "not_null_chronic_conditions__cms_chronic_conditions_hiv_aids_claim_id", "alias": "not_null_chronic_conditions__c_075c29078cdfc99a6fe124f31746e827", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["chronic_conditions__cms_chronic_conditions_hiv_aids"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"alias": "not_null_chronic_conditions__c_075c29078cdfc99a6fe124f31746e827"}, "created_at": 1701215340.264622, "column_name": "claim_id", "file_key_name": "models.chronic_conditions__cms_chronic_conditions_hiv_aids"}, "test.the_tuva_project.not_null_chronic_conditions__cms_chronic_conditions_hiv_aids_condition.da32954f00": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "condition", "model": "{{ get_where_subquery(ref('chronic_conditions__cms_chronic_conditions_hiv_aids')) }}"}, "namespace": null}, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.the_tuva_project.chronic_conditions__cms_chronic_conditions_hiv_aids"]}, "config": {"enabled": true, "alias": "not_null_chronic_conditions__c_52f5eb486d06b1bc6c4a979fe5d64785", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dev_sarah", "schema": "dbt_test__audit", "fqn": ["the_tuva_project", "chronic_conditions", "not_null_chronic_conditions__cms_chronic_conditions_hiv_aids_condition"], "unique_id": "test.the_tuva_project.not_null_chronic_conditions__cms_chronic_conditions_hiv_aids_condition.da32954f00", "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"not_null_chronic_conditions__c_52f5eb486d06b1bc6c4a979fe5d64785\") }}", "language": "sql", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/the_tuva_project", "path": "not_null_chronic_conditions__c_52f5eb486d06b1bc6c4a979fe5d64785.sql", "original_file_path": "models/chronic_conditions/cms_chronic_conditions_models.yml", "name": "not_null_chronic_conditions__cms_chronic_conditions_hiv_aids_condition", "alias": "not_null_chronic_conditions__c_52f5eb486d06b1bc6c4a979fe5d64785", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["chronic_conditions__cms_chronic_conditions_hiv_aids"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"alias": "not_null_chronic_conditions__c_52f5eb486d06b1bc6c4a979fe5d64785"}, "created_at": 1701215340.2653928, "column_name": "condition", "file_key_name": "models.chronic_conditions__cms_chronic_conditions_hiv_aids"}, "test.the_tuva_project.accepted_values_chronic_conditions__cms_chronic_conditions_hiv_aids_condition__Human_Immunodeficiency_Virus_and_or_Acquired_Immunodeficiency_Syndrome_HIV_AIDS_.c54d45a2c6": {"test_metadata": {"name": "accepted_values", "kwargs": {"values": ["Human Immunodeficiency Virus and/or Acquired Immunodeficiency Syndrome (HIV/AIDS)"], "column_name": "condition", "model": "{{ get_where_subquery(ref('chronic_conditions__cms_chronic_conditions_hiv_aids')) }}"}, "namespace": null}, "resource_type": "test", "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"]}, "config": {"enabled": true, "alias": "accepted_values_chronic_condit_dac30732a31f8623801cc82d686e9e8f", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dev_sarah", "schema": "dbt_test__audit", "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_"], "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", "raw_code": "{{ test_accepted_values(**_dbt_generic_test_kwargs) }}{{ config(alias=\"accepted_values_chronic_condit_dac30732a31f8623801cc82d686e9e8f\") }}", "language": "sql", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/the_tuva_project", "path": "accepted_values_chronic_condit_dac30732a31f8623801cc82d686e9e8f.sql", "original_file_path": "models/chronic_conditions/cms_chronic_conditions_models.yml", "name": "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": ""}, "tags": [], "refs": [["chronic_conditions__cms_chronic_conditions_hiv_aids"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"alias": "accepted_values_chronic_condit_dac30732a31f8623801cc82d686e9e8f"}, "created_at": 1701215340.266167, "column_name": "condition", "file_key_name": "models.chronic_conditions__cms_chronic_conditions_hiv_aids"}, "test.the_tuva_project.not_null_chronic_conditions__cms_chronic_conditions_oud_patient_id.382354e0d0": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "patient_id", "model": "{{ get_where_subquery(ref('chronic_conditions__cms_chronic_conditions_oud')) }}"}, "namespace": null}, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.the_tuva_project.chronic_conditions__cms_chronic_conditions_oud"]}, "config": {"enabled": true, "alias": "not_null_chronic_conditions__c_9bc0b8199dada8f26dfa51bc604f3741", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dev_sarah", "schema": "dbt_test__audit", "fqn": ["the_tuva_project", "chronic_conditions", "not_null_chronic_conditions__cms_chronic_conditions_oud_patient_id"], "unique_id": "test.the_tuva_project.not_null_chronic_conditions__cms_chronic_conditions_oud_patient_id.382354e0d0", "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"not_null_chronic_conditions__c_9bc0b8199dada8f26dfa51bc604f3741\") }}", "language": "sql", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/the_tuva_project", "path": "not_null_chronic_conditions__c_9bc0b8199dada8f26dfa51bc604f3741.sql", "original_file_path": "models/chronic_conditions/cms_chronic_conditions_models.yml", "name": "not_null_chronic_conditions__cms_chronic_conditions_oud_patient_id", "alias": "not_null_chronic_conditions__c_9bc0b8199dada8f26dfa51bc604f3741", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["chronic_conditions__cms_chronic_conditions_oud"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"alias": "not_null_chronic_conditions__c_9bc0b8199dada8f26dfa51bc604f3741"}, "created_at": 1701215340.268474, "column_name": "patient_id", "file_key_name": "models.chronic_conditions__cms_chronic_conditions_oud"}, "test.the_tuva_project.not_null_chronic_conditions__cms_chronic_conditions_oud_claim_id.7ee5fe28fe": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "claim_id", "model": "{{ get_where_subquery(ref('chronic_conditions__cms_chronic_conditions_oud')) }}"}, "namespace": null}, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.the_tuva_project.chronic_conditions__cms_chronic_conditions_oud"]}, "config": {"enabled": true, "alias": "not_null_chronic_conditions__c_e8858b22e3298bb06dc366c69d72845e", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dev_sarah", "schema": "dbt_test__audit", "fqn": ["the_tuva_project", "chronic_conditions", "not_null_chronic_conditions__cms_chronic_conditions_oud_claim_id"], "unique_id": "test.the_tuva_project.not_null_chronic_conditions__cms_chronic_conditions_oud_claim_id.7ee5fe28fe", "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"not_null_chronic_conditions__c_e8858b22e3298bb06dc366c69d72845e\") }}", "language": "sql", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/the_tuva_project", "path": "not_null_chronic_conditions__c_e8858b22e3298bb06dc366c69d72845e.sql", "original_file_path": "models/chronic_conditions/cms_chronic_conditions_models.yml", "name": "not_null_chronic_conditions__cms_chronic_conditions_oud_claim_id", "alias": "not_null_chronic_conditions__c_e8858b22e3298bb06dc366c69d72845e", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["chronic_conditions__cms_chronic_conditions_oud"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"alias": "not_null_chronic_conditions__c_e8858b22e3298bb06dc366c69d72845e"}, "created_at": 1701215340.2692852, "column_name": "claim_id", "file_key_name": "models.chronic_conditions__cms_chronic_conditions_oud"}, "test.the_tuva_project.not_null_chronic_conditions__cms_chronic_conditions_oud_condition.6800b245ea": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "condition", "model": "{{ get_where_subquery(ref('chronic_conditions__cms_chronic_conditions_oud')) }}"}, "namespace": null}, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.the_tuva_project.chronic_conditions__cms_chronic_conditions_oud"]}, "config": {"enabled": true, "alias": "not_null_chronic_conditions__c_e1503323470a6f1632ee17ce36ebfdf4", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dev_sarah", "schema": "dbt_test__audit", "fqn": ["the_tuva_project", "chronic_conditions", "not_null_chronic_conditions__cms_chronic_conditions_oud_condition"], "unique_id": "test.the_tuva_project.not_null_chronic_conditions__cms_chronic_conditions_oud_condition.6800b245ea", "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"not_null_chronic_conditions__c_e1503323470a6f1632ee17ce36ebfdf4\") }}", "language": "sql", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/the_tuva_project", "path": "not_null_chronic_conditions__c_e1503323470a6f1632ee17ce36ebfdf4.sql", "original_file_path": "models/chronic_conditions/cms_chronic_conditions_models.yml", "name": "not_null_chronic_conditions__cms_chronic_conditions_oud_condition", "alias": "not_null_chronic_conditions__c_e1503323470a6f1632ee17ce36ebfdf4", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["chronic_conditions__cms_chronic_conditions_oud"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"alias": "not_null_chronic_conditions__c_e1503323470a6f1632ee17ce36ebfdf4"}, "created_at": 1701215340.270401, "column_name": "condition", "file_key_name": "models.chronic_conditions__cms_chronic_conditions_oud"}, "test.the_tuva_project.accepted_values_chronic_conditions__cms_chronic_conditions_oud_condition__Opioid_Use_Disorder_OUD_.f44489eec5": {"test_metadata": {"name": "accepted_values", "kwargs": {"values": ["Opioid Use Disorder (OUD)"], "column_name": "condition", "model": "{{ get_where_subquery(ref('chronic_conditions__cms_chronic_conditions_oud')) }}"}, "namespace": null}, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_accepted_values", "macro.dbt.get_where_subquery"], "nodes": ["model.the_tuva_project.chronic_conditions__cms_chronic_conditions_oud"]}, "config": {"enabled": true, "alias": "accepted_values_chronic_condit_e9f47fcdb123676b8c14e66963fb2f9e", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dev_sarah", "schema": "dbt_test__audit", "fqn": ["the_tuva_project", "chronic_conditions", "accepted_values_chronic_conditions__cms_chronic_conditions_oud_condition__Opioid_Use_Disorder_OUD_"], "unique_id": "test.the_tuva_project.accepted_values_chronic_conditions__cms_chronic_conditions_oud_condition__Opioid_Use_Disorder_OUD_.f44489eec5", "raw_code": "{{ test_accepted_values(**_dbt_generic_test_kwargs) }}{{ config(alias=\"accepted_values_chronic_condit_e9f47fcdb123676b8c14e66963fb2f9e\") }}", "language": "sql", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/the_tuva_project", "path": "accepted_values_chronic_condit_e9f47fcdb123676b8c14e66963fb2f9e.sql", "original_file_path": "models/chronic_conditions/cms_chronic_conditions_models.yml", "name": "accepted_values_chronic_conditions__cms_chronic_conditions_oud_condition__Opioid_Use_Disorder_OUD_", "alias": "accepted_values_chronic_condit_e9f47fcdb123676b8c14e66963fb2f9e", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["chronic_conditions__cms_chronic_conditions_oud"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"alias": "accepted_values_chronic_condit_e9f47fcdb123676b8c14e66963fb2f9e"}, "created_at": 1701215340.271212, "column_name": "condition", "file_key_name": "models.chronic_conditions__cms_chronic_conditions_oud"}, "test.the_tuva_project.unique_chronic_conditions__tuva_chronic_conditions_long__patient_id___condition_.c9509bb46f": {"test_metadata": {"name": "unique", "kwargs": {"column_name": "(patient_id || '_' || condition)", "model": "{{ get_where_subquery(ref('chronic_conditions__tuva_chronic_conditions_long')) }}"}, "namespace": null}, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_unique"], "nodes": ["model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_long"]}, "config": {"enabled": true, "alias": "unique_chronic_conditions__tuv_5a5fdcf2a52369894b11527da0860423", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dev_sarah", "schema": "dbt_test__audit", "fqn": ["the_tuva_project", "chronic_conditions", "unique_chronic_conditions__tuva_chronic_conditions_long__patient_id___condition_"], "unique_id": "test.the_tuva_project.unique_chronic_conditions__tuva_chronic_conditions_long__patient_id___condition_.c9509bb46f", "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}{{ config(alias=\"unique_chronic_conditions__tuv_5a5fdcf2a52369894b11527da0860423\") }}", "language": "sql", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/the_tuva_project", "path": "unique_chronic_conditions__tuv_5a5fdcf2a52369894b11527da0860423.sql", "original_file_path": "models/chronic_conditions/tuva_chronic_conditions_models.yml", "name": "unique_chronic_conditions__tuva_chronic_conditions_long__patient_id___condition_", "alias": "unique_chronic_conditions__tuv_5a5fdcf2a52369894b11527da0860423", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["chronic_conditions__tuva_chronic_conditions_long"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"alias": "unique_chronic_conditions__tuv_5a5fdcf2a52369894b11527da0860423"}, "created_at": 1701215340.2917042, "column_name": null, "file_key_name": "models.chronic_conditions__tuva_chronic_conditions_long"}, "test.the_tuva_project.unique_chronic_conditions__tuva_chronic_conditions_wide_patient_id.02386b9158": {"test_metadata": {"name": "unique", "kwargs": {"column_name": "patient_id", "model": "{{ get_where_subquery(ref('chronic_conditions__tuva_chronic_conditions_wide')) }}"}, "namespace": null}, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_unique"], "nodes": ["model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_wide"]}, "config": {"enabled": true, "alias": "unique_chronic_conditions__tuv_f6c9876f5d8c62c8b1b037d28f2c9550", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dev_sarah", "schema": "dbt_test__audit", "fqn": ["the_tuva_project", "chronic_conditions", "unique_chronic_conditions__tuva_chronic_conditions_wide_patient_id"], "unique_id": "test.the_tuva_project.unique_chronic_conditions__tuva_chronic_conditions_wide_patient_id.02386b9158", "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}{{ config(alias=\"unique_chronic_conditions__tuv_f6c9876f5d8c62c8b1b037d28f2c9550\") }}", "language": "sql", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/the_tuva_project", "path": "unique_chronic_conditions__tuv_f6c9876f5d8c62c8b1b037d28f2c9550.sql", "original_file_path": "models/chronic_conditions/tuva_chronic_conditions_models.yml", "name": "unique_chronic_conditions__tuva_chronic_conditions_wide_patient_id", "alias": "unique_chronic_conditions__tuv_f6c9876f5d8c62c8b1b037d28f2c9550", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["chronic_conditions__tuva_chronic_conditions_wide"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"alias": "unique_chronic_conditions__tuv_f6c9876f5d8c62c8b1b037d28f2c9550"}, "created_at": 1701215340.2925172, "column_name": null, "file_key_name": "models.chronic_conditions__tuva_chronic_conditions_wide"}, "test.the_tuva_project.not_null_chronic_conditions__tuva_chronic_conditions_wide_patient_id.705b1ca561": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "patient_id", "model": "{{ get_where_subquery(ref('chronic_conditions__tuva_chronic_conditions_wide')) }}"}, "namespace": null}, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_wide"]}, "config": {"enabled": true, "alias": "not_null_chronic_conditions__t_85a7e6e4e3c122035b615b501d74cac4", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dev_sarah", "schema": "dbt_test__audit", "fqn": ["the_tuva_project", "chronic_conditions", "not_null_chronic_conditions__tuva_chronic_conditions_wide_patient_id"], "unique_id": "test.the_tuva_project.not_null_chronic_conditions__tuva_chronic_conditions_wide_patient_id.705b1ca561", "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"not_null_chronic_conditions__t_85a7e6e4e3c122035b615b501d74cac4\") }}", "language": "sql", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/the_tuva_project", "path": "not_null_chronic_conditions__t_85a7e6e4e3c122035b615b501d74cac4.sql", "original_file_path": "models/chronic_conditions/tuva_chronic_conditions_models.yml", "name": "not_null_chronic_conditions__tuva_chronic_conditions_wide_patient_id", "alias": "not_null_chronic_conditions__t_85a7e6e4e3c122035b615b501d74cac4", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["chronic_conditions__tuva_chronic_conditions_wide"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"alias": "not_null_chronic_conditions__t_85a7e6e4e3c122035b615b501d74cac4"}, "created_at": 1701215340.293453, "column_name": null, "file_key_name": "models.chronic_conditions__tuva_chronic_conditions_wide"}, "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}, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_unique"], "nodes": ["seed.the_tuva_project.ed_classification__johnston_icd9"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dev_sarah", "schema": "dbt_test__audit", "fqn": ["the_tuva_project", "value_sets", "ed_classification", "unique_ed_classification__johnston_icd9_icd9"], "unique_id": "test.the_tuva_project.unique_ed_classification__johnston_icd9_icd9.08c1dc4617", "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "language": "sql", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/the_tuva_project", "path": "unique_ed_classification__johnston_icd9_icd9.sql", "original_file_path": "seeds/value_sets/ed_classification/ed_classification_seeds.yml", "name": "unique_ed_classification__johnston_icd9_icd9", "alias": "unique_ed_classification__johnston_icd9_icd9", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["ed_classification__johnston_icd9"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1701215340.445842, "column_name": "icd9", "file_key_name": "seeds.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}, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["seed.the_tuva_project.ed_classification__johnston_icd9"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dev_sarah", "schema": "dbt_test__audit", "fqn": ["the_tuva_project", "value_sets", "ed_classification", "not_null_ed_classification__johnston_icd9_icd9"], "unique_id": "test.the_tuva_project.not_null_ed_classification__johnston_icd9_icd9.a7feea49c0", "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/the_tuva_project", "path": "not_null_ed_classification__johnston_icd9_icd9.sql", "original_file_path": "seeds/value_sets/ed_classification/ed_classification_seeds.yml", "name": "not_null_ed_classification__johnston_icd9_icd9", "alias": "not_null_ed_classification__johnston_icd9_icd9", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["ed_classification__johnston_icd9"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1701215340.446652, "column_name": "icd9", "file_key_name": "seeds.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}, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_unique"], "nodes": ["seed.the_tuva_project.ed_classification__johnston_icd10"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dev_sarah", "schema": "dbt_test__audit", "fqn": ["the_tuva_project", "value_sets", "ed_classification", "unique_ed_classification__johnston_icd10_icd10"], "unique_id": "test.the_tuva_project.unique_ed_classification__johnston_icd10_icd10.3d55f2b2dd", "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "language": "sql", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/the_tuva_project", "path": "unique_ed_classification__johnston_icd10_icd10.sql", "original_file_path": "seeds/value_sets/ed_classification/ed_classification_seeds.yml", "name": "unique_ed_classification__johnston_icd10_icd10", "alias": "unique_ed_classification__johnston_icd10_icd10", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["ed_classification__johnston_icd10"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1701215340.44743, "column_name": "icd10", "file_key_name": "seeds.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}, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["seed.the_tuva_project.ed_classification__johnston_icd10"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dev_sarah", "schema": "dbt_test__audit", "fqn": ["the_tuva_project", "value_sets", "ed_classification", "not_null_ed_classification__johnston_icd10_icd10"], "unique_id": "test.the_tuva_project.not_null_ed_classification__johnston_icd10_icd10.d04e7f84c7", "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/the_tuva_project", "path": "not_null_ed_classification__johnston_icd10_icd10.sql", "original_file_path": "seeds/value_sets/ed_classification/ed_classification_seeds.yml", "name": "not_null_ed_classification__johnston_icd10_icd10", "alias": "not_null_ed_classification__johnston_icd10_icd10", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["ed_classification__johnston_icd10"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1701215340.4481988, "column_name": "icd10", "file_key_name": "seeds.ed_classification__johnston_icd10"}, "model.input_layer.observation": {"resource_type": "model", "depends_on": {"macros": ["macro.dbt.type_string"], "nodes": []}, "config": {"enabled": true, "alias": null, "schema": "input_layer", "database": "tuva", "tags": [], "meta": {}, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "bind": false, "post-hook": [], "pre-hook": []}, "database": "tuva", "schema": "input_layer", "fqn": ["input_layer", "observation"], "unique_id": "model.input_layer.observation", "raw_code": "select\n cast(null as {{ dbt.type_string() }} ) as observation_id\n , cast(null as {{ dbt.type_string() }} ) as patient_id\n , cast(null as {{ dbt.type_string() }} ) as encounter_id\n , cast(null as {{ dbt.type_string() }} ) as panel_id\n , cast(null as date) as observation_date\n , cast(null as {{ dbt.type_string() }} ) as observation_type\n , cast(null as {{ dbt.type_string() }} ) as source_code_type\n , cast(null as {{ dbt.type_string() }} ) as source_code\n , cast(null as {{ dbt.type_string() }} ) as source_description\n , cast(null as {{ dbt.type_string() }} ) as normalized_code_type\n , cast(null as {{ dbt.type_string() }} ) as normalized_code\n , cast(null as {{ dbt.type_string() }} ) as normalized_description\n , cast(null as {{ dbt.type_string() }} ) as result\n , cast(null as {{ dbt.type_string() }} ) as source_units\n , cast(null as {{ dbt.type_string() }} ) as normalized_units\n , cast(null as {{ dbt.type_string() }} ) as source_reference_range_low\n , cast(null as {{ dbt.type_string() }} ) as source_reference_range_high\n , cast(null as {{ dbt.type_string() }} ) as normalized_reference_range_low\n , cast(null as {{ dbt.type_string() }} ) as normalized_reference_range_high\n , cast(null as {{ dbt.type_string() }} ) as data_source\nlimit 0", "language": "sql", "package_name": "input_layer", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/docs_generate", "path": "observation.sql", "original_file_path": "models/observation.sql", "name": "observation", "alias": "observation", "checksum": {"name": "sha256", "checksum": "f811aa31586fe9cd5fce30d9b1160a415c09612da672b2957dd915dbfea5f030"}, "tags": [], "refs": [], "sources": [], "metrics": [], "description": "The observation table contains information on measurements other than lab tests e.g. blood pressure, height, and weight.\n", "columns": {"observation_id": {"name": "observation_id", "description": "Unique identifier for each observation in the dataset.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "patient_id": {"name": "patient_id", "description": "Unique identifier for each patient in the dataset.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "encounter_id": {"name": "encounter_id", "description": "Unique identifier for each encounter in the dataset.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "panel_id": {"name": "panel_id", "description": "Unique identifier for the panel.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "observation_date": {"name": "observation_date", "description": "Date the observation was recorded.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "observation_type": {"name": "observation_type", "description": "Type of observation.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "source_code_type": {"name": "source_code_type", "description": "Source code type of the observation.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "source_code": {"name": "source_code", "description": "Source code of the observation.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "source_description": {"name": "source_description", "description": "Source description of the observation.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "normalized_code_type": {"name": "normalized_code_type", "description": "Normalized code type of the observation.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "normalized_code": {"name": "normalized_code", "description": "Normalized code of the observation.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "normalized_description": {"name": "normalized_description", "description": "Normalized description of the observatino.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "result": {"name": "result", "description": "The result of the observation.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "source_units": {"name": "source_units", "description": "Source units of the lab test.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "normalized_units": {"name": "normalized_units", "description": "Normalized units of the lab test.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "source_reference_range_low": {"name": "source_reference_range_low", "description": "The low end of the reference range from the source system.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "source_reference_range_high": {"name": "source_reference_range_high", "description": "The high end of the reference range from the source system.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "normalized_reference_range_low": {"name": "normalized_reference_range_low", "description": "The normalized low end of the reference range.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "normalized_reference_range_high": {"name": "normalized_reference_range_high", "description": "The normalized high end of the reference range.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "data_source": {"name": "data_source", "description": "Custom description of the source system e.g. Epic.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "input_layer://models/_models.yml", "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"bind": false, "database": "tuva", "schema": "input_layer"}, "created_at": 1701299227.4085472}, "model.the_tuva_project.chronic_conditions__cms_chronic_conditions_wide": {"resource_type": "model", "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"]}, "config": {"enabled": true, "alias": "cms_chronic_conditions_wide", "schema": "chronic_conditions", "database": null, "tags": ["cms_chronic_conditions", "chronic_conditions"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#2e0e0e"}, "bind": false, "post-hook": [], "pre-hook": []}, "database": "dev_sarah", "schema": "chronic_conditions", "fqn": ["the_tuva_project", "chronic_conditions", "final", "chronic_conditions__cms_chronic_conditions_wide"], "unique_id": "model.the_tuva_project.chronic_conditions__cms_chronic_conditions_wide", "raw_code": "{{ config(\n enabled = var('cms_chronic_conditions_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\n )\n}}\n\nwith chronic_conditions as (\n\n select distinct\n condition\n , condition_column_name\n from {{ ref('chronic_conditions__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 {{ ref('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 , {{ dbt_utils.pivot(\n column='condition_column_name'\n , values=dbt_utils.get_column_values(\n ref ('chronic_conditions__cms_chronic_conditions_hierarchy')\n , 'condition_column_name'\n , order_by= 'condition_column_name'\n )\n , agg='max'\n , then_value= 1\n , else_value= 0\n , quote_identifiers = False\n ) }}\n , '{{ var('tuva_last_run')}}' as tuva_last_run\nfrom {{ ref('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", "language": "sql", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/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", "name": "chronic_conditions__cms_chronic_conditions_wide", "alias": "cms_chronic_conditions_wide", "checksum": {"name": "sha256", "checksum": "1a4a6540512db0e049723d6afdeaa6cf95638321608170855f18964c9fbae4ad"}, "tags": ["cms_chronic_conditions", "chronic_conditions"], "refs": [["chronic_conditions__cms_chronic_conditions_hierarchy"], ["chronic_conditions__cms_chronic_conditions_long"], ["chronic_conditions__cms_chronic_conditions_hierarchy"], ["cms_chronic_conditions__stg_core__patient"]], "sources": [], "metrics": [], "description": "This model pivots conditions on the patient level (i.e. one record per patient) with flags for each chronic condition.\n", "columns": {"patient_id": {"name": "patient_id", "description": "Unique ID for the patient.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "acute_myocardial_infarction": {"name": "acute_myocardial_infarction", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "adhd_conduct_disorders_and_hyperkinetic_syndrome": {"name": "adhd_conduct_disorders_and_hyperkinetic_syndrome", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "alcohol_use_disorders": {"name": "alcohol_use_disorders", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "alzheimers_disease": {"name": "alzheimers_disease", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "anemia": {"name": "anemia", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "anxiety_disorders": {"name": "anxiety_disorders", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "asthma": {"name": "asthma", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "atrial_fibrillation_and_flutter": {"name": "atrial_fibrillation_and_flutter", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "autism_spectrum_disorders": {"name": "autism_spectrum_disorders", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "benign_prostatic_hyperplasia": {"name": "benign_prostatic_hyperplasia", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "bipolar_disorder": {"name": "bipolar_disorder", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "cancer_breast": {"name": "cancer_breast", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "cancer_colorectal": {"name": "cancer_colorectal", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "cancer_endometrial": {"name": "cancer_endometrial", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "cancer_lung": {"name": "cancer_lung", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "cancer_prostate": {"name": "cancer_prostate", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "cancer_urologic_kidney_renal_pelvis_and_ureter": {"name": "cancer_urologic_kidney_renal_pelvis_and_ureter", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "cataract": {"name": "cataract", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "cerebral_palsy": {"name": "cerebral_palsy", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "chronic_kidney_disease": {"name": "chronic_kidney_disease", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "chronic_obstructive_pulmonary_disease": {"name": "chronic_obstructive_pulmonary_disease", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "cystic_fibrosis_and_other_metabolic_developmental_disorders": {"name": "cystic_fibrosis_and_other_metabolic_developmental_disorders", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "depression_bipolar_or_other_depressive_mood_disorders": {"name": "depression_bipolar_or_other_depressive_mood_disorders", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "depressive_disorders": {"name": "depressive_disorders", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "diabetes": {"name": "diabetes", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "drug_use_disorders": {"name": "drug_use_disorders", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "epilepsy": {"name": "epilepsy", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "fibromyalgia_and_chronic_pain_and_fatigue": {"name": "fibromyalgia_and_chronic_pain_and_fatigue", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "glaucoma": {"name": "glaucoma", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "heart_failure_and_non_ischemic_heart_disease": {"name": "heart_failure_and_non_ischemic_heart_disease", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "hepatitis_a": {"name": "hepatitis_a", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "hepatitis_b_acute_or_unspecified": {"name": "hepatitis_b_acute_or_unspecified", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "hepatitis_b_chronic": {"name": "hepatitis_b_chronic", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "hepatitis_c_acute": {"name": "hepatitis_c_acute", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "hepatitis_c_chronic": {"name": "hepatitis_c_chronic", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "hepatitis_c_unspecified": {"name": "hepatitis_c_unspecified", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "hepatitis_d": {"name": "hepatitis_d", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "hepatitis_e": {"name": "hepatitis_e", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "hip_pelvic_fracture": {"name": "hip_pelvic_fracture", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "human_immunodeficiency_virus_and_or_acquired_immunodeficiency_syndrome_hiv_aids": {"name": "human_immunodeficiency_virus_and_or_acquired_immunodeficiency_syndrome_hiv_aids", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "hyperlipidemia": {"name": "hyperlipidemia", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "hypertension": {"name": "hypertension", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "hypothyroidism": {"name": "hypothyroidism", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "intellectual_disabilities_and_related_conditions": {"name": "intellectual_disabilities_and_related_conditions", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "ischemic_heart_disease": {"name": "ischemic_heart_disease", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "learning_disabilities": {"name": "learning_disabilities", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "leukemias_and_lymphomas": {"name": "leukemias_and_lymphomas", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "liver_disease_cirrhosis_and_other_liver_conditions_except_viral_hepatitis": {"name": "liver_disease_cirrhosis_and_other_liver_conditions_except_viral_hepatitis", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "migraine_and_chronic_headache": {"name": "migraine_and_chronic_headache", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "mobility_impairments": {"name": "mobility_impairments", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "multiple_sclerosis_and_transverse_myelitis": {"name": "multiple_sclerosis_and_transverse_myelitis", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "muscular_dystrophy": {"name": "muscular_dystrophy", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "non_alzheimers_dementia": {"name": "non_alzheimers_dementia", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "obesity": {"name": "obesity", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "opioid_use_disorder_oud": {"name": "opioid_use_disorder_oud", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "osteoporosis_with_or_without_pathological_fracture": {"name": "osteoporosis_with_or_without_pathological_fracture", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "other_developmental_delays": {"name": "other_developmental_delays", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "parkinsons_disease_and_secondary_parkinsonism": {"name": "parkinsons_disease_and_secondary_parkinsonism", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "peripheral_vascular_disease_pvd": {"name": "peripheral_vascular_disease_pvd", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "personality_disorders": {"name": "personality_disorders", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "pneumonia_all_cause": {"name": "pneumonia_all_cause", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "post_traumatic_stress_disorder_ptsd": {"name": "post_traumatic_stress_disorder_ptsd", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "pressure_and_chronic_ulcers": {"name": "pressure_and_chronic_ulcers", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "rheumatoid_arthritis_osteoarthritis": {"name": "rheumatoid_arthritis_osteoarthritis", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "schizophrenia": {"name": "schizophrenia", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "schizophrenia_and_other_psychotic_disorders": {"name": "schizophrenia_and_other_psychotic_disorders", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "sensory_blindness_and_visual_impairment": {"name": "sensory_blindness_and_visual_impairment", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "sensory_deafness_and_hearing_impairment": {"name": "sensory_deafness_and_hearing_impairment", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "sickle_cell_disease": {"name": "sickle_cell_disease", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "spina_bifida_and_other_congenital_anomalies_of_the_nervous_system": {"name": "spina_bifida_and_other_congenital_anomalies_of_the_nervous_system", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "spinal_cord_injury": {"name": "spinal_cord_injury", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "stroke_transient_ischemic_attack": {"name": "stroke_transient_ischemic_attack", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "tobacco_use": {"name": "tobacco_use", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "traumatic_brain_injury_and_nonpsychotic_mental_disorders_due_to_brain_damage": {"name": "traumatic_brain_injury_and_nonpsychotic_mental_disorders_due_to_brain_damage", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "viral_hepatitis_general": {"name": "viral_hepatitis_general", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The time at with the model was materialized. Generated by `dbt_utils.pretty_time` as the local time of the `dbt run` environment. Timezone is configurable via the `tuva_last_run` var.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": "#2e0e0e"}, "patch_path": "the_tuva_project://models/chronic_conditions/cms_chronic_conditions_models.yml", "compiled_path": null, "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": 1701299227.433182}, "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}, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_unique"], "nodes": ["model.the_tuva_project.chronic_conditions__cms_chronic_conditions_wide"]}, "config": {"enabled": true, "alias": "unique_chronic_conditions__cms_dd279730922ed20d9a6785adad24b5e2", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dev_sarah", "schema": "dbt_test__audit", "fqn": ["the_tuva_project", "chronic_conditions", "unique_chronic_conditions__cms_chronic_conditions_wide_patient_id"], "unique_id": "test.the_tuva_project.unique_chronic_conditions__cms_chronic_conditions_wide_patient_id.60c2d9a586", "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}{{ config(alias=\"unique_chronic_conditions__cms_dd279730922ed20d9a6785adad24b5e2\") }}", "language": "sql", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/the_tuva_project", "path": "unique_chronic_conditions__cms_dd279730922ed20d9a6785adad24b5e2.sql", "original_file_path": "models/chronic_conditions/cms_chronic_conditions_models.yml", "name": "unique_chronic_conditions__cms_chronic_conditions_wide_patient_id", "alias": "unique_chronic_conditions__cms_dd279730922ed20d9a6785adad24b5e2", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["chronic_conditions__cms_chronic_conditions_wide"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"alias": "unique_chronic_conditions__cms_dd279730922ed20d9a6785adad24b5e2"}, "created_at": 1701299227.437195, "column_name": "patient_id", "file_key_name": "models.chronic_conditions__cms_chronic_conditions_wide"}, "test.the_tuva_project.not_null_chronic_conditions__cms_chronic_conditions_wide_patient_id.5c2c8ae105": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "patient_id", "model": "{{ get_where_subquery(ref('chronic_conditions__cms_chronic_conditions_wide')) }}"}, "namespace": null}, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.the_tuva_project.chronic_conditions__cms_chronic_conditions_wide"]}, "config": {"enabled": true, "alias": "not_null_chronic_conditions__c_acd55fa202206ca2dac1594f14fc377c", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dev_sarah", "schema": "dbt_test__audit", "fqn": ["the_tuva_project", "chronic_conditions", "not_null_chronic_conditions__cms_chronic_conditions_wide_patient_id"], "unique_id": "test.the_tuva_project.not_null_chronic_conditions__cms_chronic_conditions_wide_patient_id.5c2c8ae105", "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"not_null_chronic_conditions__c_acd55fa202206ca2dac1594f14fc377c\") }}", "language": "sql", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/the_tuva_project", "path": "not_null_chronic_conditions__c_acd55fa202206ca2dac1594f14fc377c.sql", "original_file_path": "models/chronic_conditions/cms_chronic_conditions_models.yml", "name": "not_null_chronic_conditions__cms_chronic_conditions_wide_patient_id", "alias": "not_null_chronic_conditions__c_acd55fa202206ca2dac1594f14fc377c", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["chronic_conditions__cms_chronic_conditions_wide"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"alias": "not_null_chronic_conditions__c_acd55fa202206ca2dac1594f14fc377c"}, "created_at": 1701299227.4380648, "column_name": "patient_id", "file_key_name": "models.chronic_conditions__cms_chronic_conditions_wide"}, "model.the_tuva_project.core__practitioner": {"resource_type": "model", "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.core__stg_claims_practitioner", "model.the_tuva_project.core__stg_clinical_practitioner"]}, "config": {"enabled": true, "alias": "practitioner", "schema": "core", "database": null, "tags": ["core"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#0f3d0b"}, "bind": false, "post-hook": [], "pre-hook": []}, "database": "dev_sarah", "schema": "core", "fqn": ["the_tuva_project", "core", "final", "core__practitioner"], "unique_id": "model.the_tuva_project.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", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/the_tuva_project", "path": "core/final/core__practitioner.sql", "original_file_path": "models/core/final/core__practitioner.sql", "name": "core__practitioner", "alias": "practitioner", "checksum": {"name": "sha256", "checksum": "775c1a9019c7dad8bd26cdb669cfa8f56e61ced3adcb492b805165d42f20eacf"}, "tags": ["core"], "refs": [["core__stg_claims_practitioner"], ["core__stg_clinical_practitioner"]], "sources": [], "metrics": [], "description": "The practitioner table contains information on the providers in the dataset e.g. physicians, physicians assistants, etc.\n", "columns": {"practitioner_id": {"name": "practitioner_id", "description": "Unique ID for the provider.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "npi": {"name": "npi", "description": "NPI for the provider.", "meta": {"terminology": "/terminology/providers/provider"}, "data_type": null, "quote": null, "tags": []}, "provider_first_name": {"name": "provider_first_name", "description": "First name of the provider.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "provider_last_name": {"name": "provider_last_name", "description": "Last name of the provider.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "practice_affiliation": {"name": "practice_affiliation", "description": "Practice affiliation of the provider.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "specialty": {"name": "specialty", "description": "Specialty of the provider.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "sub_specialty": {"name": "sub_specialty", "description": "Sub specialty of the provider.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "data_source": {"name": "data_source", "description": "User-configured field that indicates the data source (e.g. typically named after the payer and state \"BCBS Tennessee\").\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The last time the data was refreshed. Generated by `dbt_utils.pretty_time` as the local time of the `dbt run` environment. Timezone is configurable via the `tuva_last_run` var.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": "#0f3d0b"}, "patch_path": "the_tuva_project://models/core/core_models.yml", "compiled_path": null, "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": 1701301033.9052842}, "model.the_tuva_project.core__eligibility": {"resource_type": "model", "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.core__stg_claims_eligibility"]}, "config": {"enabled": true, "alias": "eligibility", "schema": "core", "database": null, "tags": ["core"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#0f3d0b"}, "bind": false, "post-hook": [], "pre-hook": []}, "database": "dev_sarah", "schema": "core", "fqn": ["the_tuva_project", "core", "final", "core__eligibility"], "unique_id": "model.the_tuva_project.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", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/the_tuva_project", "path": "core/final/core__eligibility.sql", "original_file_path": "models/core/final/core__eligibility.sql", "name": "core__eligibility", "alias": "eligibility", "checksum": {"name": "sha256", "checksum": "6c4444c95ace83c2f6bc4f2e9dfc69bef360c3b0a01bea5e67b3da4761485111"}, "tags": ["core"], "refs": [["core__stg_claims_eligibility"]], "sources": [], "metrics": [], "description": "The eligibility table contains information on patient health plan and supplemental insurance eligibility.\n", "columns": {"patient_id": {"name": "patient_id", "description": "Unique identifier for each patient in the dataset.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "member_id": {"name": "member_id", "description": "Identifier that links a patient to a particular insurance product or health plan. A patient can have more than one member_id because they can have more than one insurance product/plan.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "birth_date": {"name": "birth_date", "description": "Date the patient was born.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "death_date": {"name": "death_date", "description": "Date the patient died.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "enrollment_start_date": {"name": "enrollment_start_date", "description": "Date the patient's insurance eligibility began.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "enrollment_end_date": {"name": "enrollment_end_date", "description": "Date the patient's insurance eligibility ended.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "payer": {"name": "payer", "description": "Name of the payer (i.e. health insurer) providing coverage.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "payer_type": {"name": "payer_type", "description": "Type of payer (e.g. commercial, medicare, medicaid, etc.).", "meta": {"terminology": "/terminology/tuva-concepts/payer-type"}, "data_type": null, "quote": null, "tags": []}, "plan": {"name": "plan", "description": "Name of the plan (i.e. sub contract) providing coverage.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "original_reason_entitlement_code": {"name": "original_reason_entitlement_code", "description": "Original reason for Medicare entitlement code.", "meta": {"terminology": "/terminology/administrative-codes/medicare-orec"}, "data_type": null, "quote": null, "tags": []}, "dual_status_code": {"name": "dual_status_code", "description": "Indicates whether the patient is dually eligible for Medicare and Medicaid.\n", "meta": {"terminology": "/terminology/administrative-codes/medicare-dual-eligibility"}, "data_type": null, "quote": null, "tags": []}, "medicare_status_code": {"name": "medicare_status_code", "description": "Indicates how the patient became eligible for Medicare.", "meta": {"terminology": "/terminology/administrative-codes/medicare-status"}, "data_type": null, "quote": null, "tags": []}, "data_source": {"name": "data_source", "description": "User-configured field that indicates the data source (e.g. typically named after the payer and state \"BCBS Tennessee\").\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The last time the data was refreshed. Generated by `dbt_utils.pretty_time` as the local time of the `dbt run` environment. Timezone is configurable via the `tuva_last_run` var.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": "#0f3d0b"}, "patch_path": "the_tuva_project://models/core/core_models.yml", "compiled_path": null, "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": 1701301033.909633}, "model.the_tuva_project.core__stg_clinical_lab_result": {"resource_type": "model", "depends_on": {"macros": ["macro.dbt.type_string", "macro.the_tuva_project.try_to_cast_date", "macro.dbt.type_int", "macro.dbt.type_timestamp"], "nodes": ["model.input_layer.lab_result"]}, "config": {"enabled": true, "alias": "_stg_clinical_lab_result", "schema": "core", "database": null, "tags": ["core_stage_clinical"], "meta": {}, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#0f3d0b"}, "bind": false, "post-hook": [], "pre-hook": []}, "database": "dev_sarah", "schema": "core", "fqn": ["the_tuva_project", "core", "staging", "core__stg_clinical_lab_result"], "unique_id": "model.the_tuva_project.core__stg_clinical_lab_result", "raw_code": "{{ config(\n enabled = var('clinical_enabled',var('tuva_marts_enabled',False))\n )\n}}\n\nselect\n cast(lab_result_id as {{ dbt.type_string() }} ) as lab_result_id\n , cast(patient_id as {{ dbt.type_string() }} ) as patient_id\n , cast(encounter_id as {{ dbt.type_string() }} ) as encounter_id\n , cast(accession_number as {{ dbt.type_string() }} ) as accession_number\n , cast(source_code_type as {{ dbt.type_string() }} ) as source_code_type\n , cast(source_code as {{ dbt.type_string() }} ) as source_code\n , cast(source_description as {{ dbt.type_string() }} ) as source_description\n , cast(source_component as {{ dbt.type_string() }} ) as source_component\n , cast(normalized_code_type as {{ dbt.type_string() }} ) as normalized_code_type\n , cast(normalized_code as {{ dbt.type_string() }} ) as normalized_code\n , cast(normalized_description as {{ dbt.type_string() }} ) as normalized_description\n , cast(normalized_component as {{ dbt.type_string() }} ) as normalized_component\n , cast(status as {{ dbt.type_string() }} ) as status\n , cast(result as {{ dbt.type_string() }} ) as result\n , {{ try_to_cast_date('result_date', 'YYYY-MM-DD') }} as result_date\n , {{ try_to_cast_date('collection_date', 'YYYY-MM-DD') }} as collection_date\n , cast(source_units as {{ dbt.type_string() }} ) as source_units\n , cast(normalized_units as {{ dbt.type_string() }} ) as normalized_units\n , cast(source_reference_range_low as {{ dbt.type_string() }} ) as source_reference_range_low\n , cast(source_reference_range_high as {{ dbt.type_string() }} ) as source_reference_range_high\n , cast(normalized_reference_range_low as {{ dbt.type_string() }} ) as normalized_reference_range_low\n , cast(normalized_reference_range_high as {{ dbt.type_string() }} ) as normalized_reference_range_high\n , cast(source_abnormal_flag as {{ dbt.type_int() }} ) as source_abnormal_flag\n , cast(normalized_abnormal_flag as {{ dbt.type_int() }} ) as normalized_abnormal_flag\n , cast(specimen as {{ dbt.type_string() }} ) as specimen\n , cast(ordering_practitioner_id as {{ dbt.type_string() }} ) as ordering_practitioner_id\n , cast(data_source as {{ dbt.type_string() }} ) as data_source\n , cast('{{ var('tuva_last_run')}}' as {{ dbt.type_timestamp() }} ) as tuva_last_run\nfrom {{ ref('lab_result') }}", "language": "sql", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/the_tuva_project", "path": "core/staging/core__stg_clinical_lab_result.sql", "original_file_path": "models/core/staging/core__stg_clinical_lab_result.sql", "name": "core__stg_clinical_lab_result", "alias": "_stg_clinical_lab_result", "checksum": {"name": "sha256", "checksum": "4861fe602fc9b4355ea3da9ae79829c4c4eb329b9423d304eadf2523c43b8937"}, "tags": ["core_stage_clinical"], "refs": [["lab_result"]], "sources": [], "metrics": [], "description": "Staging core clinical lab results", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#0f3d0b"}, "patch_path": "the_tuva_project://models/core/core_models.yml", "compiled_path": null, "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": 1701301033.911438}, "model.the_tuva_project.core__stg_claims_pharmacy_claim": {"resource_type": "model", "depends_on": {"macros": ["macro.dbt.type_string", "macro.dbt.type_numeric"], "nodes": ["model.input_layer.pharmacy_claim"]}, "config": {"enabled": true, "alias": "_stg_claims_pharmacy_claim", "schema": "core", "database": null, "tags": ["core_stage_claims"], "meta": {}, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#0f3d0b"}, "bind": false, "post-hook": [], "pre-hook": []}, "database": "dev_sarah", "schema": "core", "fqn": ["the_tuva_project", "core", "staging", "core__stg_claims_pharmacy_claim"], "unique_id": "model.the_tuva_project.core__stg_claims_pharmacy_claim", "raw_code": "{{ config(\n enabled = var('claims_enabled',var('tuva_marts_enabled',False))\n )\n}}\n\n-- *************************************************\n-- This dbt model creates the pharmacy_claim\n-- table in core.\n-- *************************************************\n\n\n\n\nselect\n cast(claim_id as {{ dbt.type_string() }} ) as claim_id\n , cast(claim_line_number as integer ) as claim_line_number\n , cast(patient_id as {{ dbt.type_string() }} ) as patient_id\n , cast(member_id as {{ dbt.type_string() }} ) as member_id\n , cast(payer as {{ dbt.type_string() }} ) as payer\n , cast(plan as {{ dbt.type_string() }} ) as plan\n , cast(prescribing_provider_npi as {{ dbt.type_string() }} ) as prescribing_provider_npi\n , cast(dispensing_provider_npi as {{ dbt.type_string() }} ) as dispensing_provider_npi\n , cast(dispensing_date as date ) as dispensing_date\n , cast(ndc_code as {{ dbt.type_string() }} ) 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 {{ dbt.type_numeric() }}) as paid_amount\n , cast(allowed_amount as {{ dbt.type_numeric() }} ) as allowed_amount\n , cast(coinsurance_amount as {{ dbt.type_numeric() }} ) as coinsurance_amount\n , cast(copayment_amount as {{ dbt.type_numeric() }} ) as copayment_amount\n , cast(deductible_amount as {{ dbt.type_numeric() }} ) as deductible_amount\n , cast(data_source as {{ dbt.type_string() }} ) as data_source\n , '{{ var('tuva_last_run')}}' as tuva_last_run\nfrom {{ ref('pharmacy_claim') }}", "language": "sql", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/the_tuva_project", "path": "core/staging/core__stg_claims_pharmacy_claim.sql", "original_file_path": "models/core/staging/core__stg_claims_pharmacy_claim.sql", "name": "core__stg_claims_pharmacy_claim", "alias": "_stg_claims_pharmacy_claim", "checksum": {"name": "sha256", "checksum": "9c1c8b1003554ae7708c46057caab1af44edc07f996d59fba2e2d24d588c9cb4"}, "tags": ["core_stage_claims"], "refs": [["pharmacy_claim"]], "sources": [], "metrics": [], "description": "Staging core pharmacy claims", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#0f3d0b"}, "patch_path": "the_tuva_project://models/core/core_models.yml", "compiled_path": null, "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": 1701301033.913302}, "model.the_tuva_project.core__stg_clinical_patient": {"resource_type": "model", "depends_on": {"macros": ["macro.dbt.type_string", "macro.the_tuva_project.try_to_cast_date", "macro.dbt.type_int", "macro.dbt.type_float", "macro.dbt.type_timestamp"], "nodes": ["model.input_layer.patient"]}, "config": {"enabled": true, "alias": "_stg_clinical_patient", "schema": "core", "database": null, "tags": ["core_stage_clinical"], "meta": {}, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#0f3d0b"}, "bind": false, "post-hook": [], "pre-hook": []}, "database": "dev_sarah", "schema": "core", "fqn": ["the_tuva_project", "core", "staging", "core__stg_clinical_patient"], "unique_id": "model.the_tuva_project.core__stg_clinical_patient", "raw_code": "{{ config(\n enabled = var('clinical_enabled',var('tuva_marts_enabled',False))\n )\n}}\n\nselect\n cast(patient_id as {{ dbt.type_string() }} ) as patient_id\n , cast(first_name as {{ dbt.type_string() }} ) as first_name\n , cast(last_name as {{ dbt.type_string() }} ) as last_name\n , cast(sex as {{ dbt.type_string() }} ) as sex\n , cast(race as {{ dbt.type_string() }} ) as race\n , {{ try_to_cast_date('birth_date', 'YYYY-MM-DD') }} as birth_date\n , {{ try_to_cast_date('death_date', 'YYYY-MM-DD') }} as death_date\n , cast(death_flag as {{ dbt.type_int() }} ) as death_flag\n , cast(address as {{ dbt.type_string() }} ) as address\n , cast(city as {{ dbt.type_string() }} ) as city\n , cast(state as {{ dbt.type_string() }} ) as state\n , cast(zip_code as {{ dbt.type_string() }} ) as zip_code\n , cast(county as {{ dbt.type_string() }} ) as county\n , cast(latitude as {{ dbt.type_float() }} ) as latitude\n , cast(longitude as {{ dbt.type_float() }} ) as longitude\n , cast(data_source as {{ dbt.type_string() }} ) as data_source\n , cast('{{ var('tuva_last_run')}}' as {{ dbt.type_timestamp() }} ) as tuva_last_run\n\nfrom {{ ref('patient') }}", "language": "sql", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/the_tuva_project", "path": "core/staging/core__stg_clinical_patient.sql", "original_file_path": "models/core/staging/core__stg_clinical_patient.sql", "name": "core__stg_clinical_patient", "alias": "_stg_clinical_patient", "checksum": {"name": "sha256", "checksum": "3daa12aef291b5031181cfcb88268f82029fd207206c85657d8cd0d4f3bf7b09"}, "tags": ["core_stage_clinical"], "refs": [["patient"]], "sources": [], "metrics": [], "description": "Staging core clinical patients", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#0f3d0b"}, "patch_path": "the_tuva_project://models/core/core_models.yml", "compiled_path": null, "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": 1701301033.915049}, "model.the_tuva_project.core__procedure": {"resource_type": "model", "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.core__stg_claims_procedure", "model.the_tuva_project.core__stg_clinical_procedure"]}, "config": {"enabled": true, "alias": "procedure", "schema": "core", "database": null, "tags": ["core"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#0f3d0b"}, "bind": false, "post-hook": [], "pre-hook": []}, "database": "dev_sarah", "schema": "core", "fqn": ["the_tuva_project", "core", "final", "core__procedure"], "unique_id": "model.the_tuva_project.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", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/the_tuva_project", "path": "core/final/core__procedure.sql", "original_file_path": "models/core/final/core__procedure.sql", "name": "core__procedure", "alias": "procedure", "checksum": {"name": "sha256", "checksum": "2ec212aa41f812304773bc51f2ae8bd67767d75b2fb2f29f79ad916c04ba83d2"}, "tags": ["core"], "refs": [["core__stg_claims_procedure"], ["core__stg_clinical_procedure"]], "sources": [], "metrics": [], "description": "The procedure table contains information on procedures that were performed on patients in the dataset.\n", "columns": {"procedure_id": {"name": "procedure_id", "description": "The unique identifier for the performed procedure.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "encounter_id": {"name": "encounter_id", "description": "The encounter_id for the encounter where this procedure was performed.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "claim_id": {"name": "claim_id", "description": "The claim on which the procedure was recorded.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "patient_id": {"name": "patient_id", "description": "Unique identifier for each person across all datasets.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "procedure_date": {"name": "procedure_date", "description": "Date when the procedure was performed.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "source_code_type": {"name": "source_code_type", "description": "Type of procedure code for the procedure in the source system.\n", "meta": {"terminology": "/terminology/tuva-concepts/code-type"}, "data_type": null, "quote": null, "tags": []}, "source_code": {"name": "source_code", "description": "The procedure code in the source system.", "meta": {"terminology": "/terminology/conditions-and-procedures/icd-10-pcs"}, "data_type": null, "quote": null, "tags": []}, "source_description": {"name": "source_description", "description": "Description of the procedure code.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "normalized_code_type": {"name": "normalized_code_type", "description": "Normalized type of procedure code for the procedure.", "meta": {"terminology": "/terminology/tuva-concepts/code-type"}, "data_type": null, "quote": null, "tags": []}, "normalized_code": {"name": "normalized_code", "description": "The normalized procedure code.", "meta": {"terminology": "/terminology/conditions-and-procedures/icd-10-pcs"}, "data_type": null, "quote": null, "tags": []}, "normalized_description": {"name": "normalized_description", "description": "Description of the procedure code.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "modifier_1": {"name": "modifier_1", "description": "First modifier for the procedure code.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "modifier_2": {"name": "modifier_2", "description": "Second modifier for the procedure code.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "modifier_3": {"name": "modifier_3", "description": "Third modifier for the procedure code.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "modifier_4": {"name": "modifier_4", "description": "Fourth modifier for the procedure code.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "modifier_5": {"name": "modifier_5", "description": "Fifth modifier for the procedure code.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "practitioner_id": {"name": "practitioner_id", "description": "ID of the provider who performed the procedure.", "meta": {"terminology": "/terminology/providers/provider"}, "data_type": null, "quote": null, "tags": []}, "data_source": {"name": "data_source", "description": "User-configured field that indicates the data source (e.g. typically named after the payer and state \"BCBS Tennessee\").\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The last time the data was refreshed. Generated by `dbt_utils.pretty_time` as the local time of the `dbt run` environment. Timezone is configurable via the `tuva_last_run` var.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": "#0f3d0b"}, "patch_path": "the_tuva_project://models/core/core_models.yml", "compiled_path": null, "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": 1701301033.920079}, "model.the_tuva_project.core__pharmacy_claim": {"resource_type": "model", "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.core__stg_claims_pharmacy_claim"]}, "config": {"enabled": true, "alias": "pharmacy_claim", "schema": "core", "database": null, "tags": ["core"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#0f3d0b"}, "bind": false, "post-hook": [], "pre-hook": []}, "database": "dev_sarah", "schema": "core", "fqn": ["the_tuva_project", "core", "final", "core__pharmacy_claim"], "unique_id": "model.the_tuva_project.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", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/the_tuva_project", "path": "core/final/core__pharmacy_claim.sql", "original_file_path": "models/core/final/core__pharmacy_claim.sql", "name": "core__pharmacy_claim", "alias": "pharmacy_claim", "checksum": {"name": "sha256", "checksum": "d6e2bac51e9f18580249d402ed5ddc88c616d33d70781c4adf4dfd980499f836"}, "tags": ["core"], "refs": [["core__stg_claims_pharmacy_claim"]], "sources": [], "metrics": [], "description": "The pharmacy claim table contains information on prescription drugs that were filled and billed to the insurer.\n", "columns": {"claim_id": {"name": "claim_id", "description": "Unique identifier for each claim.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "claim_line_number": {"name": "claim_line_number", "description": "Indicates the line number for the particular line of the claim.", "meta": {}, "data_type": "integer", "quote": null, "tags": []}, "patient_id": {"name": "patient_id", "description": "Unique identifier for each patient in the dataset.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "member_id": {"name": "member_id", "description": "Identifier that links a patient to a particular insurance product or health plan. A patient can have more than one member_id because they can have more than one insurance product/plan.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "payer": {"name": "payer", "description": "Name of the payer", "meta": {}, "data_type": null, "quote": null, "tags": []}, "plan": {"name": "plan", "description": "Name of the plan", "meta": {}, "data_type": null, "quote": null, "tags": []}, "prescribing_provider_npi": {"name": "prescribing_provider_npi", "description": "NPI for the provider that wrote the prescription (e.g. priamry care physician).\n", "meta": {"terminology": "/terminology/providers/provider"}, "data_type": null, "quote": null, "tags": []}, "dispensing_provider_npi": {"name": "dispensing_provider_npi", "description": "NPI for the provider that dispensed the prescription (e.g. pharmacy).\n", "meta": {"terminology": "/terminology/providers/provider"}, "data_type": null, "quote": null, "tags": []}, "dispensing_date": {"name": "dispensing_date", "description": "Date the prescription was filled.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "ndc_code": {"name": "ndc_code", "description": "National drug code on the claim.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "quantity": {"name": "quantity", "description": "Number of doses.", "meta": {}, "data_type": "integer", "quote": null, "tags": []}, "days_supply": {"name": "days_supply", "description": "Number of days supply.", "meta": {}, "data_type": "integer", "quote": null, "tags": []}, "refills": {"name": "refills", "description": "Number of refills for the prescription.", "meta": {}, "data_type": "integer", "quote": null, "tags": []}, "paid_date": {"name": "paid_date", "description": "Date the claim was paid.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "paid_amount": {"name": "paid_amount", "description": "Amount paid by the health insurer for the claim.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "allowed_amount": {"name": "allowed_amount", "description": "Contractual amount allowed to be paid by the payer + patient.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "coinsurance_amount": {"name": "coinsurance_amount", "description": "The total coinsurance charged on the claim by the provider.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "copayment_amount": {"name": "copayment_amount", "description": "The total copayment charged on the claim by the provider.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "deductible_amount": {"name": "deductible_amount", "description": "The total amount charged on the claim by the provider.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "data_source": {"name": "data_source", "description": "User-configured field that indicates the data source (e.g. typically named after the payer and state \"BCBS Tennessee\").\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The last time the data was refreshed. Generated by `dbt_utils.pretty_time` as the local time of the `dbt run` environment. Timezone is configurable via the `tuva_last_run` var.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": "#0f3d0b"}, "patch_path": "the_tuva_project://models/core/core_models.yml", "compiled_path": null, "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": 1701301033.9254808}, "model.the_tuva_project.core__encounter": {"resource_type": "model", "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.core__stg_clinical_encounter"]}, "config": {"enabled": true, "alias": "encounter", "schema": "core", "database": null, "tags": ["core"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#0f3d0b"}, "bind": false, "post-hook": [], "pre-hook": []}, "database": "dev_sarah", "schema": "core", "fqn": ["the_tuva_project", "core", "final", "core__encounter"], "unique_id": "model.the_tuva_project.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", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/the_tuva_project", "path": "core/final/core__encounter.sql", "original_file_path": "models/core/final/core__encounter.sql", "name": "core__encounter", "alias": "encounter", "checksum": {"name": "sha256", "checksum": "2cf0a388e7ed3dbd677997974437d8ac82992cf599c035a9b3e6a66d2cfeb133"}, "tags": ["core"], "refs": [["core__stg_clinical_encounter"]], "sources": [], "metrics": [], "description": "The encounter table contains information about patients visits (i.e. encounters). This includes acute inpatient, emergency department, office visits, SNF stays, etc.\n", "columns": {"encounter_id": {"name": "encounter_id", "description": "Unique identifier for each encounter.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "patient_id": {"name": "patient_id", "description": "Unique identifier for a patient.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "encounter_type": {"name": "encounter_type", "description": "Indicates the type of encounter e.g. acute inpatient, emergency department, etc.\n", "meta": {"terminology": "/terminology/tuva-concepts/encounter-type"}, "data_type": null, "quote": null, "tags": []}, "encounter_start_date": {"name": "encounter_start_date", "description": "Date when the encounter started.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "encounter_end_date": {"name": "encounter_end_date", "description": "Date when the encounter ended.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "length_of_stay": {"name": "length_of_stay", "description": "Length of the encounter calculated as encounter_end_date - encounter_start_date.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "admit_source_code": {"name": "admit_source_code", "description": "Admission source code for the encounter.", "meta": {"terminology": "/terminology/administrative-codes/admit-source"}, "data_type": null, "quote": null, "tags": []}, "admit_source_description": {"name": "admit_source_description", "description": "Description of the admit_source_code for the encounter.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "admit_type_code": {"name": "admit_type_code", "description": "Admission type code for the encounter.", "meta": {"terminology": "/terminology/administrative-codes/admit-type"}, "data_type": null, "quote": null, "tags": []}, "admit_type_description": {"name": "admit_type_description", "description": "Description of the admit_type_code for the encounter.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "discharge_disposition_code": {"name": "discharge_disposition_code", "description": "Discharge disposition code for the encounter.", "meta": {"terminology": "/terminology/administrative-codes/discharge-disposition"}, "data_type": null, "quote": null, "tags": []}, "discharge_disposition_description": {"name": "discharge_disposition_description", "description": "Description of the discharge_disposition_code for the encounter.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "attending_provider_id": {"name": "attending_provider_id", "description": "attending provider for the encounter.", "meta": {"terminology": "/terminology/providers/provider"}, "data_type": null, "quote": null, "tags": []}, "facility_npi": {"name": "facility_npi", "description": "Facility NPI for the encounter (typically represents the facility where services were performed).\n", "meta": {"terminology": "/terminology/providers/provider"}, "data_type": null, "quote": null, "tags": []}, "primary_diagnosis_code_type": {"name": "primary_diagnosis_code_type", "description": "The type of condition code reported in the source system e.g. ICD-10-CM.\n", "meta": {"terminology": "/terminology/tuva-concepts/code-type"}, "data_type": null, "quote": null, "tags": []}, "primary_diagnosis_code": {"name": "primary_diagnosis_code", "description": "Primary diagnosis code for the encounter. If from claims the primary diagnosis code comes from the institutional claim.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "primary_diagnosis_description": {"name": "primary_diagnosis_description", "description": "Description of the primary diagnosis code.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "ms_drg_code": {"name": "ms_drg_code", "description": "MS-DRG code for the encounter.", "meta": {"terminology": "/terminology/conditions-and-procedures/ms-drg"}, "data_type": null, "quote": null, "tags": []}, "ms_drg_description": {"name": "ms_drg_description", "description": "Description of the ms_drg_code.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "apr_drg_code": {"name": "apr_drg_code", "description": "APR-DRG code for the encounter.", "meta": {"terminology": "/terminology/conditions-and-procedures/apr-drg"}, "data_type": null, "quote": null, "tags": []}, "apr_drg_description": {"name": "apr_drg_description", "description": "Description of the APR-DRG code.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "paid_amount": {"name": "paid_amount", "description": "The total amount paid for the encounter by the insurer.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "allowed_amount": {"name": "allowed_amount", "description": "The total amount allowed (includes amount paid by the insurer and patient) on the encounter.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "charge_amount": {"name": "charge_amount", "description": "The total amount charged on the encounter by the provider.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "data_source": {"name": "data_source", "description": "User-configured field that indicates the data source (e.g. typically named after the payer and state \"BCBS Tennessee\").\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The last time the data was refreshed. Generated by `dbt_utils.pretty_time` as the local time of the `dbt run` environment. Timezone is configurable via the `tuva_last_run` var.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": "#0f3d0b"}, "patch_path": "the_tuva_project://models/core/core_models.yml", "compiled_path": null, "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": 1701301033.931956}, "model.the_tuva_project.core__medical_claim": {"resource_type": "model", "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.core__stg_claims_medical_claim"]}, "config": {"enabled": true, "alias": "medical_claim", "schema": "core", "database": null, "tags": ["core"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#0f3d0b"}, "bind": false, "post-hook": [], "pre-hook": []}, "database": "dev_sarah", "schema": "core", "fqn": ["the_tuva_project", "core", "final", "core__medical_claim"], "unique_id": "model.the_tuva_project.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", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/the_tuva_project", "path": "core/final/core__medical_claim.sql", "original_file_path": "models/core/final/core__medical_claim.sql", "name": "core__medical_claim", "alias": "medical_claim", "checksum": {"name": "sha256", "checksum": "b126bbc3a07a5f93f701d0199e8fde6ef13a7fd9ac7ad71619de948a8d49fdc1"}, "tags": ["core"], "refs": [["core__stg_claims_medical_claim"]], "sources": [], "metrics": [], "description": "The medical claim table contains information on services rendered to patients and billed by the provider to the insurer as claims.\n", "columns": {"claim_id": {"name": "claim_id", "description": "Unique identifier for each claim.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "claim_line_number": {"name": "claim_line_number", "description": "Indicates the line number for the particular line of the claim.\n", "meta": {}, "data_type": "integer", "quote": null, "tags": []}, "claim_type": {"name": "claim_type", "description": "Indicates whether the claim is professional (CMS-1500), institutional (UB-04), dental, or vision.\n", "meta": {"terminology": "/terminology/tuva-concepts/claim-type"}, "data_type": null, "quote": null, "tags": []}, "patient_id": {"name": "patient_id", "description": "Unique identifier for each patient in the dataset.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "member_id": {"name": "member_id", "description": "Identifier that links a patient to a particular insurance product or health plan. A patient can have more than one member_id because they can have more than one insurance product/plan.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "payer": {"name": "payer", "description": "Name of the payer", "meta": {}, "data_type": null, "quote": null, "tags": []}, "plan": {"name": "plan", "description": "Name of the plan", "meta": {}, "data_type": null, "quote": null, "tags": []}, "claim_start_date": {"name": "claim_start_date", "description": "Start date for the claim.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "claim_end_date": {"name": "claim_end_date", "description": "End date for the claim.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "claim_line_start_date": {"name": "claim_line_start_date", "description": "Start date for the claim line.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "claim_line_end_date": {"name": "claim_line_end_date", "description": "End date for the claim line.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "admission_date": {"name": "admission_date", "description": "Admission date for the claim (inpatient claims only).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "discharge_date": {"name": "discharge_date", "description": "Discharge date for the claim (inpatient claims only).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "admit_source_code": {"name": "admit_source_code", "description": "Indicates where the patient was before the healthcare encounter (inpatient claims only).\n", "meta": {"terminology": "/terminology/administrative-codes/admit-source"}, "data_type": null, "quote": null, "tags": []}, "admit_type_code": {"name": "admit_type_code", "description": "Indicates the type of admission (inpatient claims only).", "meta": {"terminology": "/terminology/administrative-codes/admit-type"}, "data_type": null, "quote": null, "tags": []}, "discharge_disposition_code": {"name": "discharge_disposition_code", "description": "Indicates the type of setting the patient was discharged to (institutional inpatient claims only).\n", "meta": {"terminology": "/terminology/administrative-codes/discharge-disposition"}, "data_type": null, "quote": null, "tags": []}, "place_of_service_code": {"name": "place_of_service_code", "description": "Place of service for the claim (professional claims only).", "meta": {"terminology": "/terminology/administrative-codes/place-of-service"}, "data_type": null, "quote": null, "tags": []}, "bill_type_code": {"name": "bill_type_code", "description": "Bill type code for the claim (institutional claims only).", "meta": {"terminology": "/terminology/administrative-codes/bill-type"}, "data_type": null, "quote": null, "tags": []}, "ms_drg_code": {"name": "ms_drg_code", "description": "MS-DRG for the claim (inpatient claims only).", "meta": {"terminology": "/terminology/conditions-and-procedures/ms-drg"}, "data_type": null, "quote": null, "tags": []}, "apr_drg_code": {"name": "apr_drg_code", "description": "APR-DRG for the claim (inpatient claims only).", "meta": {"terminology": "/terminology/conditions-and-procedures/apr-drg"}, "data_type": null, "quote": null, "tags": []}, "revenue_center_code": {"name": "revenue_center_code", "description": "Revenue center code for the claim line (institutional only and typically multiple codes per claim).\n", "meta": {"terminology": "/terminology/administrative-codes/revenue-center"}, "data_type": null, "quote": null, "tags": []}, "service_unit_quantity": {"name": "service_unit_quantity", "description": "The number of units for the particular revenue center code.", "meta": {}, "data_type": "integer", "quote": null, "tags": []}, "hcpcs_code": {"name": "hcpcs_code", "description": "HCPCS level 1 or level 2 code for the claim line.", "meta": {"terminology": "/terminology/conditions-and-procedures/hcpcs-level-2"}, "data_type": null, "quote": null, "tags": []}, "hcpcs_modifier_1": {"name": "hcpcs_modifier_1", "description": "1st modifier for HCPCS code.", "meta": {"terminology": "/terminology/conditions-and-procedures/hcpcs-level-2"}, "data_type": null, "quote": null, "tags": []}, "hcpcs_modifier_2": {"name": "hcpcs_modifier_2", "description": "2nd modifier for HCPCS code.", "meta": {"terminology": "/terminology/conditions-and-procedures/hcpcs-level-2"}, "data_type": null, "quote": null, "tags": []}, "hcpcs_modifier_3": {"name": "hcpcs_modifier_3", "description": "3rd modifier for HCPCS code.", "meta": {"terminology": "/terminology/conditions-and-procedures/hcpcs-level-2"}, "data_type": null, "quote": null, "tags": []}, "hcpcs_modifier_4": {"name": "hcpcs_modifier_4", "description": "4th modifier for HCPCS code.", "meta": {"terminology": "/terminology/conditions-and-procedures/hcpcs-level-2"}, "data_type": null, "quote": null, "tags": []}, "hcpcs_modifier_5": {"name": "hcpcs_modifier_5", "description": "5th modifier for HCPCS code.", "meta": {"terminology": "/terminology/conditions-and-procedures/hcpcs-level-2"}, "data_type": null, "quote": null, "tags": []}, "rendering_npi": {"name": "rendering_npi", "description": "Rendering NPI for the claim (typically represents the physician or entity providing services).\n", "meta": {"terminology": "/terminology/providers/provider"}, "data_type": null, "quote": null, "tags": []}, "billing_npi": {"name": "billing_npi", "description": "Billing NPI for the claim (typically represents organization billing the claim).\n", "meta": {"terminology": "/terminology/providers/provider"}, "data_type": null, "quote": null, "tags": []}, "facility_npi": {"name": "facility_npi", "description": "Facility NPI for the claim (typically represents the facility where services were performed).\n", "meta": {"terminology": "/terminology/providers/provider"}, "data_type": null, "quote": null, "tags": []}, "paid_date": {"name": "paid_date", "description": "The date the claim was paid.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "paid_amount": {"name": "paid_amount", "description": "The total amount paid on the claim by the insurer.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "allowed_amount": {"name": "allowed_amount", "description": "The total amount allowed (includes amount paid by the insurer and patient) on the claim.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "charge_amount": {"name": "charge_amount", "description": "The total amount charged on the claim by the provider.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "coinsurance_amount": {"name": "coinsurance_amount", "description": "The total coinsurance charged on the claim by the provider.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "copayment_amount": {"name": "copayment_amount", "description": "The total copayment charged on the claim by the provider.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "deductible_amount": {"name": "deductible_amount", "description": "The total amount charged on the claim by the provider.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "total_cost_amount": {"name": "total_cost_amount", "description": "The total amount paid on the claim by different parties.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "encounter_type": {"name": "encounter_type", "description": "The type of encounter this claim belongs to.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "encounter_id": {"name": "encounter_id", "description": "The encounter_id for the encounter that this claims belongs to.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "service_category_1": {"name": "service_category_1", "description": "The broader service category this claim belongs to.", "meta": {"terminology": "/value-sets/service-category"}, "data_type": null, "quote": null, "tags": []}, "service_category_2": {"name": "service_category_2", "description": "The more specific service category this claim belongs to.", "meta": {"terminology": "/value-sets/service-category"}, "data_type": null, "quote": null, "tags": []}, "data_source": {"name": "data_source", "description": "User-configured field that indicates the data source (e.g. typically named after the payer and state \"BCBS Tennessee\").\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The last time the data was refreshed. Generated by `dbt_utils.pretty_time` as the local time of the `dbt run` environment. Timezone is configurable via the `tuva_last_run` var.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": "#0f3d0b"}, "patch_path": "the_tuva_project://models/core/core_models.yml", "compiled_path": null, "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": 1701301033.9766998}, "model.the_tuva_project.core__stg_clinical_medication": {"resource_type": "model", "depends_on": {"macros": ["macro.dbt.type_string", "macro.the_tuva_project.try_to_cast_date", "macro.dbt.type_int", "macro.dbt.type_timestamp"], "nodes": ["model.input_layer.medication"]}, "config": {"enabled": true, "alias": "_stg_clinical_medication", "schema": "core", "database": null, "tags": ["core_stage_clinical"], "meta": {}, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#0f3d0b"}, "bind": false, "post-hook": [], "pre-hook": []}, "database": "dev_sarah", "schema": "core", "fqn": ["the_tuva_project", "core", "staging", "core__stg_clinical_medication"], "unique_id": "model.the_tuva_project.core__stg_clinical_medication", "raw_code": "{{ config(\n enabled = var('clinical_enabled',var('tuva_marts_enabled',False))\n )\n}}\n\nselect\n cast(medication_id as {{ dbt.type_string() }} ) as medication_id\n , cast(patient_id as {{ dbt.type_string() }} ) as patient_id\n , cast(encounter_id as {{ dbt.type_string() }} ) as encounter_id\n , {{ try_to_cast_date('dispensing_date', 'YYYY-MM-DD') }} as dispensing_date\n , {{ try_to_cast_date('prescribing_date', 'YYYY-MM-DD') }} as prescribing_date\n , cast(source_code_type as {{ dbt.type_string() }} ) as source_code_type\n , cast(source_code as {{ dbt.type_string() }} ) as source_code\n , cast(source_description as {{ dbt.type_string() }} ) as source_description\n , cast(ndc_code as {{ dbt.type_string() }} ) as ndc_code\n , cast(ndc_description as {{ dbt.type_string() }} ) as ndc_description\n , cast(rxnorm_code as {{ dbt.type_string() }} ) as rxnorm_code\n , cast(rxnorm_description as {{ dbt.type_string() }} ) as rxnorm_description \n , cast(atc_code as {{ dbt.type_string() }} ) as atc_code\n , cast(atc_description as {{ dbt.type_string() }} ) as atc_description\n , cast(route as {{ dbt.type_string() }} ) as route\n , cast(strength as {{ dbt.type_string() }} ) as strength\n , cast(quantity as {{ dbt.type_int() }} ) as quantity\n , cast(quantity_unit as {{ dbt.type_string() }} ) as quantity_unit\n , cast(days_supply as {{ dbt.type_int() }} ) as days_supply\n , cast(practitioner_id as {{ dbt.type_string() }} ) as practitioner_id\n , cast(data_source as {{ dbt.type_string() }} ) as data_source\n , cast('{{ var('tuva_last_run')}}' as {{ dbt.type_timestamp() }} ) as tuva_last_run\nfrom {{ ref('medication') }}", "language": "sql", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/the_tuva_project", "path": "core/staging/core__stg_clinical_medication.sql", "original_file_path": "models/core/staging/core__stg_clinical_medication.sql", "name": "core__stg_clinical_medication", "alias": "_stg_clinical_medication", "checksum": {"name": "sha256", "checksum": "3534e17215e27b1fd8d009a8fd5a2f88343046667b640afb9e4fbb068db9e60b"}, "tags": ["core_stage_clinical"], "refs": [["medication"]], "sources": [], "metrics": [], "description": "Staging core clinical medications", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#0f3d0b"}, "patch_path": "the_tuva_project://models/core/core_models.yml", "compiled_path": null, "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": 1701301033.9785988}, "model.the_tuva_project.core__observation": {"resource_type": "model", "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.core__stg_clinical_observation"]}, "config": {"enabled": true, "alias": "observation", "schema": "core", "database": null, "tags": ["core"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#0f3d0b"}, "bind": false, "post-hook": [], "pre-hook": []}, "database": "dev_sarah", "schema": "core", "fqn": ["the_tuva_project", "core", "final", "core__observation"], "unique_id": "model.the_tuva_project.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", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/the_tuva_project", "path": "core/final/core__observation.sql", "original_file_path": "models/core/final/core__observation.sql", "name": "core__observation", "alias": "observation", "checksum": {"name": "sha256", "checksum": "8e922586d391bb227ab514044d20f47f328a489ae785158adf2d12a7f1c84d4b"}, "tags": ["core"], "refs": [["core__stg_clinical_observation"]], "sources": [], "metrics": [], "description": "The observation table contains information on measurements other than lab tests e.g. blood pressure, height, and weight.\n", "columns": {"observation_id": {"name": "observation_id", "description": "Unique identifier for each observation in the dataset.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "patient_id": {"name": "patient_id", "description": "Unique identifier for each patient in the dataset.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "encounter_id": {"name": "encounter_id", "description": "Unique identifier for each encounter in the dataset.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "panel_id": {"name": "panel_id", "description": "Unique identifier for the panel.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "observation_date": {"name": "observation_date", "description": "Date the observation was recorded.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "observation_type": {"name": "observation_type", "description": "Type of observation.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "source_code_type": {"name": "source_code_type", "description": "Source code type of the observation.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "source_code": {"name": "source_code", "description": "Source code of the observation.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "source_description": {"name": "source_description", "description": "Source description of the observation.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "normalized_code_type": {"name": "normalized_code_type", "description": "Normalized code type of the observation.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "normalized_code": {"name": "normalized_code", "description": "Normalized code of the observation.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "normalized_description": {"name": "normalized_description", "description": "Normalized description of the observatino.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "result": {"name": "result", "description": "The result of the observation.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "source_units": {"name": "source_units", "description": "Source units of the lab test.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "normalized_units": {"name": "normalized_units", "description": "Normalized units of the lab test.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "source_reference_range_low": {"name": "source_reference_range_low", "description": "The low end of the reference range from the source system.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "source_reference_range_high": {"name": "source_reference_range_high", "description": "The high end of the reference range from the source system.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "normalized_reference_range_low": {"name": "normalized_reference_range_low", "description": "The normalized low end of the reference range.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "normalized_reference_range_high": {"name": "normalized_reference_range_high", "description": "The normalized high end of the reference range.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "data_source": {"name": "data_source", "description": "Custom description of the source system e.g. Epic.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The last time the data was refreshed. Generated by `dbt_utils.pretty_time` as the local time of the `dbt run` environment. Timezone is configurable via the `tuva_last_run` var.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": "#0f3d0b"}, "patch_path": "the_tuva_project://models/core/core_models.yml", "compiled_path": null, "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": 1701301033.983381}, "model.the_tuva_project.core__stg_claims_eligibility": {"resource_type": "model", "depends_on": {"macros": ["macro.dbt.type_string"], "nodes": ["model.input_layer.eligibility"]}, "config": {"enabled": true, "alias": "_stg_claims_eligibility", "schema": "core", "database": null, "tags": ["core_stage_claims"], "meta": {}, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#0f3d0b"}, "bind": false, "post-hook": [], "pre-hook": []}, "database": "dev_sarah", "schema": "core", "fqn": ["the_tuva_project", "core", "staging", "core__stg_claims_eligibility"], "unique_id": "model.the_tuva_project.core__stg_claims_eligibility", "raw_code": "{{ config(\n enabled = var('claims_enabled',var('tuva_marts_enabled',False))\n )\n}}\n\n-- *************************************************\n-- This dbt model creates the eligibility table in core.\n-- *************************************************\n\n\n\n\nselect\n cast(patient_id as {{ dbt.type_string() }} ) as patient_id\n , cast(member_id as {{ dbt.type_string() }} ) as member_id\n , cast(birth_date as date) as birth_date\n , cast(death_date as date) as death_date\n , cast(enrollment_start_date as date ) as enrollment_start_date\n , cast(enrollment_end_date as date ) as enrollment_end_date\n , cast(payer as {{ dbt.type_string() }} ) as payer\n , cast(payer_type as {{ dbt.type_string() }} ) as payer_type\n , cast(plan as {{ dbt.type_string() }} ) as plan\n , cast(original_reason_entitlement_code as {{ dbt.type_string() }} ) as original_reason_entitlement_code\n , cast(dual_status_code as {{ dbt.type_string() }} ) as dual_status_code\n , cast(medicare_status_code as {{ dbt.type_string() }} ) as medicare_status_code\n , cast(data_source as {{ dbt.type_string() }} ) as data_source\n , '{{ var('tuva_last_run')}}' as tuva_last_run\nfrom {{ ref('eligibility') }}", "language": "sql", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/the_tuva_project", "path": "core/staging/core__stg_claims_eligibility.sql", "original_file_path": "models/core/staging/core__stg_claims_eligibility.sql", "name": "core__stg_claims_eligibility", "alias": "_stg_claims_eligibility", "checksum": {"name": "sha256", "checksum": "7d963b93a6738d0781189e05324e8c51711c5a33b82fdd25e7c36494a5dc9d14"}, "tags": ["core_stage_claims"], "refs": [["eligibility"]], "sources": [], "metrics": [], "description": "Staging core eligibility", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#0f3d0b"}, "patch_path": "the_tuva_project://models/core/core_models.yml", "compiled_path": null, "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": 1701301033.9853702}, "model.the_tuva_project.core__stg_claims_patient": {"resource_type": "model", "depends_on": {"macros": ["macro.dbt.type_string", "macro.dbt.type_float", "macro.dbt.type_timestamp"], "nodes": ["model.input_layer.eligibility"]}, "config": {"enabled": true, "alias": "_stg_claims_patient", "schema": "core", "database": null, "tags": ["core_stage_claims"], "meta": {}, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#0f3d0b"}, "bind": false, "post-hook": [], "pre-hook": []}, "database": "dev_sarah", "schema": "core", "fqn": ["the_tuva_project", "core", "staging", "core__stg_claims_patient"], "unique_id": "model.the_tuva_project.core__stg_claims_patient", "raw_code": "{{ config(\n enabled = var('claims_enabled',var('tuva_marts_enabled',False))\n )\n}}\n\n-- *************************************************\n-- This dbt model creates the patient table in core.\n-- *************************************************\n\n\n\n\nwith patient_stage as(\n select\n patient_id\n ,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 {{ ref('eligibility')}}\n)\n\nselect\n cast(patient_id as {{ dbt.type_string() }}) as patient_id\n , cast(first_name as {{ dbt.type_string() }}) as first_name\n , cast(last_name as {{ dbt.type_string() }}) as last_name\n , cast(gender as {{ dbt.type_string() }}) as sex\n , cast(race as {{ dbt.type_string() }}) 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 {{ dbt.type_string() }}) as address\n , cast(city as {{ dbt.type_string() }}) as city\n , cast(state as {{ dbt.type_string() }}) as state\n , cast(zip_code as {{ dbt.type_string() }}) as zip_code\n , cast(null as {{ dbt.type_string() }}) as county\n , cast(null as {{ dbt.type_float() }}) as latitude \n , cast(null as {{ dbt.type_float() }}) as longitude\n , cast(data_source as {{ dbt.type_string() }}) as data_source\n , cast('{{ var('tuva_last_run')}}' as {{ dbt.type_timestamp() }}) as tuva_last_run\nfrom patient_stage\nwhere row_sequence = 1", "language": "sql", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/the_tuva_project", "path": "core/staging/core__stg_claims_patient.sql", "original_file_path": "models/core/staging/core__stg_claims_patient.sql", "name": "core__stg_claims_patient", "alias": "_stg_claims_patient", "checksum": {"name": "sha256", "checksum": "4b7864cbea39f19f4a4d967294f78616ad5a7e1a329b8450581af7cfe5d5b1fb"}, "tags": ["core_stage_claims"], "refs": [["eligibility"]], "sources": [], "metrics": [], "description": "Staging core claims patients", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#0f3d0b"}, "patch_path": "the_tuva_project://models/core/core_models.yml", "compiled_path": null, "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": 1701301033.9871302}, "model.the_tuva_project.core__stg_clinical_location": {"resource_type": "model", "depends_on": {"macros": ["macro.dbt.type_string", "macro.dbt.type_float", "macro.dbt.type_timestamp"], "nodes": ["model.input_layer.location"]}, "config": {"enabled": true, "alias": "_stg_clinical_location", "schema": "core", "database": null, "tags": ["core_stage_clinical"], "meta": {}, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#0f3d0b"}, "bind": false, "post-hook": [], "pre-hook": []}, "database": "dev_sarah", "schema": "core", "fqn": ["the_tuva_project", "core", "staging", "core__stg_clinical_location"], "unique_id": "model.the_tuva_project.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('{{ var('tuva_last_run')}}' as {{ dbt.type_timestamp() }} ) as tuva_last_run\r\nfrom {{ ref('location') }}", "language": "sql", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/the_tuva_project", "path": "core/staging/core__stg_clinical_location.sql", "original_file_path": "models/core/staging/core__stg_clinical_location.sql", "name": "core__stg_clinical_location", "alias": "_stg_clinical_location", "checksum": {"name": "sha256", "checksum": "d174a7c1a6034db5bd81239712dd36ba2a7d8ddebeda83eca4c9d86f00c169b8"}, "tags": ["core_stage_clinical"], "refs": [["location"]], "sources": [], "metrics": [], "description": "Staging core clinical locations", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#0f3d0b"}, "patch_path": "the_tuva_project://models/core/core_models.yml", "compiled_path": null, "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": 1701301033.988981}, "model.the_tuva_project.core__stg_claims_medical_claim": {"resource_type": "model", "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.input_layer.medical_claim", "model.the_tuva_project.service_category__service_category_grouper", "model.the_tuva_project.acute_inpatient__encounter_id", "model.the_tuva_project.emergency_department__int_encounter_id"]}, "config": {"enabled": true, "alias": "_stg_claims_medical_claim", "schema": "core", "database": null, "tags": ["core_stage_claims"], "meta": {}, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#0f3d0b"}, "bind": false, "post-hook": [], "pre-hook": []}, "database": "dev_sarah", "schema": "core", "fqn": ["the_tuva_project", "core", "staging", "core__stg_claims_medical_claim"], "unique_id": "model.the_tuva_project.core__stg_claims_medical_claim", "raw_code": "{{ config(\n enabled = var('claims_enabled',var('tuva_marts_enabled',False))\n )\n}}\n\n-- *************************************************\n-- This dbt model creates the medical_claim table\n-- in core. It adds these 4 fields to the input layer\n-- medical claim table:\n-- encounter_id\n-- service_category_1\n-- service_category_2\n-- *************************************************\n\n\nselect\n cast(med.claim_id as {{ dbt.type_string() }} ) as claim_id\n , cast(med.claim_line_number as {{ dbt.type_int() }} ) as claim_line_number\n , cast(coalesce(ap.encounter_id,ed.encounter_id) as {{ dbt.type_string() }} ) as encounter_id \n , cast(med.claim_type as {{ dbt.type_string() }} ) as claim_type\n , cast(med.patient_id as {{ dbt.type_string() }} ) as patient_id\n , cast(med.member_id as {{ dbt.type_string() }} ) as member_id\n , cast(med.payer as {{ dbt.type_string() }} ) as payer\n , cast(med.plan as {{ dbt.type_string() }} ) as plan\n , {{ try_to_cast_date('med.claim_start_date', 'YYYY-MM-DD') }} as claim_start_date\n , {{ try_to_cast_date('med.claim_end_date', 'YYYY-MM-DD') }} as claim_end_date\n , {{ try_to_cast_date('med.claim_line_start_date', 'YYYY-MM-DD') }} as claim_line_start_date\n , {{ try_to_cast_date('med.claim_line_end_date', 'YYYY-MM-DD') }} as claim_line_end_date\n , {{ try_to_cast_date('med.admission_date', 'YYYY-MM-DD') }} as admission_date\n , {{ try_to_cast_date('med.discharge_date', 'YYYY-MM-DD') }} as discharge_date\n , cast(srv_group.service_category_1 as {{ dbt.type_string() }} ) as service_category_1\n , cast(srv_group.service_category_2 as {{ dbt.type_string() }} ) as service_category_2\n , cast(med.admit_source_code as {{ dbt.type_string() }} ) as admit_source_code\n , cast(med.admit_type_code as {{ dbt.type_string() }} ) as admit_type_code\n , cast(med.discharge_disposition_code as {{ dbt.type_string() }} ) as discharge_disposition_code\n , cast(med.place_of_service_code as {{ dbt.type_string() }} ) as place_of_service_code\n , cast(med.bill_type_code as {{ dbt.type_string() }} ) as bill_type_code\n , cast(med.ms_drg_code as {{ dbt.type_string() }} ) as ms_drg_code\n , cast(med.apr_drg_code as {{ dbt.type_string() }} ) as apr_drg_code\n , cast(med.revenue_center_code as {{ dbt.type_string() }} ) as revenue_center_code\n , cast(med.service_unit_quantity as {{ dbt.type_int() }} ) as service_unit_quantity\n , cast(med.hcpcs_code as {{ dbt.type_string() }} ) as hcpcs_code\n , cast(med.hcpcs_modifier_1 as {{ dbt.type_string() }} ) as hcpcs_modifier_1\n , cast(med.hcpcs_modifier_2 as {{ dbt.type_string() }} ) as hcpcs_modifier_2\n , cast(med.hcpcs_modifier_3 as {{ dbt.type_string() }} ) as hcpcs_modifier_3\n , cast(med.hcpcs_modifier_4 as {{ dbt.type_string() }} ) as hcpcs_modifier_4\n , cast(med.hcpcs_modifier_5 as {{ dbt.type_string() }} ) as hcpcs_modifier_5\n , cast(med.rendering_npi as {{ dbt.type_string() }} ) as rendering_npi\n , cast(med.billing_npi as {{ dbt.type_string() }} ) as billing_npi\n , cast(med.facility_npi as {{ dbt.type_string() }} ) as facility_npi\n , {{ try_to_cast_date('med.paid_date', 'YYYY-MM-DD') }} as paid_date\n , cast(med.paid_amount as {{ dbt.type_numeric() }} ) as paid_amount\n , cast(med.allowed_amount as {{ dbt.type_numeric() }} ) as allowed_amount\n , cast(med.charge_amount as {{ dbt.type_numeric() }} ) as charge_amount\n , cast(med.coinsurance_amount as {{ dbt.type_numeric() }} ) as coinsurance_amount\n , cast(med.copayment_amount as {{ dbt.type_numeric() }} ) as copayment_amount\n , cast(med.deductible_amount as {{ dbt.type_numeric() }} ) as deductible_amount\n , cast(med.total_cost_amount as {{ dbt.type_numeric() }} ) as total_cost_amount\n , cast(med.data_source as {{ dbt.type_string() }} ) as data_source\n , cast('{{ var('tuva_last_run')}}' as {{ dbt.type_timestamp() }} ) as tuva_last_run\nfrom {{ ref('medical_claim') }} med\nleft join {{ ref('service_category__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 {{ ref('acute_inpatient__encounter_id') }} ap\n on med.claim_id = ap.claim_id\n and med.claim_line_number = ap.claim_line_number\nleft join {{ ref('emergency_department__int_encounter_id') }} ed\n on med.claim_id = ed.claim_id\n and med.claim_line_number = ed.claim_line_number", "language": "sql", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/the_tuva_project", "path": "core/staging/core__stg_claims_medical_claim.sql", "original_file_path": "models/core/staging/core__stg_claims_medical_claim.sql", "name": "core__stg_claims_medical_claim", "alias": "_stg_claims_medical_claim", "checksum": {"name": "sha256", "checksum": "6f41a90bb1f07f495b9fbf11c5f6d721bb3e92c0dca772dbcd9c082cfa1ac4a6"}, "tags": ["core_stage_claims"], "refs": [["medical_claim"], ["service_category__service_category_grouper"], ["acute_inpatient__encounter_id"], ["emergency_department__int_encounter_id"]], "sources": [], "metrics": [], "description": "Staging core medical claims", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#0f3d0b"}, "patch_path": "the_tuva_project://models/core/core_models.yml", "compiled_path": null, "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": 1701301033.990696}, "model.the_tuva_project.core__stg_claims_encounter": {"resource_type": "model", "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", "model.the_tuva_project.emergency_department__summary"]}, "config": {"enabled": true, "alias": "_stg_claims_encounter", "schema": "core", "database": null, "tags": ["core_stage_claims"], "meta": {}, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#0f3d0b"}, "bind": false, "post-hook": [], "pre-hook": []}, "database": "dev_sarah", "schema": "core", "fqn": ["the_tuva_project", "core", "staging", "core__stg_claims_encounter"], "unique_id": "model.the_tuva_project.core__stg_claims_encounter", "raw_code": "{{ config(\n enabled = var('claims_enabled',var('tuva_marts_enabled',False))\n )\n}}\n\n-- *************************************************\n-- This dbt model creates the encounter table in core.\n-- *************************************************\n\nselect\n cast(encounter_id as {{ dbt.type_string() }} ) as encounter_id\n , cast(patient_id as {{ dbt.type_string() }} ) as patient_id\n , cast('acute inpatient' as {{ dbt.type_string() }} ) as encounter_type\n , {{ try_to_cast_date('encounter_start_date', 'YYYY-MM-DD') }} as encounter_start_date\n , {{ try_to_cast_date('encounter_end_date', 'YYYY-MM-DD') }} as encounter_end_date\n , cast(length_of_stay as {{ dbt.type_int() }} ) as length_of_stay\n , cast(admit_source_code as {{ dbt.type_string() }} ) as admit_source_code\n , cast(admit_source_description as {{ dbt.type_string() }} ) as admit_source_description\n , cast(admit_type_code as {{ dbt.type_string() }} ) as admit_type_code\n , cast(admit_type_description as {{ dbt.type_string() }} ) as admit_type_description\n , cast(discharge_disposition_code as {{ dbt.type_string() }} ) as discharge_disposition_code\n , cast(discharge_disposition_description as {{ dbt.type_string() }} ) as discharge_disposition_description\n , cast(null as {{ dbt.type_string() }} ) as attending_provider_id\n , cast(facility_npi as {{ dbt.type_string() }} ) as facility_npi\n , cast(primary_diagnosis_code_type as {{ dbt.type_string() }} ) as primary_diagnosis_code_type\n , cast(primary_diagnosis_code as {{ dbt.type_string() }} ) as primary_diagnosis_code\n , cast(primary_diagnosis_description as {{ dbt.type_string() }} ) as primary_diagnosis_description\n , cast(ms_drg_code as {{ dbt.type_string() }} ) as ms_drg_code\n , cast(ms_drg_description as {{ dbt.type_string() }} ) as ms_drg_description\n , cast(apr_drg_code as {{ dbt.type_string() }} ) as apr_drg_code\n , cast(apr_drg_description as {{ dbt.type_string() }} ) as apr_drg_description\n , cast(total_paid_amount as {{ dbt.type_numeric() }} ) as paid_amount\n , cast(total_allowed_amount as {{ dbt.type_numeric() }} ) as allowed_amount\n , cast(total_charge_amount as {{ dbt.type_numeric() }} ) as charge_amount\n , cast(data_source as {{ dbt.type_string() }} ) as data_source\n , cast('{{ var('tuva_last_run')}}' as {{ dbt.type_timestamp() }} ) as tuva_last_run\nfrom {{ ref('acute_inpatient__summary') }} \n\nunion all \n\nselect\n cast(encounter_id as {{ dbt.type_string() }} ) as encounter_id\n , cast(patient_id as {{ dbt.type_string() }} ) as patient_id\n , cast('emergency department' as {{ dbt.type_string() }} ) as encounter_type\n , {{ try_to_cast_date('encounter_start_date', 'YYYY-MM-DD') }} as encounter_start_date\n , {{ try_to_cast_date('encounter_end_date', 'YYYY-MM-DD') }} as encounter_end_date\n , cast(length_of_stay as {{ dbt.type_int() }} ) as length_of_stay\n , cast(admit_source_code as {{ dbt.type_string() }} ) as admit_source_code\n , cast(admit_source_description as {{ dbt.type_string() }} ) as admit_source_description\n , cast(admit_type_code as {{ dbt.type_string() }} ) as admit_type_code\n , cast(admit_type_description as {{ dbt.type_string() }} ) as admit_type_description\n , cast(discharge_disposition_code as {{ dbt.type_string() }} ) as discharge_disposition_code\n , cast(discharge_disposition_description as {{ dbt.type_string() }} ) as discharge_disposition_description\n , cast(null as {{ dbt.type_string() }} ) as attending_provider_id\n , cast(facility_npi as {{ dbt.type_string() }} ) as facility_npi\n , cast(primary_diagnosis_code_type as {{ dbt.type_string() }} ) as primary_diagnosis_code_type\n , cast(primary_diagnosis_code as {{ dbt.type_string() }} ) as primary_diagnosis_code\n , cast(primary_diagnosis_description as {{ dbt.type_string() }} ) as primary_diagnosis_description\n , cast(ms_drg_code as {{ dbt.type_string() }} ) as ms_drg_code\n , cast(ms_drg_description as {{ dbt.type_string() }} ) as ms_drg_description\n , cast(apr_drg_code as {{ dbt.type_string() }} ) as apr_drg_code\n , cast(apr_drg_description as {{ dbt.type_string() }} ) as apr_drg_description\n , cast(total_paid_amount as {{ dbt.type_numeric() }} ) as paid_amount\n , cast(total_allowed_amount as {{ dbt.type_numeric() }} ) as allowed_amount\n , cast(total_charge_amount as {{ dbt.type_numeric() }} ) as charge_amount\n , cast(data_source as {{ dbt.type_string() }} ) as data_source\n , cast('{{ var('tuva_last_run')}}' as {{ dbt.type_timestamp() }} ) as tuva_last_run\nfrom {{ ref('emergency_department__summary') }}", "language": "sql", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/the_tuva_project", "path": "core/staging/core__stg_claims_encounter.sql", "original_file_path": "models/core/staging/core__stg_claims_encounter.sql", "name": "core__stg_claims_encounter", "alias": "_stg_claims_encounter", "checksum": {"name": "sha256", "checksum": "68b1a7ec09b0819a46a609a44f52203edc0ece9a1d196c1552c8285d2a65e78f"}, "tags": ["core_stage_claims"], "refs": [["acute_inpatient__summary"], ["emergency_department__summary"]], "sources": [], "metrics": [], "description": "Staging core claims encounters", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#0f3d0b"}, "patch_path": "the_tuva_project://models/core/core_models.yml", "compiled_path": null, "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": 1701301033.992518}, "model.the_tuva_project.core__stg_clinical_observation": {"resource_type": "model", "depends_on": {"macros": ["macro.dbt.type_string", "macro.the_tuva_project.try_to_cast_date", "macro.dbt.type_timestamp"], "nodes": ["model.input_layer.observation"]}, "config": {"enabled": true, "alias": "_stg_clinical_observation", "schema": "core", "database": null, "tags": ["core_stage_clinical"], "meta": {}, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#0f3d0b"}, "bind": false, "post-hook": [], "pre-hook": []}, "database": "dev_sarah", "schema": "core", "fqn": ["the_tuva_project", "core", "staging", "core__stg_clinical_observation"], "unique_id": "model.the_tuva_project.core__stg_clinical_observation", "raw_code": "{{ config(\n enabled = var('clinical_enabled',var('tuva_marts_enabled',False))\n )\n}}\n\n\nselect\n cast(observation_id as {{ dbt.type_string() }} ) as observation_id\n , cast(patient_id as {{ dbt.type_string() }} ) as patient_id\n , cast(encounter_id as {{ dbt.type_string() }} ) as encounter_id\n , cast(panel_id as {{ dbt.type_string() }} ) as panel_id\n , {{ try_to_cast_date('observation_date', 'YYYY-MM-DD') }} as observation_date\n , cast(observation_type as {{ dbt.type_string() }} ) as observation_type\n , cast(source_code_type as {{ dbt.type_string() }} ) as source_code_type\n , cast(source_code as {{ dbt.type_string() }} ) as source_code\n , cast(source_description as {{ dbt.type_string() }} ) as source_description\n , cast(normalized_code_type as {{ dbt.type_string() }} ) as normalized_code_type\n , cast(normalized_code as {{ dbt.type_string() }} ) as normalized_code\n , cast(normalized_description as {{ dbt.type_string() }} ) as normalized_description\n , cast(result as {{ dbt.type_string() }} ) as result\n , cast(source_units as {{ dbt.type_string() }} ) as source_units\n , cast(normalized_units as {{ dbt.type_string() }} ) as normalized_units\n , cast(source_reference_range_low as {{ dbt.type_string() }} ) as source_reference_range_low\n , cast(source_reference_range_high as {{ dbt.type_string() }} ) as source_reference_range_high\n , cast(normalized_reference_range_low as {{ dbt.type_string() }} ) as normalized_reference_range_low\n , cast(normalized_reference_range_high as {{ dbt.type_string() }} ) as normalized_reference_range_high\n , cast(data_source as {{ dbt.type_string() }} ) as data_source\n , cast('{{ var('tuva_last_run')}}' as {{ dbt.type_timestamp() }} ) as tuva_last_run\nfrom {{ ref('observation') }}", "language": "sql", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/the_tuva_project", "path": "core/staging/core__stg_clinical_observation.sql", "original_file_path": "models/core/staging/core__stg_clinical_observation.sql", "name": "core__stg_clinical_observation", "alias": "_stg_clinical_observation", "checksum": {"name": "sha256", "checksum": "b31467cd0c59b6991f06f89f122a3e668b8620f30634b202c27e21905f6e9173"}, "tags": ["core_stage_clinical"], "refs": [["observation"]], "sources": [], "metrics": [], "description": "Staging core clinical observations", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#0f3d0b"}, "patch_path": "the_tuva_project://models/core/core_models.yml", "compiled_path": null, "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": 1701301033.994234}, "model.the_tuva_project.core__stg_claims_practitioner": {"resource_type": "model", "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"]}, "config": {"enabled": true, "alias": "_stg_claims_practitioner", "schema": "core", "database": null, "tags": ["core_stage_claims"], "meta": {}, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#0f3d0b"}, "bind": false, "post-hook": [], "pre-hook": []}, "database": "dev_sarah", "schema": "core", "fqn": ["the_tuva_project", "core", "staging", "core__stg_claims_practitioner"], "unique_id": "model.the_tuva_project.core__stg_claims_practitioner", "raw_code": "{{ config(\n enabled = var('claims_enabled',var('tuva_marts_enabled',False))\n )\n}}\n\n-- *************************************************\n-- This dbt model creates the provider table \n-- in core. It includes data about all providers\n-- present in the raw claims dataset.\n-- *************************************************\n\n\nwith all_providers_in_claims_dataset as (\nselect distinct facility_npi as npi, data_source\nfrom {{ ref('core__stg_claims_medical_claim') }}\n\nunion all\n\nselect distinct rendering_npi as npi, data_source\nfrom {{ ref('core__stg_claims_medical_claim') }}\n\nunion all\n\nselect distinct billing_npi as npi, data_source\nfrom {{ ref('core__stg_claims_medical_claim') }}\n),\n\n\nprovider as (\nselect aa.*, bb.data_source\nfrom {{ ref('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 {{ dbt.type_string() }} ) as practitioner_id\n , cast(npi as {{ dbt.type_string() }} ) as npi\n , cast(provider_first_name as {{ dbt.type_string() }} ) as provider_first_name\n , cast(provider_last_name as {{ dbt.type_string() }} ) as provider_last_name\n , cast(parent_organization_name as {{ dbt.type_string() }} ) as practice_affiliation\n , cast(primary_specialty_description as {{ dbt.type_string() }} ) as specialty\n , cast(null as {{ dbt.type_string() }} ) as sub_specialty\n , cast(data_source as {{ dbt.type_string() }} ) as data_source\n , cast('{{ var('tuva_last_run')}}' as {{ dbt.type_timestamp() }} ) as tuva_last_run\nfrom provider", "language": "sql", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/the_tuva_project", "path": "core/staging/core__stg_claims_practitioner.sql", "original_file_path": "models/core/staging/core__stg_claims_practitioner.sql", "name": "core__stg_claims_practitioner", "alias": "_stg_claims_practitioner", "checksum": {"name": "sha256", "checksum": "9269a2374be6c16d321ec60b7b97b4c833c322ae21f3553b506feb7fcbee1342"}, "tags": ["core_stage_claims"], "refs": [["core__stg_claims_medical_claim"], ["core__stg_claims_medical_claim"], ["core__stg_claims_medical_claim"], ["terminology__provider"]], "sources": [], "metrics": [], "description": "Staging core providers in the claims dataset", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#0f3d0b"}, "patch_path": "the_tuva_project://models/core/core_models.yml", "compiled_path": null, "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": 1701301033.996059}, "model.the_tuva_project.core__stg_claims_location": {"resource_type": "model", "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"]}, "config": {"enabled": true, "alias": "_stg_claims_location", "schema": "core", "database": null, "tags": ["core_stage_claims"], "meta": {}, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#0f3d0b"}, "bind": false, "post-hook": [], "pre-hook": []}, "database": "dev_sarah", "schema": "core", "fqn": ["the_tuva_project", "core", "staging", "core__stg_claims_location"], "unique_id": "model.the_tuva_project.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", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/the_tuva_project", "path": "core/staging/core__stg_claims_location.sql", "original_file_path": "models/core/staging/core__stg_claims_location.sql", "name": "core__stg_claims_location", "alias": "_stg_claims_location", "checksum": {"name": "sha256", "checksum": "2b02d9e557b871867f284fc790abb1ab1881d1427309d84c3a34c2753e13be57"}, "tags": ["core_stage_claims"], "refs": [["core__stg_claims_medical_claim"], ["core__stg_claims_medical_claim"], ["core__stg_claims_medical_claim"], ["terminology__provider"]], "sources": [], "metrics": [], "description": "Staging core claims locations", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#0f3d0b"}, "patch_path": "the_tuva_project://models/core/core_models.yml", "compiled_path": null, "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": 1701301033.9977899}, "model.the_tuva_project.core__stg_claims_procedure": {"resource_type": "model", "depends_on": {"macros": ["macro.dbt.type_string", "macro.the_tuva_project.try_to_cast_date", "macro.dbt.type_timestamp"], "nodes": ["model.input_layer.medical_claim", "model.input_layer.medical_claim", "model.input_layer.medical_claim", "model.input_layer.medical_claim", "model.input_layer.medical_claim", "model.input_layer.medical_claim", "model.input_layer.medical_claim", "model.input_layer.medical_claim", "model.input_layer.medical_claim", "model.input_layer.medical_claim", "model.input_layer.medical_claim", "model.input_layer.medical_claim", "model.input_layer.medical_claim", "model.input_layer.medical_claim", "model.input_layer.medical_claim", "model.input_layer.medical_claim", "model.input_layer.medical_claim", "model.input_layer.medical_claim", "model.input_layer.medical_claim", "model.input_layer.medical_claim", "model.input_layer.medical_claim", "model.input_layer.medical_claim", "model.input_layer.medical_claim", "model.input_layer.medical_claim", "model.input_layer.medical_claim", "seed.the_tuva_project.terminology__icd_10_pcs", "model.the_tuva_project.acute_inpatient__encounter_id", "model.the_tuva_project.emergency_department__int_encounter_id"]}, "config": {"enabled": true, "alias": "_stg_claims_procedure", "schema": "core", "database": null, "tags": ["core_stage_claims"], "meta": {}, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#0f3d0b"}, "bind": false, "post-hook": [], "pre-hook": []}, "database": "dev_sarah", "schema": "core", "fqn": ["the_tuva_project", "core", "staging", "core__stg_claims_procedure"], "unique_id": "model.the_tuva_project.core__stg_claims_procedure", "raw_code": "{{ config(\n enabled = var('claims_enabled',var('tuva_marts_enabled',False))\n )\n}}\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 {{ ref('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 {{ ref('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 {{ ref('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 {{ ref('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 {{ ref('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 {{ ref('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 {{ ref('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 {{ ref('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 {{ ref('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 {{ ref('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 {{ ref('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 {{ ref('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 {{ ref('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 {{ ref('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 {{ ref('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 {{ ref('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 {{ ref('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 {{ ref('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 {{ ref('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 {{ ref('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 {{ ref('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 {{ ref('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 {{ ref('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 {{ ref('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 {{ ref('medical_claim') }} \nwhere procedure_code_25 is not null\n\n)\n\n\nselect distinct\n cast(null as {{ dbt.type_string() }} ) as procedure_id\n , cast(unpivot_cte.patient_id as {{ dbt.type_string() }} ) as patient_id\n , cast(coalesce(ap.encounter_id, ed.encounter_id) as {{ dbt.type_string() }} ) as encounter_id\n , cast(unpivot_cte.claim_id as {{ dbt.type_string() }} ) as claim_id\n , {{ try_to_cast_date('unpivot_cte.procedure_date', 'YYYY-MM-DD') }} as procedure_date\n , cast(unpivot_cte.source_code_type as {{ dbt.type_string() }} ) as source_code_type\n , cast(unpivot_cte.source_code as {{ dbt.type_string() }} ) as source_code\n , cast(null as {{ dbt.type_string() }} ) as source_description\n , cast(case\n when icd.icd_10_pcs is not null then 'icd-10-pcs'\n end as {{ dbt.type_string() }} ) as normalized_code_type\n , cast(icd.icd_10_pcs as {{ dbt.type_string() }} ) as normalized_code\n , cast(icd.description as {{ dbt.type_string() }} ) as normalized_description\n , cast(unpivot_cte.modifier_1 as {{ dbt.type_string() }} ) as modifier_1\n , cast(unpivot_cte.modifier_2 as {{ dbt.type_string() }} ) as modifier_2\n , cast(unpivot_cte.modifier_3 as {{ dbt.type_string() }} ) as modifier_3\n , cast(unpivot_cte.modifier_4 as {{ dbt.type_string() }} ) as modifier_4\n , cast(null as {{ dbt.type_string() }} ) as modifier_5\n , cast(unpivot_cte.practitioner_npi as {{ dbt.type_string() }} ) as practitioner_id\n , cast(unpivot_cte.data_source as {{ dbt.type_string() }} ) as data_source\n , cast('{{ var('tuva_last_run')}}' as {{ dbt.type_timestamp() }} ) as tuva_last_run\nfrom unpivot_cte\n left join {{ ref('terminology__icd_10_pcs') }} as icd\n on unpivot_cte.source_code = icd.icd_10_pcs\nleft join {{ ref('acute_inpatient__encounter_id')}} as ap\n on unpivot_cte.claim_id = ap.claim_id\nleft join {{ ref('emergency_department__int_encounter_id')}} as ed\n on unpivot_cte.claim_id = ed.claim_id", "language": "sql", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/the_tuva_project", "path": "core/staging/core__stg_claims_procedure.sql", "original_file_path": "models/core/staging/core__stg_claims_procedure.sql", "name": "core__stg_claims_procedure", "alias": "_stg_claims_procedure", "checksum": {"name": "sha256", "checksum": "14ad656a08a0c12d50e489c84acb76bd89130a581df08de60b62fc8da1b970df"}, "tags": ["core_stage_claims"], "refs": [["medical_claim"], ["medical_claim"], ["medical_claim"], ["medical_claim"], ["medical_claim"], ["medical_claim"], ["medical_claim"], ["medical_claim"], ["medical_claim"], ["medical_claim"], ["medical_claim"], ["medical_claim"], ["medical_claim"], ["medical_claim"], ["medical_claim"], ["medical_claim"], ["medical_claim"], ["medical_claim"], ["medical_claim"], ["medical_claim"], ["medical_claim"], ["medical_claim"], ["medical_claim"], ["medical_claim"], ["medical_claim"], ["terminology__icd_10_pcs"], ["acute_inpatient__encounter_id"], ["emergency_department__int_encounter_id"]], "sources": [], "metrics": [], "description": "Staging core claims procedures", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#0f3d0b"}, "patch_path": "the_tuva_project://models/core/core_models.yml", "compiled_path": null, "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": 1701301033.9994931}, "model.the_tuva_project.core__stg_clinical_procedure": {"resource_type": "model", "depends_on": {"macros": ["macro.dbt.type_string", "macro.the_tuva_project.try_to_cast_date", "macro.dbt.type_timestamp"], "nodes": ["model.input_layer.procedure"]}, "config": {"enabled": true, "alias": "_stg_clinical_procedure", "schema": "core", "database": null, "tags": ["core_stage_clinical"], "meta": {}, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#0f3d0b"}, "bind": false, "post-hook": [], "pre-hook": []}, "database": "dev_sarah", "schema": "core", "fqn": ["the_tuva_project", "core", "staging", "core__stg_clinical_procedure"], "unique_id": "model.the_tuva_project.core__stg_clinical_procedure", "raw_code": "{{ config(\n enabled = var('clinical_enabled',var('tuva_marts_enabled',False))\n )\n}}\n\nselect\n cast(procedure_id as {{ dbt.type_string() }} ) as procedure_id \n , cast(patient_id as {{ dbt.type_string() }} ) as patient_id\n , cast(encounter_id as {{ dbt.type_string() }} ) as encounter_id\n , cast(claim_id as {{ dbt.type_string() }} ) as claim_id\n , {{ try_to_cast_date('procedure_date', 'YYYY-MM-DD') }} as procedure_date\n , cast(source_code_type as {{ dbt.type_string() }} ) as source_code_type\n , cast(source_code as {{ dbt.type_string() }} ) as source_code\n , cast(source_description as {{ dbt.type_string() }} ) as source_description\n , cast(normalized_code_type as {{ dbt.type_string() }} ) as normalized_code_type\n , cast(normalized_code as {{ dbt.type_string() }} ) as normalized_code\n , cast(normalized_description as {{ dbt.type_string() }} ) as normalized_description\n , cast(modifier_1 as {{ dbt.type_string() }} ) as modifier_1\n , cast(modifier_2 as {{ dbt.type_string() }} ) as modifier_2\n , cast(modifier_3 as {{ dbt.type_string() }} ) as modifier_3\n , cast(modifier_4 as {{ dbt.type_string() }} ) as modifier_4\n , cast(modifier_5 as {{ dbt.type_string() }} ) as modifier_5\n , cast(practitioner_id as {{ dbt.type_string() }} ) as practitioner_id\n , cast(data_source as {{ dbt.type_string() }} ) as data_source\n , cast('{{ var('tuva_last_run')}}' as {{ dbt.type_timestamp() }} ) as tuva_last_run\nfrom {{ ref('procedure') }}", "language": "sql", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/the_tuva_project", "path": "core/staging/core__stg_clinical_procedure.sql", "original_file_path": "models/core/staging/core__stg_clinical_procedure.sql", "name": "core__stg_clinical_procedure", "alias": "_stg_clinical_procedure", "checksum": {"name": "sha256", "checksum": "9f332ea3f889dc17ca47d3668380056beb9958919f436791d2d345119ba919bf"}, "tags": ["core_stage_clinical"], "refs": [["procedure"]], "sources": [], "metrics": [], "description": "Staging core clinical procedures", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#0f3d0b"}, "patch_path": "the_tuva_project://models/core/core_models.yml", "compiled_path": null, "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": 1701301034.0013561}, "model.the_tuva_project.core__lab_result": {"resource_type": "model", "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.core__stg_clinical_lab_result"]}, "config": {"enabled": true, "alias": "lab_result", "schema": "core", "database": null, "tags": ["core"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#0f3d0b"}, "bind": false, "post-hook": [], "pre-hook": []}, "database": "dev_sarah", "schema": "core", "fqn": ["the_tuva_project", "core", "final", "core__lab_result"], "unique_id": "model.the_tuva_project.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", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/the_tuva_project", "path": "core/final/core__lab_result.sql", "original_file_path": "models/core/final/core__lab_result.sql", "name": "core__lab_result", "alias": "lab_result", "checksum": {"name": "sha256", "checksum": "f9476ba4518a0bd40ed1de34b409cd2a90558632afa56fb482ab58b016ad4ab9"}, "tags": ["core"], "refs": [["core__stg_clinical_lab_result"]], "sources": [], "metrics": [], "description": "The lab result table contains information about lab test results, including the LOINC code and description, units, reference range, and result.\n", "columns": {"lab_result_id": {"name": "lab_result_id", "description": "Unique identifier for the lab test.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "patient_id": {"name": "patient_id", "description": "Unique identifier for each patient.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "encounter_id": {"name": "encounter_id", "description": "Unique identifier for each encounter. Included in this table if the lab test can be linked to an encounter.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "accession_number": {"name": "accession_number", "description": "The lab order number from the source system.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "source_code_type": {"name": "source_code_type", "description": "The code type from the source system.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "source_code": {"name": "source_code", "description": "The code for the lab from the source system.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "source_description": {"name": "source_description", "description": "The description for the lab test from the source system.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "source_component": {"name": "source_component", "description": "The description for the component of the test from the source system.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "normalized_code_type": {"name": "normalized_code_type", "description": "The normalized code type.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "normalized_code": {"name": "normalized_code", "description": "The normalized code e.g. LOINC.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "normalized_description": {"name": "normalized_description", "description": "The normalized description for the code.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "normalized_component": {"name": "normalized_component", "description": "The normalized component.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "status": {"name": "status", "description": "The status of the lab test.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "result": {"name": "result", "description": "The result of the lab test.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "result_date": {"name": "result_date", "description": "Date of the test result.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "collection_date": {"name": "collection_date", "description": "Date the test was collected.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "source_units": {"name": "source_units", "description": "Source units of the lab test.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "normalized_units": {"name": "normalized_units", "description": "Normalized units of the lab test.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "source_reference_range_low": {"name": "source_reference_range_low", "description": "The low end of the reference range from the source system.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "source_reference_range_high": {"name": "source_reference_range_high", "description": "The high end of the reference range from the source system.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "normalized_reference_range_low": {"name": "normalized_reference_range_low", "description": "The normalized low end of the reference range.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "normalized_reference_range_high": {"name": "normalized_reference_range_high", "description": "The normalized high end of the reference range.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "source_abnormal_flag": {"name": "source_abnormal_flag", "description": "Indicates whether the result is abnormal or normal.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "normalized_abnormal_flag": {"name": "normalized_abnormal_flag", "description": "Normalized abnormal flag.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "specimen": {"name": "specimen", "description": "The type of specimen e.g. blood, plasma, urine.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "ordering_practitioner_id": {"name": "ordering_practitioner_id", "description": "Unique identifier for the practitioner who ordered the lab test.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "data_source": {"name": "data_source", "description": "Custom description of the source system e.g. Epic.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The last time the data was refreshed. Generated by `dbt_utils.pretty_time` as the local time of the `dbt run` environment. Timezone is configurable via the `tuva_last_run` var. \n", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": "#0f3d0b"}, "patch_path": "the_tuva_project://models/core/core_models.yml", "compiled_path": null, "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": 1701301034.007169}, "model.the_tuva_project.core__medication": {"resource_type": "model", "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.core__stg_clinical_medication"]}, "config": {"enabled": true, "alias": "medication", "schema": "core", "database": null, "tags": ["core"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#0f3d0b"}, "bind": false, "post-hook": [], "pre-hook": []}, "database": "dev_sarah", "schema": "core", "fqn": ["the_tuva_project", "core", "final", "core__medication"], "unique_id": "model.the_tuva_project.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", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/the_tuva_project", "path": "core/final/core__medication.sql", "original_file_path": "models/core/final/core__medication.sql", "name": "core__medication", "alias": "medication", "checksum": {"name": "sha256", "checksum": "465c23d0e83d37bcd661cec2d9e6b14101d171d7dc5b1481e9ef8e0580998512"}, "tags": ["core"], "refs": [["core__stg_clinical_medication"]], "sources": [], "metrics": [], "description": "The medication table contains information on medications ordered and/or administered during a patient encounter.\n", "columns": {"medication_id": {"name": "medication_id", "description": "Unique identifier for each medication in the table.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "patient_id": {"name": "patient_id", "description": "Unique identifier for each patient in the dataset.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "encounter_id": {"name": "encounter_id", "description": "Unique identifier for each encounter in the dataset.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "dispensing_date": {"name": "dispensing_date", "description": "Date the medication was dispensed.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "prescribing_date": {"name": "prescribing_date", "description": "Date the medication was prescribed.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "source_code_type": {"name": "source_code_type", "description": "The source code type of the medication.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "source_code": {"name": "source_code", "description": "The source code for the medication.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "source_description": {"name": "source_description", "description": "The source description of the medication.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "ndc_code": {"name": "ndc_code", "description": "National drug code associated with the medication.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "ndc_description": {"name": "ndc_description", "description": "Description for the NDC.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "rxnorm_code": {"name": "rxnorm_code", "description": "RxNorm code associated with the medication.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "rxnorm_description": {"name": "rxnorm_description", "description": "Description for the RxNorm code.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "atc_code": {"name": "atc_code", "description": "ATC code for the medication.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "atc_description": {"name": "atc_description", "description": "Description for the ATC code.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "route": {"name": "route", "description": "The route used to administer the medication.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "strength": {"name": "strength", "description": "The strength of the medication.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "quantity": {"name": "quantity", "description": "The quantity of the medication.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "quantity_unit": {"name": "quantity_unit", "description": "The units for the quantity.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "days_supply": {"name": "days_supply", "description": "The number of days supply included.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "practitioner_id": {"name": "practitioner_id", "description": "Unique identifier for the practitioner who ordered the medication.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "data_source": {"name": "data_source", "description": "Custom description of the source system e.g. Epic.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The last time the data was refreshed. Generated by `dbt_utils.pretty_time` as the local time of the `dbt run` environment. Timezone is configurable via the `tuva_last_run` var.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": "#0f3d0b"}, "patch_path": "the_tuva_project://models/core/core_models.yml", "compiled_path": null, "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": 1701301034.012259}, "model.the_tuva_project.core__location": {"resource_type": "model", "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.core__stg_claims_location", "model.the_tuva_project.core__stg_clinical_location"]}, "config": {"enabled": true, "alias": "location", "schema": "core", "database": null, "tags": ["core"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#0f3d0b"}, "bind": false, "post-hook": [], "pre-hook": []}, "database": "dev_sarah", "schema": "core", "fqn": ["the_tuva_project", "core", "final", "core__location"], "unique_id": "model.the_tuva_project.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", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/the_tuva_project", "path": "core/final/core__location.sql", "original_file_path": "models/core/final/core__location.sql", "name": "core__location", "alias": "location", "checksum": {"name": "sha256", "checksum": "c37dfb21d3e6de4641e1cb7413e8f44db8eab3f488ee294f7cec3f1e04518273"}, "tags": ["core"], "refs": [["core__stg_claims_location"], ["core__stg_clinical_location"]], "sources": [], "metrics": [], "description": "The location table contains information on practice and facility locations where patients receive medical care.\n", "columns": {"location_id": {"name": "location_id", "description": "Unique identifier for each location.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "npi": {"name": "npi", "description": "The national provider identifier associated with the location e.g. facility_npi.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "name": {"name": "name", "description": "The name of the location.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "facility_type": {"name": "facility_type", "description": "The type of facility e.g. acute care hospital.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "parent_organization": {"name": "parent_organization", "description": "The parent organization associated with the facility.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "address": {"name": "address", "description": "The street address of the location.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "city": {"name": "city", "description": "The city of the location.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "state": {"name": "state", "description": "The state of the location.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "zip_code": {"name": "zip_code", "description": "The zip code of the location.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "latitude": {"name": "latitude", "description": "The latitude of the location.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "longitude": {"name": "longitude", "description": "The longitude of the location.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "data_source": {"name": "data_source", "description": "Custom description of the source system e.g. Epic.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The last time the data was refreshed. Generated by `dbt_utils.pretty_time` as the local time of the `dbt run` environment. Timezone is configurable via the `tuva_last_run` var.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": "#0f3d0b"}, "patch_path": "the_tuva_project://models/core/core_models.yml", "compiled_path": null, "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": 1701301034.01586}, "model.the_tuva_project.core__stg_clinical_condition": {"resource_type": "model", "depends_on": {"macros": ["macro.dbt.type_string", "macro.the_tuva_project.try_to_cast_date", "macro.dbt.type_int", "macro.dbt.type_timestamp"], "nodes": ["model.input_layer.condition"]}, "config": {"enabled": true, "alias": "_stg_clinical_condition", "schema": "core", "database": null, "tags": ["core_stage_clinical"], "meta": {}, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#0f3d0b"}, "bind": false, "post-hook": [], "pre-hook": []}, "database": "dev_sarah", "schema": "core", "fqn": ["the_tuva_project", "core", "staging", "core__stg_clinical_condition"], "unique_id": "model.the_tuva_project.core__stg_clinical_condition", "raw_code": "{{ config(\n enabled = var('clinical_enabled',var('tuva_marts_enabled',False))\n )\n}}\n\nselect\n cast(condition_id as {{ dbt.type_string() }} ) as condition_id\n , cast(patient_id as {{ dbt.type_string() }} ) as patient_id\n , cast(encounter_id as {{ dbt.type_string() }} ) as encounter_id\n , cast(claim_id as {{ dbt.type_string() }} ) as claim_id\n , {{ try_to_cast_date('recorded_date', 'YYYY-MM-DD') }} as recorded_date\n , {{ try_to_cast_date('onset_date', 'YYYY-MM-DD') }} as onset_date\n , {{ try_to_cast_date('resolved_date', 'YYYY-MM-DD') }} as resolved_date\n , cast(status as {{ dbt.type_string() }} ) as status\n , cast(condition_type as {{ dbt.type_string() }} ) as condition_type\n , cast(source_code_type as {{ dbt.type_string() }} ) as source_code_type\n , cast(source_code as {{ dbt.type_string() }} ) as source_code\n , cast(source_description as {{ dbt.type_string() }} ) as source_description\n , cast(normalized_code_type as {{ dbt.type_string() }} ) as normalized_code_type\n , cast(normalized_code as {{ dbt.type_string() }} ) as normalized_code\n , cast(normalized_description as {{ dbt.type_string() }} ) as normalized_description\n , cast(condition_rank as {{ dbt.type_int() }} ) as condition_rank\n , cast(present_on_admit_code as {{ dbt.type_string() }} ) as present_on_admit_code\n , cast(present_on_admit_description as {{ dbt.type_string() }} ) as present_on_admit_description\n , cast(data_source as {{ dbt.type_string() }} ) as data_source\n , cast('{{ var('tuva_last_run')}}' as {{ dbt.type_timestamp() }} ) as tuva_last_run\nfrom {{ ref('condition') }}", "language": "sql", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/the_tuva_project", "path": "core/staging/core__stg_clinical_condition.sql", "original_file_path": "models/core/staging/core__stg_clinical_condition.sql", "name": "core__stg_clinical_condition", "alias": "_stg_clinical_condition", "checksum": {"name": "sha256", "checksum": "d3889d8a95c2317831b0269c43788072e3e59a2c3c45d2ea457dcd50a56519c6"}, "tags": ["core_stage_clinical"], "refs": [["condition"]], "sources": [], "metrics": [], "description": "Staging core clinical conditions", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#0f3d0b"}, "patch_path": "the_tuva_project://models/core/core_models.yml", "compiled_path": null, "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": 1701301034.0176032}, "model.the_tuva_project.core__patient": {"resource_type": "model", "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.core__stg_claims_patient", "model.the_tuva_project.core__stg_clinical_patient"]}, "config": {"enabled": true, "alias": "patient", "schema": "core", "database": null, "tags": ["core"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#0f3d0b"}, "bind": false, "post-hook": [], "pre-hook": []}, "database": "dev_sarah", "schema": "core", "fqn": ["the_tuva_project", "core", "final", "core__patient"], "unique_id": "model.the_tuva_project.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", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/the_tuva_project", "path": "core/final/core__patient.sql", "original_file_path": "models/core/final/core__patient.sql", "name": "core__patient", "alias": "patient", "checksum": {"name": "sha256", "checksum": "b61f67fdabee3aa43bcbc17b1deb9f655a317e812c6571a11caf3f26b22e2ed8"}, "tags": ["core"], "refs": [["core__stg_claims_patient"], ["core__stg_clinical_patient"]], "sources": [], "metrics": [], "description": "The patient table contains demographic and geographic information on patients.\n", "columns": {"patient_id": {"name": "patient_id", "description": "Unique identifier for each person across all datasets.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "sex": {"name": "sex", "description": "The gender of the patient.", "meta": {"terminology": "/terminology/demographics/gender"}, "data_type": null, "quote": null, "tags": []}, "race": {"name": "race", "description": "The race of the patient.", "meta": {"terminology": "/terminology/demographics/race"}, "data_type": null, "quote": null, "tags": []}, "birth_date": {"name": "birth_date", "description": "The birth date of the patient.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "death_date": {"name": "death_date", "description": "The death date of the patient if there is one.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "death_flag": {"name": "death_flag", "description": "A flag indicating if the patient has died.", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "first_name": {"name": "first_name", "description": "The first name of the patient.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "last_name": {"name": "last_name", "description": "The last name of the patient.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "address": {"name": "address", "description": "The address of the patient.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "city": {"name": "city", "description": "The city where the patient lives.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "state": {"name": "state", "description": "The state where the patient lives.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "zip_code": {"name": "zip_code", "description": "The zip code for the patient.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "county": {"name": "county", "description": "The county for the patient.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "latitude": {"name": "latitude", "description": "The latitude for the patient.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "longitude": {"name": "longitude", "description": "The longitude for the patient.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "phone": {"name": "phone", "description": "The phone number for the patient.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "data_source": {"name": "data_source", "description": "User-configured field that indicates the data source (e.g. typically named after the payer and state \"BCBS Tennessee\").\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The last time the data was refreshed. Generated by `dbt_utils.pretty_time` as the local time of the `dbt run` environment. Timezone is configurable via the `tuva_last_run` var.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": "#0f3d0b"}, "patch_path": "the_tuva_project://models/core/core_models.yml", "compiled_path": null, "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": 1701301034.022271}, "model.the_tuva_project.core__stg_claims_condition": {"resource_type": "model", "depends_on": {"macros": ["macro.dbt.type_string", "macro.the_tuva_project.try_to_cast_date", "macro.dbt.type_int", "macro.dbt.type_timestamp"], "nodes": ["model.input_layer.medical_claim", "model.input_layer.medical_claim", "model.input_layer.medical_claim", "model.input_layer.medical_claim", "model.input_layer.medical_claim", "model.input_layer.medical_claim", "model.input_layer.medical_claim", "model.input_layer.medical_claim", "model.input_layer.medical_claim", "model.input_layer.medical_claim", "model.input_layer.medical_claim", "model.input_layer.medical_claim", "model.input_layer.medical_claim", "model.input_layer.medical_claim", "model.input_layer.medical_claim", "model.input_layer.medical_claim", "model.input_layer.medical_claim", "model.input_layer.medical_claim", "model.input_layer.medical_claim", "model.input_layer.medical_claim", "model.input_layer.medical_claim", "model.input_layer.medical_claim", "model.input_layer.medical_claim", "model.input_layer.medical_claim", "model.input_layer.medical_claim", "model.the_tuva_project.acute_inpatient__encounter_id", "model.the_tuva_project.emergency_department__int_encounter_id", "seed.the_tuva_project.terminology__icd_10_cm", "seed.the_tuva_project.terminology__present_on_admission"]}, "config": {"enabled": true, "alias": "_stg_claims_condition", "schema": "core", "database": null, "tags": ["core_stage_claims"], "meta": {}, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#0f3d0b"}, "bind": false, "post-hook": [], "pre-hook": []}, "database": "dev_sarah", "schema": "core", "fqn": ["the_tuva_project", "core", "staging", "core__stg_claims_condition"], "unique_id": "model.the_tuva_project.core__stg_claims_condition", "raw_code": "{{ config(\n enabled = var('claims_enabled',var('tuva_marts_enabled',False))\n )\n}}\n\n-- *************************************************\n-- This dbt model creates the condition table in core.\n-- *************************************************\n\nwith unpivot_cte as (\n\nselect\n claim_id,\n patient_id,\n coalesce(admission_date,\n claim_start_date,\n 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 {{ ref('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 {{ ref('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 {{ ref('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 {{ ref('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 {{ ref('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 {{ ref('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 {{ ref('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 {{ ref('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 {{ ref('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 {{ ref('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 {{ ref('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 {{ ref('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 {{ ref('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 {{ ref('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 {{ ref('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 {{ ref('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 {{ ref('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 {{ ref('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 {{ ref('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 {{ ref('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 {{ ref('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 {{ ref('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 {{ ref('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 {{ ref('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 {{ ref('medical_claim') }} \nwhere diagnosis_code_25 is not null\n\n)\n\nselect distinct\n cast(null as {{ dbt.type_string() }} ) as condition_id,\n cast(unpivot_cte.patient_id as {{ dbt.type_string() }} ) as patient_id,\n cast(coalesce(ap.encounter_id, ed.encounter_id) as {{ dbt.type_string() }} ) as encounter_id,\n cast(unpivot_cte.claim_id as {{ dbt.type_string() }} ) as claim_id,\n {{ try_to_cast_date('unpivot_cte.condition_date', 'YYYY-MM-DD') }} as recorded_date,\n {{ try_to_cast_date('null', 'YYYY-MM-DD') }} as onset_date,\n {{ try_to_cast_date('null', 'YYYY-MM-DD') }} as resolved_date,\n cast('active' as {{ dbt.type_string() }} ) as status,\n cast(unpivot_cte.condition_type as {{ dbt.type_string() }} ) as condition_type,\n cast(unpivot_cte.source_code_type as {{ dbt.type_string() }} ) as source_code_type,\n cast(unpivot_cte.source_code as {{ dbt.type_string() }} ) as source_code,\n cast(null as {{ dbt.type_string() }} ) as source_description,\n cast(case\n when icd.icd_10_cm is not null then 'icd-10-cm'\n end as {{ dbt.type_string() }} ) as normalized_code_type,\n cast(icd.icd_10_cm as {{ dbt.type_string() }} ) as normalized_code,\n cast(icd.description as {{ dbt.type_string() }} ) as normalized_description,\n cast(unpivot_cte.diagnosis_rank as {{ dbt.type_int() }} ) as condition_rank,\n cast(unpivot_cte.present_on_admit_code as {{ dbt.type_string() }} ) as present_on_admit_code,\n cast(poa.present_on_admit_description as {{ dbt.type_string() }} ) as present_on_admit_description,\n cast(unpivot_cte.data_source as {{ dbt.type_string() }} ) as data_source,\n cast('{{ var('tuva_last_run')}}' as {{ dbt.type_timestamp() }} ) as tuva_last_run\nfrom unpivot_cte\nleft join {{ ref('acute_inpatient__encounter_id')}} as ap\n on unpivot_cte.claim_id = ap.claim_id\nleft join {{ ref('emergency_department__int_encounter_id')}} as ed\n on unpivot_cte.claim_id = ed.claim_id\nleft join {{ ref('terminology__icd_10_cm') }} icd\n on unpivot_cte.source_code = icd.icd_10_cm\nleft join {{ ref('terminology__present_on_admission') }} as poa\n on unpivot_cte.present_on_admit_code = poa.present_on_admit_code", "language": "sql", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/the_tuva_project", "path": "core/staging/core__stg_claims_condition.sql", "original_file_path": "models/core/staging/core__stg_claims_condition.sql", "name": "core__stg_claims_condition", "alias": "_stg_claims_condition", "checksum": {"name": "sha256", "checksum": "5132af6398d95abd0daf99c49fb21346115f07ac1711d2e63bfed9dd772f49aa"}, "tags": ["core_stage_claims"], "refs": [["medical_claim"], ["medical_claim"], ["medical_claim"], ["medical_claim"], ["medical_claim"], ["medical_claim"], ["medical_claim"], ["medical_claim"], ["medical_claim"], ["medical_claim"], ["medical_claim"], ["medical_claim"], ["medical_claim"], ["medical_claim"], ["medical_claim"], ["medical_claim"], ["medical_claim"], ["medical_claim"], ["medical_claim"], ["medical_claim"], ["medical_claim"], ["medical_claim"], ["medical_claim"], ["medical_claim"], ["medical_claim"], ["acute_inpatient__encounter_id"], ["emergency_department__int_encounter_id"], ["terminology__icd_10_cm"], ["terminology__present_on_admission"]], "sources": [], "metrics": [], "description": "Staging core claims conditions", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#0f3d0b"}, "patch_path": "the_tuva_project://models/core/core_models.yml", "compiled_path": null, "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": 1701301034.024111}, "model.the_tuva_project.core__stg_clinical_encounter": {"resource_type": "model", "depends_on": {"macros": ["macro.dbt.type_string", "macro.the_tuva_project.try_to_cast_date", "macro.dbt.type_int", "macro.dbt.type_numeric", "macro.dbt.type_timestamp"], "nodes": ["model.input_layer.encounter"]}, "config": {"enabled": true, "alias": "_stg_clinical_encounter", "schema": "core", "database": null, "tags": ["core_stage_clinical"], "meta": {}, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#0f3d0b"}, "bind": false, "post-hook": [], "pre-hook": []}, "database": "dev_sarah", "schema": "core", "fqn": ["the_tuva_project", "core", "staging", "core__stg_clinical_encounter"], "unique_id": "model.the_tuva_project.core__stg_clinical_encounter", "raw_code": "{{ config(\n enabled = var('clinical_enabled',var('tuva_marts_enabled',False))\n )\n}}\n\nselect \n cast(encounter_id as {{ dbt.type_string() }} ) as encounter_id\n , cast(patient_id as {{ dbt.type_string() }} ) as patient_id\n , cast(encounter_type as {{ dbt.type_string() }} ) as encounter_type\n , {{ try_to_cast_date('encounter_start_date', 'YYYY-MM-DD') }} as encounter_start_date\n , {{ try_to_cast_date('encounter_end_date', 'YYYY-MM-DD') }} as encounter_end_date\n , cast(length_of_stay as {{ dbt.type_int() }} ) as length_of_stay\n , cast(admit_source_code as {{ dbt.type_string() }} ) as admit_source_code\n , cast(admit_source_description as {{ dbt.type_string() }} ) as admit_source_description\n , cast(admit_type_code as {{ dbt.type_string() }} ) as admit_type_code\n , cast(admit_type_description as {{ dbt.type_string() }} ) as admit_type_description\n , cast(discharge_disposition_code as {{ dbt.type_string() }} ) as discharge_disposition_code\n , cast(discharge_disposition_description as {{ dbt.type_string() }} ) as discharge_disposition_description\n , cast(attending_provider_id as {{ dbt.type_string() }} ) as attending_provider_id\n , cast(facility_npi as {{ dbt.type_string() }} ) as facility_npi\n , cast(primary_diagnosis_code as {{ dbt.type_string() }} ) as primary_diagnosis_code_type\n , cast(primary_diagnosis_code as {{ dbt.type_string() }} ) as primary_diagnosis_code\n , cast(primary_diagnosis_description as {{ dbt.type_string() }} ) as primary_diagnosis_description\n , cast(ms_drg_code as {{ dbt.type_string() }} ) as ms_drg_code\n , cast(ms_drg_description as {{ dbt.type_string() }} ) as ms_drg_description \n , cast(apr_drg_code as {{ dbt.type_string() }} ) as apr_drg_code\n , cast(apr_drg_description as {{ dbt.type_string() }} ) as apr_drg_description\n , cast(paid_amount as {{ dbt.type_numeric() }} ) as paid_amount\n , cast(allowed_amount as {{ dbt.type_numeric() }} ) as allowed_amount\n , cast(charge_amount as {{ dbt.type_numeric() }} ) as charge_amount\n , cast(data_source as {{ dbt.type_string() }} ) as data_source\n , cast('{{ var('tuva_last_run')}}' as {{ dbt.type_timestamp() }} ) as tuva_last_run\nfrom {{ ref('encounter') }}", "language": "sql", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/the_tuva_project", "path": "core/staging/core__stg_clinical_encounter.sql", "original_file_path": "models/core/staging/core__stg_clinical_encounter.sql", "name": "core__stg_clinical_encounter", "alias": "_stg_clinical_encounter", "checksum": {"name": "sha256", "checksum": "4431839a775b14f67b0b5264226fae33b2941824f1fa40f77253b0b9e9f77a44"}, "tags": ["core_stage_clinical"], "refs": [["encounter"]], "sources": [], "metrics": [], "description": "Staging core clinical encounters", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#0f3d0b"}, "patch_path": "the_tuva_project://models/core/core_models.yml", "compiled_path": null, "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": 1701301034.025862}, "model.the_tuva_project.core__condition": {"resource_type": "model", "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.core__stg_claims_condition", "model.the_tuva_project.core__stg_clinical_condition"]}, "config": {"enabled": true, "alias": "condition", "schema": "core", "database": null, "tags": ["core"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#0f3d0b"}, "bind": false, "post-hook": [], "pre-hook": []}, "database": "dev_sarah", "schema": "core", "fqn": ["the_tuva_project", "core", "final", "core__condition"], "unique_id": "model.the_tuva_project.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", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/the_tuva_project", "path": "core/final/core__condition.sql", "original_file_path": "models/core/final/core__condition.sql", "name": "core__condition", "alias": "condition", "checksum": {"name": "sha256", "checksum": "6bf20ce96592d16fd9ab798870231dc2cb5fd32632e677db4eccf028738d1a4f"}, "tags": ["core"], "refs": [["core__stg_claims_condition"], ["core__stg_clinical_condition"]], "sources": [], "metrics": [], "description": "The core condition table contains information related to medical conditions patients have, including problems, admitting diagnosis codes, and billable diagnosis codes.\n", "columns": {"condition_id": {"name": "condition_id", "description": "Unique identifier for each condition in the table.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "patient_id": {"name": "patient_id", "description": "Unique identifier for each patient in the dataset.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "encounter_id": {"name": "encounter_id", "description": "Unique identifier for each encounter.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "claim_id": {"name": "claim_id", "description": "Unique identifier for each claim.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "recorded_date": {"name": "recorded_date", "description": "Date when the condition was recorded.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "onset_date": {"name": "onset_date", "description": "Date when the condition first occurred.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "resolved_date": {"name": "resolved_date", "description": "Date when the condition was resolved.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "status": {"name": "status", "description": "Status of the condition.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "condition_type": {"name": "condition_type", "description": "The type of condition i.e. problem, admitting, or billing.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "source_code_type": {"name": "source_code_type", "description": "The type of condition code reported in the source system e.g. ICD-10-CM.\n", "meta": {"terminology": "/terminology/tuva-concepts/code-type"}, "data_type": null, "quote": null, "tags": []}, "source_code": {"name": "source_code", "description": "The condition code in the source system e.g. the ICD-10 code.\n", "meta": {"terminology": "/terminology/conditions-and-procedures/icd-10-cm"}, "data_type": null, "quote": null, "tags": []}, "source_description": {"name": "source_description", "description": "Description of the condition code in the source system.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "normalized_code_type": {"name": "normalized_code_type", "description": "The normalized type of condition code.", "meta": {"terminology": "/terminology/tuva-concepts/code-type"}, "data_type": null, "quote": null, "tags": []}, "normalized_code": {"name": "normalized_code", "description": "The normalized condition code.", "meta": {"terminology": "/terminology/conditions-and-procedures/icd-10-cm"}, "data_type": null, "quote": null, "tags": []}, "normalized_description": {"name": "normalized_description", "description": "Normalized description of the condition code.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "condition_rank": {"name": "condition_rank", "description": "The numerical ranking of a diagnosis code in a claim. Principle diagnosis code is given a ranking of 1. Claims data typically has a strict ranking of conditions whereas medical records will often not have this information or the information won't be accurate.\n", "meta": {}, "data_type": "integer", "quote": null, "tags": []}, "present_on_admit_code": {"name": "present_on_admit_code", "description": "The present_on_admit_code related to the condition.", "meta": {"terminology": "/terminology/administrative-codes/present-on-admission"}, "data_type": null, "quote": null, "tags": []}, "present_on_admit_description": {"name": "present_on_admit_description", "description": "The description of the present_on_admit_code for the condition.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "data_source": {"name": "data_source", "description": "User-configured field that indicates the data source (e.g. typically named after the payer and state \"BCBS Tennessee\").\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The last time the data was refreshed. Generated by `dbt_utils.pretty_time` as the local time of the `dbt run` environment. Timezone is configurable via the `tuva_last_run` var.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": "#0f3d0b"}, "patch_path": "the_tuva_project://models/core/core_models.yml", "compiled_path": null, "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": 1701301034.031206}, "model.the_tuva_project.core__stg_clinical_practitioner": {"resource_type": "model", "depends_on": {"macros": ["macro.dbt.type_string", "macro.dbt.type_timestamp"], "nodes": ["model.input_layer.practitioner"]}, "config": {"enabled": true, "alias": "_stg_clinical_practitioner", "schema": "core", "database": null, "tags": ["core_stage_clinical"], "meta": {}, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#0f3d0b"}, "bind": false, "post-hook": [], "pre-hook": []}, "database": "dev_sarah", "schema": "core", "fqn": ["the_tuva_project", "core", "staging", "core__stg_clinical_practitioner"], "unique_id": "model.the_tuva_project.core__stg_clinical_practitioner", "raw_code": "{{ config(\n enabled = var('clinical_enabled',var('tuva_marts_enabled',False))\n )\n}}\n\nselect\n cast(practitioner_id as {{ dbt.type_string() }} ) as practitioner_id\n , cast(npi as {{ dbt.type_string() }} ) as npi\n , cast(first_name as {{ dbt.type_string() }} ) as first_name\n , cast(last_name as {{ dbt.type_string() }} ) as last_name\n , cast(practice_affiliation as {{ dbt.type_string() }} ) as practice_affiliation\n , cast(specialty as {{ dbt.type_string() }} ) as specialty\n , cast(sub_specialty as {{ dbt.type_string() }} ) as sub_specialty\n , cast(data_source as {{ dbt.type_string() }} ) as data_source\n , cast('{{ var('tuva_last_run')}}' as {{ dbt.type_timestamp() }} ) as tuva_last_run\nfrom {{ ref('practitioner') }}", "language": "sql", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/the_tuva_project", "path": "core/staging/core__stg_clinical_practitioner.sql", "original_file_path": "models/core/staging/core__stg_clinical_practitioner.sql", "name": "core__stg_clinical_practitioner", "alias": "_stg_clinical_practitioner", "checksum": {"name": "sha256", "checksum": "e04f15cb36d85a844dd2b7fb431eedc8db9a6dfc6eb03e8fdbe604002558dfb1"}, "tags": ["core_stage_clinical"], "refs": [["practitioner"]], "sources": [], "metrics": [], "description": "Staging core clinical providers", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#0f3d0b"}, "patch_path": "the_tuva_project://models/core/core_models.yml", "compiled_path": null, "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": 1701301034.032966}, "test.the_tuva_project.unique_core__medical_claim__claim_id_claim_line_number_.b9ab42f1f0": {"test_metadata": {"name": "unique", "kwargs": {"column_name": "(claim_id||'-'||claim_line_number)", "model": "{{ get_where_subquery(ref('core__medical_claim')) }}"}, "namespace": null}, "resource_type": "test", "depends_on": {"macros": ["macro.dbt.test_unique"], "nodes": ["model.the_tuva_project.core__medical_claim"]}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "database": "dev_sarah", "schema": "dbt_test__audit", "fqn": ["the_tuva_project", "core", "unique_core__medical_claim__claim_id_claim_line_number_"], "unique_id": "test.the_tuva_project.unique_core__medical_claim__claim_id_claim_line_number_.b9ab42f1f0", "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "language": "sql", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/the_tuva_project", "path": "unique_core__medical_claim__claim_id_claim_line_number_.sql", "original_file_path": "models/core/core_models.yml", "name": "unique_core__medical_claim__claim_id_claim_line_number_", "alias": "unique_core__medical_claim__claim_id_claim_line_number_", "checksum": {"name": "none", "checksum": ""}, "tags": [], "refs": [["core__medical_claim"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1701301034.037023, "column_name": null, "file_key_name": "models.core__medical_claim"}}, "sources": {}, "macros": {"macro.input_layer.try_to_cast_date": {"unique_id": "macro.input_layer.try_to_cast_date", "package_name": "input_layer", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/docs_generate", "path": "../macros/try_to_cast_date.sql", "original_file_path": "../macros/try_to_cast_date.sql", "name": "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", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.input_layer.snowflake__try_to_cast_date"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1701215337.511932, "supported_languages": null}, "macro.input_layer.bigquery__try_to_cast_date": {"unique_id": "macro.input_layer.bigquery__try_to_cast_date", "package_name": "input_layer", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/docs_generate", "path": "../macros/try_to_cast_date.sql", "original_file_path": "../macros/try_to_cast_date.sql", "name": "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", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1701215337.512165, "supported_languages": null}, "macro.input_layer.default__try_to_cast_date": {"unique_id": "macro.input_layer.default__try_to_cast_date", "package_name": "input_layer", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/docs_generate", "path": "../macros/try_to_cast_date.sql", "original_file_path": "../macros/try_to_cast_date.sql", "name": "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", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1701215337.512286, "supported_languages": null}, "macro.input_layer.postgres__try_to_cast_date": {"unique_id": "macro.input_layer.postgres__try_to_cast_date", "package_name": "input_layer", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/docs_generate", "path": "../macros/try_to_cast_date.sql", "original_file_path": "../macros/try_to_cast_date.sql", "name": "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", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1701215337.512753, "supported_languages": null}, "macro.input_layer.redshift__try_to_cast_date": {"unique_id": "macro.input_layer.redshift__try_to_cast_date", "package_name": "input_layer", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/docs_generate", "path": "../macros/try_to_cast_date.sql", "original_file_path": "../macros/try_to_cast_date.sql", "name": "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", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1701215337.513222, "supported_languages": null}, "macro.input_layer.snowflake__try_to_cast_date": {"unique_id": "macro.input_layer.snowflake__try_to_cast_date", "package_name": "input_layer", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/docs_generate", "path": "../macros/try_to_cast_date.sql", "original_file_path": "../macros/try_to_cast_date.sql", "name": "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 -%}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1701215337.513334, "supported_languages": null}, "macro.input_layer.default__generate_schema_name": {"unique_id": "macro.input_layer.default__generate_schema_name", "package_name": "input_layer", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/docs_generate", "path": "../macros/generate_schema_name.sql", "original_file_path": "../macros/generate_schema_name.sql", "name": "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 %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1701215337.513758, "supported_languages": null}, "macro.dbt_snowflake.snowflake__get_catalog": {"unique_id": "macro.dbt_snowflake.snowflake__get_catalog", "package_name": "dbt_snowflake", "root_path": "/opt/homebrew/lib/python3.9/site-packages/dbt/include/snowflake", "path": "macros/catalog.sql", "original_file_path": "macros/catalog.sql", "name": "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 %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1701215337.514687, "supported_languages": null}, "macro.dbt_snowflake.snowflake__create_table_as": {"unique_id": "macro.dbt_snowflake.snowflake__create_table_as", "package_name": "dbt_snowflake", "root_path": "/opt/homebrew/lib/python3.9/site-packages/dbt/include/snowflake", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "snowflake__create_table_as", "macro_sql": "{% macro snowflake__create_table_as(temporary, relation, compiled_code, language='sql') -%}\n {%- if language == 'sql' -%}\n {%- set transient = config.get('transient', default=true) -%}\n {%- set cluster_by_keys = config.get('cluster_by', default=none) -%}\n {%- set enable_automatic_clustering = config.get('automatic_clustering', default=false) -%}\n {%- set copy_grants = config.get('copy_grants', default=false) -%}\n\n {%- if cluster_by_keys is not none and cluster_by_keys is string -%}\n {%- set cluster_by_keys = [cluster_by_keys] -%}\n {%- endif -%}\n {%- if cluster_by_keys is not none -%}\n {%- set cluster_by_string = cluster_by_keys|join(\", \")-%}\n {% else %}\n {%- set cluster_by_string = none -%}\n {%- endif -%}\n {%- set sql_header = config.get('sql_header', none) -%}\n\n {{ sql_header if sql_header is not none }}\n\n create or replace {% if temporary -%}\n temporary\n {%- elif transient -%}\n transient\n {%- endif %} table {{ relation }} {% if copy_grants and not temporary -%} copy grants {%- endif %} as\n (\n {%- if cluster_by_string is not none -%}\n select * from(\n {{ compiled_code }}\n ) order by ({{ cluster_by_string }})\n {%- else -%}\n {{ compiled_code }}\n {%- endif %}\n );\n {% if cluster_by_string is not none and not temporary -%}\n alter table {{relation}} cluster by ({{cluster_by_string}});\n {%- endif -%}\n {% if enable_automatic_clustering and cluster_by_string is not none and not temporary -%}\n alter table {{relation}} resume recluster;\n {%- endif -%}\n\n {%- elif language == 'python' -%}\n {{ py_write_table(compiled_code=compiled_code, target_relation=relation, temporary=temporary) }}\n {%- else -%}\n {% do exceptions.raise_compiler_error(\"snowflake__create_table_as macro didn't get supported language, it got %s\" % language) %}\n {%- endif -%}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_snowflake.py_write_table"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1701215337.527244, "supported_languages": null}, "macro.dbt_snowflake.get_column_comment_sql": {"unique_id": "macro.dbt_snowflake.get_column_comment_sql", "package_name": "dbt_snowflake", "root_path": "/opt/homebrew/lib/python3.9/site-packages/dbt/include/snowflake", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "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 %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1701215337.5279412, "supported_languages": null}, "macro.dbt_snowflake.get_persist_docs_column_list": {"unique_id": "macro.dbt_snowflake.get_persist_docs_column_list", "package_name": "dbt_snowflake", "root_path": "/opt/homebrew/lib/python3.9/site-packages/dbt/include/snowflake", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "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 %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_snowflake.get_column_comment_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1701215337.5282161, "supported_languages": null}, "macro.dbt_snowflake.snowflake__create_view_as": {"unique_id": "macro.dbt_snowflake.snowflake__create_view_as", "package_name": "dbt_snowflake", "root_path": "/opt/homebrew/lib/python3.9/site-packages/dbt/include/snowflake", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "snowflake__create_view_as", "macro_sql": "{% macro snowflake__create_view_as(relation, sql) -%}\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 %} view {{ relation }}\n {% if config.persist_column_docs() -%}\n {% set model_columns = model.columns %}\n {% set query_columns = get_columns_in_query(sql) %}\n {{ get_persist_docs_column_list(model_columns, query_columns) }}\n\n {%- endif %}\n {% if copy_grants -%} copy grants {%- endif %} as (\n {{ sql }}\n );\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.get_columns_in_query", "macro.dbt_snowflake.get_persist_docs_column_list"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1701215337.528955, "supported_languages": null}, "macro.dbt_snowflake.snowflake__get_columns_in_relation": {"unique_id": "macro.dbt_snowflake.snowflake__get_columns_in_relation", "package_name": "dbt_snowflake", "root_path": "/opt/homebrew/lib/python3.9/site-packages/dbt/include/snowflake", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "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 %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1701215337.5297081, "supported_languages": null}, "macro.dbt_snowflake.snowflake__list_schemas": {"unique_id": "macro.dbt_snowflake.snowflake__list_schemas", "package_name": "dbt_snowflake", "root_path": "/opt/homebrew/lib/python3.9/site-packages/dbt/include/snowflake", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "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 %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1701215337.530237, "supported_languages": null}, "macro.dbt_snowflake.snowflake__list_relations_without_caching": {"unique_id": "macro.dbt_snowflake.snowflake__list_relations_without_caching", "package_name": "dbt_snowflake", "root_path": "/opt/homebrew/lib/python3.9/site-packages/dbt/include/snowflake", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "snowflake__list_relations_without_caching", "macro_sql": "{% macro snowflake__list_relations_without_caching(schema_relation) %}\n {%- set sql -%}\n show terse objects in {{ schema_relation }}\n {%- endset -%}\n\n {%- set result = run_query(sql) -%}\n {% set maximum = 10000 %}\n {% if (result | length) >= maximum %}\n {% set msg %}\n Too many schemas in schema {{ schema_relation }}! dbt can only get\n information about schemas with fewer than {{ maximum }} objects.\n {% endset %}\n {% do exceptions.raise_compiler_error(msg) %}\n {% endif %}\n {%- do return(result) -%}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1701215337.53073, "supported_languages": null}, "macro.dbt_snowflake.snowflake__check_schema_exists": {"unique_id": "macro.dbt_snowflake.snowflake__check_schema_exists", "package_name": "dbt_snowflake", "root_path": "/opt/homebrew/lib/python3.9/site-packages/dbt/include/snowflake", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "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 %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1701215337.53105, "supported_languages": null}, "macro.dbt_snowflake.snowflake__rename_relation": {"unique_id": "macro.dbt_snowflake.snowflake__rename_relation", "package_name": "dbt_snowflake", "root_path": "/opt/homebrew/lib/python3.9/site-packages/dbt/include/snowflake", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "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 %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1701215337.531242, "supported_languages": null}, "macro.dbt_snowflake.snowflake__alter_column_type": {"unique_id": "macro.dbt_snowflake.snowflake__alter_column_type", "package_name": "dbt_snowflake", "root_path": "/opt/homebrew/lib/python3.9/site-packages/dbt/include/snowflake", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "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 %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1701215337.531488, "supported_languages": null}, "macro.dbt_snowflake.snowflake__alter_relation_comment": {"unique_id": "macro.dbt_snowflake.snowflake__alter_relation_comment", "package_name": "dbt_snowflake", "root_path": "/opt/homebrew/lib/python3.9/site-packages/dbt/include/snowflake", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "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 %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1701215337.531691, "supported_languages": null}, "macro.dbt_snowflake.snowflake__alter_column_comment": {"unique_id": "macro.dbt_snowflake.snowflake__alter_column_comment", "package_name": "dbt_snowflake", "root_path": "/opt/homebrew/lib/python3.9/site-packages/dbt/include/snowflake", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "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 %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_snowflake.get_column_comment_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1701215337.532277, "supported_languages": null}, "macro.dbt_snowflake.get_current_query_tag": {"unique_id": "macro.dbt_snowflake.get_current_query_tag", "package_name": "dbt_snowflake", "root_path": "/opt/homebrew/lib/python3.9/site-packages/dbt/include/snowflake", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "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 %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1701215337.53248, "supported_languages": null}, "macro.dbt_snowflake.set_query_tag": {"unique_id": "macro.dbt_snowflake.set_query_tag", "package_name": "dbt_snowflake", "root_path": "/opt/homebrew/lib/python3.9/site-packages/dbt/include/snowflake", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "set_query_tag", "macro_sql": "{% macro set_query_tag() -%}\n {{ return(adapter.dispatch('set_query_tag', 'dbt')()) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_snowflake.snowflake__set_query_tag"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1701215337.5326452, "supported_languages": null}, "macro.dbt_snowflake.snowflake__set_query_tag": {"unique_id": "macro.dbt_snowflake.snowflake__set_query_tag", "package_name": "dbt_snowflake", "root_path": "/opt/homebrew/lib/python3.9/site-packages/dbt/include/snowflake", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "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 %}", "resource_type": "macro", "tags": [], "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": 1701215337.533115, "supported_languages": null}, "macro.dbt_snowflake.unset_query_tag": {"unique_id": "macro.dbt_snowflake.unset_query_tag", "package_name": "dbt_snowflake", "root_path": "/opt/homebrew/lib/python3.9/site-packages/dbt/include/snowflake", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "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 %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_snowflake.snowflake__unset_query_tag"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1701215337.5333, "supported_languages": null}, "macro.dbt_snowflake.snowflake__unset_query_tag": {"unique_id": "macro.dbt_snowflake.snowflake__unset_query_tag", "package_name": "dbt_snowflake", "root_path": "/opt/homebrew/lib/python3.9/site-packages/dbt/include/snowflake", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "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 %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1701215337.533768, "supported_languages": null}, "macro.dbt_snowflake.snowflake__alter_relation_add_remove_columns": {"unique_id": "macro.dbt_snowflake.snowflake__alter_relation_add_remove_columns", "package_name": "dbt_snowflake", "root_path": "/opt/homebrew/lib/python3.9/site-packages/dbt/include/snowflake", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "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 %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1701215337.534573, "supported_languages": null}, "macro.dbt_snowflake.snowflake_dml_explicit_transaction": {"unique_id": "macro.dbt_snowflake.snowflake_dml_explicit_transaction", "package_name": "dbt_snowflake", "root_path": "/opt/homebrew/lib/python3.9/site-packages/dbt/include/snowflake", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "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 %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1701215337.534786, "supported_languages": null}, "macro.dbt_snowflake.snowflake__truncate_relation": {"unique_id": "macro.dbt_snowflake.snowflake__truncate_relation", "package_name": "dbt_snowflake", "root_path": "/opt/homebrew/lib/python3.9/site-packages/dbt/include/snowflake", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "name": "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 %}", "resource_type": "macro", "tags": [], "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": 1701215337.535027, "supported_languages": null}, "macro.dbt_snowflake.snowflake__copy_grants": {"unique_id": "macro.dbt_snowflake.snowflake__copy_grants", "package_name": "dbt_snowflake", "root_path": "/opt/homebrew/lib/python3.9/site-packages/dbt/include/snowflake", "path": "macros/apply_grants.sql", "original_file_path": "macros/apply_grants.sql", "name": "snowflake__copy_grants", "macro_sql": "{% macro snowflake__copy_grants() %}\n {% set copy_grants = config.get('copy_grants', False) %}\n {{ return(copy_grants) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1701215337.535418, "supported_languages": null}, "macro.dbt_snowflake.snowflake__support_multiple_grantees_per_dcl_statement": {"unique_id": "macro.dbt_snowflake.snowflake__support_multiple_grantees_per_dcl_statement", "package_name": "dbt_snowflake", "root_path": "/opt/homebrew/lib/python3.9/site-packages/dbt/include/snowflake", "path": "macros/apply_grants.sql", "original_file_path": "macros/apply_grants.sql", "name": "snowflake__support_multiple_grantees_per_dcl_statement", "macro_sql": "\n\n{%- macro snowflake__support_multiple_grantees_per_dcl_statement() -%}\n {{ return(False) }}\n{%- endmacro -%}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1701215337.535529, "supported_languages": null}, "macro.dbt_snowflake.materialization_test_snowflake": {"unique_id": "macro.dbt_snowflake.materialization_test_snowflake", "package_name": "dbt_snowflake", "root_path": "/opt/homebrew/lib/python3.9/site-packages/dbt/include/snowflake", "path": "macros/materializations/test.sql", "original_file_path": "macros/materializations/test.sql", "name": "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 -%}", "resource_type": "macro", "tags": [], "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": 1701215337.535956, "supported_languages": ["sql"]}, "macro.dbt_snowflake.snowflake__get_merge_sql": {"unique_id": "macro.dbt_snowflake.snowflake__get_merge_sql", "package_name": "dbt_snowflake", "root_path": "/opt/homebrew/lib/python3.9/site-packages/dbt/include/snowflake", "path": "macros/materializations/merge.sql", "original_file_path": "macros/materializations/merge.sql", "name": "snowflake__get_merge_sql", "macro_sql": "{% macro snowflake__get_merge_sql(target, source_sql, unique_key, dest_columns, 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, predicates) }}\n\n {%- endif -%}\n {%- endset -%}\n\n {% do return(snowflake_dml_explicit_transaction(dml)) %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "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": 1701215337.5372102, "supported_languages": null}, "macro.dbt_snowflake.snowflake__get_delete_insert_merge_sql": {"unique_id": "macro.dbt_snowflake.snowflake__get_delete_insert_merge_sql", "package_name": "dbt_snowflake", "root_path": "/opt/homebrew/lib/python3.9/site-packages/dbt/include/snowflake", "path": "macros/materializations/merge.sql", "original_file_path": "macros/materializations/merge.sql", "name": "snowflake__get_delete_insert_merge_sql", "macro_sql": "{% macro snowflake__get_delete_insert_merge_sql(target, source, unique_key, dest_columns) %}\n {% set dml = default__get_delete_insert_merge_sql(target, source, unique_key, dest_columns) %}\n {% do return(snowflake_dml_explicit_transaction(dml)) %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "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": 1701215337.537503, "supported_languages": null}, "macro.dbt_snowflake.snowflake__snapshot_merge_sql": {"unique_id": "macro.dbt_snowflake.snowflake__snapshot_merge_sql", "package_name": "dbt_snowflake", "root_path": "/opt/homebrew/lib/python3.9/site-packages/dbt/include/snowflake", "path": "macros/materializations/merge.sql", "original_file_path": "macros/materializations/merge.sql", "name": "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 %}", "resource_type": "macro", "tags": [], "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": 1701215337.537772, "supported_languages": null}, "macro.dbt_snowflake.snowflake__load_csv_rows": {"unique_id": "macro.dbt_snowflake.snowflake__load_csv_rows", "package_name": "dbt_snowflake", "root_path": "/opt/homebrew/lib/python3.9/site-packages/dbt/include/snowflake", "path": "macros/materializations/seed.sql", "original_file_path": "macros/materializations/seed.sql", "name": "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 %}", "resource_type": "macro", "tags": [], "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": 1701215337.539871, "supported_languages": null}, "macro.dbt_snowflake.materialization_seed_snowflake": {"unique_id": "macro.dbt_snowflake.materialization_seed_snowflake", "package_name": "dbt_snowflake", "root_path": "/opt/homebrew/lib/python3.9/site-packages/dbt/include/snowflake", "path": "macros/materializations/seed.sql", "original_file_path": "macros/materializations/seed.sql", "name": "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 %}", "resource_type": "macro", "tags": [], "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": 1701215337.540163, "supported_languages": ["sql"]}, "macro.dbt_snowflake.materialization_view_snowflake": {"unique_id": "macro.dbt_snowflake.materialization_view_snowflake", "package_name": "dbt_snowflake", "root_path": "/opt/homebrew/lib/python3.9/site-packages/dbt/include/snowflake", "path": "macros/materializations/view.sql", "original_file_path": "macros/materializations/view.sql", "name": "materialization_view_snowflake", "macro_sql": "{% materialization view, adapter='snowflake' -%}\n\n {% set original_query_tag = set_query_tag() %}\n {% set to_return = create_or_replace_view() %}\n\n {% set target_relation = this.incorporate(type='view') %}\n\n {% do persist_docs(target_relation, model, for_columns=false) %}\n\n {% do return(to_return) %}\n\n {% do unset_query_tag(original_query_tag) %}\n\n{%- endmaterialization %}", "resource_type": "macro", "tags": [], "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": 1701215337.540755, "supported_languages": ["sql"]}, "macro.dbt_snowflake.materialization_table_snowflake": {"unique_id": "macro.dbt_snowflake.materialization_table_snowflake", "package_name": "dbt_snowflake", "root_path": "/opt/homebrew/lib/python3.9/site-packages/dbt/include/snowflake", "path": "macros/materializations/table.sql", "original_file_path": "macros/materializations/table.sql", "name": "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 %}", "resource_type": "macro", "tags": [], "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": 1701215337.5430698, "supported_languages": ["sql", "python"]}, "macro.dbt_snowflake.py_write_table": {"unique_id": "macro.dbt_snowflake.py_write_table", "package_name": "dbt_snowflake", "root_path": "/opt/homebrew/lib/python3.9/site-packages/dbt/include/snowflake", "path": "macros/materializations/table.sql", "original_file_path": "macros/materializations/table.sql", "name": "py_write_table", "macro_sql": "{% macro py_write_table(compiled_code, target_relation, temporary=False) %}\n{{ compiled_code }}\ndef materialize(session, df, target_relation):\n # make sure pandas exists\n import importlib.util\n package_name = 'pandas'\n if importlib.util.find_spec(package_name):\n import pandas\n if isinstance(df, pandas.core.frame.DataFrame):\n # session.write_pandas does not have overwrite function\n df = session.createDataFrame(df)\n df.write.mode(\"overwrite\").save_as_table(\"{{ target_relation }}\", create_temp_table={{temporary}})\n\ndef main(session):\n dbt = dbtObj(session.table)\n df = model(dbt, session)\n materialize(session, df, dbt.this)\n return \"OK\"\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1701215337.543287, "supported_languages": null}, "macro.dbt_snowflake.py_script_comment": {"unique_id": "macro.dbt_snowflake.py_script_comment", "package_name": "dbt_snowflake", "root_path": "/opt/homebrew/lib/python3.9/site-packages/dbt/include/snowflake", "path": "macros/materializations/table.sql", "original_file_path": "macros/materializations/table.sql", "name": "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%}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1701215337.5433831, "supported_languages": null}, "macro.dbt_snowflake.dbt_snowflake_get_tmp_relation_type": {"unique_id": "macro.dbt_snowflake.dbt_snowflake_get_tmp_relation_type", "package_name": "dbt_snowflake", "root_path": "/opt/homebrew/lib/python3.9/site-packages/dbt/include/snowflake", "path": "macros/materializations/incremental.sql", "original_file_path": "macros/materializations/incremental.sql", "name": "dbt_snowflake_get_tmp_relation_type", "macro_sql": "{% macro dbt_snowflake_get_tmp_relation_type(strategy, unique_key, language) %}\n\n /* {#\n If we are running multiple statements (DELETE + INSERT),\n we must first save the model query results as a temporary table\n in order to guarantee consistent inputs to both statements.\n\n If we are running a single statement (MERGE or INSERT alone),\n we can save the model query definition as a view instead,\n for faster overall incremental processing.\n #} */\n\n {% if language == 'sql' and (strategy in ('default', 'append', 'merge') or (unique_key is none)) %}\n {{ return('view') }}\n {% else %} {#-- play it safe -- #}\n {{ return('table') }}\n {% endif %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1701215337.544748, "supported_languages": null}, "macro.dbt_snowflake.materialization_incremental_snowflake": {"unique_id": "macro.dbt_snowflake.materialization_incremental_snowflake", "package_name": "dbt_snowflake", "root_path": "/opt/homebrew/lib/python3.9/site-packages/dbt/include/snowflake", "path": "macros/materializations/incremental.sql", "original_file_path": "macros/materializations/incremental.sql", "name": "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 {{ create_view_as(tmp_relation, compiled_code) }}\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('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, '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 %}", "resource_type": "macro", "tags": [], "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.create_view_as", "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": 1701215337.547939, "supported_languages": ["sql", "python"]}, "macro.dbt_snowflake.snowflake__get_incremental_default_sql": {"unique_id": "macro.dbt_snowflake.snowflake__get_incremental_default_sql", "package_name": "dbt_snowflake", "root_path": "/opt/homebrew/lib/python3.9/site-packages/dbt/include/snowflake", "path": "macros/materializations/incremental.sql", "original_file_path": "macros/materializations/incremental.sql", "name": "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 %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.get_incremental_merge_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1701215337.5481029, "supported_languages": null}, "macro.dbt_snowflake.materialization_snapshot_snowflake": {"unique_id": "macro.dbt_snowflake.materialization_snapshot_snowflake", "package_name": "dbt_snowflake", "root_path": "/opt/homebrew/lib/python3.9/site-packages/dbt/include/snowflake", "path": "macros/materializations/snapshot.sql", "original_file_path": "macros/materializations/snapshot.sql", "name": "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 %}", "resource_type": "macro", "tags": [], "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": 1701215337.548519, "supported_languages": ["sql"]}, "macro.dbt_snowflake.snowflake__current_timestamp": {"unique_id": "macro.dbt_snowflake.snowflake__current_timestamp", "package_name": "dbt_snowflake", "root_path": "/opt/homebrew/lib/python3.9/site-packages/dbt/include/snowflake", "path": "macros/utils/timestamps.sql", "original_file_path": "macros/utils/timestamps.sql", "name": "snowflake__current_timestamp", "macro_sql": "{% macro snowflake__current_timestamp() -%}\n convert_timezone('UTC', current_timestamp())\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1701215337.5488489, "supported_languages": null}, "macro.dbt_snowflake.snowflake__snapshot_string_as_time": {"unique_id": "macro.dbt_snowflake.snowflake__snapshot_string_as_time", "package_name": "dbt_snowflake", "root_path": "/opt/homebrew/lib/python3.9/site-packages/dbt/include/snowflake", "path": "macros/utils/timestamps.sql", "original_file_path": "macros/utils/timestamps.sql", "name": "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 %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1701215337.549021, "supported_languages": null}, "macro.dbt_snowflake.snowflake__snapshot_get_time": {"unique_id": "macro.dbt_snowflake.snowflake__snapshot_get_time", "package_name": "dbt_snowflake", "root_path": "/opt/homebrew/lib/python3.9/site-packages/dbt/include/snowflake", "path": "macros/utils/timestamps.sql", "original_file_path": "macros/utils/timestamps.sql", "name": "snowflake__snapshot_get_time", "macro_sql": "{% macro snowflake__snapshot_get_time() -%}\n to_timestamp_ntz({{ current_timestamp() }})\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.current_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1701215337.549126, "supported_languages": null}, "macro.dbt_snowflake.snowflake__current_timestamp_backcompat": {"unique_id": "macro.dbt_snowflake.snowflake__current_timestamp_backcompat", "package_name": "dbt_snowflake", "root_path": "/opt/homebrew/lib/python3.9/site-packages/dbt/include/snowflake", "path": "macros/utils/timestamps.sql", "original_file_path": "macros/utils/timestamps.sql", "name": "snowflake__current_timestamp_backcompat", "macro_sql": "{% macro snowflake__current_timestamp_backcompat() %}\n current_timestamp::{{ type_timestamp() }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.type_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1701215337.549226, "supported_languages": null}, "macro.dbt_snowflake.snowflake__current_timestamp_in_utc_backcompat": {"unique_id": "macro.dbt_snowflake.snowflake__current_timestamp_in_utc_backcompat", "package_name": "dbt_snowflake", "root_path": "/opt/homebrew/lib/python3.9/site-packages/dbt/include/snowflake", "path": "macros/utils/timestamps.sql", "original_file_path": "macros/utils/timestamps.sql", "name": "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 %}", "resource_type": "macro", "tags": [], "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": 1701215337.549356, "supported_languages": null}, "macro.dbt_snowflake.snowflake__escape_single_quotes": {"unique_id": "macro.dbt_snowflake.snowflake__escape_single_quotes", "package_name": "dbt_snowflake", "root_path": "/opt/homebrew/lib/python3.9/site-packages/dbt/include/snowflake", "path": "macros/utils/escape_single_quotes.sql", "original_file_path": "macros/utils/escape_single_quotes.sql", "name": "snowflake__escape_single_quotes", "macro_sql": "{% macro snowflake__escape_single_quotes(expression) -%}\n{{ expression | replace(\"'\", \"\\\\'\") }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1701215337.549598, "supported_languages": null}, "macro.dbt_snowflake.snowflake__right": {"unique_id": "macro.dbt_snowflake.snowflake__right", "package_name": "dbt_snowflake", "root_path": "/opt/homebrew/lib/python3.9/site-packages/dbt/include/snowflake", "path": "macros/utils/right.sql", "original_file_path": "macros/utils/right.sql", "name": "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 -%}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1701215337.549879, "supported_languages": null}, "macro.dbt_snowflake.snowflake__safe_cast": {"unique_id": "macro.dbt_snowflake.snowflake__safe_cast", "package_name": "dbt_snowflake", "root_path": "/opt/homebrew/lib/python3.9/site-packages/dbt/include/snowflake", "path": "macros/utils/safe_cast.sql", "original_file_path": "macros/utils/safe_cast.sql", "name": "snowflake__safe_cast", "macro_sql": "{% macro snowflake__safe_cast(field, type) %}\n try_cast({{field}} as {{type}})\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1701215337.550098, "supported_languages": null}, "macro.dbt_snowflake.snowflake__bool_or": {"unique_id": "macro.dbt_snowflake.snowflake__bool_or", "package_name": "dbt_snowflake", "root_path": "/opt/homebrew/lib/python3.9/site-packages/dbt/include/snowflake", "path": "macros/utils/bool_or.sql", "original_file_path": "macros/utils/bool_or.sql", "name": "snowflake__bool_or", "macro_sql": "{% macro snowflake__bool_or(expression) -%}\n\n boolor_agg({{ expression }})\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1701215337.5502841, "supported_languages": null}, "macro.dbt_snowflake.snowflake__array_construct": {"unique_id": "macro.dbt_snowflake.snowflake__array_construct", "package_name": "dbt_snowflake", "root_path": "/opt/homebrew/lib/python3.9/site-packages/dbt/include/snowflake", "path": "macros/utils/array_construct.sql", "original_file_path": "macros/utils/array_construct.sql", "name": "snowflake__array_construct", "macro_sql": "{% macro snowflake__array_construct(inputs, data_type) -%}\n array_construct( {{ inputs|join(' , ') }} )\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1701215337.5505102, "supported_languages": null}, "macro.dbt.run_hooks": {"unique_id": "macro.dbt.run_hooks", "package_name": "dbt", "root_path": "/opt/homebrew/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/hooks.sql", "original_file_path": "macros/materializations/hooks.sql", "name": "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 %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1701215337.5515862, "supported_languages": null}, "macro.dbt.make_hook_config": {"unique_id": "macro.dbt.make_hook_config", "package_name": "dbt", "root_path": "/opt/homebrew/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/hooks.sql", "original_file_path": "macros/materializations/hooks.sql", "name": "make_hook_config", "macro_sql": "{% macro make_hook_config(sql, inside_transaction) %}\n {{ tojson({\"sql\": sql, \"transaction\": inside_transaction}) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1701215337.5517719, "supported_languages": null}, "macro.dbt.before_begin": {"unique_id": "macro.dbt.before_begin", "package_name": "dbt", "root_path": "/opt/homebrew/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/hooks.sql", "original_file_path": "macros/materializations/hooks.sql", "name": "before_begin", "macro_sql": "{% macro before_begin(sql) %}\n {{ make_hook_config(sql, inside_transaction=False) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.make_hook_config"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1701215337.5519109, "supported_languages": null}, "macro.dbt.in_transaction": {"unique_id": "macro.dbt.in_transaction", "package_name": "dbt", "root_path": "/opt/homebrew/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/hooks.sql", "original_file_path": "macros/materializations/hooks.sql", "name": "in_transaction", "macro_sql": "{% macro in_transaction(sql) %}\n {{ make_hook_config(sql, inside_transaction=True) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.make_hook_config"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1701215337.552047, "supported_languages": null}, "macro.dbt.after_commit": {"unique_id": "macro.dbt.after_commit", "package_name": "dbt", "root_path": "/opt/homebrew/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/hooks.sql", "original_file_path": "macros/materializations/hooks.sql", "name": "after_commit", "macro_sql": "{% macro after_commit(sql) %}\n {{ make_hook_config(sql, inside_transaction=False) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.make_hook_config"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1701215337.55218, "supported_languages": null}, "macro.dbt.set_sql_header": {"unique_id": "macro.dbt.set_sql_header", "package_name": "dbt", "root_path": "/opt/homebrew/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/configs.sql", "original_file_path": "macros/materializations/configs.sql", "name": "set_sql_header", "macro_sql": "{% macro set_sql_header(config) -%}\n {{ config.set('sql_header', caller()) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1701215337.552594, "supported_languages": null}, "macro.dbt.should_full_refresh": {"unique_id": "macro.dbt.should_full_refresh", "package_name": "dbt", "root_path": "/opt/homebrew/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/configs.sql", "original_file_path": "macros/materializations/configs.sql", "name": "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 %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1701215337.552881, "supported_languages": null}, "macro.dbt.should_store_failures": {"unique_id": "macro.dbt.should_store_failures", "package_name": "dbt", "root_path": "/opt/homebrew/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/configs.sql", "original_file_path": "macros/materializations/configs.sql", "name": "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 %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1701215337.553237, "supported_languages": null}, "macro.dbt.snapshot_merge_sql": {"unique_id": "macro.dbt.snapshot_merge_sql", "package_name": "dbt", "root_path": "/opt/homebrew/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshots/snapshot_merge.sql", "original_file_path": "macros/materializations/snapshots/snapshot_merge.sql", "name": "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 %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_snowflake.snowflake__snapshot_merge_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1701215337.5537012, "supported_languages": null}, "macro.dbt.default__snapshot_merge_sql": {"unique_id": "macro.dbt.default__snapshot_merge_sql", "package_name": "dbt", "root_path": "/opt/homebrew/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshots/snapshot_merge.sql", "original_file_path": "macros/materializations/snapshots/snapshot_merge.sql", "name": "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 %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1701215337.553961, "supported_languages": null}, "macro.dbt.strategy_dispatch": {"unique_id": "macro.dbt.strategy_dispatch", "package_name": "dbt", "root_path": "/opt/homebrew/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshots/strategies.sql", "original_file_path": "macros/materializations/snapshots/strategies.sql", "name": "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 %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1701215337.5572, "supported_languages": null}, "macro.dbt.snapshot_hash_arguments": {"unique_id": "macro.dbt.snapshot_hash_arguments", "package_name": "dbt", "root_path": "/opt/homebrew/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshots/strategies.sql", "original_file_path": "macros/materializations/snapshots/strategies.sql", "name": "snapshot_hash_arguments", "macro_sql": "{% macro snapshot_hash_arguments(args) -%}\n {{ adapter.dispatch('snapshot_hash_arguments', 'dbt')(args) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__snapshot_hash_arguments"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1701215337.557365, "supported_languages": null}, "macro.dbt.default__snapshot_hash_arguments": {"unique_id": "macro.dbt.default__snapshot_hash_arguments", "package_name": "dbt", "root_path": "/opt/homebrew/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshots/strategies.sql", "original_file_path": "macros/materializations/snapshots/strategies.sql", "name": "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 %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1701215337.557578, "supported_languages": null}, "macro.dbt.snapshot_timestamp_strategy": {"unique_id": "macro.dbt.snapshot_timestamp_strategy", "package_name": "dbt", "root_path": "/opt/homebrew/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshots/strategies.sql", "original_file_path": "macros/materializations/snapshots/strategies.sql", "name": "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 %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.snapshot_hash_arguments"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1701215337.5582669, "supported_languages": null}, "macro.dbt.snapshot_string_as_time": {"unique_id": "macro.dbt.snapshot_string_as_time", "package_name": "dbt", "root_path": "/opt/homebrew/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshots/strategies.sql", "original_file_path": "macros/materializations/snapshots/strategies.sql", "name": "snapshot_string_as_time", "macro_sql": "{% macro snapshot_string_as_time(timestamp) -%}\n {{ adapter.dispatch('snapshot_string_as_time', 'dbt')(timestamp) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "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": 1701215337.5584278, "supported_languages": null}, "macro.dbt.default__snapshot_string_as_time": {"unique_id": "macro.dbt.default__snapshot_string_as_time", "package_name": "dbt", "root_path": "/opt/homebrew/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshots/strategies.sql", "original_file_path": "macros/materializations/snapshots/strategies.sql", "name": "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 %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1701215337.558594, "supported_languages": null}, "macro.dbt.snapshot_check_all_get_existing_columns": {"unique_id": "macro.dbt.snapshot_check_all_get_existing_columns", "package_name": "dbt", "root_path": "/opt/homebrew/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshots/strategies.sql", "original_file_path": "macros/materializations/snapshots/strategies.sql", "name": "snapshot_check_all_get_existing_columns", "macro_sql": "{% macro snapshot_check_all_get_existing_columns(node, target_exists, check_cols_config) -%}\n {%- if not target_exists -%}\n {#-- no table yet -> return whatever the query does --#}\n {{ return((false, query_columns)) }}\n {%- endif -%}\n\n {#-- handle any schema changes --#}\n {%- set target_relation = adapter.get_relation(database=node.database, schema=node.schema, identifier=node.alias) -%}\n\n {% if check_cols_config == 'all' %}\n {%- set query_columns = get_columns_in_query(node['compiled_code']) -%}\n\n {% elif check_cols_config is iterable and (check_cols_config | length) > 0 %}\n {#-- query for proper casing/quoting, to support comparison below --#}\n {%- set select_check_cols_from_target -%}\n select {{ check_cols_config | join(', ') }} from ({{ node['compiled_code'] }}) subq\n {%- endset -%}\n {% set query_columns = get_columns_in_query(select_check_cols_from_target) %}\n\n {% else %}\n {% do exceptions.raise_compiler_error(\"Invalid value for 'check_cols': \" ~ check_cols_config) %}\n {% endif %}\n\n {%- set existing_cols = adapter.get_columns_in_relation(target_relation) | map(attribute = 'name') | list -%}\n {%- set ns = namespace() -%} {#-- handle for-loop scoping with a namespace --#}\n {%- set ns.column_added = false -%}\n\n {%- set intersection = [] -%}\n {%- for col in query_columns -%}\n {%- if col in existing_cols -%}\n {%- do intersection.append(adapter.quote(col)) -%}\n {%- else -%}\n {% set ns.column_added = true %}\n {%- endif -%}\n {%- endfor -%}\n {{ return((ns.column_added, intersection)) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.get_columns_in_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1701215337.559933, "supported_languages": null}, "macro.dbt.snapshot_check_strategy": {"unique_id": "macro.dbt.snapshot_check_strategy", "package_name": "dbt", "root_path": "/opt/homebrew/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshots/strategies.sql", "original_file_path": "macros/materializations/snapshots/strategies.sql", "name": "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 %}", "resource_type": "macro", "tags": [], "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": 1701215337.561258, "supported_languages": null}, "macro.dbt.create_columns": {"unique_id": "macro.dbt.create_columns", "package_name": "dbt", "root_path": "/opt/homebrew/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "name": "create_columns", "macro_sql": "{% macro create_columns(relation, columns) %}\n {{ adapter.dispatch('create_columns', 'dbt')(relation, columns) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__create_columns"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1701215337.564862, "supported_languages": null}, "macro.dbt.default__create_columns": {"unique_id": "macro.dbt.default__create_columns", "package_name": "dbt", "root_path": "/opt/homebrew/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "name": "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 %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1701215337.565136, "supported_languages": null}, "macro.dbt.post_snapshot": {"unique_id": "macro.dbt.post_snapshot", "package_name": "dbt", "root_path": "/opt/homebrew/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "name": "post_snapshot", "macro_sql": "{% macro post_snapshot(staging_relation) %}\n {{ adapter.dispatch('post_snapshot', 'dbt')(staging_relation) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__post_snapshot"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1701215337.565299, "supported_languages": null}, "macro.dbt.default__post_snapshot": {"unique_id": "macro.dbt.default__post_snapshot", "package_name": "dbt", "root_path": "/opt/homebrew/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "name": "default__post_snapshot", "macro_sql": "{% macro default__post_snapshot(staging_relation) %}\n {# no-op #}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1701215337.565381, "supported_languages": null}, "macro.dbt.get_true_sql": {"unique_id": "macro.dbt.get_true_sql", "package_name": "dbt", "root_path": "/opt/homebrew/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "name": "get_true_sql", "macro_sql": "{% macro get_true_sql() %}\n {{ adapter.dispatch('get_true_sql', 'dbt')() }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__get_true_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1701215337.565519, "supported_languages": null}, "macro.dbt.default__get_true_sql": {"unique_id": "macro.dbt.default__get_true_sql", "package_name": "dbt", "root_path": "/opt/homebrew/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "name": "default__get_true_sql", "macro_sql": "{% macro default__get_true_sql() %}\n {{ return('TRUE') }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1701215337.5656261, "supported_languages": null}, "macro.dbt.snapshot_staging_table": {"unique_id": "macro.dbt.snapshot_staging_table", "package_name": "dbt", "root_path": "/opt/homebrew/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "name": "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 %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__snapshot_staging_table"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1701215337.565831, "supported_languages": null}, "macro.dbt.default__snapshot_staging_table": {"unique_id": "macro.dbt.default__snapshot_staging_table", "package_name": "dbt", "root_path": "/opt/homebrew/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "name": "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 %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.snapshot_get_time"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1701215337.5666618, "supported_languages": null}, "macro.dbt.build_snapshot_table": {"unique_id": "macro.dbt.build_snapshot_table", "package_name": "dbt", "root_path": "/opt/homebrew/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "name": "build_snapshot_table", "macro_sql": "{% macro build_snapshot_table(strategy, sql) -%}\n {{ adapter.dispatch('build_snapshot_table', 'dbt')(strategy, sql) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__build_snapshot_table"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1701215337.566845, "supported_languages": null}, "macro.dbt.default__build_snapshot_table": {"unique_id": "macro.dbt.default__build_snapshot_table", "package_name": "dbt", "root_path": "/opt/homebrew/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "name": "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 %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1701215337.567082, "supported_languages": null}, "macro.dbt.build_snapshot_staging_table": {"unique_id": "macro.dbt.build_snapshot_staging_table", "package_name": "dbt", "root_path": "/opt/homebrew/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "name": "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 %}", "resource_type": "macro", "tags": [], "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": 1701215337.567489, "supported_languages": null}, "macro.dbt.materialization_snapshot_default": {"unique_id": "macro.dbt.materialization_snapshot_default", "package_name": "dbt", "root_path": "/opt/homebrew/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/snapshots/snapshot.sql", "original_file_path": "macros/materializations/snapshots/snapshot.sql", "name": "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 %}", "resource_type": "macro", "tags": [], "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": 1701215337.5731368, "supported_languages": ["sql"]}, "macro.dbt.materialization_test_default": {"unique_id": "macro.dbt.materialization_test_default", "package_name": "dbt", "root_path": "/opt/homebrew/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/tests/test.sql", "original_file_path": "macros/materializations/tests/test.sql", "name": "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 -%}", "resource_type": "macro", "tags": [], "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": 1701215337.575117, "supported_languages": ["sql"]}, "macro.dbt.get_test_sql": {"unique_id": "macro.dbt.get_test_sql", "package_name": "dbt", "root_path": "/opt/homebrew/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/tests/helpers.sql", "original_file_path": "macros/materializations/tests/helpers.sql", "name": "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 %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__get_test_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1701215337.575603, "supported_languages": null}, "macro.dbt.default__get_test_sql": {"unique_id": "macro.dbt.default__get_test_sql", "package_name": "dbt", "root_path": "/opt/homebrew/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/tests/helpers.sql", "original_file_path": "macros/materializations/tests/helpers.sql", "name": "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 %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1701215337.575906, "supported_languages": null}, "macro.dbt.get_where_subquery": {"unique_id": "macro.dbt.get_where_subquery", "package_name": "dbt", "root_path": "/opt/homebrew/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/tests/where_subquery.sql", "original_file_path": "macros/materializations/tests/where_subquery.sql", "name": "get_where_subquery", "macro_sql": "{% macro get_where_subquery(relation) -%}\n {% do return(adapter.dispatch('get_where_subquery', 'dbt')(relation)) %}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__get_where_subquery"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1701215337.576315, "supported_languages": null}, "macro.dbt.default__get_where_subquery": {"unique_id": "macro.dbt.default__get_where_subquery", "package_name": "dbt", "root_path": "/opt/homebrew/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/tests/where_subquery.sql", "original_file_path": "macros/materializations/tests/where_subquery.sql", "name": "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 %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1701215337.576684, "supported_languages": null}, "macro.dbt.get_quoted_csv": {"unique_id": "macro.dbt.get_quoted_csv", "package_name": "dbt", "root_path": "/opt/homebrew/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/column_helpers.sql", "original_file_path": "macros/materializations/models/incremental/column_helpers.sql", "name": "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 %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1701215337.578167, "supported_languages": null}, "macro.dbt.diff_columns": {"unique_id": "macro.dbt.diff_columns", "package_name": "dbt", "root_path": "/opt/homebrew/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/column_helpers.sql", "original_file_path": "macros/materializations/models/incremental/column_helpers.sql", "name": "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 %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1701215337.5786948, "supported_languages": null}, "macro.dbt.diff_column_data_types": {"unique_id": "macro.dbt.diff_column_data_types", "package_name": "dbt", "root_path": "/opt/homebrew/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/column_helpers.sql", "original_file_path": "macros/materializations/models/incremental/column_helpers.sql", "name": "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 %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1701215337.579337, "supported_languages": null}, "macro.dbt.get_merge_update_columns": {"unique_id": "macro.dbt.get_merge_update_columns", "package_name": "dbt", "root_path": "/opt/homebrew/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/column_helpers.sql", "original_file_path": "macros/materializations/models/incremental/column_helpers.sql", "name": "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 %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__get_merge_update_columns"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1701215337.579564, "supported_languages": null}, "macro.dbt.default__get_merge_update_columns": {"unique_id": "macro.dbt.default__get_merge_update_columns", "package_name": "dbt", "root_path": "/opt/homebrew/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/column_helpers.sql", "original_file_path": "macros/materializations/models/incremental/column_helpers.sql", "name": "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 %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1701215337.580248, "supported_languages": null}, "macro.dbt.get_merge_sql": {"unique_id": "macro.dbt.get_merge_sql", "package_name": "dbt", "root_path": "/opt/homebrew/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/merge.sql", "original_file_path": "macros/materializations/models/incremental/merge.sql", "name": "get_merge_sql", "macro_sql": "{% macro get_merge_sql(target, source, unique_key, dest_columns, predicates=none) -%}\n {{ adapter.dispatch('get_merge_sql', 'dbt')(target, source, unique_key, dest_columns, predicates) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_snowflake.snowflake__get_merge_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1701215337.584332, "supported_languages": null}, "macro.dbt.default__get_merge_sql": {"unique_id": "macro.dbt.default__get_merge_sql", "package_name": "dbt", "root_path": "/opt/homebrew/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/merge.sql", "original_file_path": "macros/materializations/models/incremental/merge.sql", "name": "default__get_merge_sql", "macro_sql": "{% macro default__get_merge_sql(target, source, unique_key, dest_columns, predicates) -%}\n {%- set predicates = [] if predicates is none else [] + 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 %}", "resource_type": "macro", "tags": [], "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": 1701215337.5859258, "supported_languages": null}, "macro.dbt.get_delete_insert_merge_sql": {"unique_id": "macro.dbt.get_delete_insert_merge_sql", "package_name": "dbt", "root_path": "/opt/homebrew/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/merge.sql", "original_file_path": "macros/materializations/models/incremental/merge.sql", "name": "get_delete_insert_merge_sql", "macro_sql": "{% macro get_delete_insert_merge_sql(target, source, unique_key, dest_columns) -%}\n {{ adapter.dispatch('get_delete_insert_merge_sql', 'dbt')(target, source, unique_key, dest_columns) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "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": 1701215337.5861619, "supported_languages": null}, "macro.dbt.default__get_delete_insert_merge_sql": {"unique_id": "macro.dbt.default__get_delete_insert_merge_sql", "package_name": "dbt", "root_path": "/opt/homebrew/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/merge.sql", "original_file_path": "macros/materializations/models/incremental/merge.sql", "name": "default__get_delete_insert_merge_sql", "macro_sql": "{% macro default__get_delete_insert_merge_sql(target, source, unique_key, dest_columns) -%}\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 );\n {% else %}\n delete from {{ target }}\n where (\n {{ unique_key }}) in (\n select ({{ unique_key }})\n from {{ source }}\n );\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 %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.get_quoted_csv"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1701215337.58688, "supported_languages": null}, "macro.dbt.get_insert_overwrite_merge_sql": {"unique_id": "macro.dbt.get_insert_overwrite_merge_sql", "package_name": "dbt", "root_path": "/opt/homebrew/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/merge.sql", "original_file_path": "macros/materializations/models/incremental/merge.sql", "name": "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 %}", "resource_type": "macro", "tags": [], "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": 1701215337.587138, "supported_languages": null}, "macro.dbt.default__get_insert_overwrite_merge_sql": {"unique_id": "macro.dbt.default__get_insert_overwrite_merge_sql", "package_name": "dbt", "root_path": "/opt/homebrew/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/merge.sql", "original_file_path": "macros/materializations/models/incremental/merge.sql", "name": "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 %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.get_quoted_csv"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1701215337.5877602, "supported_languages": null}, "macro.dbt.is_incremental": {"unique_id": "macro.dbt.is_incremental", "package_name": "dbt", "root_path": "/opt/homebrew/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/is_incremental.sql", "original_file_path": "macros/materializations/models/incremental/is_incremental.sql", "name": "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 %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.should_full_refresh"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1701215337.5884612, "supported_languages": null}, "macro.dbt.get_incremental_append_sql": {"unique_id": "macro.dbt.get_incremental_append_sql", "package_name": "dbt", "root_path": "/opt/homebrew/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/strategies.sql", "original_file_path": "macros/materializations/models/incremental/strategies.sql", "name": "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 %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__get_incremental_append_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1701215337.589327, "supported_languages": null}, "macro.dbt.default__get_incremental_append_sql": {"unique_id": "macro.dbt.default__get_incremental_append_sql", "package_name": "dbt", "root_path": "/opt/homebrew/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/strategies.sql", "original_file_path": "macros/materializations/models/incremental/strategies.sql", "name": "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 %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.get_insert_into_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1701215337.5895622, "supported_languages": null}, "macro.dbt.get_incremental_delete_insert_sql": {"unique_id": "macro.dbt.get_incremental_delete_insert_sql", "package_name": "dbt", "root_path": "/opt/homebrew/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/strategies.sql", "original_file_path": "macros/materializations/models/incremental/strategies.sql", "name": "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 %}", "resource_type": "macro", "tags": [], "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": 1701215337.589741, "supported_languages": null}, "macro.dbt.default__get_incremental_delete_insert_sql": {"unique_id": "macro.dbt.default__get_incremental_delete_insert_sql", "package_name": "dbt", "root_path": "/opt/homebrew/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/strategies.sql", "original_file_path": "macros/materializations/models/incremental/strategies.sql", "name": "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\"])) %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.get_delete_insert_merge_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1701215337.589998, "supported_languages": null}, "macro.dbt.get_incremental_merge_sql": {"unique_id": "macro.dbt.get_incremental_merge_sql", "package_name": "dbt", "root_path": "/opt/homebrew/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/strategies.sql", "original_file_path": "macros/materializations/models/incremental/strategies.sql", "name": "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 %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__get_incremental_merge_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1701215337.590179, "supported_languages": null}, "macro.dbt.default__get_incremental_merge_sql": {"unique_id": "macro.dbt.default__get_incremental_merge_sql", "package_name": "dbt", "root_path": "/opt/homebrew/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/strategies.sql", "original_file_path": "macros/materializations/models/incremental/strategies.sql", "name": "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\"])) %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.get_merge_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1701215337.5904372, "supported_languages": null}, "macro.dbt.get_incremental_insert_overwrite_sql": {"unique_id": "macro.dbt.get_incremental_insert_overwrite_sql", "package_name": "dbt", "root_path": "/opt/homebrew/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/strategies.sql", "original_file_path": "macros/materializations/models/incremental/strategies.sql", "name": "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 %}", "resource_type": "macro", "tags": [], "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": 1701215337.5906188, "supported_languages": null}, "macro.dbt.default__get_incremental_insert_overwrite_sql": {"unique_id": "macro.dbt.default__get_incremental_insert_overwrite_sql", "package_name": "dbt", "root_path": "/opt/homebrew/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/strategies.sql", "original_file_path": "macros/materializations/models/incremental/strategies.sql", "name": "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[\"predicates\"])) %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.get_insert_overwrite_merge_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1701215337.590942, "supported_languages": null}, "macro.dbt.get_incremental_default_sql": {"unique_id": "macro.dbt.get_incremental_default_sql", "package_name": "dbt", "root_path": "/opt/homebrew/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/strategies.sql", "original_file_path": "macros/materializations/models/incremental/strategies.sql", "name": "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 %}", "resource_type": "macro", "tags": [], "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": 1701215337.5911522, "supported_languages": null}, "macro.dbt.default__get_incremental_default_sql": {"unique_id": "macro.dbt.default__get_incremental_default_sql", "package_name": "dbt", "root_path": "/opt/homebrew/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/strategies.sql", "original_file_path": "macros/materializations/models/incremental/strategies.sql", "name": "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 %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.get_incremental_append_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1701215337.591307, "supported_languages": null}, "macro.dbt.get_insert_into_sql": {"unique_id": "macro.dbt.get_insert_into_sql", "package_name": "dbt", "root_path": "/opt/homebrew/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/strategies.sql", "original_file_path": "macros/materializations/models/incremental/strategies.sql", "name": "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 %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.get_quoted_csv"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1701215337.59159, "supported_languages": null}, "macro.dbt.materialization_incremental_default": {"unique_id": "macro.dbt.materialization_incremental_default", "package_name": "dbt", "root_path": "/opt/homebrew/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/incremental.sql", "original_file_path": "macros/materializations/models/incremental/incremental.sql", "name": "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('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, '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 %}", "resource_type": "macro", "tags": [], "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": 1701215337.5963478, "supported_languages": ["sql"]}, "macro.dbt.incremental_validate_on_schema_change": {"unique_id": "macro.dbt.incremental_validate_on_schema_change", "package_name": "dbt", "root_path": "/opt/homebrew/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/on_schema_change.sql", "original_file_path": "macros/materializations/models/incremental/on_schema_change.sql", "name": "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 %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1701215337.6012712, "supported_languages": null}, "macro.dbt.check_for_schema_changes": {"unique_id": "macro.dbt.check_for_schema_changes", "package_name": "dbt", "root_path": "/opt/homebrew/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/on_schema_change.sql", "original_file_path": "macros/materializations/models/incremental/on_schema_change.sql", "name": "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 %}", "resource_type": "macro", "tags": [], "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": 1701215337.6024399, "supported_languages": null}, "macro.dbt.sync_column_schemas": {"unique_id": "macro.dbt.sync_column_schemas", "package_name": "dbt", "root_path": "/opt/homebrew/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/on_schema_change.sql", "original_file_path": "macros/materializations/models/incremental/on_schema_change.sql", "name": "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 %}", "resource_type": "macro", "tags": [], "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": 1701215337.6036339, "supported_languages": null}, "macro.dbt.process_schema_changes": {"unique_id": "macro.dbt.process_schema_changes", "package_name": "dbt", "root_path": "/opt/homebrew/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/incremental/on_schema_change.sql", "original_file_path": "macros/materializations/models/incremental/on_schema_change.sql", "name": "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 %}", "resource_type": "macro", "tags": [], "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": 1701215337.604469, "supported_languages": null}, "macro.dbt.materialization_table_default": {"unique_id": "macro.dbt.materialization_table_default", "package_name": "dbt", "root_path": "/opt/homebrew/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/table/table.sql", "original_file_path": "macros/materializations/models/table/table.sql", "name": "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 %}", "resource_type": "macro", "tags": [], "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": 1701215337.6069279, "supported_languages": ["sql"]}, "macro.dbt.get_create_table_as_sql": {"unique_id": "macro.dbt.get_create_table_as_sql", "package_name": "dbt", "root_path": "/opt/homebrew/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/table/create_table_as.sql", "original_file_path": "macros/materializations/models/table/create_table_as.sql", "name": "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 %}", "resource_type": "macro", "tags": [], "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": 1701215337.607469, "supported_languages": null}, "macro.dbt.default__get_create_table_as_sql": {"unique_id": "macro.dbt.default__get_create_table_as_sql", "package_name": "dbt", "root_path": "/opt/homebrew/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/table/create_table_as.sql", "original_file_path": "macros/materializations/models/table/create_table_as.sql", "name": "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 %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.create_table_as"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1701215337.607646, "supported_languages": null}, "macro.dbt.create_table_as": {"unique_id": "macro.dbt.create_table_as", "package_name": "dbt", "root_path": "/opt/homebrew/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/table/create_table_as.sql", "original_file_path": "macros/materializations/models/table/create_table_as.sql", "name": "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 %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_snowflake.snowflake__create_table_as"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1701215337.608057, "supported_languages": null}, "macro.dbt.default__create_table_as": {"unique_id": "macro.dbt.default__create_table_as", "package_name": "dbt", "root_path": "/opt/homebrew/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/table/create_table_as.sql", "original_file_path": "macros/materializations/models/table/create_table_as.sql", "name": "default__create_table_as", "macro_sql": "{% macro default__create_table_as(temporary, relation, sql) -%}\n {%- set sql_header = config.get('sql_header', none) -%}\n\n {{ sql_header if sql_header is not none }}\n\n create {% if temporary: -%}temporary{%- endif %} table\n {{ relation.include(database=(not temporary), schema=(not temporary)) }}\n as (\n {{ sql }}\n );\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1701215337.608455, "supported_languages": null}, "macro.dbt.materialization_view_default": {"unique_id": "macro.dbt.materialization_view_default", "package_name": "dbt", "root_path": "/opt/homebrew/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/view/view.sql", "original_file_path": "macros/materializations/models/view/view.sql", "name": "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 -%}", "resource_type": "macro", "tags": [], "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": 1701215337.610891, "supported_languages": ["sql"]}, "macro.dbt.handle_existing_table": {"unique_id": "macro.dbt.handle_existing_table", "package_name": "dbt", "root_path": "/opt/homebrew/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/view/helpers.sql", "original_file_path": "macros/materializations/models/view/helpers.sql", "name": "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 %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__handle_existing_table"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1701215337.611236, "supported_languages": null}, "macro.dbt.default__handle_existing_table": {"unique_id": "macro.dbt.default__handle_existing_table", "package_name": "dbt", "root_path": "/opt/homebrew/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/view/helpers.sql", "original_file_path": "macros/materializations/models/view/helpers.sql", "name": "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 %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1701215337.611455, "supported_languages": null}, "macro.dbt.create_or_replace_view": {"unique_id": "macro.dbt.create_or_replace_view", "package_name": "dbt", "root_path": "/opt/homebrew/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/view/create_or_replace_view.sql", "original_file_path": "macros/materializations/models/view/create_or_replace_view.sql", "name": "create_or_replace_view", "macro_sql": "{% macro create_or_replace_view() %}\n {%- set identifier = model['alias'] -%}\n\n {%- set old_relation = adapter.get_relation(database=database, schema=schema, identifier=identifier) -%}\n {%- set exists_as_view = (old_relation is not none and old_relation.is_view) -%}\n\n {%- set target_relation = api.Relation.create(\n identifier=identifier, schema=schema, database=database,\n type='view') -%}\n {% set grant_config = config.get('grants') %}\n\n {{ run_hooks(pre_hooks) }}\n\n -- If there's a table with the same name and we weren't told to full refresh,\n -- that's an error. If we were told to full refresh, drop it. This behavior differs\n -- for Snowflake and BigQuery, so multiple dispatch is used.\n {%- if old_relation is not none and old_relation.is_table -%}\n {{ handle_existing_table(should_full_refresh(), old_relation) }}\n {%- endif -%}\n\n -- build model\n {% call statement('main') -%}\n {{ get_create_view_as_sql(target_relation, sql) }}\n {%- endcall %}\n\n {% set should_revoke = should_revoke(exists_as_view, full_refresh_mode=True) %}\n {% do apply_grants(target_relation, grant_config, should_revoke=True) %}\n\n {{ run_hooks(post_hooks) }}\n\n {{ return({'relations': [target_relation]}) }}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "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": 1701215337.612967, "supported_languages": null}, "macro.dbt.get_create_view_as_sql": {"unique_id": "macro.dbt.get_create_view_as_sql", "package_name": "dbt", "root_path": "/opt/homebrew/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/view/create_view_as.sql", "original_file_path": "macros/materializations/models/view/create_view_as.sql", "name": "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 %}", "resource_type": "macro", "tags": [], "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": 1701215337.613373, "supported_languages": null}, "macro.dbt.default__get_create_view_as_sql": {"unique_id": "macro.dbt.default__get_create_view_as_sql", "package_name": "dbt", "root_path": "/opt/homebrew/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/view/create_view_as.sql", "original_file_path": "macros/materializations/models/view/create_view_as.sql", "name": "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 %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.create_view_as"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1701215337.613528, "supported_languages": null}, "macro.dbt.create_view_as": {"unique_id": "macro.dbt.create_view_as", "package_name": "dbt", "root_path": "/opt/homebrew/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/view/create_view_as.sql", "original_file_path": "macros/materializations/models/view/create_view_as.sql", "name": "create_view_as", "macro_sql": "{% macro create_view_as(relation, sql) -%}\n {{ adapter.dispatch('create_view_as', 'dbt')(relation, sql) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_snowflake.snowflake__create_view_as"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1701215337.613704, "supported_languages": null}, "macro.dbt.default__create_view_as": {"unique_id": "macro.dbt.default__create_view_as", "package_name": "dbt", "root_path": "/opt/homebrew/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/models/view/create_view_as.sql", "original_file_path": "macros/materializations/models/view/create_view_as.sql", "name": "default__create_view_as", "macro_sql": "{% macro default__create_view_as(relation, sql) -%}\n {%- set sql_header = config.get('sql_header', none) -%}\n\n {{ sql_header if sql_header is not none }}\n create view {{ relation }} as (\n {{ sql }}\n );\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1701215337.61395, "supported_languages": null}, "macro.dbt.materialization_seed_default": {"unique_id": "macro.dbt.materialization_seed_default", "package_name": "dbt", "root_path": "/opt/homebrew/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/seeds/seed.sql", "original_file_path": "macros/materializations/seeds/seed.sql", "name": "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 %}", "resource_type": "macro", "tags": [], "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": 1701215337.617069, "supported_languages": ["sql"]}, "macro.dbt.create_csv_table": {"unique_id": "macro.dbt.create_csv_table", "package_name": "dbt", "root_path": "/opt/homebrew/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "name": "create_csv_table", "macro_sql": "{% macro create_csv_table(model, agate_table) -%}\n {{ adapter.dispatch('create_csv_table', 'dbt')(model, agate_table) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__create_csv_table"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1701215337.62143, "supported_languages": null}, "macro.dbt.default__create_csv_table": {"unique_id": "macro.dbt.default__create_csv_table", "package_name": "dbt", "root_path": "/opt/homebrew/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "name": "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 %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1701215337.6222951, "supported_languages": null}, "macro.dbt.reset_csv_table": {"unique_id": "macro.dbt.reset_csv_table", "package_name": "dbt", "root_path": "/opt/homebrew/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "name": "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 %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__reset_csv_table"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1701215337.622518, "supported_languages": null}, "macro.dbt.default__reset_csv_table": {"unique_id": "macro.dbt.default__reset_csv_table", "package_name": "dbt", "root_path": "/opt/homebrew/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "name": "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 %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.create_csv_table"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1701215337.622977, "supported_languages": null}, "macro.dbt.get_csv_sql": {"unique_id": "macro.dbt.get_csv_sql", "package_name": "dbt", "root_path": "/opt/homebrew/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "name": "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 %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__get_csv_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1701215337.6231658, "supported_languages": null}, "macro.dbt.default__get_csv_sql": {"unique_id": "macro.dbt.default__get_csv_sql", "package_name": "dbt", "root_path": "/opt/homebrew/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "name": "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 %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1701215337.62329, "supported_languages": null}, "macro.dbt.get_binding_char": {"unique_id": "macro.dbt.get_binding_char", "package_name": "dbt", "root_path": "/opt/homebrew/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "name": "get_binding_char", "macro_sql": "{% macro get_binding_char() -%}\n {{ adapter.dispatch('get_binding_char', 'dbt')() }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__get_binding_char"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1701215337.6234229, "supported_languages": null}, "macro.dbt.default__get_binding_char": {"unique_id": "macro.dbt.default__get_binding_char", "package_name": "dbt", "root_path": "/opt/homebrew/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "name": "default__get_binding_char", "macro_sql": "{% macro default__get_binding_char() %}\n {{ return('%s') }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1701215337.62353, "supported_languages": null}, "macro.dbt.get_batch_size": {"unique_id": "macro.dbt.get_batch_size", "package_name": "dbt", "root_path": "/opt/homebrew/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "name": "get_batch_size", "macro_sql": "{% macro get_batch_size() -%}\n {{ return(adapter.dispatch('get_batch_size', 'dbt')()) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__get_batch_size"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1701215337.623682, "supported_languages": null}, "macro.dbt.default__get_batch_size": {"unique_id": "macro.dbt.default__get_batch_size", "package_name": "dbt", "root_path": "/opt/homebrew/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "name": "default__get_batch_size", "macro_sql": "{% macro default__get_batch_size() %}\n {{ return(10000) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1701215337.623793, "supported_languages": null}, "macro.dbt.get_seed_column_quoted_csv": {"unique_id": "macro.dbt.get_seed_column_quoted_csv", "package_name": "dbt", "root_path": "/opt/homebrew/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "name": "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 %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1701215337.624244, "supported_languages": null}, "macro.dbt.load_csv_rows": {"unique_id": "macro.dbt.load_csv_rows", "package_name": "dbt", "root_path": "/opt/homebrew/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "name": "load_csv_rows", "macro_sql": "{% macro load_csv_rows(model, agate_table) -%}\n {{ adapter.dispatch('load_csv_rows', 'dbt')(model, agate_table) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_snowflake.snowflake__load_csv_rows"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1701215337.6244211, "supported_languages": null}, "macro.dbt.default__load_csv_rows": {"unique_id": "macro.dbt.default__load_csv_rows", "package_name": "dbt", "root_path": "/opt/homebrew/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "name": "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 %}", "resource_type": "macro", "tags": [], "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": 1701215337.625669, "supported_languages": null}, "macro.dbt.generate_alias_name": {"unique_id": "macro.dbt.generate_alias_name", "package_name": "dbt", "root_path": "/opt/homebrew/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/get_custom_name/get_custom_alias.sql", "original_file_path": "macros/get_custom_name/get_custom_alias.sql", "name": "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 %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__generate_alias_name"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1701215337.626104, "supported_languages": null}, "macro.dbt.default__generate_alias_name": {"unique_id": "macro.dbt.default__generate_alias_name", "package_name": "dbt", "root_path": "/opt/homebrew/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/get_custom_name/get_custom_alias.sql", "original_file_path": "macros/get_custom_name/get_custom_alias.sql", "name": "default__generate_alias_name", "macro_sql": "{% macro default__generate_alias_name(custom_alias_name=none, node=none) -%}\n\n {%- if custom_alias_name is none -%}\n\n {{ node.name }}\n\n {%- else -%}\n\n {{ custom_alias_name | trim }}\n\n {%- endif -%}\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1701215337.6263192, "supported_languages": null}, "macro.dbt.generate_schema_name": {"unique_id": "macro.dbt.generate_schema_name", "package_name": "dbt", "root_path": "/opt/homebrew/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/get_custom_name/get_custom_schema.sql", "original_file_path": "macros/get_custom_name/get_custom_schema.sql", "name": "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 %}", "resource_type": "macro", "tags": [], "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": 1701215337.6268601, "supported_languages": null}, "macro.dbt.default__generate_schema_name": {"unique_id": "macro.dbt.default__generate_schema_name", "package_name": "dbt", "root_path": "/opt/homebrew/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/get_custom_name/get_custom_schema.sql", "original_file_path": "macros/get_custom_name/get_custom_schema.sql", "name": "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 %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1701215337.627118, "supported_languages": null}, "macro.dbt.generate_schema_name_for_env": {"unique_id": "macro.dbt.generate_schema_name_for_env", "package_name": "dbt", "root_path": "/opt/homebrew/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/get_custom_name/get_custom_schema.sql", "original_file_path": "macros/get_custom_name/get_custom_schema.sql", "name": "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 %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1701215337.627393, "supported_languages": null}, "macro.dbt.generate_database_name": {"unique_id": "macro.dbt.generate_database_name", "package_name": "dbt", "root_path": "/opt/homebrew/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/get_custom_name/get_custom_database.sql", "original_file_path": "macros/get_custom_name/get_custom_database.sql", "name": "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 %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__generate_database_name"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1701215337.627826, "supported_languages": null}, "macro.dbt.default__generate_database_name": {"unique_id": "macro.dbt.default__generate_database_name", "package_name": "dbt", "root_path": "/opt/homebrew/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/get_custom_name/get_custom_database.sql", "original_file_path": "macros/get_custom_name/get_custom_database.sql", "name": "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 %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1701215337.628064, "supported_languages": null}, "macro.dbt.default__test_relationships": {"unique_id": "macro.dbt.default__test_relationships", "package_name": "dbt", "root_path": "/opt/homebrew/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/generic_test_sql/relationships.sql", "original_file_path": "macros/generic_test_sql/relationships.sql", "name": "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 %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1701215337.628453, "supported_languages": null}, "macro.dbt.default__test_not_null": {"unique_id": "macro.dbt.default__test_not_null", "package_name": "dbt", "root_path": "/opt/homebrew/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/generic_test_sql/not_null.sql", "original_file_path": "macros/generic_test_sql/not_null.sql", "name": "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 %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.should_store_failures"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1701215337.6287942, "supported_languages": null}, "macro.dbt.default__test_unique": {"unique_id": "macro.dbt.default__test_unique", "package_name": "dbt", "root_path": "/opt/homebrew/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/generic_test_sql/unique.sql", "original_file_path": "macros/generic_test_sql/unique.sql", "name": "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 %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1701215337.6290822, "supported_languages": null}, "macro.dbt.default__test_accepted_values": {"unique_id": "macro.dbt.default__test_accepted_values", "package_name": "dbt", "root_path": "/opt/homebrew/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/generic_test_sql/accepted_values.sql", "original_file_path": "macros/generic_test_sql/accepted_values.sql", "name": "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 %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1701215337.629664, "supported_languages": null}, "macro.dbt.statement": {"unique_id": "macro.dbt.statement", "package_name": "dbt", "root_path": "/opt/homebrew/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/etc/statement.sql", "original_file_path": "macros/etc/statement.sql", "name": "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 %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1701215337.631103, "supported_languages": null}, "macro.dbt.noop_statement": {"unique_id": "macro.dbt.noop_statement", "package_name": "dbt", "root_path": "/opt/homebrew/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/etc/statement.sql", "original_file_path": "macros/etc/statement.sql", "name": "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 %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1701215337.6318421, "supported_languages": null}, "macro.dbt.run_query": {"unique_id": "macro.dbt.run_query", "package_name": "dbt", "root_path": "/opt/homebrew/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/etc/statement.sql", "original_file_path": "macros/etc/statement.sql", "name": "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 %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1701215337.632122, "supported_languages": null}, "macro.dbt.convert_datetime": {"unique_id": "macro.dbt.convert_datetime", "package_name": "dbt", "root_path": "/opt/homebrew/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/etc/datetime.sql", "original_file_path": "macros/etc/datetime.sql", "name": "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 %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1701215337.633813, "supported_languages": null}, "macro.dbt.dates_in_range": {"unique_id": "macro.dbt.dates_in_range", "package_name": "dbt", "root_path": "/opt/homebrew/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/etc/datetime.sql", "original_file_path": "macros/etc/datetime.sql", "name": "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 %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.convert_datetime"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1701215337.634933, "supported_languages": null}, "macro.dbt.partition_range": {"unique_id": "macro.dbt.partition_range", "package_name": "dbt", "root_path": "/opt/homebrew/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/etc/datetime.sql", "original_file_path": "macros/etc/datetime.sql", "name": "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 %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.dates_in_range"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1701215337.635644, "supported_languages": null}, "macro.dbt.py_current_timestring": {"unique_id": "macro.dbt.py_current_timestring", "package_name": "dbt", "root_path": "/opt/homebrew/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/etc/datetime.sql", "original_file_path": "macros/etc/datetime.sql", "name": "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 %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1701215337.635865, "supported_languages": null}, "macro.dbt.except": {"unique_id": "macro.dbt.except", "package_name": "dbt", "root_path": "/opt/homebrew/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/except.sql", "original_file_path": "macros/utils/except.sql", "name": "except", "macro_sql": "{% macro except() %}\n {{ return(adapter.dispatch('except', 'dbt')()) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__except"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1701215337.6361442, "supported_languages": null}, "macro.dbt.default__except": {"unique_id": "macro.dbt.default__except", "package_name": "dbt", "root_path": "/opt/homebrew/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/except.sql", "original_file_path": "macros/utils/except.sql", "name": "default__except", "macro_sql": "{% macro default__except() %}\n\n except\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1701215337.636217, "supported_languages": null}, "macro.dbt.replace": {"unique_id": "macro.dbt.replace", "package_name": "dbt", "root_path": "/opt/homebrew/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/replace.sql", "original_file_path": "macros/utils/replace.sql", "name": "replace", "macro_sql": "{% macro replace(field, old_chars, new_chars) -%}\n {{ return(adapter.dispatch('replace', 'dbt') (field, old_chars, new_chars)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__replace"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1701215337.636587, "supported_languages": null}, "macro.dbt.default__replace": {"unique_id": "macro.dbt.default__replace", "package_name": "dbt", "root_path": "/opt/homebrew/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/replace.sql", "original_file_path": "macros/utils/replace.sql", "name": "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 %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1701215337.636745, "supported_languages": null}, "macro.dbt.concat": {"unique_id": "macro.dbt.concat", "package_name": "dbt", "root_path": "/opt/homebrew/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/concat.sql", "original_file_path": "macros/utils/concat.sql", "name": "concat", "macro_sql": "{% macro concat(fields) -%}\n {{ return(adapter.dispatch('concat', 'dbt')(fields)) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__concat"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1701215337.637037, "supported_languages": null}, "macro.dbt.default__concat": {"unique_id": "macro.dbt.default__concat", "package_name": "dbt", "root_path": "/opt/homebrew/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/concat.sql", "original_file_path": "macros/utils/concat.sql", "name": "default__concat", "macro_sql": "{% macro default__concat(fields) -%}\n {{ fields|join(' || ') }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1701215337.6371572, "supported_languages": null}, "macro.dbt.length": {"unique_id": "macro.dbt.length", "package_name": "dbt", "root_path": "/opt/homebrew/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/length.sql", "original_file_path": "macros/utils/length.sql", "name": "length", "macro_sql": "{% macro length(expression) -%}\n {{ return(adapter.dispatch('length', 'dbt') (expression)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__length"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1701215337.637454, "supported_languages": null}, "macro.dbt.default__length": {"unique_id": "macro.dbt.default__length", "package_name": "dbt", "root_path": "/opt/homebrew/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/length.sql", "original_file_path": "macros/utils/length.sql", "name": "default__length", "macro_sql": "{% macro default__length(expression) %}\n\n length(\n {{ expression }}\n )\n\n{%- endmacro -%}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1701215337.637556, "supported_languages": null}, "macro.dbt.dateadd": {"unique_id": "macro.dbt.dateadd", "package_name": "dbt", "root_path": "/opt/homebrew/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/dateadd.sql", "original_file_path": "macros/utils/dateadd.sql", "name": "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 %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__dateadd"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1701215337.6379352, "supported_languages": null}, "macro.dbt.default__dateadd": {"unique_id": "macro.dbt.default__dateadd", "package_name": "dbt", "root_path": "/opt/homebrew/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/dateadd.sql", "original_file_path": "macros/utils/dateadd.sql", "name": "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 %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1701215337.6380942, "supported_languages": null}, "macro.dbt.intersect": {"unique_id": "macro.dbt.intersect", "package_name": "dbt", "root_path": "/opt/homebrew/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/intersect.sql", "original_file_path": "macros/utils/intersect.sql", "name": "intersect", "macro_sql": "{% macro intersect() %}\n {{ return(adapter.dispatch('intersect', 'dbt')()) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__intersect"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1701215337.638368, "supported_languages": null}, "macro.dbt.default__intersect": {"unique_id": "macro.dbt.default__intersect", "package_name": "dbt", "root_path": "/opt/homebrew/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/intersect.sql", "original_file_path": "macros/utils/intersect.sql", "name": "default__intersect", "macro_sql": "{% macro default__intersect() %}\n\n intersect\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1701215337.63844, "supported_languages": null}, "macro.dbt.escape_single_quotes": {"unique_id": "macro.dbt.escape_single_quotes", "package_name": "dbt", "root_path": "/opt/homebrew/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/escape_single_quotes.sql", "original_file_path": "macros/utils/escape_single_quotes.sql", "name": "escape_single_quotes", "macro_sql": "{% macro escape_single_quotes(expression) %}\n {{ return(adapter.dispatch('escape_single_quotes', 'dbt') (expression)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_snowflake.snowflake__escape_single_quotes"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1701215337.638746, "supported_languages": null}, "macro.dbt.default__escape_single_quotes": {"unique_id": "macro.dbt.default__escape_single_quotes", "package_name": "dbt", "root_path": "/opt/homebrew/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/escape_single_quotes.sql", "original_file_path": "macros/utils/escape_single_quotes.sql", "name": "default__escape_single_quotes", "macro_sql": "{% macro default__escape_single_quotes(expression) -%}\n{{ expression | replace(\"'\",\"''\") }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1701215337.63888, "supported_languages": null}, "macro.dbt.right": {"unique_id": "macro.dbt.right", "package_name": "dbt", "root_path": "/opt/homebrew/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/right.sql", "original_file_path": "macros/utils/right.sql", "name": "right", "macro_sql": "{% macro right(string_text, length_expression) -%}\n {{ return(adapter.dispatch('right', 'dbt') (string_text, length_expression)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_snowflake.snowflake__right"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1701215337.639215, "supported_languages": null}, "macro.dbt.default__right": {"unique_id": "macro.dbt.default__right", "package_name": "dbt", "root_path": "/opt/homebrew/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/right.sql", "original_file_path": "macros/utils/right.sql", "name": "default__right", "macro_sql": "{% macro default__right(string_text, length_expression) %}\n\n right(\n {{ string_text }},\n {{ length_expression }}\n )\n\n{%- endmacro -%}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1701215337.639408, "supported_languages": null}, "macro.dbt.listagg": {"unique_id": "macro.dbt.listagg", "package_name": "dbt", "root_path": "/opt/homebrew/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/listagg.sql", "original_file_path": "macros/utils/listagg.sql", "name": "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 %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__listagg"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1701215337.640051, "supported_languages": null}, "macro.dbt.default__listagg": {"unique_id": "macro.dbt.default__listagg", "package_name": "dbt", "root_path": "/opt/homebrew/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/listagg.sql", "original_file_path": "macros/utils/listagg.sql", "name": "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 %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1701215337.640434, "supported_languages": null}, "macro.dbt.datediff": {"unique_id": "macro.dbt.datediff", "package_name": "dbt", "root_path": "/opt/homebrew/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/datediff.sql", "original_file_path": "macros/utils/datediff.sql", "name": "datediff", "macro_sql": "{% macro datediff(first_date, second_date, datepart) %}\n {{ return(adapter.dispatch('datediff', 'dbt')(first_date, second_date, datepart)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__datediff"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1701215337.640817, "supported_languages": null}, "macro.dbt.default__datediff": {"unique_id": "macro.dbt.default__datediff", "package_name": "dbt", "root_path": "/opt/homebrew/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/datediff.sql", "original_file_path": "macros/utils/datediff.sql", "name": "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 %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1701215337.640981, "supported_languages": null}, "macro.dbt.safe_cast": {"unique_id": "macro.dbt.safe_cast", "package_name": "dbt", "root_path": "/opt/homebrew/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/safe_cast.sql", "original_file_path": "macros/utils/safe_cast.sql", "name": "safe_cast", "macro_sql": "{% macro safe_cast(field, type) %}\n {{ return(adapter.dispatch('safe_cast', 'dbt') (field, type)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_snowflake.snowflake__safe_cast"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1701215337.641313, "supported_languages": null}, "macro.dbt.default__safe_cast": {"unique_id": "macro.dbt.default__safe_cast", "package_name": "dbt", "root_path": "/opt/homebrew/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/safe_cast.sql", "original_file_path": "macros/utils/safe_cast.sql", "name": "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 %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1701215337.641448, "supported_languages": null}, "macro.dbt.hash": {"unique_id": "macro.dbt.hash", "package_name": "dbt", "root_path": "/opt/homebrew/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/hash.sql", "original_file_path": "macros/utils/hash.sql", "name": "hash", "macro_sql": "{% macro hash(field) -%}\n {{ return(adapter.dispatch('hash', 'dbt') (field)) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__hash"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1701215337.6417549, "supported_languages": null}, "macro.dbt.default__hash": {"unique_id": "macro.dbt.default__hash", "package_name": "dbt", "root_path": "/opt/homebrew/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/hash.sql", "original_file_path": "macros/utils/hash.sql", "name": "default__hash", "macro_sql": "{% macro default__hash(field) -%}\n md5(cast({{ field }} as {{ api.Column.translate_type('string') }}))\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1701215337.64191, "supported_languages": null}, "macro.dbt.cast_bool_to_text": {"unique_id": "macro.dbt.cast_bool_to_text", "package_name": "dbt", "root_path": "/opt/homebrew/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/cast_bool_to_text.sql", "original_file_path": "macros/utils/cast_bool_to_text.sql", "name": "cast_bool_to_text", "macro_sql": "{% macro cast_bool_to_text(field) %}\n {{ adapter.dispatch('cast_bool_to_text', 'dbt') (field) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__cast_bool_to_text"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1701215337.642199, "supported_languages": null}, "macro.dbt.default__cast_bool_to_text": {"unique_id": "macro.dbt.default__cast_bool_to_text", "package_name": "dbt", "root_path": "/opt/homebrew/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/cast_bool_to_text.sql", "original_file_path": "macros/utils/cast_bool_to_text.sql", "name": "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 %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1701215337.6423502, "supported_languages": null}, "macro.dbt.any_value": {"unique_id": "macro.dbt.any_value", "package_name": "dbt", "root_path": "/opt/homebrew/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/any_value.sql", "original_file_path": "macros/utils/any_value.sql", "name": "any_value", "macro_sql": "{% macro any_value(expression) -%}\n {{ return(adapter.dispatch('any_value', 'dbt') (expression)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__any_value"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1701215337.642645, "supported_languages": null}, "macro.dbt.default__any_value": {"unique_id": "macro.dbt.default__any_value", "package_name": "dbt", "root_path": "/opt/homebrew/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/any_value.sql", "original_file_path": "macros/utils/any_value.sql", "name": "default__any_value", "macro_sql": "{% macro default__any_value(expression) -%}\n\n any_value({{ expression }})\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1701215337.642745, "supported_languages": null}, "macro.dbt.position": {"unique_id": "macro.dbt.position", "package_name": "dbt", "root_path": "/opt/homebrew/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/position.sql", "original_file_path": "macros/utils/position.sql", "name": "position", "macro_sql": "{% macro position(substring_text, string_text) -%}\n {{ return(adapter.dispatch('position', 'dbt') (substring_text, string_text)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__position"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1701215337.6430771, "supported_languages": null}, "macro.dbt.default__position": {"unique_id": "macro.dbt.default__position", "package_name": "dbt", "root_path": "/opt/homebrew/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/position.sql", "original_file_path": "macros/utils/position.sql", "name": "default__position", "macro_sql": "{% macro default__position(substring_text, string_text) %}\n\n position(\n {{ substring_text }} in {{ string_text }}\n )\n\n{%- endmacro -%}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1701215337.643209, "supported_languages": null}, "macro.dbt.string_literal": {"unique_id": "macro.dbt.string_literal", "package_name": "dbt", "root_path": "/opt/homebrew/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/literal.sql", "original_file_path": "macros/utils/literal.sql", "name": "string_literal", "macro_sql": "{%- macro string_literal(value) -%}\n {{ return(adapter.dispatch('string_literal', 'dbt') (value)) }}\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__string_literal"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1701215337.6435, "supported_languages": null}, "macro.dbt.default__string_literal": {"unique_id": "macro.dbt.default__string_literal", "package_name": "dbt", "root_path": "/opt/homebrew/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/literal.sql", "original_file_path": "macros/utils/literal.sql", "name": "default__string_literal", "macro_sql": "{% macro default__string_literal(value) -%}\n '{{ value }}'\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1701215337.6436, "supported_languages": null}, "macro.dbt.type_string": {"unique_id": "macro.dbt.type_string", "package_name": "dbt", "root_path": "/opt/homebrew/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "name": "type_string", "macro_sql": "\n\n{%- macro type_string() -%}\n {{ return(adapter.dispatch('type_string', 'dbt')()) }}\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1701215337.644524, "supported_languages": null}, "macro.dbt.default__type_string": {"unique_id": "macro.dbt.default__type_string", "package_name": "dbt", "root_path": "/opt/homebrew/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "name": "default__type_string", "macro_sql": "{% macro default__type_string() %}\n {{ return(api.Column.translate_type(\"string\")) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1701215337.644672, "supported_languages": null}, "macro.dbt.type_timestamp": {"unique_id": "macro.dbt.type_timestamp", "package_name": "dbt", "root_path": "/opt/homebrew/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "name": "type_timestamp", "macro_sql": "\n\n{%- macro type_timestamp() -%}\n {{ return(adapter.dispatch('type_timestamp', 'dbt')()) }}\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__type_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1701215337.64489, "supported_languages": null}, "macro.dbt.default__type_timestamp": {"unique_id": "macro.dbt.default__type_timestamp", "package_name": "dbt", "root_path": "/opt/homebrew/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "name": "default__type_timestamp", "macro_sql": "{% macro default__type_timestamp() %}\n {{ return(api.Column.translate_type(\"timestamp\")) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1701215337.64504, "supported_languages": null}, "macro.dbt.type_float": {"unique_id": "macro.dbt.type_float", "package_name": "dbt", "root_path": "/opt/homebrew/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "name": "type_float", "macro_sql": "\n\n{%- macro type_float() -%}\n {{ return(adapter.dispatch('type_float', 'dbt')()) }}\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__type_float"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1701215337.6451998, "supported_languages": null}, "macro.dbt.default__type_float": {"unique_id": "macro.dbt.default__type_float", "package_name": "dbt", "root_path": "/opt/homebrew/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "name": "default__type_float", "macro_sql": "{% macro default__type_float() %}\n {{ return(api.Column.translate_type(\"float\")) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1701215337.645344, "supported_languages": null}, "macro.dbt.type_numeric": {"unique_id": "macro.dbt.type_numeric", "package_name": "dbt", "root_path": "/opt/homebrew/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "name": "type_numeric", "macro_sql": "\n\n{%- macro type_numeric() -%}\n {{ return(adapter.dispatch('type_numeric', 'dbt')()) }}\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__type_numeric"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1701215337.645498, "supported_languages": null}, "macro.dbt.default__type_numeric": {"unique_id": "macro.dbt.default__type_numeric", "package_name": "dbt", "root_path": "/opt/homebrew/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "name": "default__type_numeric", "macro_sql": "{% macro default__type_numeric() %}\n {{ return(api.Column.numeric_type(\"numeric\", 28, 6)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1701215337.64567, "supported_languages": null}, "macro.dbt.type_bigint": {"unique_id": "macro.dbt.type_bigint", "package_name": "dbt", "root_path": "/opt/homebrew/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "name": "type_bigint", "macro_sql": "\n\n{%- macro type_bigint() -%}\n {{ return(adapter.dispatch('type_bigint', 'dbt')()) }}\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__type_bigint"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1701215337.645827, "supported_languages": null}, "macro.dbt.default__type_bigint": {"unique_id": "macro.dbt.default__type_bigint", "package_name": "dbt", "root_path": "/opt/homebrew/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "name": "default__type_bigint", "macro_sql": "{% macro default__type_bigint() %}\n {{ return(api.Column.translate_type(\"bigint\")) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1701215337.645976, "supported_languages": null}, "macro.dbt.type_int": {"unique_id": "macro.dbt.type_int", "package_name": "dbt", "root_path": "/opt/homebrew/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "name": "type_int", "macro_sql": "\n\n{%- macro type_int() -%}\n {{ return(adapter.dispatch('type_int', 'dbt')()) }}\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__type_int"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1701215337.646131, "supported_languages": null}, "macro.dbt.default__type_int": {"unique_id": "macro.dbt.default__type_int", "package_name": "dbt", "root_path": "/opt/homebrew/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "name": "default__type_int", "macro_sql": "{%- macro default__type_int() -%}\n {{ return(api.Column.translate_type(\"integer\")) }}\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1701215337.6462688, "supported_languages": null}, "macro.dbt.type_boolean": {"unique_id": "macro.dbt.type_boolean", "package_name": "dbt", "root_path": "/opt/homebrew/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "name": "type_boolean", "macro_sql": "\n\n{%- macro type_boolean() -%}\n {{ return(adapter.dispatch('type_boolean', 'dbt')()) }}\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__type_boolean"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1701215337.646421, "supported_languages": null}, "macro.dbt.default__type_boolean": {"unique_id": "macro.dbt.default__type_boolean", "package_name": "dbt", "root_path": "/opt/homebrew/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "name": "default__type_boolean", "macro_sql": "{%- macro default__type_boolean() -%}\n {{ return(api.Column.translate_type(\"boolean\")) }}\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1701215337.646558, "supported_languages": null}, "macro.dbt.array_concat": {"unique_id": "macro.dbt.array_concat", "package_name": "dbt", "root_path": "/opt/homebrew/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/array_concat.sql", "original_file_path": "macros/utils/array_concat.sql", "name": "array_concat", "macro_sql": "{% macro array_concat(array_1, array_2) -%}\n {{ return(adapter.dispatch('array_concat', 'dbt')(array_1, array_2)) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__array_concat"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1701215337.6468842, "supported_languages": null}, "macro.dbt.default__array_concat": {"unique_id": "macro.dbt.default__array_concat", "package_name": "dbt", "root_path": "/opt/homebrew/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/array_concat.sql", "original_file_path": "macros/utils/array_concat.sql", "name": "default__array_concat", "macro_sql": "{% macro default__array_concat(array_1, array_2) -%}\n array_cat({{ array_1 }}, {{ array_2 }})\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1701215337.647014, "supported_languages": null}, "macro.dbt.bool_or": {"unique_id": "macro.dbt.bool_or", "package_name": "dbt", "root_path": "/opt/homebrew/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/bool_or.sql", "original_file_path": "macros/utils/bool_or.sql", "name": "bool_or", "macro_sql": "{% macro bool_or(expression) -%}\n {{ return(adapter.dispatch('bool_or', 'dbt') (expression)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_snowflake.snowflake__bool_or"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1701215337.647308, "supported_languages": null}, "macro.dbt.default__bool_or": {"unique_id": "macro.dbt.default__bool_or", "package_name": "dbt", "root_path": "/opt/homebrew/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/bool_or.sql", "original_file_path": "macros/utils/bool_or.sql", "name": "default__bool_or", "macro_sql": "{% macro default__bool_or(expression) -%}\n\n bool_or({{ expression }})\n\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1701215337.647406, "supported_languages": null}, "macro.dbt.last_day": {"unique_id": "macro.dbt.last_day", "package_name": "dbt", "root_path": "/opt/homebrew/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/last_day.sql", "original_file_path": "macros/utils/last_day.sql", "name": "last_day", "macro_sql": "{% macro last_day(date, datepart) %}\n {{ return(adapter.dispatch('last_day', 'dbt') (date, datepart)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__last_day"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1701215337.647787, "supported_languages": null}, "macro.dbt.default_last_day": {"unique_id": "macro.dbt.default_last_day", "package_name": "dbt", "root_path": "/opt/homebrew/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/last_day.sql", "original_file_path": "macros/utils/last_day.sql", "name": "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", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.dateadd", "macro.dbt.date_trunc"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1701215337.648046, "supported_languages": null}, "macro.dbt.default__last_day": {"unique_id": "macro.dbt.default__last_day", "package_name": "dbt", "root_path": "/opt/homebrew/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/last_day.sql", "original_file_path": "macros/utils/last_day.sql", "name": "default__last_day", "macro_sql": "{% macro default__last_day(date, datepart) -%}\n {{dbt.default_last_day(date, datepart)}}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default_last_day"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1701215337.648187, "supported_languages": null}, "macro.dbt.split_part": {"unique_id": "macro.dbt.split_part", "package_name": "dbt", "root_path": "/opt/homebrew/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/split_part.sql", "original_file_path": "macros/utils/split_part.sql", "name": "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 %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__split_part"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1701215337.648727, "supported_languages": null}, "macro.dbt.default__split_part": {"unique_id": "macro.dbt.default__split_part", "package_name": "dbt", "root_path": "/opt/homebrew/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/split_part.sql", "original_file_path": "macros/utils/split_part.sql", "name": "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 %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1701215337.6488829, "supported_languages": null}, "macro.dbt._split_part_negative": {"unique_id": "macro.dbt._split_part_negative", "package_name": "dbt", "root_path": "/opt/homebrew/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/split_part.sql", "original_file_path": "macros/utils/split_part.sql", "name": "_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 %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1701215337.649159, "supported_languages": null}, "macro.dbt.date_trunc": {"unique_id": "macro.dbt.date_trunc", "package_name": "dbt", "root_path": "/opt/homebrew/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/date_trunc.sql", "original_file_path": "macros/utils/date_trunc.sql", "name": "date_trunc", "macro_sql": "{% macro date_trunc(datepart, date) -%}\n {{ return(adapter.dispatch('date_trunc', 'dbt') (datepart, date)) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__date_trunc"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1701215337.649479, "supported_languages": null}, "macro.dbt.default__date_trunc": {"unique_id": "macro.dbt.default__date_trunc", "package_name": "dbt", "root_path": "/opt/homebrew/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/date_trunc.sql", "original_file_path": "macros/utils/date_trunc.sql", "name": "default__date_trunc", "macro_sql": "{% macro default__date_trunc(datepart, date) -%}\n date_trunc('{{datepart}}', {{date}})\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1701215337.649607, "supported_languages": null}, "macro.dbt.array_construct": {"unique_id": "macro.dbt.array_construct", "package_name": "dbt", "root_path": "/opt/homebrew/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/array_construct.sql", "original_file_path": "macros/utils/array_construct.sql", "name": "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 %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_snowflake.snowflake__array_construct"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1701215337.650017, "supported_languages": null}, "macro.dbt.default__array_construct": {"unique_id": "macro.dbt.default__array_construct", "package_name": "dbt", "root_path": "/opt/homebrew/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/array_construct.sql", "original_file_path": "macros/utils/array_construct.sql", "name": "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 %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1701215337.650248, "supported_languages": null}, "macro.dbt.array_append": {"unique_id": "macro.dbt.array_append", "package_name": "dbt", "root_path": "/opt/homebrew/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/array_append.sql", "original_file_path": "macros/utils/array_append.sql", "name": "array_append", "macro_sql": "{% macro array_append(array, new_element) -%}\n {{ return(adapter.dispatch('array_append', 'dbt')(array, new_element)) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__array_append"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1701215337.6505978, "supported_languages": null}, "macro.dbt.default__array_append": {"unique_id": "macro.dbt.default__array_append", "package_name": "dbt", "root_path": "/opt/homebrew/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/utils/array_append.sql", "original_file_path": "macros/utils/array_append.sql", "name": "default__array_append", "macro_sql": "{% macro default__array_append(array, new_element) -%}\n array_append({{ array }}, {{ new_element }})\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1701215337.650728, "supported_languages": null}, "macro.dbt.create_schema": {"unique_id": "macro.dbt.create_schema", "package_name": "dbt", "root_path": "/opt/homebrew/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/schema.sql", "original_file_path": "macros/adapters/schema.sql", "name": "create_schema", "macro_sql": "{% macro create_schema(relation) -%}\n {{ adapter.dispatch('create_schema', 'dbt')(relation) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__create_schema"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1701215337.651159, "supported_languages": null}, "macro.dbt.default__create_schema": {"unique_id": "macro.dbt.default__create_schema", "package_name": "dbt", "root_path": "/opt/homebrew/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/schema.sql", "original_file_path": "macros/adapters/schema.sql", "name": "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 %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1701215337.65134, "supported_languages": null}, "macro.dbt.drop_schema": {"unique_id": "macro.dbt.drop_schema", "package_name": "dbt", "root_path": "/opt/homebrew/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/schema.sql", "original_file_path": "macros/adapters/schema.sql", "name": "drop_schema", "macro_sql": "{% macro drop_schema(relation) -%}\n {{ adapter.dispatch('drop_schema', 'dbt')(relation) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__drop_schema"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1701215337.6515021, "supported_languages": null}, "macro.dbt.default__drop_schema": {"unique_id": "macro.dbt.default__drop_schema", "package_name": "dbt", "root_path": "/opt/homebrew/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/schema.sql", "original_file_path": "macros/adapters/schema.sql", "name": "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 %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1701215337.65168, "supported_languages": null}, "macro.dbt.current_timestamp": {"unique_id": "macro.dbt.current_timestamp", "package_name": "dbt", "root_path": "/opt/homebrew/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/timestamps.sql", "original_file_path": "macros/adapters/timestamps.sql", "name": "current_timestamp", "macro_sql": "{%- macro current_timestamp() -%}\n {{ adapter.dispatch('current_timestamp', 'dbt')() }}\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_snowflake.snowflake__current_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1701215337.6522, "supported_languages": null}, "macro.dbt.default__current_timestamp": {"unique_id": "macro.dbt.default__current_timestamp", "package_name": "dbt", "root_path": "/opt/homebrew/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/timestamps.sql", "original_file_path": "macros/adapters/timestamps.sql", "name": "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 %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1701215337.6523461, "supported_languages": null}, "macro.dbt.snapshot_get_time": {"unique_id": "macro.dbt.snapshot_get_time", "package_name": "dbt", "root_path": "/opt/homebrew/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/timestamps.sql", "original_file_path": "macros/adapters/timestamps.sql", "name": "snapshot_get_time", "macro_sql": "\n\n{%- macro snapshot_get_time() -%}\n {{ adapter.dispatch('snapshot_get_time', 'dbt')() }}\n{%- endmacro -%}\n\n", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_snowflake.snowflake__snapshot_get_time"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1701215337.65248, "supported_languages": null}, "macro.dbt.default__snapshot_get_time": {"unique_id": "macro.dbt.default__snapshot_get_time", "package_name": "dbt", "root_path": "/opt/homebrew/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/timestamps.sql", "original_file_path": "macros/adapters/timestamps.sql", "name": "default__snapshot_get_time", "macro_sql": "{% macro default__snapshot_get_time() %}\n {{ current_timestamp() }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.current_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1701215337.6525812, "supported_languages": null}, "macro.dbt.current_timestamp_backcompat": {"unique_id": "macro.dbt.current_timestamp_backcompat", "package_name": "dbt", "root_path": "/opt/homebrew/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/timestamps.sql", "original_file_path": "macros/adapters/timestamps.sql", "name": "current_timestamp_backcompat", "macro_sql": "{% macro current_timestamp_backcompat() %}\n {{ return(adapter.dispatch('current_timestamp_backcompat', 'dbt')()) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_snowflake.snowflake__current_timestamp_backcompat"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1701215337.652742, "supported_languages": null}, "macro.dbt.default__current_timestamp_backcompat": {"unique_id": "macro.dbt.default__current_timestamp_backcompat", "package_name": "dbt", "root_path": "/opt/homebrew/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/timestamps.sql", "original_file_path": "macros/adapters/timestamps.sql", "name": "default__current_timestamp_backcompat", "macro_sql": "{% macro default__current_timestamp_backcompat() %}\n current_timestamp::timestamp\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1701215337.652812, "supported_languages": null}, "macro.dbt.current_timestamp_in_utc_backcompat": {"unique_id": "macro.dbt.current_timestamp_in_utc_backcompat", "package_name": "dbt", "root_path": "/opt/homebrew/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/timestamps.sql", "original_file_path": "macros/adapters/timestamps.sql", "name": "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 %}", "resource_type": "macro", "tags": [], "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": 1701215337.652968, "supported_languages": null}, "macro.dbt.default__current_timestamp_in_utc_backcompat": {"unique_id": "macro.dbt.default__current_timestamp_in_utc_backcompat", "package_name": "dbt", "root_path": "/opt/homebrew/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/timestamps.sql", "original_file_path": "macros/adapters/timestamps.sql", "name": "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 %}", "resource_type": "macro", "tags": [], "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": 1701215337.6531289, "supported_languages": null}, "macro.dbt.get_create_index_sql": {"unique_id": "macro.dbt.get_create_index_sql", "package_name": "dbt", "root_path": "/opt/homebrew/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/indexes.sql", "original_file_path": "macros/adapters/indexes.sql", "name": "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 %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__get_create_index_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1701215337.653619, "supported_languages": null}, "macro.dbt.default__get_create_index_sql": {"unique_id": "macro.dbt.default__get_create_index_sql", "package_name": "dbt", "root_path": "/opt/homebrew/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/indexes.sql", "original_file_path": "macros/adapters/indexes.sql", "name": "default__get_create_index_sql", "macro_sql": "{% macro default__get_create_index_sql(relation, index_dict) -%}\n {% do return(None) %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1701215337.653814, "supported_languages": null}, "macro.dbt.create_indexes": {"unique_id": "macro.dbt.create_indexes", "package_name": "dbt", "root_path": "/opt/homebrew/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/indexes.sql", "original_file_path": "macros/adapters/indexes.sql", "name": "create_indexes", "macro_sql": "{% macro create_indexes(relation) -%}\n {{ adapter.dispatch('create_indexes', 'dbt')(relation) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__create_indexes"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1701215337.6539679, "supported_languages": null}, "macro.dbt.default__create_indexes": {"unique_id": "macro.dbt.default__create_indexes", "package_name": "dbt", "root_path": "/opt/homebrew/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/indexes.sql", "original_file_path": "macros/adapters/indexes.sql", "name": "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 %}", "resource_type": "macro", "tags": [], "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": 1701215337.654346, "supported_languages": null}, "macro.dbt.make_intermediate_relation": {"unique_id": "macro.dbt.make_intermediate_relation", "package_name": "dbt", "root_path": "/opt/homebrew/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "name": "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 %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__make_intermediate_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1701215337.657305, "supported_languages": null}, "macro.dbt.default__make_intermediate_relation": {"unique_id": "macro.dbt.default__make_intermediate_relation", "package_name": "dbt", "root_path": "/opt/homebrew/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "name": "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 %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__make_temp_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1701215337.657472, "supported_languages": null}, "macro.dbt.make_temp_relation": {"unique_id": "macro.dbt.make_temp_relation", "package_name": "dbt", "root_path": "/opt/homebrew/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "name": "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 %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__make_temp_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1701215337.6576881, "supported_languages": null}, "macro.dbt.default__make_temp_relation": {"unique_id": "macro.dbt.default__make_temp_relation", "package_name": "dbt", "root_path": "/opt/homebrew/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "name": "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 %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1701215337.6579719, "supported_languages": null}, "macro.dbt.make_backup_relation": {"unique_id": "macro.dbt.make_backup_relation", "package_name": "dbt", "root_path": "/opt/homebrew/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "name": "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 %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__make_backup_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1701215337.658209, "supported_languages": null}, "macro.dbt.default__make_backup_relation": {"unique_id": "macro.dbt.default__make_backup_relation", "package_name": "dbt", "root_path": "/opt/homebrew/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "name": "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 %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1701215337.6585212, "supported_languages": null}, "macro.dbt.drop_relation": {"unique_id": "macro.dbt.drop_relation", "package_name": "dbt", "root_path": "/opt/homebrew/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "name": "drop_relation", "macro_sql": "{% macro drop_relation(relation) -%}\n {{ return(adapter.dispatch('drop_relation', 'dbt')(relation)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__drop_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1701215337.658699, "supported_languages": null}, "macro.dbt.default__drop_relation": {"unique_id": "macro.dbt.default__drop_relation", "package_name": "dbt", "root_path": "/opt/homebrew/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "name": "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 %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1701215337.6589, "supported_languages": null}, "macro.dbt.truncate_relation": {"unique_id": "macro.dbt.truncate_relation", "package_name": "dbt", "root_path": "/opt/homebrew/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "name": "truncate_relation", "macro_sql": "{% macro truncate_relation(relation) -%}\n {{ return(adapter.dispatch('truncate_relation', 'dbt')(relation)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_snowflake.snowflake__truncate_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1701215337.659075, "supported_languages": null}, "macro.dbt.default__truncate_relation": {"unique_id": "macro.dbt.default__truncate_relation", "package_name": "dbt", "root_path": "/opt/homebrew/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "name": "default__truncate_relation", "macro_sql": "{% macro default__truncate_relation(relation) -%}\n {% call statement('truncate_relation') -%}\n truncate table {{ relation }}\n {%- endcall %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1701215337.6592472, "supported_languages": null}, "macro.dbt.rename_relation": {"unique_id": "macro.dbt.rename_relation", "package_name": "dbt", "root_path": "/opt/homebrew/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "name": "rename_relation", "macro_sql": "{% macro rename_relation(from_relation, to_relation) -%}\n {{ return(adapter.dispatch('rename_relation', 'dbt')(from_relation, to_relation)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_snowflake.snowflake__rename_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1701215337.659439, "supported_languages": null}, "macro.dbt.default__rename_relation": {"unique_id": "macro.dbt.default__rename_relation", "package_name": "dbt", "root_path": "/opt/homebrew/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "name": "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 %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1701215337.65971, "supported_languages": null}, "macro.dbt.get_or_create_relation": {"unique_id": "macro.dbt.get_or_create_relation", "package_name": "dbt", "root_path": "/opt/homebrew/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "name": "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 %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__get_or_create_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1701215337.6599512, "supported_languages": null}, "macro.dbt.default__get_or_create_relation": {"unique_id": "macro.dbt.default__get_or_create_relation", "package_name": "dbt", "root_path": "/opt/homebrew/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "name": "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 %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1701215337.660481, "supported_languages": null}, "macro.dbt.load_cached_relation": {"unique_id": "macro.dbt.load_cached_relation", "package_name": "dbt", "root_path": "/opt/homebrew/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "name": "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 %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1701215337.660804, "supported_languages": null}, "macro.dbt.load_relation": {"unique_id": "macro.dbt.load_relation", "package_name": "dbt", "root_path": "/opt/homebrew/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "name": "load_relation", "macro_sql": "{% macro load_relation(relation) %}\n {{ return(load_cached_relation(relation)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.load_cached_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1701215337.660953, "supported_languages": null}, "macro.dbt.drop_relation_if_exists": {"unique_id": "macro.dbt.drop_relation_if_exists", "package_name": "dbt", "root_path": "/opt/homebrew/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "name": "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 %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1701215337.661142, "supported_languages": null}, "macro.dbt.collect_freshness": {"unique_id": "macro.dbt.collect_freshness", "package_name": "dbt", "root_path": "/opt/homebrew/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/freshness.sql", "original_file_path": "macros/adapters/freshness.sql", "name": "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 %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__collect_freshness"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1701215337.661612, "supported_languages": null}, "macro.dbt.default__collect_freshness": {"unique_id": "macro.dbt.default__collect_freshness", "package_name": "dbt", "root_path": "/opt/homebrew/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/freshness.sql", "original_file_path": "macros/adapters/freshness.sql", "name": "default__collect_freshness", "macro_sql": "{% macro default__collect_freshness(source, loaded_at_field, filter) %}\n {% call statement('collect_freshness', fetch_result=True, auto_begin=False) -%}\n select\n max({{ loaded_at_field }}) as max_loaded_at,\n {{ current_timestamp() }} as snapshotted_at\n from {{ source }}\n {% if filter %}\n where {{ filter }}\n {% endif %}\n {% endcall %}\n {{ return(load_result('collect_freshness').table) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement", "macro.dbt.current_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1701215337.6620202, "supported_languages": null}, "macro.dbt.copy_grants": {"unique_id": "macro.dbt.copy_grants", "package_name": "dbt", "root_path": "/opt/homebrew/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "name": "copy_grants", "macro_sql": "{% macro copy_grants() %}\n {{ return(adapter.dispatch('copy_grants', 'dbt')()) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_snowflake.snowflake__copy_grants"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1701215337.6636071, "supported_languages": null}, "macro.dbt.default__copy_grants": {"unique_id": "macro.dbt.default__copy_grants", "package_name": "dbt", "root_path": "/opt/homebrew/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "name": "default__copy_grants", "macro_sql": "{% macro default__copy_grants() %}\n {{ return(True) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1701215337.663719, "supported_languages": null}, "macro.dbt.support_multiple_grantees_per_dcl_statement": {"unique_id": "macro.dbt.support_multiple_grantees_per_dcl_statement", "package_name": "dbt", "root_path": "/opt/homebrew/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "name": "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 %}", "resource_type": "macro", "tags": [], "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": 1701215337.663882, "supported_languages": null}, "macro.dbt.default__support_multiple_grantees_per_dcl_statement": {"unique_id": "macro.dbt.default__support_multiple_grantees_per_dcl_statement", "package_name": "dbt", "root_path": "/opt/homebrew/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "name": "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", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1701215337.6639879, "supported_languages": null}, "macro.dbt.should_revoke": {"unique_id": "macro.dbt.should_revoke", "package_name": "dbt", "root_path": "/opt/homebrew/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "name": "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 %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.copy_grants"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1701215337.66432, "supported_languages": null}, "macro.dbt.get_show_grant_sql": {"unique_id": "macro.dbt.get_show_grant_sql", "package_name": "dbt", "root_path": "/opt/homebrew/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "name": "get_show_grant_sql", "macro_sql": "{% macro get_show_grant_sql(relation) %}\n {{ return(adapter.dispatch(\"get_show_grant_sql\", \"dbt\")(relation)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__get_show_grant_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1701215337.664504, "supported_languages": null}, "macro.dbt.default__get_show_grant_sql": {"unique_id": "macro.dbt.default__get_show_grant_sql", "package_name": "dbt", "root_path": "/opt/homebrew/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "name": "default__get_show_grant_sql", "macro_sql": "{% macro default__get_show_grant_sql(relation) %}\n show grants on {{ relation }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1701215337.6646001, "supported_languages": null}, "macro.dbt.get_grant_sql": {"unique_id": "macro.dbt.get_grant_sql", "package_name": "dbt", "root_path": "/opt/homebrew/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "name": "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 %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__get_grant_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1701215337.664819, "supported_languages": null}, "macro.dbt.default__get_grant_sql": {"unique_id": "macro.dbt.default__get_grant_sql", "package_name": "dbt", "root_path": "/opt/homebrew/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "name": "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", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1701215337.665014, "supported_languages": null}, "macro.dbt.get_revoke_sql": {"unique_id": "macro.dbt.get_revoke_sql", "package_name": "dbt", "root_path": "/opt/homebrew/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "name": "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 %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__get_revoke_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1701215337.665233, "supported_languages": null}, "macro.dbt.default__get_revoke_sql": {"unique_id": "macro.dbt.default__get_revoke_sql", "package_name": "dbt", "root_path": "/opt/homebrew/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "name": "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", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1701215337.6654139, "supported_languages": null}, "macro.dbt.get_dcl_statement_list": {"unique_id": "macro.dbt.get_dcl_statement_list", "package_name": "dbt", "root_path": "/opt/homebrew/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "name": "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 %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__get_dcl_statement_list"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1701215337.665633, "supported_languages": null}, "macro.dbt.default__get_dcl_statement_list": {"unique_id": "macro.dbt.default__get_dcl_statement_list", "package_name": "dbt", "root_path": "/opt/homebrew/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "name": "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 %}", "resource_type": "macro", "tags": [], "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": 1701215337.666282, "supported_languages": null}, "macro.dbt.call_dcl_statements": {"unique_id": "macro.dbt.call_dcl_statements", "package_name": "dbt", "root_path": "/opt/homebrew/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "name": "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 %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__call_dcl_statements"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1701215337.666528, "supported_languages": null}, "macro.dbt.default__call_dcl_statements": {"unique_id": "macro.dbt.default__call_dcl_statements", "package_name": "dbt", "root_path": "/opt/homebrew/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "name": "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 %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1701215337.666763, "supported_languages": null}, "macro.dbt.apply_grants": {"unique_id": "macro.dbt.apply_grants", "package_name": "dbt", "root_path": "/opt/homebrew/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "name": "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 %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__apply_grants"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1701215337.666987, "supported_languages": null}, "macro.dbt.default__apply_grants": {"unique_id": "macro.dbt.default__apply_grants", "package_name": "dbt", "root_path": "/opt/homebrew/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "name": "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 %}", "resource_type": "macro", "tags": [], "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": 1701215337.668093, "supported_languages": null}, "macro.dbt.alter_column_comment": {"unique_id": "macro.dbt.alter_column_comment", "package_name": "dbt", "root_path": "/opt/homebrew/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/persist_docs.sql", "original_file_path": "macros/adapters/persist_docs.sql", "name": "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 %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_snowflake.snowflake__alter_column_comment"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1701215337.668782, "supported_languages": null}, "macro.dbt.default__alter_column_comment": {"unique_id": "macro.dbt.default__alter_column_comment", "package_name": "dbt", "root_path": "/opt/homebrew/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/persist_docs.sql", "original_file_path": "macros/adapters/persist_docs.sql", "name": "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 %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1701215337.66895, "supported_languages": null}, "macro.dbt.alter_relation_comment": {"unique_id": "macro.dbt.alter_relation_comment", "package_name": "dbt", "root_path": "/opt/homebrew/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/persist_docs.sql", "original_file_path": "macros/adapters/persist_docs.sql", "name": "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 %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_snowflake.snowflake__alter_relation_comment"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1701215337.669148, "supported_languages": null}, "macro.dbt.default__alter_relation_comment": {"unique_id": "macro.dbt.default__alter_relation_comment", "package_name": "dbt", "root_path": "/opt/homebrew/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/persist_docs.sql", "original_file_path": "macros/adapters/persist_docs.sql", "name": "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 %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1701215337.669309, "supported_languages": null}, "macro.dbt.persist_docs": {"unique_id": "macro.dbt.persist_docs", "package_name": "dbt", "root_path": "/opt/homebrew/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/persist_docs.sql", "original_file_path": "macros/adapters/persist_docs.sql", "name": "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 %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__persist_docs"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1701215337.66957, "supported_languages": null}, "macro.dbt.default__persist_docs": {"unique_id": "macro.dbt.default__persist_docs", "package_name": "dbt", "root_path": "/opt/homebrew/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/persist_docs.sql", "original_file_path": "macros/adapters/persist_docs.sql", "name": "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 %}", "resource_type": "macro", "tags": [], "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": 1701215337.670041, "supported_languages": null}, "macro.dbt.get_catalog": {"unique_id": "macro.dbt.get_catalog", "package_name": "dbt", "root_path": "/opt/homebrew/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "name": "get_catalog", "macro_sql": "{% macro get_catalog(information_schema, schemas) -%}\n {{ return(adapter.dispatch('get_catalog', 'dbt')(information_schema, schemas)) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_snowflake.snowflake__get_catalog"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1701215337.671425, "supported_languages": null}, "macro.dbt.default__get_catalog": {"unique_id": "macro.dbt.default__get_catalog", "package_name": "dbt", "root_path": "/opt/homebrew/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "name": "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 %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1701215337.671676, "supported_languages": null}, "macro.dbt.information_schema_name": {"unique_id": "macro.dbt.information_schema_name", "package_name": "dbt", "root_path": "/opt/homebrew/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "name": "information_schema_name", "macro_sql": "{% macro information_schema_name(database) %}\n {{ return(adapter.dispatch('information_schema_name', 'dbt')(database)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__information_schema_name"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1701215337.671859, "supported_languages": null}, "macro.dbt.default__information_schema_name": {"unique_id": "macro.dbt.default__information_schema_name", "package_name": "dbt", "root_path": "/opt/homebrew/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "name": "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 %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1701215337.6720052, "supported_languages": null}, "macro.dbt.list_schemas": {"unique_id": "macro.dbt.list_schemas", "package_name": "dbt", "root_path": "/opt/homebrew/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "name": "list_schemas", "macro_sql": "{% macro list_schemas(database) -%}\n {{ return(adapter.dispatch('list_schemas', 'dbt')(database)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_snowflake.snowflake__list_schemas"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1701215337.672178, "supported_languages": null}, "macro.dbt.default__list_schemas": {"unique_id": "macro.dbt.default__list_schemas", "package_name": "dbt", "root_path": "/opt/homebrew/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "name": "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 %}", "resource_type": "macro", "tags": [], "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": 1701215337.672408, "supported_languages": null}, "macro.dbt.check_schema_exists": {"unique_id": "macro.dbt.check_schema_exists", "package_name": "dbt", "root_path": "/opt/homebrew/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "name": "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 %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_snowflake.snowflake__check_schema_exists"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1701215337.672606, "supported_languages": null}, "macro.dbt.default__check_schema_exists": {"unique_id": "macro.dbt.default__check_schema_exists", "package_name": "dbt", "root_path": "/opt/homebrew/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "name": "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 %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.replace", "macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1701215337.672891, "supported_languages": null}, "macro.dbt.list_relations_without_caching": {"unique_id": "macro.dbt.list_relations_without_caching", "package_name": "dbt", "root_path": "/opt/homebrew/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "name": "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 %}", "resource_type": "macro", "tags": [], "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": 1701215337.673079, "supported_languages": null}, "macro.dbt.default__list_relations_without_caching": {"unique_id": "macro.dbt.default__list_relations_without_caching", "package_name": "dbt", "root_path": "/opt/homebrew/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "name": "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 %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1701215337.6732318, "supported_languages": null}, "macro.dbt.get_columns_in_relation": {"unique_id": "macro.dbt.get_columns_in_relation", "package_name": "dbt", "root_path": "/opt/homebrew/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "name": "get_columns_in_relation", "macro_sql": "{% macro get_columns_in_relation(relation) -%}\n {{ return(adapter.dispatch('get_columns_in_relation', 'dbt')(relation)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "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": 1701215337.674803, "supported_languages": null}, "macro.dbt.default__get_columns_in_relation": {"unique_id": "macro.dbt.default__get_columns_in_relation", "package_name": "dbt", "root_path": "/opt/homebrew/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "name": "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 %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1701215337.675019, "supported_languages": null}, "macro.dbt.sql_convert_columns_in_relation": {"unique_id": "macro.dbt.sql_convert_columns_in_relation", "package_name": "dbt", "root_path": "/opt/homebrew/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "name": "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 %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1701215337.675324, "supported_languages": null}, "macro.dbt.get_columns_in_query": {"unique_id": "macro.dbt.get_columns_in_query", "package_name": "dbt", "root_path": "/opt/homebrew/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "name": "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 %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__get_columns_in_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1701215337.675505, "supported_languages": null}, "macro.dbt.default__get_columns_in_query": {"unique_id": "macro.dbt.default__get_columns_in_query", "package_name": "dbt", "root_path": "/opt/homebrew/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "name": "default__get_columns_in_query", "macro_sql": "{% macro default__get_columns_in_query(select_sql) %}\n {% call statement('get_columns_in_query', fetch_result=True, auto_begin=False) -%}\n select * from (\n {{ select_sql }}\n ) as __dbt_sbq\n where false\n limit 0\n {% endcall %}\n\n {{ return(load_result('get_columns_in_query').table.columns | map(attribute='name') | list) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1701215337.6758358, "supported_languages": null}, "macro.dbt.alter_column_type": {"unique_id": "macro.dbt.alter_column_type", "package_name": "dbt", "root_path": "/opt/homebrew/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "name": "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 %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_snowflake.snowflake__alter_column_type"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1701215337.6760619, "supported_languages": null}, "macro.dbt.default__alter_column_type": {"unique_id": "macro.dbt.default__alter_column_type", "package_name": "dbt", "root_path": "/opt/homebrew/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "name": "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 %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1701215337.676637, "supported_languages": null}, "macro.dbt.alter_relation_add_remove_columns": {"unique_id": "macro.dbt.alter_relation_add_remove_columns", "package_name": "dbt", "root_path": "/opt/homebrew/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "name": "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 %}", "resource_type": "macro", "tags": [], "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": 1701215337.676887, "supported_languages": null}, "macro.dbt.default__alter_relation_add_remove_columns": {"unique_id": "macro.dbt.default__alter_relation_add_remove_columns", "package_name": "dbt", "root_path": "/opt/homebrew/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "name": "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 %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1701215337.6776361, "supported_languages": null}, "macro.dbt.build_ref_function": {"unique_id": "macro.dbt.build_ref_function", "package_name": "dbt", "root_path": "/opt/homebrew/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/python_model/python.sql", "original_file_path": "macros/python_model/python.sql", "name": "build_ref_function", "macro_sql": "{% macro build_ref_function(model) %}\n\n {%- set ref_dict = {} -%}\n {%- for _ref in model.refs -%}\n {%- set resolved = ref(*_ref) -%}\n {%- do ref_dict.update({_ref | join(\".\"): resolved.quote(database=False, schema=False, identifier=False) | string}) -%}\n {%- endfor -%}\n\ndef ref(*args,dbt_load_df_function):\n refs = {{ ref_dict | tojson }}\n key = \".\".join(args)\n return dbt_load_df_function(refs[key])\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1701215337.6790478, "supported_languages": null}, "macro.dbt.build_source_function": {"unique_id": "macro.dbt.build_source_function", "package_name": "dbt", "root_path": "/opt/homebrew/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/python_model/python.sql", "original_file_path": "macros/python_model/python.sql", "name": "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(\".\"): resolved.quote(database=False, schema=False, identifier=False) | string}) -%}\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 %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1701215337.679512, "supported_languages": null}, "macro.dbt.build_config_dict": {"unique_id": "macro.dbt.build_config_dict", "package_name": "dbt", "root_path": "/opt/homebrew/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/python_model/python.sql", "original_file_path": "macros/python_model/python.sql", "name": "build_config_dict", "macro_sql": "{% macro build_config_dict(model) %}\n {%- set config_dict = {} -%}\n {%- for key in model.config.config_keys_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[key] -%}\n {%- do config_dict.update({key: value}) -%}\n {%- endfor -%}\nconfig_dict = {{ config_dict }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1701215337.679947, "supported_languages": null}, "macro.dbt.py_script_postfix": {"unique_id": "macro.dbt.py_script_postfix", "package_name": "dbt", "root_path": "/opt/homebrew/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/python_model/python.sql", "original_file_path": "macros/python_model/python.sql", "name": "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 def __repr__(self):\n return '{{ this }}'\n\n\nclass dbtObj:\n def __init__(self, load_df_function) -> None:\n self.source = lambda *args: source(*args, dbt_load_df_function=load_df_function)\n self.ref = lambda *args: ref(*args, dbt_load_df_function=load_df_function)\n self.config = config\n self.this = this()\n self.is_incremental = {{ is_incremental() }}\n\n# COMMAND ----------\n{{py_script_comment()}}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.build_ref_function", "macro.dbt.build_source_function", "macro.dbt.build_config_dict", "macro.dbt.is_incremental", "macro.dbt.py_script_comment"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1701215337.6803489, "supported_languages": null}, "macro.dbt.py_script_comment": {"unique_id": "macro.dbt.py_script_comment", "package_name": "dbt", "root_path": "/opt/homebrew/lib/python3.9/site-packages/dbt/include/global_project", "path": "macros/python_model/python.sql", "original_file_path": "macros/python_model/python.sql", "name": "py_script_comment", "macro_sql": "{%macro py_script_comment()%}\n{%endmacro%}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1701215337.680419, "supported_languages": null}, "macro.dbt.test_unique": {"unique_id": "macro.dbt.test_unique", "package_name": "dbt", "root_path": "/opt/homebrew/lib/python3.9/site-packages/dbt/include/global_project", "path": "tests/generic/builtin.sql", "original_file_path": "tests/generic/builtin.sql", "name": "test_unique", "macro_sql": "{% test unique(model, column_name) %}\n {% set macro = adapter.dispatch('test_unique', 'dbt') %}\n {{ macro(model, column_name) }}\n{% endtest %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__test_unique"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1701215337.680956, "supported_languages": null}, "macro.dbt.test_not_null": {"unique_id": "macro.dbt.test_not_null", "package_name": "dbt", "root_path": "/opt/homebrew/lib/python3.9/site-packages/dbt/include/global_project", "path": "tests/generic/builtin.sql", "original_file_path": "tests/generic/builtin.sql", "name": "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 %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__test_not_null"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1701215337.681175, "supported_languages": null}, "macro.dbt.test_accepted_values": {"unique_id": "macro.dbt.test_accepted_values", "package_name": "dbt", "root_path": "/opt/homebrew/lib/python3.9/site-packages/dbt/include/global_project", "path": "tests/generic/builtin.sql", "original_file_path": "tests/generic/builtin.sql", "name": "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 %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__test_accepted_values"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1701215337.681451, "supported_languages": null}, "macro.dbt.test_relationships": {"unique_id": "macro.dbt.test_relationships", "package_name": "dbt", "root_path": "/opt/homebrew/lib/python3.9/site-packages/dbt/include/global_project", "path": "tests/generic/builtin.sql", "original_file_path": "tests/generic/builtin.sql", "name": "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 %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.default__test_relationships"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1701215337.6817129, "supported_languages": null}, "macro.dbt_utils.get_url_host": {"unique_id": "macro.dbt_utils.get_url_host", "package_name": "dbt_utils", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/dbt_utils", "path": "macros/web/get_url_host.sql", "original_file_path": "macros/web/get_url_host.sql", "name": "get_url_host", "macro_sql": "{% macro get_url_host(field) -%}\n {{ return(adapter.dispatch('get_url_host', 'dbt_utils')(field)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__get_url_host"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1701215337.682102, "supported_languages": null}, "macro.dbt_utils.default__get_url_host": {"unique_id": "macro.dbt_utils.default__get_url_host", "package_name": "dbt_utils", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/dbt_utils", "path": "macros/web/get_url_host.sql", "original_file_path": "macros/web/get_url_host.sql", "name": "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 %}", "resource_type": "macro", "tags": [], "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": 1701215337.6825778, "supported_languages": null}, "macro.dbt_utils.get_url_path": {"unique_id": "macro.dbt_utils.get_url_path", "package_name": "dbt_utils", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/dbt_utils", "path": "macros/web/get_url_path.sql", "original_file_path": "macros/web/get_url_path.sql", "name": "get_url_path", "macro_sql": "{% macro get_url_path(field) -%}\n {{ return(adapter.dispatch('get_url_path', 'dbt_utils')(field)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__get_url_path"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1701215337.68308, "supported_languages": null}, "macro.dbt_utils.default__get_url_path": {"unique_id": "macro.dbt_utils.default__get_url_path", "package_name": "dbt_utils", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/dbt_utils", "path": "macros/web/get_url_path.sql", "original_file_path": "macros/web/get_url_path.sql", "name": "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 %}", "resource_type": "macro", "tags": [], "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": 1701215337.683784, "supported_languages": null}, "macro.dbt_utils.get_url_parameter": {"unique_id": "macro.dbt_utils.get_url_parameter", "package_name": "dbt_utils", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/dbt_utils", "path": "macros/web/get_url_parameter.sql", "original_file_path": "macros/web/get_url_parameter.sql", "name": "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 %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__get_url_parameter"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1701215337.6841412, "supported_languages": null}, "macro.dbt_utils.default__get_url_parameter": {"unique_id": "macro.dbt_utils.default__get_url_parameter", "package_name": "dbt_utils", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/dbt_utils", "path": "macros/web/get_url_parameter.sql", "original_file_path": "macros/web/get_url_parameter.sql", "name": "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 %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.split_part"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1701215337.684454, "supported_languages": null}, "macro.dbt_utils.test_fewer_rows_than": {"unique_id": "macro.dbt_utils.test_fewer_rows_than", "package_name": "dbt_utils", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/dbt_utils", "path": "macros/generic_tests/fewer_rows_than.sql", "original_file_path": "macros/generic_tests/fewer_rows_than.sql", "name": "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 %}", "resource_type": "macro", "tags": [], "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": 1701215337.685506, "supported_languages": null}, "macro.dbt_utils.default__test_fewer_rows_than": {"unique_id": "macro.dbt_utils.default__test_fewer_rows_than", "package_name": "dbt_utils", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/dbt_utils", "path": "macros/generic_tests/fewer_rows_than.sql", "original_file_path": "macros/generic_tests/fewer_rows_than.sql", "name": "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 %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1701215337.686511, "supported_languages": null}, "macro.dbt_utils.test_equal_rowcount": {"unique_id": "macro.dbt_utils.test_equal_rowcount", "package_name": "dbt_utils", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/dbt_utils", "path": "macros/generic_tests/equal_rowcount.sql", "original_file_path": "macros/generic_tests/equal_rowcount.sql", "name": "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 %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__test_equal_rowcount"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1701215337.68738, "supported_languages": null}, "macro.dbt_utils.default__test_equal_rowcount": {"unique_id": "macro.dbt_utils.default__test_equal_rowcount", "package_name": "dbt_utils", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/dbt_utils", "path": "macros/generic_tests/equal_rowcount.sql", "original_file_path": "macros/generic_tests/equal_rowcount.sql", "name": "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 %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1701215337.6884181, "supported_languages": null}, "macro.dbt_utils.test_relationships_where": {"unique_id": "macro.dbt_utils.test_relationships_where", "package_name": "dbt_utils", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/dbt_utils", "path": "macros/generic_tests/relationships_where.sql", "original_file_path": "macros/generic_tests/relationships_where.sql", "name": "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 %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__test_relationships_where"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1701215337.689111, "supported_languages": null}, "macro.dbt_utils.default__test_relationships_where": {"unique_id": "macro.dbt_utils.default__test_relationships_where", "package_name": "dbt_utils", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/dbt_utils", "path": "macros/generic_tests/relationships_where.sql", "original_file_path": "macros/generic_tests/relationships_where.sql", "name": "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 %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1701215337.6894379, "supported_languages": null}, "macro.dbt_utils.test_recency": {"unique_id": "macro.dbt_utils.test_recency", "package_name": "dbt_utils", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/dbt_utils", "path": "macros/generic_tests/recency.sql", "original_file_path": "macros/generic_tests/recency.sql", "name": "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 %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__test_recency"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1701215337.690175, "supported_languages": null}, "macro.dbt_utils.default__test_recency": {"unique_id": "macro.dbt_utils.default__test_recency", "package_name": "dbt_utils", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/dbt_utils", "path": "macros/generic_tests/recency.sql", "original_file_path": "macros/generic_tests/recency.sql", "name": "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 %}", "resource_type": "macro", "tags": [], "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": 1701215337.690999, "supported_languages": null}, "macro.dbt_utils.test_not_constant": {"unique_id": "macro.dbt_utils.test_not_constant", "package_name": "dbt_utils", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/dbt_utils", "path": "macros/generic_tests/not_constant.sql", "original_file_path": "macros/generic_tests/not_constant.sql", "name": "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 %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__test_not_constant"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1701215337.691493, "supported_languages": null}, "macro.dbt_utils.default__test_not_constant": {"unique_id": "macro.dbt_utils.default__test_not_constant", "package_name": "dbt_utils", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/dbt_utils", "path": "macros/generic_tests/not_constant.sql", "original_file_path": "macros/generic_tests/not_constant.sql", "name": "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 %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1701215337.691956, "supported_languages": null}, "macro.dbt_utils.test_accepted_range": {"unique_id": "macro.dbt_utils.test_accepted_range", "package_name": "dbt_utils", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/dbt_utils", "path": "macros/generic_tests/accepted_range.sql", "original_file_path": "macros/generic_tests/accepted_range.sql", "name": "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 %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__test_accepted_range"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1701215337.6925929, "supported_languages": null}, "macro.dbt_utils.default__test_accepted_range": {"unique_id": "macro.dbt_utils.default__test_accepted_range", "package_name": "dbt_utils", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/dbt_utils", "path": "macros/generic_tests/accepted_range.sql", "original_file_path": "macros/generic_tests/accepted_range.sql", "name": "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 %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1701215337.6930509, "supported_languages": null}, "macro.dbt_utils.test_not_accepted_values": {"unique_id": "macro.dbt_utils.test_not_accepted_values", "package_name": "dbt_utils", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/dbt_utils", "path": "macros/generic_tests/not_accepted_values.sql", "original_file_path": "macros/generic_tests/not_accepted_values.sql", "name": "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 %}", "resource_type": "macro", "tags": [], "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": 1701215337.693632, "supported_languages": null}, "macro.dbt_utils.default__test_not_accepted_values": {"unique_id": "macro.dbt_utils.default__test_not_accepted_values", "package_name": "dbt_utils", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/dbt_utils", "path": "macros/generic_tests/not_accepted_values.sql", "original_file_path": "macros/generic_tests/not_accepted_values.sql", "name": "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 %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1701215337.694008, "supported_languages": null}, "macro.dbt_utils.test_at_least_one": {"unique_id": "macro.dbt_utils.test_at_least_one", "package_name": "dbt_utils", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/dbt_utils", "path": "macros/generic_tests/at_least_one.sql", "original_file_path": "macros/generic_tests/at_least_one.sql", "name": "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 %}", "resource_type": "macro", "tags": [], "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": 1701215337.694689, "supported_languages": null}, "macro.dbt_utils.default__test_at_least_one": {"unique_id": "macro.dbt_utils.default__test_at_least_one", "package_name": "dbt_utils", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/dbt_utils", "path": "macros/generic_tests/at_least_one.sql", "original_file_path": "macros/generic_tests/at_least_one.sql", "name": "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 %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1701215337.6955378, "supported_languages": null}, "macro.dbt_utils.test_unique_combination_of_columns": {"unique_id": "macro.dbt_utils.test_unique_combination_of_columns", "package_name": "dbt_utils", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/dbt_utils", "path": "macros/generic_tests/unique_combination_of_columns.sql", "original_file_path": "macros/generic_tests/unique_combination_of_columns.sql", "name": "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 %}", "resource_type": "macro", "tags": [], "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": 1701215337.6961868, "supported_languages": null}, "macro.dbt_utils.default__test_unique_combination_of_columns": {"unique_id": "macro.dbt_utils.default__test_unique_combination_of_columns", "package_name": "dbt_utils", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/dbt_utils", "path": "macros/generic_tests/unique_combination_of_columns.sql", "original_file_path": "macros/generic_tests/unique_combination_of_columns.sql", "name": "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 %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1701215337.69682, "supported_languages": null}, "macro.dbt_utils.test_cardinality_equality": {"unique_id": "macro.dbt_utils.test_cardinality_equality", "package_name": "dbt_utils", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/dbt_utils", "path": "macros/generic_tests/cardinality_equality.sql", "original_file_path": "macros/generic_tests/cardinality_equality.sql", "name": "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 %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__test_cardinality_equality"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1701215337.6974132, "supported_languages": null}, "macro.dbt_utils.default__test_cardinality_equality": {"unique_id": "macro.dbt_utils.default__test_cardinality_equality", "package_name": "dbt_utils", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/dbt_utils", "path": "macros/generic_tests/cardinality_equality.sql", "original_file_path": "macros/generic_tests/cardinality_equality.sql", "name": "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 %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.except"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1701215337.69775, "supported_languages": null}, "macro.dbt_utils.test_expression_is_true": {"unique_id": "macro.dbt_utils.test_expression_is_true", "package_name": "dbt_utils", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/dbt_utils", "path": "macros/generic_tests/expression_is_true.sql", "original_file_path": "macros/generic_tests/expression_is_true.sql", "name": "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 %}", "resource_type": "macro", "tags": [], "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": 1701215337.6982331, "supported_languages": null}, "macro.dbt_utils.default__test_expression_is_true": {"unique_id": "macro.dbt_utils.default__test_expression_is_true", "package_name": "dbt_utils", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/dbt_utils", "path": "macros/generic_tests/expression_is_true.sql", "original_file_path": "macros/generic_tests/expression_is_true.sql", "name": "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 %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.should_store_failures"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1701215337.698587, "supported_languages": null}, "macro.dbt_utils.test_not_null_proportion": {"unique_id": "macro.dbt_utils.test_not_null_proportion", "package_name": "dbt_utils", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/dbt_utils", "path": "macros/generic_tests/not_null_proportion.sql", "original_file_path": "macros/generic_tests/not_null_proportion.sql", "name": "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 %}", "resource_type": "macro", "tags": [], "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": 1701215337.699268, "supported_languages": null}, "macro.dbt_utils.default__test_not_null_proportion": {"unique_id": "macro.dbt_utils.default__test_not_null_proportion", "package_name": "dbt_utils", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/dbt_utils", "path": "macros/generic_tests/not_null_proportion.sql", "original_file_path": "macros/generic_tests/not_null_proportion.sql", "name": "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 %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1701215337.700052, "supported_languages": null}, "macro.dbt_utils.test_sequential_values": {"unique_id": "macro.dbt_utils.test_sequential_values", "package_name": "dbt_utils", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/dbt_utils", "path": "macros/generic_tests/sequential_values.sql", "original_file_path": "macros/generic_tests/sequential_values.sql", "name": "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 %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__test_sequential_values"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1701215337.700953, "supported_languages": null}, "macro.dbt_utils.default__test_sequential_values": {"unique_id": "macro.dbt_utils.default__test_sequential_values", "package_name": "dbt_utils", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/dbt_utils", "path": "macros/generic_tests/sequential_values.sql", "original_file_path": "macros/generic_tests/sequential_values.sql", "name": "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 %}", "resource_type": "macro", "tags": [], "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": 1701215337.7018251, "supported_languages": null}, "macro.dbt_utils.test_equality": {"unique_id": "macro.dbt_utils.test_equality", "package_name": "dbt_utils", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/dbt_utils", "path": "macros/generic_tests/equality.sql", "original_file_path": "macros/generic_tests/equality.sql", "name": "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 %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__test_equality"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1701215337.702589, "supported_languages": null}, "macro.dbt_utils.default__test_equality": {"unique_id": "macro.dbt_utils.default__test_equality", "package_name": "dbt_utils", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/dbt_utils", "path": "macros/generic_tests/equality.sql", "original_file_path": "macros/generic_tests/equality.sql", "name": "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 %}", "resource_type": "macro", "tags": [], "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": 1701215337.703466, "supported_languages": null}, "macro.dbt_utils.test_not_empty_string": {"unique_id": "macro.dbt_utils.test_not_empty_string", "package_name": "dbt_utils", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/dbt_utils", "path": "macros/generic_tests/not_empty_string.sql", "original_file_path": "macros/generic_tests/not_empty_string.sql", "name": "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 %}", "resource_type": "macro", "tags": [], "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": 1701215337.704, "supported_languages": null}, "macro.dbt_utils.default__test_not_empty_string": {"unique_id": "macro.dbt_utils.default__test_not_empty_string", "package_name": "dbt_utils", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/dbt_utils", "path": "macros/generic_tests/not_empty_string.sql", "original_file_path": "macros/generic_tests/not_empty_string.sql", "name": "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 %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1701215337.7042859, "supported_languages": null}, "macro.dbt_utils.test_mutually_exclusive_ranges": {"unique_id": "macro.dbt_utils.test_mutually_exclusive_ranges", "package_name": "dbt_utils", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/dbt_utils", "path": "macros/generic_tests/mutually_exclusive_ranges.sql", "original_file_path": "macros/generic_tests/mutually_exclusive_ranges.sql", "name": "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 %}", "resource_type": "macro", "tags": [], "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": 1701215337.707399, "supported_languages": null}, "macro.dbt_utils.default__test_mutually_exclusive_ranges": {"unique_id": "macro.dbt_utils.default__test_mutually_exclusive_ranges", "package_name": "dbt_utils", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/dbt_utils", "path": "macros/generic_tests/mutually_exclusive_ranges.sql", "original_file_path": "macros/generic_tests/mutually_exclusive_ranges.sql", "name": "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 %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1701215337.708902, "supported_languages": null}, "macro.dbt_utils.pretty_log_format": {"unique_id": "macro.dbt_utils.pretty_log_format", "package_name": "dbt_utils", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/dbt_utils", "path": "macros/jinja_helpers/pretty_log_format.sql", "original_file_path": "macros/jinja_helpers/pretty_log_format.sql", "name": "pretty_log_format", "macro_sql": "{% macro pretty_log_format(message) %}\n {{ return(adapter.dispatch('pretty_log_format', 'dbt_utils')(message)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__pretty_log_format"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1701215337.709227, "supported_languages": null}, "macro.dbt_utils.default__pretty_log_format": {"unique_id": "macro.dbt_utils.default__pretty_log_format", "package_name": "dbt_utils", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/dbt_utils", "path": "macros/jinja_helpers/pretty_log_format.sql", "original_file_path": "macros/jinja_helpers/pretty_log_format.sql", "name": "default__pretty_log_format", "macro_sql": "{% macro default__pretty_log_format(message) %}\n {{ return( dbt_utils.pretty_time() ~ ' + ' ~ message) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.pretty_time"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1701215337.7093928, "supported_languages": null}, "macro.dbt_utils._is_relation": {"unique_id": "macro.dbt_utils._is_relation", "package_name": "dbt_utils", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/dbt_utils", "path": "macros/jinja_helpers/_is_relation.sql", "original_file_path": "macros/jinja_helpers/_is_relation.sql", "name": "_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 %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1701215337.70988, "supported_languages": null}, "macro.dbt_utils.pretty_time": {"unique_id": "macro.dbt_utils.pretty_time", "package_name": "dbt_utils", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/dbt_utils", "path": "macros/jinja_helpers/pretty_time.sql", "original_file_path": "macros/jinja_helpers/pretty_time.sql", "name": "pretty_time", "macro_sql": "{% macro pretty_time(format='%H:%M:%S') %}\n {{ return(adapter.dispatch('pretty_time', 'dbt_utils')(format)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__pretty_time"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1701215337.7102022, "supported_languages": null}, "macro.dbt_utils.default__pretty_time": {"unique_id": "macro.dbt_utils.default__pretty_time", "package_name": "dbt_utils", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/dbt_utils", "path": "macros/jinja_helpers/pretty_time.sql", "original_file_path": "macros/jinja_helpers/pretty_time.sql", "name": "default__pretty_time", "macro_sql": "{% macro default__pretty_time(format='%H:%M:%S') %}\n {{ return(modules.datetime.datetime.now().strftime(format)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1701215337.710398, "supported_languages": null}, "macro.dbt_utils.log_info": {"unique_id": "macro.dbt_utils.log_info", "package_name": "dbt_utils", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/dbt_utils", "path": "macros/jinja_helpers/log_info.sql", "original_file_path": "macros/jinja_helpers/log_info.sql", "name": "log_info", "macro_sql": "{% macro log_info(message) %}\n {{ return(adapter.dispatch('log_info', 'dbt_utils')(message)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__log_info"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1701215337.710701, "supported_languages": null}, "macro.dbt_utils.default__log_info": {"unique_id": "macro.dbt_utils.default__log_info", "package_name": "dbt_utils", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/dbt_utils", "path": "macros/jinja_helpers/log_info.sql", "original_file_path": "macros/jinja_helpers/log_info.sql", "name": "default__log_info", "macro_sql": "{% macro default__log_info(message) %}\n {{ log(dbt_utils.pretty_log_format(message), info=True) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.pretty_log_format"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1701215337.71087, "supported_languages": null}, "macro.dbt_utils.slugify": {"unique_id": "macro.dbt_utils.slugify", "package_name": "dbt_utils", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/dbt_utils", "path": "macros/jinja_helpers/slugify.sql", "original_file_path": "macros/jinja_helpers/slugify.sql", "name": "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 %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1701215337.711513, "supported_languages": null}, "macro.dbt_utils._is_ephemeral": {"unique_id": "macro.dbt_utils._is_ephemeral", "package_name": "dbt_utils", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/dbt_utils", "path": "macros/jinja_helpers/_is_ephemeral.sql", "original_file_path": "macros/jinja_helpers/_is_ephemeral.sql", "name": "_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 %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1701215337.712357, "supported_languages": null}, "macro.dbt_utils.get_intervals_between": {"unique_id": "macro.dbt_utils.get_intervals_between", "package_name": "dbt_utils", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/date_spine.sql", "original_file_path": "macros/sql/date_spine.sql", "name": "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 %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__get_intervals_between"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1701215337.713061, "supported_languages": null}, "macro.dbt_utils.default__get_intervals_between": {"unique_id": "macro.dbt_utils.default__get_intervals_between", "package_name": "dbt_utils", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/date_spine.sql", "original_file_path": "macros/sql/date_spine.sql", "name": "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 %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement", "macro.dbt.datediff"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1701215337.7136378, "supported_languages": null}, "macro.dbt_utils.date_spine": {"unique_id": "macro.dbt_utils.date_spine", "package_name": "dbt_utils", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/date_spine.sql", "original_file_path": "macros/sql/date_spine.sql", "name": "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 %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__date_spine"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1701215337.713863, "supported_languages": null}, "macro.dbt_utils.default__date_spine": {"unique_id": "macro.dbt_utils.default__date_spine", "package_name": "dbt_utils", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/date_spine.sql", "original_file_path": "macros/sql/date_spine.sql", "name": "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 %}", "resource_type": "macro", "tags": [], "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": 1701215337.714207, "supported_languages": null}, "macro.dbt_utils.safe_subtract": {"unique_id": "macro.dbt_utils.safe_subtract", "package_name": "dbt_utils", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/safe_subtract.sql", "original_file_path": "macros/sql/safe_subtract.sql", "name": "safe_subtract", "macro_sql": "{%- macro safe_subtract(field_list) -%}\n {{ return(adapter.dispatch('safe_subtract', 'dbt_utils')(field_list)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__safe_subtract"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1701215337.714633, "supported_languages": null}, "macro.dbt_utils.default__safe_subtract": {"unique_id": "macro.dbt_utils.default__safe_subtract", "package_name": "dbt_utils", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/safe_subtract.sql", "original_file_path": "macros/sql/safe_subtract.sql", "name": "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 -%}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1701215337.715156, "supported_languages": null}, "macro.dbt_utils.nullcheck_table": {"unique_id": "macro.dbt_utils.nullcheck_table", "package_name": "dbt_utils", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/nullcheck_table.sql", "original_file_path": "macros/sql/nullcheck_table.sql", "name": "nullcheck_table", "macro_sql": "{% macro nullcheck_table(relation) %}\n {{ return(adapter.dispatch('nullcheck_table', 'dbt_utils')(relation)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__nullcheck_table"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1701215337.7155159, "supported_languages": null}, "macro.dbt_utils.default__nullcheck_table": {"unique_id": "macro.dbt_utils.default__nullcheck_table", "package_name": "dbt_utils", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/nullcheck_table.sql", "original_file_path": "macros/sql/nullcheck_table.sql", "name": "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 %}", "resource_type": "macro", "tags": [], "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": 1701215337.715849, "supported_languages": null}, "macro.dbt_utils.get_relations_by_pattern": {"unique_id": "macro.dbt_utils.get_relations_by_pattern", "package_name": "dbt_utils", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/get_relations_by_pattern.sql", "original_file_path": "macros/sql/get_relations_by_pattern.sql", "name": "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 %}", "resource_type": "macro", "tags": [], "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": 1701215337.716529, "supported_languages": null}, "macro.dbt_utils.default__get_relations_by_pattern": {"unique_id": "macro.dbt_utils.default__get_relations_by_pattern", "package_name": "dbt_utils", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/get_relations_by_pattern.sql", "original_file_path": "macros/sql/get_relations_by_pattern.sql", "name": "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 %}", "resource_type": "macro", "tags": [], "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": 1701215337.717419, "supported_languages": null}, "macro.dbt_utils.get_powers_of_two": {"unique_id": "macro.dbt_utils.get_powers_of_two", "package_name": "dbt_utils", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/generate_series.sql", "original_file_path": "macros/sql/generate_series.sql", "name": "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 %}", "resource_type": "macro", "tags": [], "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": 1701215337.718244, "supported_languages": null}, "macro.dbt_utils.default__get_powers_of_two": {"unique_id": "macro.dbt_utils.default__get_powers_of_two", "package_name": "dbt_utils", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/generate_series.sql", "original_file_path": "macros/sql/generate_series.sql", "name": "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 %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1701215337.718652, "supported_languages": null}, "macro.dbt_utils.generate_series": {"unique_id": "macro.dbt_utils.generate_series", "package_name": "dbt_utils", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/generate_series.sql", "original_file_path": "macros/sql/generate_series.sql", "name": "generate_series", "macro_sql": "{% macro generate_series(upper_bound) %}\n {{ return(adapter.dispatch('generate_series', 'dbt_utils')(upper_bound)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__generate_series"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1701215337.718839, "supported_languages": null}, "macro.dbt_utils.default__generate_series": {"unique_id": "macro.dbt_utils.default__generate_series", "package_name": "dbt_utils", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/generate_series.sql", "original_file_path": "macros/sql/generate_series.sql", "name": "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 %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.get_powers_of_two"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1701215337.719339, "supported_languages": null}, "macro.dbt_utils.get_relations_by_prefix": {"unique_id": "macro.dbt_utils.get_relations_by_prefix", "package_name": "dbt_utils", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/get_relations_by_prefix.sql", "original_file_path": "macros/sql/get_relations_by_prefix.sql", "name": "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 %}", "resource_type": "macro", "tags": [], "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": 1701215337.720032, "supported_languages": null}, "macro.dbt_utils.default__get_relations_by_prefix": {"unique_id": "macro.dbt_utils.default__get_relations_by_prefix", "package_name": "dbt_utils", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/get_relations_by_prefix.sql", "original_file_path": "macros/sql/get_relations_by_prefix.sql", "name": "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 %}", "resource_type": "macro", "tags": [], "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": 1701215337.7208588, "supported_languages": null}, "macro.dbt_utils.get_tables_by_prefix_sql": {"unique_id": "macro.dbt_utils.get_tables_by_prefix_sql", "package_name": "dbt_utils", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/get_tables_by_prefix_sql.sql", "original_file_path": "macros/sql/get_tables_by_prefix_sql.sql", "name": "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 %}", "resource_type": "macro", "tags": [], "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": 1701215337.7213051, "supported_languages": null}, "macro.dbt_utils.default__get_tables_by_prefix_sql": {"unique_id": "macro.dbt_utils.default__get_tables_by_prefix_sql", "package_name": "dbt_utils", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/get_tables_by_prefix_sql.sql", "original_file_path": "macros/sql/get_tables_by_prefix_sql.sql", "name": "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 %}", "resource_type": "macro", "tags": [], "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": 1701215337.721579, "supported_languages": null}, "macro.dbt_utils.star": {"unique_id": "macro.dbt_utils.star", "package_name": "dbt_utils", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/star.sql", "original_file_path": "macros/sql/star.sql", "name": "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 %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__star"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1701215337.722765, "supported_languages": null}, "macro.dbt_utils.default__star": {"unique_id": "macro.dbt_utils.default__star", "package_name": "dbt_utils", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/star.sql", "original_file_path": "macros/sql/star.sql", "name": "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 %}", "resource_type": "macro", "tags": [], "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": 1701215337.724405, "supported_languages": null}, "macro.dbt_utils.unpivot": {"unique_id": "macro.dbt_utils.unpivot", "package_name": "dbt_utils", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/unpivot.sql", "original_file_path": "macros/sql/unpivot.sql", "name": "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 %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__unpivot"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1701215337.725867, "supported_languages": null}, "macro.dbt_utils.default__unpivot": {"unique_id": "macro.dbt_utils.default__unpivot", "package_name": "dbt_utils", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/unpivot.sql", "original_file_path": "macros/sql/unpivot.sql", "name": "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 %}", "resource_type": "macro", "tags": [], "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": 1701215337.727637, "supported_languages": null}, "macro.dbt_utils.safe_divide": {"unique_id": "macro.dbt_utils.safe_divide", "package_name": "dbt_utils", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/safe_divide.sql", "original_file_path": "macros/sql/safe_divide.sql", "name": "safe_divide", "macro_sql": "{% macro safe_divide(numerator, denominator) -%}\n {{ return(adapter.dispatch('safe_divide', 'dbt_utils')(numerator, denominator)) }}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__safe_divide"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1701215337.727985, "supported_languages": null}, "macro.dbt_utils.default__safe_divide": {"unique_id": "macro.dbt_utils.default__safe_divide", "package_name": "dbt_utils", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/safe_divide.sql", "original_file_path": "macros/sql/safe_divide.sql", "name": "default__safe_divide", "macro_sql": "{% macro default__safe_divide(numerator, denominator) %}\n ( {{ numerator }} ) / nullif( ( {{ denominator }} ), 0)\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1701215337.7281148, "supported_languages": null}, "macro.dbt_utils.union_relations": {"unique_id": "macro.dbt_utils.union_relations", "package_name": "dbt_utils", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/union.sql", "original_file_path": "macros/sql/union.sql", "name": "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 %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__union_relations"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1701215337.730965, "supported_languages": null}, "macro.dbt_utils.default__union_relations": {"unique_id": "macro.dbt_utils.default__union_relations", "package_name": "dbt_utils", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/union.sql", "original_file_path": "macros/sql/union.sql", "name": "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 -%}", "resource_type": "macro", "tags": [], "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": 1701215337.7343621, "supported_languages": null}, "macro.dbt_utils.group_by": {"unique_id": "macro.dbt_utils.group_by", "package_name": "dbt_utils", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/groupby.sql", "original_file_path": "macros/sql/groupby.sql", "name": "group_by", "macro_sql": "{%- macro group_by(n) -%}\n {{ return(adapter.dispatch('group_by', 'dbt_utils')(n)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__group_by"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1701215337.7347322, "supported_languages": null}, "macro.dbt_utils.default__group_by": {"unique_id": "macro.dbt_utils.default__group_by", "package_name": "dbt_utils", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/groupby.sql", "original_file_path": "macros/sql/groupby.sql", "name": "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 -%}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1701215337.7349792, "supported_languages": null}, "macro.dbt_utils.deduplicate": {"unique_id": "macro.dbt_utils.deduplicate", "package_name": "dbt_utils", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/deduplicate.sql", "original_file_path": "macros/sql/deduplicate.sql", "name": "deduplicate", "macro_sql": "{%- macro deduplicate(relation, partition_by, order_by) -%}\n {{ return(adapter.dispatch('deduplicate', 'dbt_utils')(relation, partition_by, order_by)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.snowflake__deduplicate"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1701215337.735745, "supported_languages": null}, "macro.dbt_utils.default__deduplicate": {"unique_id": "macro.dbt_utils.default__deduplicate", "package_name": "dbt_utils", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/deduplicate.sql", "original_file_path": "macros/sql/deduplicate.sql", "name": "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", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1701215337.735956, "supported_languages": null}, "macro.dbt_utils.redshift__deduplicate": {"unique_id": "macro.dbt_utils.redshift__deduplicate", "package_name": "dbt_utils", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/deduplicate.sql", "original_file_path": "macros/sql/deduplicate.sql", "name": "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 %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__deduplicate"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1701215337.736149, "supported_languages": null}, "macro.dbt_utils.postgres__deduplicate": {"unique_id": "macro.dbt_utils.postgres__deduplicate", "package_name": "dbt_utils", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/deduplicate.sql", "original_file_path": "macros/sql/deduplicate.sql", "name": "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", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1701215337.736335, "supported_languages": null}, "macro.dbt_utils.snowflake__deduplicate": {"unique_id": "macro.dbt_utils.snowflake__deduplicate", "package_name": "dbt_utils", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/deduplicate.sql", "original_file_path": "macros/sql/deduplicate.sql", "name": "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", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1701215337.736494, "supported_languages": null}, "macro.dbt_utils.bigquery__deduplicate": {"unique_id": "macro.dbt_utils.bigquery__deduplicate", "package_name": "dbt_utils", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/deduplicate.sql", "original_file_path": "macros/sql/deduplicate.sql", "name": "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 -%}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1701215337.73666, "supported_languages": null}, "macro.dbt_utils.surrogate_key": {"unique_id": "macro.dbt_utils.surrogate_key", "package_name": "dbt_utils", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/surrogate_key.sql", "original_file_path": "macros/sql/surrogate_key.sql", "name": "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 %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__surrogate_key"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1701215337.737099, "supported_languages": null}, "macro.dbt_utils.default__surrogate_key": {"unique_id": "macro.dbt_utils.default__surrogate_key", "package_name": "dbt_utils", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/surrogate_key.sql", "original_file_path": "macros/sql/surrogate_key.sql", "name": "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 -%}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1701215337.737334, "supported_languages": null}, "macro.dbt_utils.safe_add": {"unique_id": "macro.dbt_utils.safe_add", "package_name": "dbt_utils", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/safe_add.sql", "original_file_path": "macros/sql/safe_add.sql", "name": "safe_add", "macro_sql": "{%- macro safe_add(field_list) -%}\n {{ return(adapter.dispatch('safe_add', 'dbt_utils')(field_list)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__safe_add"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1701215337.737754, "supported_languages": null}, "macro.dbt_utils.default__safe_add": {"unique_id": "macro.dbt_utils.default__safe_add", "package_name": "dbt_utils", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/safe_add.sql", "original_file_path": "macros/sql/safe_add.sql", "name": "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 -%}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1701215337.738285, "supported_languages": null}, "macro.dbt_utils.nullcheck": {"unique_id": "macro.dbt_utils.nullcheck", "package_name": "dbt_utils", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/nullcheck.sql", "original_file_path": "macros/sql/nullcheck.sql", "name": "nullcheck", "macro_sql": "{% macro nullcheck(cols) %}\n {{ return(adapter.dispatch('nullcheck', 'dbt_utils')(cols)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__nullcheck"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1701215337.738673, "supported_languages": null}, "macro.dbt_utils.default__nullcheck": {"unique_id": "macro.dbt_utils.default__nullcheck", "package_name": "dbt_utils", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/nullcheck.sql", "original_file_path": "macros/sql/nullcheck.sql", "name": "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 %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1701215337.738998, "supported_languages": null}, "macro.dbt_utils.get_tables_by_pattern_sql": {"unique_id": "macro.dbt_utils.get_tables_by_pattern_sql", "package_name": "dbt_utils", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/get_tables_by_pattern_sql.sql", "original_file_path": "macros/sql/get_tables_by_pattern_sql.sql", "name": "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 %}", "resource_type": "macro", "tags": [], "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": 1701215337.740577, "supported_languages": null}, "macro.dbt_utils.default__get_tables_by_pattern_sql": {"unique_id": "macro.dbt_utils.default__get_tables_by_pattern_sql", "package_name": "dbt_utils", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/get_tables_by_pattern_sql.sql", "original_file_path": "macros/sql/get_tables_by_pattern_sql.sql", "name": "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 %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.get_table_types_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1701215337.7409248, "supported_languages": null}, "macro.dbt_utils.bigquery__get_tables_by_pattern_sql": {"unique_id": "macro.dbt_utils.bigquery__get_tables_by_pattern_sql", "package_name": "dbt_utils", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/get_tables_by_pattern_sql.sql", "original_file_path": "macros/sql/get_tables_by_pattern_sql.sql", "name": "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 %}", "resource_type": "macro", "tags": [], "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": 1701215337.741686, "supported_languages": null}, "macro.dbt_utils._bigquery__get_matching_schemata": {"unique_id": "macro.dbt_utils._bigquery__get_matching_schemata", "package_name": "dbt_utils", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/get_tables_by_pattern_sql.sql", "original_file_path": "macros/sql/get_tables_by_pattern_sql.sql", "name": "_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 %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1701215337.742176, "supported_languages": null}, "macro.dbt_utils.get_column_values": {"unique_id": "macro.dbt_utils.get_column_values", "package_name": "dbt_utils", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/get_column_values.sql", "original_file_path": "macros/sql/get_column_values.sql", "name": "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 %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__get_column_values"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1701215337.743281, "supported_languages": null}, "macro.dbt_utils.default__get_column_values": {"unique_id": "macro.dbt_utils.default__get_column_values", "package_name": "dbt_utils", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/get_column_values.sql", "original_file_path": "macros/sql/get_column_values.sql", "name": "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 %}", "resource_type": "macro", "tags": [], "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": 1701215337.74475, "supported_languages": null}, "macro.dbt_utils.pivot": {"unique_id": "macro.dbt_utils.pivot", "package_name": "dbt_utils", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/pivot.sql", "original_file_path": "macros/sql/pivot.sql", "name": "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 %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__pivot"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1701215337.745825, "supported_languages": null}, "macro.dbt_utils.default__pivot": {"unique_id": "macro.dbt_utils.default__pivot", "package_name": "dbt_utils", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/pivot.sql", "original_file_path": "macros/sql/pivot.sql", "name": "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 %}", "resource_type": "macro", "tags": [], "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": 1701215337.7466419, "supported_languages": null}, "macro.dbt_utils.get_filtered_columns_in_relation": {"unique_id": "macro.dbt_utils.get_filtered_columns_in_relation", "package_name": "dbt_utils", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/get_filtered_columns_in_relation.sql", "original_file_path": "macros/sql/get_filtered_columns_in_relation.sql", "name": "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 %}", "resource_type": "macro", "tags": [], "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": 1701215337.747148, "supported_languages": null}, "macro.dbt_utils.default__get_filtered_columns_in_relation": {"unique_id": "macro.dbt_utils.default__get_filtered_columns_in_relation", "package_name": "dbt_utils", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/get_filtered_columns_in_relation.sql", "original_file_path": "macros/sql/get_filtered_columns_in_relation.sql", "name": "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 %}", "resource_type": "macro", "tags": [], "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": 1701215337.747854, "supported_languages": null}, "macro.dbt_utils.width_bucket": {"unique_id": "macro.dbt_utils.width_bucket", "package_name": "dbt_utils", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/width_bucket.sql", "original_file_path": "macros/sql/width_bucket.sql", "name": "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 %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.snowflake__width_bucket"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1701215337.748627, "supported_languages": null}, "macro.dbt_utils.default__width_bucket": {"unique_id": "macro.dbt_utils.default__width_bucket", "package_name": "dbt_utils", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/width_bucket.sql", "original_file_path": "macros/sql/width_bucket.sql", "name": "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 %}", "resource_type": "macro", "tags": [], "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": 1701215337.749068, "supported_languages": null}, "macro.dbt_utils.snowflake__width_bucket": {"unique_id": "macro.dbt_utils.snowflake__width_bucket", "package_name": "dbt_utils", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/width_bucket.sql", "original_file_path": "macros/sql/width_bucket.sql", "name": "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 %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1701215337.7492511, "supported_languages": null}, "macro.dbt_utils.get_query_results_as_dict": {"unique_id": "macro.dbt_utils.get_query_results_as_dict", "package_name": "dbt_utils", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/get_query_results_as_dict.sql", "original_file_path": "macros/sql/get_query_results_as_dict.sql", "name": "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 %}", "resource_type": "macro", "tags": [], "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": 1701215337.749674, "supported_languages": null}, "macro.dbt_utils.default__get_query_results_as_dict": {"unique_id": "macro.dbt_utils.default__get_query_results_as_dict", "package_name": "dbt_utils", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/get_query_results_as_dict.sql", "original_file_path": "macros/sql/get_query_results_as_dict.sql", "name": "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 %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1701215337.7502458, "supported_languages": null}, "macro.dbt_utils.generate_surrogate_key": {"unique_id": "macro.dbt_utils.generate_surrogate_key", "package_name": "dbt_utils", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/generate_surrogate_key.sql", "original_file_path": "macros/sql/generate_surrogate_key.sql", "name": "generate_surrogate_key", "macro_sql": "{%- macro generate_surrogate_key(field_list) -%}\n {{ return(adapter.dispatch('generate_surrogate_key', 'dbt_utils')(field_list)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__generate_surrogate_key"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1701215337.750731, "supported_languages": null}, "macro.dbt_utils.default__generate_surrogate_key": {"unique_id": "macro.dbt_utils.default__generate_surrogate_key", "package_name": "dbt_utils", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/generate_surrogate_key.sql", "original_file_path": "macros/sql/generate_surrogate_key.sql", "name": "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 -%}", "resource_type": "macro", "tags": [], "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": 1701215337.751331, "supported_languages": null}, "macro.dbt_utils.get_table_types_sql": {"unique_id": "macro.dbt_utils.get_table_types_sql", "package_name": "dbt_utils", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/get_table_types_sql.sql", "original_file_path": "macros/sql/get_table_types_sql.sql", "name": "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", "resource_type": "macro", "tags": [], "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": 1701215337.751877, "supported_languages": null}, "macro.dbt_utils.default__get_table_types_sql": {"unique_id": "macro.dbt_utils.default__get_table_types_sql", "package_name": "dbt_utils", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/get_table_types_sql.sql", "original_file_path": "macros/sql/get_table_types_sql.sql", "name": "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 %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1701215337.752009, "supported_languages": null}, "macro.dbt_utils.postgres__get_table_types_sql": {"unique_id": "macro.dbt_utils.postgres__get_table_types_sql", "package_name": "dbt_utils", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/get_table_types_sql.sql", "original_file_path": "macros/sql/get_table_types_sql.sql", "name": "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 %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1701215337.7521422, "supported_languages": null}, "macro.dbt_utils.databricks__get_table_types_sql": {"unique_id": "macro.dbt_utils.databricks__get_table_types_sql", "package_name": "dbt_utils", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/get_table_types_sql.sql", "original_file_path": "macros/sql/get_table_types_sql.sql", "name": "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 %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1701215337.75227, "supported_languages": null}, "macro.dbt_utils.get_single_value": {"unique_id": "macro.dbt_utils.get_single_value", "package_name": "dbt_utils", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/get_single_value.sql", "original_file_path": "macros/sql/get_single_value.sql", "name": "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 %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__get_single_value"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1701215337.752807, "supported_languages": null}, "macro.dbt_utils.default__get_single_value": {"unique_id": "macro.dbt_utils.default__get_single_value", "package_name": "dbt_utils", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/get_single_value.sql", "original_file_path": "macros/sql/get_single_value.sql", "name": "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 %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1701215337.75359, "supported_languages": null}, "macro.dbt_utils.degrees_to_radians": {"unique_id": "macro.dbt_utils.degrees_to_radians", "package_name": "dbt_utils", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/haversine_distance.sql", "original_file_path": "macros/sql/haversine_distance.sql", "name": "degrees_to_radians", "macro_sql": "{% macro degrees_to_radians(degrees) -%}\n acos(-1) * {{degrees}} / 180\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1701215337.7546098, "supported_languages": null}, "macro.dbt_utils.haversine_distance": {"unique_id": "macro.dbt_utils.haversine_distance", "package_name": "dbt_utils", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/haversine_distance.sql", "original_file_path": "macros/sql/haversine_distance.sql", "name": "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 %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.default__haversine_distance"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1701215337.754879, "supported_languages": null}, "macro.dbt_utils.default__haversine_distance": {"unique_id": "macro.dbt_utils.default__haversine_distance", "package_name": "dbt_utils", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/haversine_distance.sql", "original_file_path": "macros/sql/haversine_distance.sql", "name": "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 %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1701215337.755757, "supported_languages": null}, "macro.dbt_utils.bigquery__haversine_distance": {"unique_id": "macro.dbt_utils.bigquery__haversine_distance", "package_name": "dbt_utils", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/dbt_utils", "path": "macros/sql/haversine_distance.sql", "original_file_path": "macros/sql/haversine_distance.sql", "name": "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 %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt_utils.degrees_to_radians"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1701215337.756525, "supported_languages": null}, "macro.the_tuva_project.eligibility_missing_column_check": {"unique_id": "macro.the_tuva_project.eligibility_missing_column_check", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/the_tuva_project", "path": "macros/eligibility_missing_column_check.sql", "original_file_path": "macros/eligibility_missing_column_check.sql", "name": "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 %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1701215337.75698, "supported_languages": null}, "macro.the_tuva_project.header_duplicate_check": {"unique_id": "macro.the_tuva_project.header_duplicate_check", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/the_tuva_project", "path": "macros/header_duplicate_check.sql", "original_file_path": "macros/header_duplicate_check.sql", "name": "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 %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1701215337.7575161, "supported_languages": null}, "macro.the_tuva_project.pharmacy_claim_missing_column_check": {"unique_id": "macro.the_tuva_project.pharmacy_claim_missing_column_check", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/the_tuva_project", "path": "macros/pharmacy_claim_missing_column_check.sql", "original_file_path": "macros/pharmacy_claim_missing_column_check.sql", "name": "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 %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1701215337.757944, "supported_languages": null}, "macro.the_tuva_project.try_to_cast_date": {"unique_id": "macro.the_tuva_project.try_to_cast_date", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/the_tuva_project", "path": "macros/try_to_cast_date.sql", "original_file_path": "macros/try_to_cast_date.sql", "name": "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", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.input_layer.snowflake__try_to_cast_date"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1701215337.759854, "supported_languages": null}, "macro.the_tuva_project.bigquery__try_to_cast_date": {"unique_id": "macro.the_tuva_project.bigquery__try_to_cast_date", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/the_tuva_project", "path": "macros/try_to_cast_date.sql", "original_file_path": "macros/try_to_cast_date.sql", "name": "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", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1701215337.760055, "supported_languages": null}, "macro.the_tuva_project.default__try_to_cast_date": {"unique_id": "macro.the_tuva_project.default__try_to_cast_date", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/the_tuva_project", "path": "macros/try_to_cast_date.sql", "original_file_path": "macros/try_to_cast_date.sql", "name": "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", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1701215337.760164, "supported_languages": null}, "macro.the_tuva_project.postgres__try_to_cast_date": {"unique_id": "macro.the_tuva_project.postgres__try_to_cast_date", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/the_tuva_project", "path": "macros/try_to_cast_date.sql", "original_file_path": "macros/try_to_cast_date.sql", "name": "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", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1701215337.760614, "supported_languages": null}, "macro.the_tuva_project.redshift__try_to_cast_date": {"unique_id": "macro.the_tuva_project.redshift__try_to_cast_date", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/the_tuva_project", "path": "macros/try_to_cast_date.sql", "original_file_path": "macros/try_to_cast_date.sql", "name": "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", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1701215337.761076, "supported_languages": null}, "macro.the_tuva_project.snowflake__try_to_cast_date": {"unique_id": "macro.the_tuva_project.snowflake__try_to_cast_date", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/the_tuva_project", "path": "macros/try_to_cast_date.sql", "original_file_path": "macros/try_to_cast_date.sql", "name": "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 -%}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1701215337.761185, "supported_languages": null}, "macro.the_tuva_project.load_seed": {"unique_id": "macro.the_tuva_project.load_seed", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/the_tuva_project", "path": "macros/load_seed.sql", "original_file_path": "macros/load_seed.sql", "name": "load_seed", "macro_sql": "{% macro load_seed(uri,pattern,compression=false,headers=false,null_marker=false) %}\n{{ return(adapter.dispatch('load_seed', 'the_tuva_project')(uri,pattern,compression,headers,null_marker)) }}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.the_tuva_project.snowflake__load_seed"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1701215337.7634702, "supported_languages": null}, "macro.the_tuva_project.duckdb__load_seed": {"unique_id": "macro.the_tuva_project.duckdb__load_seed", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/the_tuva_project", "path": "macros/load_seed.sql", "original_file_path": "macros/load_seed.sql", "name": "duckdb__load_seed", "macro_sql": "{% macro duckdb__load_seed(uri,pattern,compression,headers,null_marker) %}\n{%- set columns = adapter.get_columns_in_relation(this) -%}\n{%- set collist = [] -%}\n\n{% for col in columns %}\n {% do collist.append(\"'\" ~col.name~\"'\" ~ \": \" ~ \"'\"~col.dtype~\"'\") %}\n{% endfor %}\n\n{%- set cols = collist|join(',') -%}\n{# { log( cols,true) } #}\n\n{% set sql %}\n set s3_access_key_id='AKIA2EPVNTV4FLAEBFGE';\n set s3_secret_access_key='TARgblERrFP81Op+52KZW7HrP1Om6ObEDQAUVN2u';\n set s3_region='us-east-1';\n create or replace table {{this}} as\n select\n *\n from\n read_csv('s3://{{ uri }}/{{ pattern }}*',\n {% if null_marker == true %} nullstr = '\\N' {% else %} nullstr = '' {% endif %},\n header=true,\n columns= { {{ cols }} } )\n\n{% endset %}\n\n{% call statement('ducksql',fetch_result=true) %}\n{{ sql }}\n{% endcall %}\n\n{% if execute %}\n{# debugging { log(sql, True)} #}\n{% set results = load_result('ducksql') %}\n{{ log(\"Loaded data from external s3 resource\\n loaded to: \" ~ this ~ \"\\n from: s3://\" ~ uri ,True) }}\n{# debugging { log(results, True) } #}\n{% endif %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1701215337.764489, "supported_languages": null}, "macro.the_tuva_project.redshift__load_seed": {"unique_id": "macro.the_tuva_project.redshift__load_seed", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/the_tuva_project", "path": "macros/load_seed.sql", "original_file_path": "macros/load_seed.sql", "name": "redshift__load_seed", "macro_sql": "{% macro redshift__load_seed(uri,pattern,compression,headers,null_marker) %}\n{% set sql %}\ncopy {{ this }}\n from 's3://{{ uri }}/{{ pattern }}'\n access_key_id 'AKIA2EPVNTV4FLAEBFGE'\n secret_access_key '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'\n csv\n {% if compression == true %} gzip {% else %} {% endif %}\n {% if headers == true %} ignoreheader 1 {% else %} {% endif %}\n emptyasnull\n region 'us-east-1'\n\n{% endset %}\n\n{% call statement('redsql',fetch_result=true) %}\n{{ sql }}\n{% endcall %}\n\n{% if execute %}\n{# debugging { log(sql, True)} #}\n{% set results = load_result('redsql') %}\n{{ log(\"Loaded data from external s3 resource\\n loaded to: \" ~ this ~ \"\\n from: s3://\" ~ uri ,True) }}\n{# debugging { log(results, True) } #}\n{% endif %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1701215337.765159, "supported_languages": null}, "macro.the_tuva_project.snowflake__load_seed": {"unique_id": "macro.the_tuva_project.snowflake__load_seed", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/the_tuva_project", "path": "macros/load_seed.sql", "original_file_path": "macros/load_seed.sql", "name": "snowflake__load_seed", "macro_sql": "{% macro snowflake__load_seed(uri,pattern,compression,headers,null_marker) %}\n{% set sql %} \ncopy into {{ this }}\n from s3://{{ uri }}\n file_format = (type = CSV\n {% if compression == true %} compression = 'GZIP' {% else %} compression = 'none' {% endif %}\n {% if headers == true %} skip_header = 1 {% else %} {% endif %}\n empty_field_as_null = true\n field_optionally_enclosed_by = '\"'\n)\npattern = '.*\\/{{pattern}}.*';\n{% endset %}\n{% call statement('snowsql',fetch_result=true) %}\n{{ sql }}\n{% endcall %}\n\n{% if execute %}\n{# debugging { log(sql, True)} #}\n{% set results = load_result('snowsql') %}\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) }}\n{# debugging { log(results, True)} #}\n{% endif %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1701215337.7659142, "supported_languages": null}, "macro.the_tuva_project.bigquery__load_seed": {"unique_id": "macro.the_tuva_project.bigquery__load_seed", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/the_tuva_project", "path": "macros/load_seed.sql", "original_file_path": "macros/load_seed.sql", "name": "bigquery__load_seed", "macro_sql": "{% macro bigquery__load_seed(uri,pattern,compression,headers,null_marker) %}\n{%- set columns = adapter.get_columns_in_relation(this) -%}\n{%- set collist = [] -%}\n\n{% for col in columns %}\n {% do collist.append(col.name ~ \" \" ~ col.dtype) %}\n{% endfor %}\n\n{%- set cols = collist|join(',') -%}\n{# { log( cols,true) } #}\n{% set sql %}\nload data into {{ this }} ( {{collist|join(',')}} )\nfrom files (format = 'csv',\n uris = ['gs://{{ uri }}/{{ pattern }}*'],\n {% if compression == true %} compression = 'GZIP', {% else %} {% endif %}\n {% if headers == true %} skip_leading_rows = 1, {% else %} {% endif %}\n {% if null_marker == true %} null_marker = '\\\\N', {% else %} {% endif %}\n quote = '\"'\n )\n{% endset %}\n\n{% call statement('bigsql',fetch_result=true) %}\n{{ sql }}\n{% endcall %}\n\n{% if execute %}\n{# { log(sql, True) } #}\n{% set results = load_result('bigsql') %}\n{{ log(\"Loaded data from external gs resource\\n loaded to: \" ~ this ~ \"\\n from: gs://\" ~ uri ~ \"/\" ~ pattern ~ \"*\",True) }}\n{# log(results, True) #}\n{% endif %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1701215337.767008, "supported_languages": null}, "macro.the_tuva_project.databricks__load_seed": {"unique_id": "macro.the_tuva_project.databricks__load_seed", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/the_tuva_project", "path": "macros/load_seed.sql", "original_file_path": "macros/load_seed.sql", "name": "databricks__load_seed", "macro_sql": "{% macro databricks__load_seed(uri,pattern,compression,headers,null_marker) %}\n{% if execute %}\n\n{%- set s3_path = 's3://' ~ uri ~ '/' -%}\n{%- set columns = adapter.get_columns_in_relation(this) -%}\n{%- set collist = [] -%}\n\n{% for col in columns %}\n {% do collist.append(\"_c\" ~ loop.index0 ~ \"::\" ~ col.dtype ~ \" AS \" ~ col.name ) %}\n{% endfor %}\n\n{%- set cols = collist|join(',\\n ') -%}\n\n{% set sql %}\nCOPY INTO {{ this }}\nFROM (\n SELECT\n {{ cols }}\n\n FROM '{{ s3_path }}'\n {% if env_var('AWS_SESSION_TOKEN', False) %}\n WITH (\n CREDENTIAL (\n AWS_ACCESS_KEY = \"{{ env_var('AWS_ACCESS_KEY') }}\",\n AWS_SECRET_KEY = \"{{ env_var('AWS_SECRET_KEY') }}\",\n AWS_SESSION_TOKEN = \"{{ env_var('AWS_SESSION_TOKEN') }}\"\n )\n )\n {% endif %}\n)\nFILEFORMAT = CSV\nPATTERN = '{{ pattern }}*'\nFORMAT_OPTIONS (\n {% if headers == true %} 'skipRows' = '1', {% else %} 'skipRows' = '0', {% endif %}\n {% if null_marker == true %} 'nullValue' = '\\\\N', {% else %} {% endif %}\n 'enforceSchema' = 'true',\n 'inferSchema' = 'false',\n 'sep' = ','\n)\nCOPY_OPTIONS (\n 'mergeSchema' = 'false',\n 'force' = 'true'\n)\n{% endset %}\n\n{# check logs/dbt.log for output #}\n{{ log(cols, info=False) }}\n{{ log('Current model: ' ~ this ~ '\\n', info=False) }}\n{{ log('Full s3 path: ' ~ s3_path ~ '\\n', info=False) }}\n{{ log(sql, info=False) }}\n\n{% call statement('databrickssql',fetch_result=true) %}\n{{ sql }}\n{% endcall %}\n\n{% set results = load_result('databrickssql') %}\n{% set rows_affected = results['data'][0][0] %}\n\n{{ log(results, info=False) }}\n{{ log(rows_affected, info=False) }}\n\n{{ log(\"Loaded data from external s3 resource:\", True) }}\n{{ log(\" source: \\t\" ~ s3_path ~ pattern, True) }}\n{{ log(\" target: \\t\" ~ this | replace('`',''), True) }}\n{{ log(\" rows: \\t\\033[92m\" ~ rows_affected ~ \"\\033[0m\", True) }}\n\n{% endif %}\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1701215337.768984, "supported_languages": null}, "macro.the_tuva_project.default__load_seed": {"unique_id": "macro.the_tuva_project.default__load_seed", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/the_tuva_project", "path": "macros/load_seed.sql", "original_file_path": "macros/load_seed.sql", "name": "default__load_seed", "macro_sql": "{% macro default__load_seed(uri,pattern,compression,headers,null_marker) %}\n{% if execute %}\n{% do log('No adapter found, seed not loaded',info = True) %}\n{% endif %}\n\n{% endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1701215337.769223, "supported_languages": null}, "macro.the_tuva_project.medical_claim_missing_column_check": {"unique_id": "macro.the_tuva_project.medical_claim_missing_column_check", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/the_tuva_project", "path": "macros/medical_claim_missing_column_check.sql", "original_file_path": "macros/medical_claim_missing_column_check.sql", "name": "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 %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1701215337.769724, "supported_languages": null}, "macro.the_tuva_project.date_part": {"unique_id": "macro.the_tuva_project.date_part", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/the_tuva_project", "path": "macros/date_part.sql", "original_file_path": "macros/date_part.sql", "name": "date_part", "macro_sql": "{% macro date_part(datepart, date) -%}\r\n {{ adapter.dispatch('date_part') (datepart, date) }}\r\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": ["macro.the_tuva_project.default__date_part"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1701215337.770068, "supported_languages": null}, "macro.the_tuva_project.default__date_part": {"unique_id": "macro.the_tuva_project.default__date_part", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/the_tuva_project", "path": "macros/date_part.sql", "original_file_path": "macros/date_part.sql", "name": "default__date_part", "macro_sql": "{% macro default__date_part(datepart, date) -%}\r\n date_part('{{ datepart }}', {{ date }})\r\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1701215337.770196, "supported_languages": null}, "macro.the_tuva_project.bigquery__date_part": {"unique_id": "macro.the_tuva_project.bigquery__date_part", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/the_tuva_project", "path": "macros/date_part.sql", "original_file_path": "macros/date_part.sql", "name": "bigquery__date_part", "macro_sql": "{% macro bigquery__date_part(datepart, date) -%}\r\n extract({{ datepart }} from {{ date }})\r\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1701215337.770319, "supported_languages": null}, "macro.the_tuva_project.default__generate_schema_name": {"unique_id": "macro.the_tuva_project.default__generate_schema_name", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/the_tuva_project", "path": "macros/generate_schema_name.sql", "original_file_path": "macros/generate_schema_name.sql", "name": "default__generate_schema_name", "macro_sql": "{% macro default__generate_schema_name(custom_schema_name, node) -%}\n {%- set default_schema = target.schema -%}\n {%- if custom_schema_name is not none -%}\n {{ custom_schema_name | trim }}\n {%- else -%}\n {{ default_schema }}\n {%- endif -%}\n{%- endmacro %}", "resource_type": "macro", "tags": [], "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1701215337.770723, "supported_languages": null}}, "docs": {"input_layer.__overview__": {"unique_id": "input_layer.__overview__", "package_name": "input_layer", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/docs_generate", "path": "overview.md", "original_file_path": "docs/overview.md", "name": "__overview__", "block_contents": "# \ud83e\uddf0\u00a0What is The Tuva Project?\n\nHealthcare data is difficult to analyze - we're working to change that. The Tuva Project is an open source knowledge base, code base, and community for healthcare data people.\n\n### \ud83d\udd6e\u00a0[Knowledge](https://thetuvaproject.com/)\nWe're writing the open book on how to transform and analyze healthcare data.\n\n### \ud83d\udda5\ufe0f\u00a0[Code](https://github.com/tuva-health)\nWe're translating knowledge into precise code that anyone can run on their healthcare data.\n\n### \ud83e\udd1d\u00a0[Community](https://join.slack.com/t/thetuvaproject/shared_invite/zt-16iz61187-G522Mc2WGA2mHF57e0il0Q)\nWe're building a community we're healthcare data people can ask questions and share knowledge about healthcare data."}, "dbt.__overview__": {"unique_id": "dbt.__overview__", "package_name": "dbt", "root_path": "/opt/homebrew/lib/python3.9/site-packages/dbt/include/global_project", "path": "overview.md", "original_file_path": "docs/overview.md", "name": "__overview__", "block_contents": "### Welcome!\n\nWelcome to the auto-generated documentation for your dbt project!\n\n### Navigation\n\nYou can use the `Project` and `Database` navigation tabs on the left side of the window to explore the models\nin your project.\n\n#### Project Tab\nThe `Project` tab mirrors the directory structure of your dbt project. In this tab, you can see all of the\nmodels defined in your dbt project, as well as models imported from dbt packages.\n\n#### Database Tab\nThe `Database` tab also exposes your models, but in a format that looks more like a database explorer. This view\nshows relations (tables and views) grouped into database schemas. Note that ephemeral models are _not_ shown\nin this interface, as they do not exist in the database.\n\n### Graph Exploration\nYou can click the blue icon on the bottom-right corner of the page to view the lineage graph of your models.\n\nOn model pages, you'll see the immediate parents and children of the model you're exploring. By clicking the `Expand`\nbutton at the top-right of this lineage pane, you'll be able to see all of the models that are used to build,\nor are built from, the model you're exploring.\n\nOnce expanded, you'll be able to use the `--select` and `--exclude` model selection syntax to filter the\nmodels in the graph. For more information on model selection, check out the [dbt docs](https://docs.getdbt.com/docs/model-selection-syntax).\n\nNote that you can also right-click on models to interactively filter and explore the graph.\n\n---\n\n### More information\n\n- [What is dbt](https://docs.getdbt.com/docs/introduction)?\n- Read the [dbt viewpoint](https://docs.getdbt.com/docs/viewpoint)\n- [Installation](https://docs.getdbt.com/docs/installation)\n- Join the [dbt Community](https://www.getdbt.com/community/) for questions and discussion"}}, "exposures": {}, "metrics": {}, "selectors": {}, "disabled": {"snapshot.the_tuva_project.cms_hcc__patient_risk_scores_snapshot": [{"resource_type": "snapshot", "depends_on": {"macros": [], "nodes": []}, "config": {"enabled": false, "alias": "patient_risk_scores_snapshot", "schema": null, "database": null, "tags": ["cms_hcc"], "meta": {}, "materialized": "snapshot", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": "patient_id||model_version||payment_year||tuva_last_run", "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "strategy": "timestamp", "target_schema": "cms_hcc", "target_database": null, "updated_at": "tuva_last_run", "check_cols": null, "post-hook": [], "pre-hook": []}, "database": "dev_sarah", "schema": "cms_hcc", "fqn": ["the_tuva_project", "cms_hcc", "cms_hcc__patient_risk_scores_snapshot", "cms_hcc__patient_risk_scores_snapshot"], "unique_id": "snapshot.the_tuva_project.cms_hcc__patient_risk_scores_snapshot", "raw_code": "\n\n{% set schema_var %}\n{%- if var('tuva_schema_prefix',None) != None -%}{{var('tuva_schema_prefix')}}_cms_hcc{% else %}cms_hcc{%- endif -%}\n{% endset %}\n\n{{\n config({\n \"target_schema\": schema_var\n , \"alias\": \"patient_risk_scores_snapshot\"\n , \"tags\": \"cms_hcc\"\n , \"strategy\": \"timestamp\"\n , \"updated_at\": \"tuva_last_run\"\n , \"unique_key\": \"patient_id||model_version||payment_year||tuva_last_run\"\n , \"enabled\": var('snapshots_enabled',False) == true and var('cms_hcc_enabled',var('claims_enabled',var('tuva_marts_enabled',False))) == true | as_bool\n })\n}}\n\nselect * from {{ ref('cms_hcc__patient_risk_scores') }}\n\n", "language": "sql", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/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", "name": "cms_hcc__patient_risk_scores_snapshot", "alias": "patient_risk_scores_snapshot", "checksum": {"name": "sha256", "checksum": "bd885b6e0ef9a428477c59c805e2f8e6c7633021acafc2f690436cb1317aa9f5"}, "tags": ["cms_hcc"], "refs": [["cms_hcc__patient_risk_scores"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_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": false}, "created_at": 1701215339.323158, "config_call_dict": {"target_schema": "cms_hcc", "alias": "patient_risk_scores_snapshot", "tags": ["cms_hcc"], "strategy": "timestamp", "updated_at": "tuva_last_run", "unique_key": "patient_id||model_version||payment_year||tuva_last_run", "enabled": false}}], "snapshot.the_tuva_project.cms_hcc__patient_risk_factors_snapshot": [{"resource_type": "snapshot", "depends_on": {"macros": [], "nodes": []}, "config": {"enabled": false, "alias": "patient_risk_factors_snapshot", "schema": null, "database": null, "tags": ["cms_hcc"], "meta": {}, "materialized": "snapshot", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": "patient_id||model_version||payment_year||tuva_last_run", "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "strategy": "timestamp", "target_schema": "cms_hcc", "target_database": null, "updated_at": "tuva_last_run", "check_cols": null, "post-hook": [], "pre-hook": []}, "database": "dev_sarah", "schema": "cms_hcc", "fqn": ["the_tuva_project", "cms_hcc", "cms_hcc__patient_risk_factors_snapshot", "cms_hcc__patient_risk_factors_snapshot"], "unique_id": "snapshot.the_tuva_project.cms_hcc__patient_risk_factors_snapshot", "raw_code": "\n\n{% set schema_var %}\n{%- if var('tuva_schema_prefix',None) != None -%}{{var('tuva_schema_prefix')}}_cms_hcc{% else %}cms_hcc{%- endif -%}\n{% endset %}\n\n{{\n config({\n \"target_schema\": schema_var\n , \"alias\": \"patient_risk_factors_snapshot\"\n , \"tags\": \"cms_hcc\"\n , \"strategy\": \"timestamp\"\n , \"updated_at\": \"tuva_last_run\"\n , \"unique_key\": \"patient_id||model_version||payment_year||tuva_last_run\"\n , \"enabled\": var('snapshots_enabled',False) == true and var('cms_hcc_enabled',var('claims_enabled',var('tuva_marts_enabled',False))) == true | as_bool\n })\n}}\n\nselect * from {{ ref('cms_hcc__patient_risk_factors') }}\n\n", "language": "sql", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/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", "name": "cms_hcc__patient_risk_factors_snapshot", "alias": "patient_risk_factors_snapshot", "checksum": {"name": "sha256", "checksum": "a70be9d54e7002d8c58e34ad19d6e3fd8ed685e4a555886ce6ce53163e959f3f"}, "tags": ["cms_hcc"], "refs": [["cms_hcc__patient_risk_factors"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"target_schema": "cms_hcc", "alias": "patient_risk_factors_snapshot", "tags": ["cms_hcc"], "strategy": "timestamp", "updated_at": "tuva_last_run", "unique_key": "patient_id||model_version||payment_year||tuva_last_run", "enabled": false}, "created_at": 1701215339.3288808, "config_call_dict": {"target_schema": "cms_hcc", "alias": "patient_risk_factors_snapshot", "tags": ["cms_hcc"], "strategy": "timestamp", "updated_at": "tuva_last_run", "unique_key": "patient_id||model_version||payment_year||tuva_last_run", "enabled": false}}], "snapshot.the_tuva_project.quality_measures__summary_long_snapshot": [{"resource_type": "snapshot", "depends_on": {"macros": [], "nodes": []}, "config": {"enabled": false, "alias": "summary_long_snapshot", "schema": null, "database": null, "tags": ["quality_measures"], "meta": {}, "materialized": "snapshot", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": "patient_id||denominator_flag||numerator_flag||exclusion_flag||evidence_date||exclusion_date||exclusion_reason||performance_period_begin||performance_period_end||measure_id||measure_name||measure_version||tuva_last_run", "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "strategy": "timestamp", "target_schema": "quality_measures", "target_database": null, "updated_at": "tuva_last_run", "check_cols": null, "post-hook": [], "pre-hook": []}, "database": "dev_sarah", "schema": "quality_measures", "fqn": ["the_tuva_project", "quality_measures", "quality_measures__summary_long_snapshot", "quality_measures__summary_long_snapshot"], "unique_id": "snapshot.the_tuva_project.quality_measures__summary_long_snapshot", "raw_code": "\n\n{% set schema_var %}\n{%- if var('tuva_schema_prefix',None) != None -%}{{var('tuva_schema_prefix')}}_quality_measures{% else %}quality_measures{%- endif -%}\n{% endset %}\n\n{{\n config({\n \"target_schema\": schema_var\n , \"alias\": \"summary_long_snapshot\"\n , \"tags\": \"quality_measures\"\n , \"strategy\": \"timestamp\"\n , \"updated_at\": \"tuva_last_run\"\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\"\n , \"enabled\": var('snapshots_enabled',False) == true and var('quality_measures_enabled',var('claims_enabled',var('clinical_enabled',var('tuva_marts_enabled',False)))) == true | as_bool\n })\n}}\n\nselect * from {{ ref('quality_measures__summary_long') }}\n\n", "language": "sql", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/the_tuva_project", "path": "quality_measures/quality_measures__summary_long_snapshot.sql", "original_file_path": "snapshots/quality_measures/quality_measures__summary_long_snapshot.sql", "name": "quality_measures__summary_long_snapshot", "alias": "summary_long_snapshot", "checksum": {"name": "sha256", "checksum": "508100013ad380223276c6d6452bacdfc8e465acbc98483518f15a99fa0200ee"}, "tags": ["quality_measures"], "refs": [["quality_measures__summary_long"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"target_schema": "quality_measures", "alias": "summary_long_snapshot", "tags": ["quality_measures"], "strategy": "timestamp", "updated_at": "tuva_last_run", "unique_key": "patient_id||denominator_flag||numerator_flag||exclusion_flag||evidence_date||exclusion_date||exclusion_reason||performance_period_begin||performance_period_end||measure_id||measure_name||measure_version||tuva_last_run", "enabled": false}, "created_at": 1701215339.3331141, "config_call_dict": {"target_schema": "quality_measures", "alias": "summary_long_snapshot", "tags": ["quality_measures"], "strategy": "timestamp", "updated_at": "tuva_last_run", "unique_key": "patient_id||denominator_flag||numerator_flag||exclusion_flag||evidence_date||exclusion_date||exclusion_reason||performance_period_begin||performance_period_end||measure_id||measure_name||measure_version||tuva_last_run", "enabled": false}}], "snapshot.the_tuva_project.quality_measures__summary_counts_snapshot": [{"resource_type": "snapshot", "depends_on": {"macros": [], "nodes": []}, "config": {"enabled": false, "alias": "summary_counts_snapshot", "schema": null, "database": null, "tags": ["quality_measures"], "meta": {}, "materialized": "snapshot", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": "measure_id||measure_name||measure_version||performance_period_begin||performance_period_end||tuva_last_run", "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "strategy": "timestamp", "target_schema": "quality_measures", "target_database": null, "updated_at": "tuva_last_run", "check_cols": null, "post-hook": [], "pre-hook": []}, "database": "dev_sarah", "schema": "quality_measures", "fqn": ["the_tuva_project", "quality_measures", "quality_measures__summary_counts_snapshot", "quality_measures__summary_counts_snapshot"], "unique_id": "snapshot.the_tuva_project.quality_measures__summary_counts_snapshot", "raw_code": "\n\n{% set schema_var %}\n{%- if var('tuva_schema_prefix',None) != None -%}{{var('tuva_schema_prefix')}}_quality_measures{% else %}quality_measures{%- endif -%}\n{% endset %}\n\n{{\n config({\n \"target_schema\": schema_var\n , \"alias\": \"summary_counts_snapshot\"\n , \"tags\": \"quality_measures\"\n , \"strategy\": \"timestamp\"\n , \"updated_at\": \"tuva_last_run\"\n , \"unique_key\": \"measure_id||measure_name||measure_version||performance_period_begin||performance_period_end||tuva_last_run\"\n , \"enabled\": var('snapshots_enabled',False) == true and var('quality_measures_enabled',var('claims_enabled',var('clinical_enabled',var('tuva_marts_enabled',False)))) == true | as_bool\n })\n}}\n\nselect * from {{ ref('quality_measures__summary_counts') }}\n\n", "language": "sql", "package_name": "the_tuva_project", "root_path": "/Users/sarah/tuva-repos/the_tuva_project/integration_tests/dbt_packages/the_tuva_project", "path": "quality_measures/quality_measures__summary_counts_snapshot.sql", "original_file_path": "snapshots/quality_measures/quality_measures__summary_counts_snapshot.sql", "name": "quality_measures__summary_counts_snapshot", "alias": "summary_counts_snapshot", "checksum": {"name": "sha256", "checksum": "348565060acc2b018b5f81bca5b1994b9af39929bc7a448eb6eb029db5a6b2f1"}, "tags": ["quality_measures"], "refs": [["quality_measures__summary_counts"]], "sources": [], "metrics": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "compiled_path": null, "build_path": null, "deferred": false, "unrendered_config": {"target_schema": "quality_measures", "alias": "summary_counts_snapshot", "tags": ["quality_measures"], "strategy": "timestamp", "updated_at": "tuva_last_run", "unique_key": "measure_id||measure_name||measure_version||performance_period_begin||performance_period_end||tuva_last_run", "enabled": false}, "created_at": 1701215339.33747, "config_call_dict": {"target_schema": "quality_measures", "alias": "summary_counts_snapshot", "tags": ["quality_measures"], "strategy": "timestamp", "updated_at": "tuva_last_run", "unique_key": "measure_id||measure_name||measure_version||performance_period_begin||performance_period_end||tuva_last_run", "enabled": false}}]}, "parent_map": {"model.input_layer.procedure": [], "model.input_layer.practitioner": [], "model.input_layer.encounter": [], "model.input_layer.eligibility": ["seed.input_layer.eligibility_seed"], "model.input_layer.medical_claim": ["seed.input_layer.medical_claim_seed"], "model.input_layer.pharmacy_claim": ["seed.input_layer.pharmacy_claim_seed"], "model.input_layer.location": [], "model.input_layer.patient": [], "model.input_layer.condition": [], "model.input_layer.medication": [], "model.input_layer.lab_result": [], "seed.input_layer.eligibility_seed": [], "seed.input_layer.medical_claim_seed": [], "seed.input_layer.pharmacy_claim_seed": [], "model.the_tuva_project.insights__count_claim_by_claim_type": ["model.the_tuva_project.core__medical_claim", "model.the_tuva_project.core__pharmacy_claim"], "model.the_tuva_project.insights__count_claim_by_service_category": ["model.the_tuva_project.core__medical_claim", "model.the_tuva_project.core__medical_claim"], "model.the_tuva_project.insights__trend_count_claim_by_claim_type": ["model.the_tuva_project.core__medical_claim"], "model.the_tuva_project.insights__trend_sum_amount_by_claim_type": ["model.the_tuva_project.core__medical_claim", "model.the_tuva_project.core__pharmacy_claim"], "model.the_tuva_project.insights__orphan_claim_by_claim_type": ["model.the_tuva_project.core__medical_claim", "model.the_tuva_project.core__pharmacy_claim", "model.the_tuva_project.financial_pmpm__member_months", "model.the_tuva_project.financial_pmpm__member_months"], "model.the_tuva_project.insights__count_claim_by_date_column": ["model.the_tuva_project.core__medical_claim", "model.the_tuva_project.core__medical_claim", "model.the_tuva_project.core__medical_claim", "model.the_tuva_project.core__medical_claim", "model.the_tuva_project.core__medical_claim", "model.the_tuva_project.core__pharmacy_claim", "model.the_tuva_project.core__pharmacy_claim", "model.the_tuva_project.financial_pmpm__member_months", "seed.the_tuva_project.terminology__calendar"], "model.the_tuva_project.insights__trend_sum_amount_by_service_category": ["model.the_tuva_project.core__medical_claim", "model.the_tuva_project.core__medical_claim"], "model.the_tuva_project.insights__sum_amount_by_claim_type": ["model.the_tuva_project.core__medical_claim", "model.the_tuva_project.core__pharmacy_claim"], "model.the_tuva_project.insights__sum_amount_by_service_category": ["model.the_tuva_project.core__medical_claim", "model.the_tuva_project.core__medical_claim"], "model.the_tuva_project.insights__trend_count_claim_by_service_category": ["model.the_tuva_project.core__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.ed_classification__stg_encounter": ["model.the_tuva_project.core__encounter"], "model.the_tuva_project.ed_classification__summary": ["model.the_tuva_project.ccsr__long_condition_category", "model.the_tuva_project.ed_classification__int_filter_encounter_with_classification", "model.the_tuva_project.ed_classification__stg_patient", "seed.the_tuva_project.ed_classification__categories", "seed.the_tuva_project.terminology__provider"], "model.the_tuva_project.ed_classification__int_filter_encounter_with_classification": ["model.the_tuva_project.ed_classification__int_map_primary_dx"], "model.the_tuva_project.ed_classification__int_map_primary_dx": ["model.the_tuva_project.ed_classification__stg_encounter", "seed.the_tuva_project.ed_classification__johnston_icd10", "seed.the_tuva_project.ed_classification__johnston_icd9"], "model.the_tuva_project.readmissions__stg_core__medical_claim": ["model.the_tuva_project.core__medical_claim"], "model.the_tuva_project.readmissions__stg_core__condition": ["model.the_tuva_project.core__condition"], "model.the_tuva_project.readmissions__stg_core__encounter": ["model.the_tuva_project.core__encounter"], "model.the_tuva_project.readmissions__stg_core__procedure": ["model.the_tuva_project.core__procedure"], "model.the_tuva_project.readmissions__encounter_augmented": ["model.the_tuva_project.readmissions__encounter", "model.the_tuva_project.readmissions__encounter_data_quality", "model.the_tuva_project.readmissions__encounter_specialty_cohort", "model.the_tuva_project.readmissions__index_admission", "model.the_tuva_project.readmissions__planned_encounter"], "model.the_tuva_project.readmissions__readmission_summary": ["model.the_tuva_project.readmissions__encounter_augmented"], "model.the_tuva_project.readmissions__encounter_overlap": ["model.the_tuva_project.readmissions__encounter"], "model.the_tuva_project.readmissions__encounter_specialty_cohort": ["model.the_tuva_project.readmissions__encounter", "model.the_tuva_project.readmissions__encounter_with_ccs", "model.the_tuva_project.readmissions__procedure_ccs", "seed.the_tuva_project.readmissions__specialty_cohort", "seed.the_tuva_project.readmissions__specialty_cohort", "seed.the_tuva_project.readmissions__surgery_gynecology_cohort"], "model.the_tuva_project.readmissions__encounter_data_quality": ["model.the_tuva_project.readmissions__encounter_overlap", "model.the_tuva_project.readmissions__encounter_overlap", "model.the_tuva_project.readmissions__encounter_with_ccs", "seed.the_tuva_project.terminology__discharge_disposition", "seed.the_tuva_project.terminology__ms_drg"], "model.the_tuva_project.readmissions__exclusion": ["model.the_tuva_project.readmissions__encounter_with_ccs", "seed.the_tuva_project.readmissions__exclusion_ccs_diagnosis_category"], "model.the_tuva_project.readmissions__index_admission": ["model.the_tuva_project.readmissions__encounter", "model.the_tuva_project.readmissions__exclusion", "model.the_tuva_project.readmissions__index_discharge_requirement", "model.the_tuva_project.readmissions__index_time_requirement"], "model.the_tuva_project.readmissions__index_time_requirement": ["model.the_tuva_project.readmissions__encounter", "model.the_tuva_project.readmissions__encounter"], "model.the_tuva_project.readmissions__planned_encounter": ["model.the_tuva_project.readmissions__encounter_with_ccs", "model.the_tuva_project.readmissions__encounter_with_ccs", "model.the_tuva_project.readmissions__procedure_ccs", "model.the_tuva_project.readmissions__procedure_ccs", "model.the_tuva_project.readmissions__procedure_ccs", "seed.the_tuva_project.readmissions__acute_diagnosis_ccs", "seed.the_tuva_project.readmissions__acute_diagnosis_icd_10_cm", "seed.the_tuva_project.readmissions__always_planned_ccs_diagnosis_category", "seed.the_tuva_project.readmissions__always_planned_ccs_procedure_category", "seed.the_tuva_project.readmissions__potentially_planned_ccs_procedure_category", "seed.the_tuva_project.readmissions__potentially_planned_icd_10_pcs"], "model.the_tuva_project.readmissions__encounter": ["model.the_tuva_project.readmissions__stg_core__encounter"], "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__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__encounter_with_ccs": ["model.the_tuva_project.readmissions__encounter", "seed.the_tuva_project.readmissions__icd_10_cm_to_ccs", "seed.the_tuva_project.terminology__icd_10_cm"], "model.the_tuva_project.readmissions__index_discharge_requirement": ["model.the_tuva_project.readmissions__encounter", "model.the_tuva_project.readmissions__encounter"], "model.the_tuva_project.cms_hcc__stg_core__condition": ["model.the_tuva_project.core__condition"], "model.the_tuva_project.cms_hcc__stg_core__patient": ["model.the_tuva_project.core__patient"], "model.the_tuva_project.cms_hcc__stg_core__medical_claim": ["model.the_tuva_project.core__medical_claim"], "model.the_tuva_project.cms_hcc__stg_core__eligibility": ["model.the_tuva_project.core__eligibility"], "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__patient_hcc_history": ["model.the_tuva_project.cms_hcc__int_all_conditions"], "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_eligible_conditions": ["model.the_tuva_project.cms_hcc__stg_core__condition", "model.the_tuva_project.cms_hcc__stg_core__medical_claim", "seed.the_tuva_project.cms_hcc__cpt_hcpcs"], "model.the_tuva_project.cms_hcc__int_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_all_conditions": ["model.the_tuva_project.cms_hcc__stg_core__condition", "seed.the_tuva_project.cms_hcc__disease_factors", "seed.the_tuva_project.cms_hcc__icd_10_cm_mappings", "seed.the_tuva_project.cms_hcc__icd_10_cm_mappings"], "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_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_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_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_members": ["model.the_tuva_project.cms_hcc__stg_core__eligibility", "model.the_tuva_project.cms_hcc__stg_core__patient"], "model.the_tuva_project.cms_hcc__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.emergency_department__summary": ["model.input_layer.eligibility", "model.input_layer.medical_claim", "model.input_layer.medical_claim", "model.the_tuva_project.emergency_department__int_encounter_id", "model.the_tuva_project.emergency_department__int_encounter_id", "model.the_tuva_project.emergency_department__int_encounter_id", "model.the_tuva_project.emergency_department__int_encounter_start_and_end_dates", "model.the_tuva_project.emergency_department__int_first_claim_values", "model.the_tuva_project.emergency_department__int_institutional_encounter_id", "model.the_tuva_project.emergency_department__int_last_claim_values", "seed.the_tuva_project.terminology__admit_source", "seed.the_tuva_project.terminology__admit_type", "seed.the_tuva_project.terminology__apr_drg", "seed.the_tuva_project.terminology__discharge_disposition", "seed.the_tuva_project.terminology__icd_10_cm", "seed.the_tuva_project.terminology__icd_9_cm", "seed.the_tuva_project.terminology__ms_drg", "seed.the_tuva_project.terminology__provider"], "model.the_tuva_project.emergency_department__int_encounter_id": ["model.input_layer.medical_claim", "model.the_tuva_project.emergency_department__int_institutional_encounter_id", "model.the_tuva_project.emergency_department__int_professional_encounter_id"], "model.the_tuva_project.emergency_department__int_first_claim_values": ["model.input_layer.medical_claim", "model.the_tuva_project.emergency_department__int_encounter_id"], "model.the_tuva_project.emergency_department__int_institutional_claims": ["model.input_layer.medical_claim", "model.the_tuva_project.service_category__service_category_grouper"], "model.the_tuva_project.emergency_department__int_encounter_start_and_end_dates": ["model.the_tuva_project.emergency_department__int_institutional_claims", "model.the_tuva_project.emergency_department__int_institutional_encounter_id"], "model.the_tuva_project.emergency_department__int_last_claim_values": ["model.input_layer.medical_claim", "model.the_tuva_project.emergency_department__int_encounter_id"], "model.the_tuva_project.emergency_department__int_professional_encounter_id": ["model.input_layer.medical_claim", "model.the_tuva_project.emergency_department__int_encounter_start_and_end_dates", "model.the_tuva_project.service_category__service_category_grouper"], "model.the_tuva_project.emergency_department__int_institutional_encounter_id": ["model.the_tuva_project.emergency_department__int_institutional_claims"], "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.input_layer.eligibility", "model.input_layer.medical_claim", "model.input_layer.medical_claim", "model.input_layer.medical_claim", "model.input_layer.medical_claim", "model.input_layer.medical_claim", "model.input_layer.pharmacy_claim", "model.input_layer.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__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__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__eligibility_plausibility": ["model.input_layer.eligibility", "model.input_layer.eligibility", "model.input_layer.eligibility", "model.input_layer.eligibility", "model.input_layer.eligibility"], "model.the_tuva_project.data_profiling__pharmacy_claim_duplicates": ["model.input_layer.pharmacy_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__institutional_header_failures": ["model.input_layer.medical_claim", "model.input_layer.medical_claim"], "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__claim_type_unmapped": ["model.input_layer.medical_claim"], "model.the_tuva_project.data_profiling__claim_type_mapping_failures": ["model.input_layer.medical_claim"], "model.the_tuva_project.data_profiling__eligibility_duplicates": ["model.input_layer.eligibility"], "model.the_tuva_project.data_profiling__medical_claim_invalid_values": ["model.input_layer.medical_claim", "model.input_layer.medical_claim", "model.input_layer.medical_claim", "model.input_layer.medical_claim", "model.input_layer.medical_claim", "model.input_layer.medical_claim", "model.input_layer.medical_claim", "model.input_layer.medical_claim", "model.input_layer.medical_claim", "model.input_layer.medical_claim", "model.input_layer.medical_claim", "model.input_layer.medical_claim", "model.input_layer.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_prof_missing_values": ["model.input_layer.medical_claim"], "model.the_tuva_project.data_profiling__medical_claim_denominators": ["model.input_layer.medical_claim", "model.input_layer.medical_claim", "model.input_layer.medical_claim", "model.input_layer.medical_claim", "model.input_layer.medical_claim", "model.input_layer.medical_claim", "model.input_layer.medical_claim", "model.input_layer.medical_claim", "model.input_layer.medical_claim", "model.input_layer.medical_claim", "model.input_layer.medical_claim", "model.input_layer.medical_claim", "model.input_layer.medical_claim", "model.input_layer.medical_claim", "model.input_layer.medical_claim"], "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__eligibility_missing_values": ["model.input_layer.eligibility"], "model.the_tuva_project.data_profiling__pharmacy_claim_missing_values": ["model.input_layer.pharmacy_claim"], "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__professional_header_fail_details": ["model.the_tuva_project.data_profiling__professional_header_failures"], "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__medical_claim_plausibility": ["model.input_layer.medical_claim", "model.input_layer.medical_claim"], "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__professional_header_failures": ["model.input_layer.medical_claim", "model.input_layer.medical_claim"], "model.the_tuva_project.data_profiling__eligibility_invalid_values": ["model.input_layer.eligibility", "model.input_layer.eligibility", "model.input_layer.eligibility", "model.input_layer.eligibility", "model.input_layer.eligibility", "model.input_layer.eligibility", "seed.the_tuva_project.terminology__gender", "seed.the_tuva_project.terminology__medicare_dual_eligibility", "seed.the_tuva_project.terminology__medicare_orec", "seed.the_tuva_project.terminology__medicare_status", "seed.the_tuva_project.terminology__payer_type", "seed.the_tuva_project.terminology__race"], "model.the_tuva_project.data_profiling__eligibility_denominators": ["model.input_layer.eligibility", "model.input_layer.eligibility", "model.input_layer.eligibility", "model.input_layer.eligibility", "model.input_layer.eligibility", "model.input_layer.eligibility", "model.input_layer.eligibility"], "model.the_tuva_project.data_profiling__medical_claim_inst_missing_values": ["model.input_layer.medical_claim"], "model.the_tuva_project.data_profiling__medical_claim_duplicates": ["model.input_layer.medical_claim"], "model.the_tuva_project.data_profiling__test_result_stage_pharmacy_claim": ["model.input_layer.pharmacy_claim", "model.the_tuva_project.data_profiling__test_detail"], "model.the_tuva_project.service_category__stg_medical_claim": ["model.input_layer.medical_claim"], "model.the_tuva_project.service_category__dq_input_layer_results": ["model.the_tuva_project.service_category__dq_input_layer_tests"], "model.the_tuva_project.service_category__dq_multiple_service_categories_professional": ["model.the_tuva_project.service_category__combined_professional"], "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_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__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__hospice_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__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__urgent_care_professional": ["model.the_tuva_project.service_category__stg_medical_claim"], "model.the_tuva_project.service_category__duplicate_bill_types": ["model.the_tuva_project.service_category__stg_medical_claim"], "model.the_tuva_project.service_category__dialysis_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__inpatient_rehab_professional": ["model.the_tuva_project.service_category__stg_medical_claim"], "model.the_tuva_project.service_category__dialysis_institutional": ["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__home_health_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__inpatient_psychiatric_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__hospice_institutional": ["model.the_tuva_project.service_category__stg_medical_claim"], "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__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__lab_professional": ["model.the_tuva_project.service_category__stg_medical_claim"], "model.the_tuva_project.service_category__combined_institutional": ["model.the_tuva_project.service_category__acute_inpatient_institutional", "model.the_tuva_project.service_category__dialysis_institutional", "model.the_tuva_project.service_category__duplicate_bill_types", "model.the_tuva_project.service_category__emergency_department_institutional", "model.the_tuva_project.service_category__home_health_institutional", "model.the_tuva_project.service_category__hospice_institutional", "model.the_tuva_project.service_category__lab_institutional", "model.the_tuva_project.service_category__outpatient_hospital_or_clinic_institutional", "model.the_tuva_project.service_category__outpatient_psychiatric_institutional", "model.the_tuva_project.service_category__skilled_nursing_institutional", "model.the_tuva_project.service_category__urgent_care_institutional"], "model.the_tuva_project.service_category__urgent_care_institutional": ["model.the_tuva_project.service_category__emergency_department_institutional", "model.the_tuva_project.service_category__stg_medical_claim"], "model.the_tuva_project.service_category__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__office_visit_professional": ["model.the_tuva_project.service_category__stg_medical_claim"], "model.the_tuva_project.service_category__combined_professional": ["model.the_tuva_project.service_category__acute_inpatient_professional", "model.the_tuva_project.service_category__ambulance_professional", "model.the_tuva_project.service_category__ambulance_professional", "model.the_tuva_project.service_category__ambulatory_surgery_professional", "model.the_tuva_project.service_category__dialysis_professional", "model.the_tuva_project.service_category__dme_professional", "model.the_tuva_project.service_category__dme_professional", "model.the_tuva_project.service_category__dme_professional", "model.the_tuva_project.service_category__emergency_department_professional", "model.the_tuva_project.service_category__home_health_professional", "model.the_tuva_project.service_category__hospice_professional", "model.the_tuva_project.service_category__inpatient_psychiatric_professional", "model.the_tuva_project.service_category__inpatient_rehab_professional", "model.the_tuva_project.service_category__lab_professional", "model.the_tuva_project.service_category__office_visit_professional", "model.the_tuva_project.service_category__outpatient_hospital_or_clinic_professional", "model.the_tuva_project.service_category__outpatient_psychiatric_professional", "model.the_tuva_project.service_category__outpatient_rehab_professional", "model.the_tuva_project.service_category__skilled_nursing_professional", "model.the_tuva_project.service_category__urgent_care_professional"], "model.the_tuva_project.service_category__ambulance_professional": ["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__emergency_department_institutional": ["model.the_tuva_project.service_category__acute_inpatient_institutional", "model.the_tuva_project.service_category__stg_medical_claim"], "model.the_tuva_project.service_category__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_rehab_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__acute_inpatient_professional": ["model.the_tuva_project.service_category__stg_medical_claim"], "model.the_tuva_project.acute_inpatient__stg_medical_claim": ["model.input_layer.medical_claim"], "model.the_tuva_project.acute_inpatient__stg_service_category": ["model.the_tuva_project.service_category__service_category_grouper"], "model.the_tuva_project.acute_inpatient__stg_eligibility": ["model.input_layer.eligibility"], "model.the_tuva_project.acute_inpatient__summary": ["model.input_layer.medical_claim", "model.the_tuva_project.acute_inpatient__encounter_id", "model.the_tuva_project.acute_inpatient__encounter_id", "model.the_tuva_project.acute_inpatient__encounter_id", "model.the_tuva_project.acute_inpatient__encounter_start_and_end_dates", "model.the_tuva_project.acute_inpatient__first_claim_values", "model.the_tuva_project.acute_inpatient__institutional_encounter_id", "model.the_tuva_project.acute_inpatient__last_claim_values", "model.the_tuva_project.acute_inpatient__stg_eligibility", "model.the_tuva_project.acute_inpatient__stg_medical_claim", "seed.the_tuva_project.terminology__admit_source", "seed.the_tuva_project.terminology__admit_type", "seed.the_tuva_project.terminology__apr_drg", "seed.the_tuva_project.terminology__discharge_disposition", "seed.the_tuva_project.terminology__icd_10_cm", "seed.the_tuva_project.terminology__icd_9_cm", "seed.the_tuva_project.terminology__ms_drg", "seed.the_tuva_project.terminology__provider"], "model.the_tuva_project.acute_inpatient__professional_encounter_id": ["model.the_tuva_project.acute_inpatient__encounter_start_and_end_dates", "model.the_tuva_project.acute_inpatient__stg_medical_claim", "model.the_tuva_project.acute_inpatient__stg_service_category"], "model.the_tuva_project.acute_inpatient__last_claim_values": ["model.input_layer.medical_claim", "model.the_tuva_project.acute_inpatient__encounter_id"], "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__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__institutional_encounter_id": ["model.the_tuva_project.acute_inpatient__institutional_claims"], "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__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__first_claim_values": ["model.input_layer.medical_claim", "model.the_tuva_project.acute_inpatient__encounter_id"], "model.the_tuva_project.acute_inpatient__encounter_id": ["model.input_layer.medical_claim", "model.the_tuva_project.acute_inpatient__institutional_encounter_id", "model.the_tuva_project.acute_inpatient__professional_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"], "model.the_tuva_project.quality_measures__stg_medical_claim": ["model.the_tuva_project.core__medical_claim"], "model.the_tuva_project.quality_measures__stg_core__patient": ["model.the_tuva_project.core__patient"], "model.the_tuva_project.quality_measures__stg_core__observation": ["model.the_tuva_project.core__observation"], "model.the_tuva_project.quality_measures__stg_core__medication": ["model.the_tuva_project.core__medication"], "model.the_tuva_project.quality_measures__stg_core__condition": ["model.the_tuva_project.core__condition"], "model.the_tuva_project.quality_measures__stg_core__lab_result": ["model.the_tuva_project.core__lab_result"], "model.the_tuva_project.quality_measures__stg_pharmacy_claim": ["model.the_tuva_project.core__pharmacy_claim"], "model.the_tuva_project.quality_measures__stg_core__procedure": ["model.the_tuva_project.core__procedure"], "model.the_tuva_project.quality_measures__stg_core__encounter": ["model.the_tuva_project.core__encounter"], "model.the_tuva_project.quality_measures__summary_wide": ["model.the_tuva_project.quality_measures__summary_long"], "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_nqf0034_long", "model.the_tuva_project.quality_measures__int_nqf2372_long"], "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__frailty": ["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_advanced_illness": ["model.the_tuva_project.quality_measures__int_nqf2372__frailty", "model.the_tuva_project.quality_measures__stg_core__condition", "model.the_tuva_project.quality_measures__stg_core__procedure", "model.the_tuva_project.quality_measures__stg_medical_claim", "seed.the_tuva_project.quality_measures__value_sets"], "model.the_tuva_project.quality_measures__int_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__performance_period": ["seed.the_tuva_project.quality_measures__measures", "seed.the_tuva_project.quality_measures__measures", "seed.the_tuva_project.quality_measures__measures"], "model.the_tuva_project.quality_measures__int_nqf2372_numerator": ["model.the_tuva_project.quality_measures__int_nqf2372_denominator", "model.the_tuva_project.quality_measures__stg_core__observation", "model.the_tuva_project.quality_measures__stg_core__procedure", "model.the_tuva_project.quality_measures__stg_medical_claim", "seed.the_tuva_project.quality_measures__value_sets"], "model.the_tuva_project.quality_measures__int_nqf2372_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_exclude_dementia": ["model.the_tuva_project.quality_measures__int_nqf2372__frailty", "model.the_tuva_project.quality_measures__stg_core__medication", "model.the_tuva_project.quality_measures__stg_pharmacy_claim", "seed.the_tuva_project.quality_measures__value_sets"], "model.the_tuva_project.quality_measures__int_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_denominator": ["model.the_tuva_project.quality_measures__int_nqf2372__performance_period", "model.the_tuva_project.quality_measures__stg_core__encounter", "model.the_tuva_project.quality_measures__stg_core__patient", "model.the_tuva_project.quality_measures__stg_core__procedure", "model.the_tuva_project.quality_measures__stg_medical_claim", "seed.the_tuva_project.quality_measures__value_sets"], "model.the_tuva_project.quality_measures__int_nqf2372_exclude_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_nqf0034_denominator": ["model.the_tuva_project.quality_measures__int_nqf0034__performance_period", "model.the_tuva_project.quality_measures__int_nqf0034__performance_period", "model.the_tuva_project.quality_measures__int_nqf0034__performance_period", "model.the_tuva_project.quality_measures__stg_core__encounter", "model.the_tuva_project.quality_measures__stg_core__patient", "model.the_tuva_project.quality_measures__stg_core__procedure", "model.the_tuva_project.quality_measures__stg_medical_claim", "seed.the_tuva_project.quality_measures__value_sets"], "model.the_tuva_project.quality_measures__int_nqf0034_exclude_dementia": ["model.the_tuva_project.quality_measures__int_nqf0034__frailty", "model.the_tuva_project.quality_measures__int_nqf0034__performance_period", "model.the_tuva_project.quality_measures__int_nqf0034__performance_period", "model.the_tuva_project.quality_measures__int_nqf0034__performance_period", "model.the_tuva_project.quality_measures__int_nqf0034__performance_period", "model.the_tuva_project.quality_measures__stg_core__medication", "model.the_tuva_project.quality_measures__stg_pharmacy_claim", "seed.the_tuva_project.quality_measures__value_sets"], "model.the_tuva_project.quality_measures__int_nqf0034_long": ["model.the_tuva_project.quality_measures__int_nqf0034__performance_period", "model.the_tuva_project.quality_measures__int_nqf0034_denominator", "model.the_tuva_project.quality_measures__int_nqf0034_exclusions", "model.the_tuva_project.quality_measures__int_nqf0034_numerator", "model.the_tuva_project.quality_measures__stg_core__patient", "seed.the_tuva_project.quality_measures__measures", "seed.the_tuva_project.quality_measures__measures", "seed.the_tuva_project.quality_measures__measures"], "model.the_tuva_project.quality_measures__int_nqf0034__performance_period": [], "model.the_tuva_project.quality_measures__int_nqf0034_exclusions": ["model.the_tuva_project.quality_measures__int_nqf0034_denominator", "model.the_tuva_project.quality_measures__int_nqf0034_exclude_advanced_illness", "model.the_tuva_project.quality_measures__int_nqf0034_exclude_colectomy_cancer", "model.the_tuva_project.quality_measures__int_nqf0034_exclude_dementia", "model.the_tuva_project.quality_measures__int_nqf0034_exclude_hospice_palliative", "model.the_tuva_project.quality_measures__int_nqf0034_exclude_institutional_snp"], "model.the_tuva_project.quality_measures__int_nqf0034__frailty": ["model.the_tuva_project.quality_measures__int_nqf0034__performance_period", "model.the_tuva_project.quality_measures__int_nqf0034__performance_period", "model.the_tuva_project.quality_measures__int_nqf0034__performance_period", "model.the_tuva_project.quality_measures__int_nqf0034__performance_period", "model.the_tuva_project.quality_measures__int_nqf0034_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_nqf0034_exclude_hospice_palliative": ["model.the_tuva_project.quality_measures__int_nqf0034__performance_period", "model.the_tuva_project.quality_measures__int_nqf0034__performance_period", "model.the_tuva_project.quality_measures__int_nqf0034__performance_period", "model.the_tuva_project.quality_measures__int_nqf0034__performance_period", "model.the_tuva_project.quality_measures__stg_core__condition", "model.the_tuva_project.quality_measures__stg_core__observation", "model.the_tuva_project.quality_measures__stg_core__procedure", "model.the_tuva_project.quality_measures__stg_medical_claim", "seed.the_tuva_project.quality_measures__value_sets"], "model.the_tuva_project.quality_measures__int_nqf0034_exclude_advanced_illness": ["model.the_tuva_project.quality_measures__int_nqf0034__frailty", "model.the_tuva_project.quality_measures__int_nqf0034__performance_period", "model.the_tuva_project.quality_measures__int_nqf0034__performance_period", "model.the_tuva_project.quality_measures__int_nqf0034__performance_period", "model.the_tuva_project.quality_measures__int_nqf0034__performance_period", "model.the_tuva_project.quality_measures__int_nqf0034__performance_period", "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", "seed.the_tuva_project.quality_measures__value_sets"], "model.the_tuva_project.quality_measures__int_nqf0034_exclude_institutional_snp": ["model.the_tuva_project.quality_measures__int_nqf0034__performance_period", "model.the_tuva_project.quality_measures__int_nqf0034_denominator", "model.the_tuva_project.quality_measures__stg_medical_claim"], "model.the_tuva_project.quality_measures__int_nqf0034_exclude_colectomy_cancer": ["model.the_tuva_project.quality_measures__stg_core__condition", "model.the_tuva_project.quality_measures__stg_core__observation", "model.the_tuva_project.quality_measures__stg_core__procedure", "model.the_tuva_project.quality_measures__stg_medical_claim", "seed.the_tuva_project.quality_measures__value_sets"], "model.the_tuva_project.quality_measures__int_nqf0034_numerator": ["model.the_tuva_project.quality_measures__int_nqf0034__performance_period", "model.the_tuva_project.quality_measures__int_nqf0034_denominator", "model.the_tuva_project.quality_measures__stg_core__lab_result", "model.the_tuva_project.quality_measures__stg_core__observation", "model.the_tuva_project.quality_measures__stg_core__procedure", "model.the_tuva_project.quality_measures__stg_medical_claim", "seed.the_tuva_project.quality_measures__value_sets"], "model.the_tuva_project.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.ccsr__singular_condition_category": ["model.the_tuva_project.ccsr__long_condition_category"], "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__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.financial_pmpm__stg_eligibility": ["model.the_tuva_project.core__eligibility"], "model.the_tuva_project.financial_pmpm__stg_medical_claim": ["model.the_tuva_project.core__medical_claim"], "model.the_tuva_project.financial_pmpm__stg_pharmacy_claim": ["model.the_tuva_project.core__pharmacy_claim"], "model.the_tuva_project.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__member_months", "model.the_tuva_project.financial_pmpm__service_category_1_allowed_pivot", "model.the_tuva_project.financial_pmpm__service_category_1_paid_pivot", "model.the_tuva_project.financial_pmpm__service_category_2_allowed_pivot", "model.the_tuva_project.financial_pmpm__service_category_2_paid_pivot"], "model.the_tuva_project.financial_pmpm__member_months": ["model.the_tuva_project.financial_pmpm__stg_eligibility", "seed.the_tuva_project.terminology__calendar"], "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_paid_pivot": ["model.the_tuva_project.financial_pmpm__patient_spend_with_service_categories"], "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_2_allowed_pivot": ["model.the_tuva_project.financial_pmpm__patient_spend_with_service_categories"], "model.the_tuva_project.cms_chronic_conditions__stg_pharmacy_claim": ["model.input_layer.pharmacy_claim"], "model.the_tuva_project.tuva_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.tuva_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_medical_claim": ["model.input_layer.medical_claim"], "model.the_tuva_project.cms_chronic_conditions__stg_core__condition": ["model.the_tuva_project.core__condition"], "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_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_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.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"], "seed.the_tuva_project.terminology__admit_type": [], "seed.the_tuva_project.terminology__ssa_fips_state": [], "seed.the_tuva_project.terminology__medicare_orec": [], "seed.the_tuva_project.terminology__gender": [], "seed.the_tuva_project.terminology__ethnicity": [], "seed.the_tuva_project.terminology__ms_drg": [], "seed.the_tuva_project.terminology__revenue_center": [], "seed.the_tuva_project.terminology__icd_9_cm": [], "seed.the_tuva_project.terminology__race": [], "seed.the_tuva_project.terminology__medicare_status": [], "seed.the_tuva_project.terminology__loinc_deprecated_mapping": [], "seed.the_tuva_project.terminology__place_of_service": [], "seed.the_tuva_project.terminology__discharge_disposition": [], "seed.the_tuva_project.terminology__icd_9_pcs": [], "seed.the_tuva_project.terminology__present_on_admission": [], "seed.the_tuva_project.terminology__mdc": [], "seed.the_tuva_project.terminology__admit_source": [], "seed.the_tuva_project.terminology__calendar": [], "seed.the_tuva_project.terminology__other_provider_taxonomy": [], "seed.the_tuva_project.terminology__icd_10_cm": [], "seed.the_tuva_project.terminology__claim_type": [], "seed.the_tuva_project.terminology__hcpcs_level_2": [], "seed.the_tuva_project.terminology__fips_county": [], "seed.the_tuva_project.terminology__ansi_fips_state": [], "seed.the_tuva_project.terminology__encounter_type": [], "seed.the_tuva_project.terminology__provider": [], "seed.the_tuva_project.terminology__payer_type": [], "seed.the_tuva_project.terminology__apr_drg": [], "seed.the_tuva_project.terminology__icd_10_pcs": [], "seed.the_tuva_project.terminology__code_type": [], "seed.the_tuva_project.terminology__medicare_dual_eligibility": [], "seed.the_tuva_project.terminology__bill_type": [], "seed.the_tuva_project.terminology__loinc": [], "seed.the_tuva_project.data_profiling__test_catalog": [], "seed.the_tuva_project.service_category__service_categories": [], "seed.the_tuva_project.ed_classification__johnston_icd9": [], "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__categories": [], "seed.the_tuva_project.readmissions__potentially_planned_ccs_procedure_category": [], "seed.the_tuva_project.readmissions__icd_10_cm_to_ccs": [], "seed.the_tuva_project.readmissions__potentially_planned_icd_10_pcs": [], "seed.the_tuva_project.readmissions__acute_diagnosis_ccs": [], "seed.the_tuva_project.readmissions__specialty_cohort": [], "seed.the_tuva_project.readmissions__exclusion_ccs_diagnosis_category": [], "seed.the_tuva_project.readmissions__acute_diagnosis_icd_10_cm": [], "seed.the_tuva_project.readmissions__surgery_gynecology_cohort": [], "seed.the_tuva_project.readmissions__always_planned_ccs_procedure_category": [], "seed.the_tuva_project.readmissions__icd_10_pcs_to_ccs": [], "seed.the_tuva_project.readmissions__always_planned_ccs_diagnosis_category": [], "seed.the_tuva_project.cms_hcc__disabled_interaction_factors": [], "seed.the_tuva_project.cms_hcc__disease_hierarchy": [], "seed.the_tuva_project.cms_hcc__icd_10_cm_mappings": [], "seed.the_tuva_project.cms_hcc__disease_factors": [], "seed.the_tuva_project.cms_hcc__disease_interaction_factors": [], "seed.the_tuva_project.cms_hcc__cpt_hcpcs": [], "seed.the_tuva_project.cms_hcc__adjustment_rates": [], "seed.the_tuva_project.cms_hcc__enrollment_interaction_factors": [], "seed.the_tuva_project.cms_hcc__payment_hcc_count_factors": [], "seed.the_tuva_project.cms_hcc__demographic_factors": [], "seed.the_tuva_project.quality_measures__value_sets": [], "seed.the_tuva_project.quality_measures__measures": [], "seed.the_tuva_project.quality_measures__concepts": [], "seed.the_tuva_project.ccsr__dxccsr_v2023_1_cleaned_map": [], "seed.the_tuva_project.ccsr__prccsr_v2023_1_cleaned_map": [], "seed.the_tuva_project.ccsr__dxccsr_v2023_1_body_systems": [], "seed.the_tuva_project.chronic_conditions__tuva_chronic_conditions_hierarchy": [], "seed.the_tuva_project.chronic_conditions__cms_chronic_conditions_hierarchy": [], "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.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"], "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_financial_pmpm__pmpm_prep__patient_id___year_month___plan_.b941ddaf9e": ["model.the_tuva_project.financial_pmpm__pmpm_prep"], "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_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"], "model.input_layer.observation": [], "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"], "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"], "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__eligibility": ["model.the_tuva_project.core__stg_claims_eligibility"], "model.the_tuva_project.core__stg_clinical_lab_result": ["model.input_layer.lab_result"], "model.the_tuva_project.core__stg_claims_pharmacy_claim": ["model.input_layer.pharmacy_claim"], "model.the_tuva_project.core__stg_clinical_patient": ["model.input_layer.patient"], "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__pharmacy_claim": ["model.the_tuva_project.core__stg_claims_pharmacy_claim"], "model.the_tuva_project.core__encounter": ["model.the_tuva_project.core__stg_clinical_encounter"], "model.the_tuva_project.core__medical_claim": ["model.the_tuva_project.core__stg_claims_medical_claim"], "model.the_tuva_project.core__stg_clinical_medication": ["model.input_layer.medication"], "model.the_tuva_project.core__observation": ["model.the_tuva_project.core__stg_clinical_observation"], "model.the_tuva_project.core__stg_claims_eligibility": ["model.input_layer.eligibility"], "model.the_tuva_project.core__stg_claims_patient": ["model.input_layer.eligibility"], "model.the_tuva_project.core__stg_clinical_location": ["model.input_layer.location"], "model.the_tuva_project.core__stg_claims_medical_claim": ["model.input_layer.medical_claim", "model.the_tuva_project.acute_inpatient__encounter_id", "model.the_tuva_project.emergency_department__int_encounter_id", "model.the_tuva_project.service_category__service_category_grouper"], "model.the_tuva_project.core__stg_claims_encounter": ["model.the_tuva_project.acute_inpatient__summary", "model.the_tuva_project.emergency_department__summary"], "model.the_tuva_project.core__stg_clinical_observation": ["model.input_layer.observation"], "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_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_procedure": ["model.input_layer.medical_claim", "model.input_layer.medical_claim", "model.input_layer.medical_claim", "model.input_layer.medical_claim", "model.input_layer.medical_claim", "model.input_layer.medical_claim", "model.input_layer.medical_claim", "model.input_layer.medical_claim", "model.input_layer.medical_claim", "model.input_layer.medical_claim", "model.input_layer.medical_claim", "model.input_layer.medical_claim", "model.input_layer.medical_claim", "model.input_layer.medical_claim", "model.input_layer.medical_claim", "model.input_layer.medical_claim", "model.input_layer.medical_claim", "model.input_layer.medical_claim", "model.input_layer.medical_claim", "model.input_layer.medical_claim", "model.input_layer.medical_claim", "model.input_layer.medical_claim", "model.input_layer.medical_claim", "model.input_layer.medical_claim", "model.input_layer.medical_claim", "model.the_tuva_project.acute_inpatient__encounter_id", "model.the_tuva_project.emergency_department__int_encounter_id", "seed.the_tuva_project.terminology__icd_10_pcs"], "model.the_tuva_project.core__stg_clinical_procedure": ["model.input_layer.procedure"], "model.the_tuva_project.core__lab_result": ["model.the_tuva_project.core__stg_clinical_lab_result"], "model.the_tuva_project.core__medication": ["model.the_tuva_project.core__stg_clinical_medication"], "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__stg_clinical_condition": ["model.input_layer.condition"], "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__stg_claims_condition": ["model.input_layer.medical_claim", "model.input_layer.medical_claim", "model.input_layer.medical_claim", "model.input_layer.medical_claim", "model.input_layer.medical_claim", "model.input_layer.medical_claim", "model.input_layer.medical_claim", "model.input_layer.medical_claim", "model.input_layer.medical_claim", "model.input_layer.medical_claim", "model.input_layer.medical_claim", "model.input_layer.medical_claim", "model.input_layer.medical_claim", "model.input_layer.medical_claim", "model.input_layer.medical_claim", "model.input_layer.medical_claim", "model.input_layer.medical_claim", "model.input_layer.medical_claim", "model.input_layer.medical_claim", "model.input_layer.medical_claim", "model.input_layer.medical_claim", "model.input_layer.medical_claim", "model.input_layer.medical_claim", "model.input_layer.medical_claim", "model.input_layer.medical_claim", "model.the_tuva_project.acute_inpatient__encounter_id", "model.the_tuva_project.emergency_department__int_encounter_id", "seed.the_tuva_project.terminology__icd_10_cm", "seed.the_tuva_project.terminology__present_on_admission"], "model.the_tuva_project.core__stg_clinical_encounter": ["model.input_layer.encounter"], "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__stg_clinical_practitioner": ["model.input_layer.practitioner"], "test.the_tuva_project.unique_core__medical_claim__claim_id_claim_line_number_.b9ab42f1f0": ["model.the_tuva_project.core__medical_claim"]}, "child_map": {"model.input_layer.procedure": ["model.the_tuva_project.core__stg_clinical_procedure"], "model.input_layer.practitioner": ["model.the_tuva_project.core__stg_clinical_practitioner"], "model.input_layer.encounter": ["model.the_tuva_project.core__stg_clinical_encounter"], "model.input_layer.eligibility": ["model.the_tuva_project.acute_inpatient__stg_eligibility", "model.the_tuva_project.core__stg_claims_eligibility", "model.the_tuva_project.core__stg_claims_patient", "model.the_tuva_project.data_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_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_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.the_tuva_project.emergency_department__summary"], "model.input_layer.medical_claim": ["model.the_tuva_project.acute_inpatient__encounter_id", "model.the_tuva_project.acute_inpatient__first_claim_values", "model.the_tuva_project.acute_inpatient__last_claim_values", "model.the_tuva_project.acute_inpatient__stg_medical_claim", "model.the_tuva_project.acute_inpatient__summary", "model.the_tuva_project.cms_chronic_conditions__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.emergency_department__int_encounter_id", "model.the_tuva_project.emergency_department__int_first_claim_values", "model.the_tuva_project.emergency_department__int_institutional_claims", "model.the_tuva_project.emergency_department__int_last_claim_values", "model.the_tuva_project.emergency_department__int_professional_encounter_id", "model.the_tuva_project.emergency_department__summary", "model.the_tuva_project.emergency_department__summary", "model.the_tuva_project.service_category__stg_medical_claim"], "model.input_layer.pharmacy_claim": ["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.input_layer.location": ["model.the_tuva_project.core__stg_clinical_location"], "model.input_layer.patient": ["model.the_tuva_project.core__stg_clinical_patient"], "model.input_layer.condition": ["model.the_tuva_project.core__stg_clinical_condition"], "model.input_layer.medication": ["model.the_tuva_project.core__stg_clinical_medication"], "model.input_layer.lab_result": ["model.the_tuva_project.core__stg_clinical_lab_result"], "seed.input_layer.eligibility_seed": ["model.input_layer.eligibility"], "seed.input_layer.medical_claim_seed": ["model.input_layer.medical_claim"], "seed.input_layer.pharmacy_claim_seed": ["model.input_layer.pharmacy_claim"], "model.the_tuva_project.insights__count_claim_by_claim_type": [], "model.the_tuva_project.insights__count_claim_by_service_category": [], "model.the_tuva_project.insights__trend_count_claim_by_claim_type": [], "model.the_tuva_project.insights__trend_sum_amount_by_claim_type": [], "model.the_tuva_project.insights__orphan_claim_by_claim_type": [], "model.the_tuva_project.insights__count_claim_by_date_column": [], "model.the_tuva_project.insights__trend_sum_amount_by_service_category": [], "model.the_tuva_project.insights__sum_amount_by_claim_type": [], "model.the_tuva_project.insights__sum_amount_by_service_category": [], "model.the_tuva_project.insights__trend_count_claim_by_service_category": [], "model.the_tuva_project.ed_classification__stg_patient": ["model.the_tuva_project.ed_classification__summary"], "model.the_tuva_project.ed_classification__stg_encounter": ["model.the_tuva_project.ed_classification__int_map_primary_dx"], "model.the_tuva_project.ed_classification__summary": [], "model.the_tuva_project.ed_classification__int_filter_encounter_with_classification": ["model.the_tuva_project.ed_classification__summary"], "model.the_tuva_project.ed_classification__int_map_primary_dx": ["model.the_tuva_project.ed_classification__int_filter_encounter_with_classification"], "model.the_tuva_project.readmissions__stg_core__medical_claim": [], "model.the_tuva_project.readmissions__stg_core__condition": [], "model.the_tuva_project.readmissions__stg_core__encounter": ["model.the_tuva_project.readmissions__encounter"], "model.the_tuva_project.readmissions__stg_core__procedure": ["model.the_tuva_project.readmissions__procedure_ccs"], "model.the_tuva_project.readmissions__encounter_augmented": ["model.the_tuva_project.readmissions__readmission_summary"], "model.the_tuva_project.readmissions__readmission_summary": [], "model.the_tuva_project.readmissions__encounter_overlap": ["model.the_tuva_project.readmissions__encounter_data_quality", "model.the_tuva_project.readmissions__encounter_data_quality", "model.the_tuva_project.readmissions__readmission_crude", "model.the_tuva_project.readmissions__readmission_crude"], "model.the_tuva_project.readmissions__encounter_specialty_cohort": ["model.the_tuva_project.readmissions__encounter_augmented"], "model.the_tuva_project.readmissions__encounter_data_quality": ["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_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__encounter": ["model.the_tuva_project.readmissions__encounter_augmented", "model.the_tuva_project.readmissions__encounter_overlap", "model.the_tuva_project.readmissions__encounter_specialty_cohort", "model.the_tuva_project.readmissions__encounter_with_ccs", "model.the_tuva_project.readmissions__index_admission", "model.the_tuva_project.readmissions__index_discharge_requirement", "model.the_tuva_project.readmissions__index_discharge_requirement", "model.the_tuva_project.readmissions__index_time_requirement", "model.the_tuva_project.readmissions__index_time_requirement", "model.the_tuva_project.readmissions__readmission_crude"], "model.the_tuva_project.readmissions__readmission_crude": [], "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__encounter_with_ccs": ["model.the_tuva_project.readmissions__encounter_data_quality", "model.the_tuva_project.readmissions__encounter_specialty_cohort", "model.the_tuva_project.readmissions__exclusion", "model.the_tuva_project.readmissions__planned_encounter", "model.the_tuva_project.readmissions__planned_encounter"], "model.the_tuva_project.readmissions__index_discharge_requirement": ["model.the_tuva_project.readmissions__index_admission"], "model.the_tuva_project.cms_hcc__stg_core__condition": ["model.the_tuva_project.cms_hcc__int_all_conditions", "model.the_tuva_project.cms_hcc__int_eligible_conditions"], "model.the_tuva_project.cms_hcc__stg_core__patient": ["model.the_tuva_project.cms_hcc__int_members"], "model.the_tuva_project.cms_hcc__stg_core__medical_claim": ["model.the_tuva_project.cms_hcc__int_eligible_conditions"], "model.the_tuva_project.cms_hcc__stg_core__eligibility": ["model.the_tuva_project.cms_hcc__int_members"], "model.the_tuva_project.cms_hcc__patient_risk_factors": ["model.the_tuva_project.cms_hcc__patient_risk_scores"], "model.the_tuva_project.cms_hcc__patient_risk_scores": ["test.the_tuva_project.unique_cms_hcc__patient_risk_scores_patient_id.05b154e126"], "model.the_tuva_project.cms_hcc__patient_hcc_history": [], "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_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_disease_interaction_factors": ["model.the_tuva_project.cms_hcc__patient_risk_factors"], "model.the_tuva_project.cms_hcc__int_all_conditions": ["model.the_tuva_project.cms_hcc__patient_hcc_history"], "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_disabled_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_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_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__int_enrollment_interaction_factors": ["model.the_tuva_project.cms_hcc__patient_risk_factors"], "model.the_tuva_project.emergency_department__summary": ["model.the_tuva_project.core__stg_claims_encounter"], "model.the_tuva_project.emergency_department__int_encounter_id": ["model.the_tuva_project.core__stg_claims_condition", "model.the_tuva_project.core__stg_claims_medical_claim", "model.the_tuva_project.core__stg_claims_procedure", "model.the_tuva_project.emergency_department__int_first_claim_values", "model.the_tuva_project.emergency_department__int_last_claim_values", "model.the_tuva_project.emergency_department__summary", "model.the_tuva_project.emergency_department__summary", "model.the_tuva_project.emergency_department__summary"], "model.the_tuva_project.emergency_department__int_first_claim_values": ["model.the_tuva_project.emergency_department__summary"], "model.the_tuva_project.emergency_department__int_institutional_claims": ["model.the_tuva_project.emergency_department__int_encounter_start_and_end_dates", "model.the_tuva_project.emergency_department__int_institutional_encounter_id"], "model.the_tuva_project.emergency_department__int_encounter_start_and_end_dates": ["model.the_tuva_project.emergency_department__int_professional_encounter_id", "model.the_tuva_project.emergency_department__summary"], "model.the_tuva_project.emergency_department__int_last_claim_values": ["model.the_tuva_project.emergency_department__summary"], "model.the_tuva_project.emergency_department__int_professional_encounter_id": ["model.the_tuva_project.emergency_department__int_encounter_id"], "model.the_tuva_project.emergency_department__int_institutional_encounter_id": ["model.the_tuva_project.emergency_department__int_encounter_id", "model.the_tuva_project.emergency_department__int_encounter_start_and_end_dates", "model.the_tuva_project.emergency_department__summary"], "model.the_tuva_project.data_profiling__test_result": [], "model.the_tuva_project.data_profiling__use_case": [], "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__summary": [], "model.the_tuva_project.data_profiling__eligibility_plausibility": ["model.the_tuva_project.data_profiling__test_detail_stage_eligibility"], "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__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__institutional_header_failures": ["model.the_tuva_project.data_profiling__institutional_header_fail_details"], "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__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__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__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__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_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__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__test_detail_stage_eligibility": ["model.the_tuva_project.data_profiling__test_detail"], "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__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__test_result_stage_medical_claim": ["model.the_tuva_project.data_profiling__test_result"], "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_medical_claim": ["model.the_tuva_project.data_profiling__test_detail"], "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__test_result_stage_eligibility": ["model.the_tuva_project.data_profiling__test_result"], "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__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_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__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_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__test_result_stage_pharmacy_claim": ["model.the_tuva_project.data_profiling__test_result"], "model.the_tuva_project.service_category__stg_medical_claim": ["model.the_tuva_project.service_category__acute_inpatient_institutional", "model.the_tuva_project.service_category__acute_inpatient_institutional", "model.the_tuva_project.service_category__acute_inpatient_institutional", "model.the_tuva_project.service_category__acute_inpatient_institutional", "model.the_tuva_project.service_category__acute_inpatient_professional", "model.the_tuva_project.service_category__ambulance_professional", "model.the_tuva_project.service_category__ambulatory_surgery_professional", "model.the_tuva_project.service_category__dialysis_institutional", "model.the_tuva_project.service_category__dialysis_professional", "model.the_tuva_project.service_category__dme_professional", "model.the_tuva_project.service_category__dq_input_layer_tests", "model.the_tuva_project.service_category__dq_input_layer_tests", "model.the_tuva_project.service_category__dq_input_layer_tests", "model.the_tuva_project.service_category__dq_input_layer_tests", "model.the_tuva_project.service_category__dq_input_layer_tests", "model.the_tuva_project.service_category__dq_input_layer_tests", "model.the_tuva_project.service_category__dq_input_layer_tests", "model.the_tuva_project.service_category__dq_input_layer_tests", "model.the_tuva_project.service_category__dq_input_layer_tests", "model.the_tuva_project.service_category__dq_input_layer_tests", "model.the_tuva_project.service_category__dq_input_layer_tests", "model.the_tuva_project.service_category__dq_input_layer_tests", "model.the_tuva_project.service_category__dq_input_layer_tests", "model.the_tuva_project.service_category__dq_input_layer_tests", "model.the_tuva_project.service_category__duplicate_bill_types", "model.the_tuva_project.service_category__emergency_department_institutional", "model.the_tuva_project.service_category__emergency_department_professional", "model.the_tuva_project.service_category__home_health_institutional", "model.the_tuva_project.service_category__home_health_professional", "model.the_tuva_project.service_category__hospice_institutional", "model.the_tuva_project.service_category__hospice_professional", "model.the_tuva_project.service_category__inpatient_psychiatric_professional", "model.the_tuva_project.service_category__inpatient_rehab_professional", "model.the_tuva_project.service_category__lab_institutional", "model.the_tuva_project.service_category__lab_professional", "model.the_tuva_project.service_category__office_visit_professional", "model.the_tuva_project.service_category__outpatient_hospital_or_clinic_institutional", "model.the_tuva_project.service_category__outpatient_hospital_or_clinic_professional", "model.the_tuva_project.service_category__outpatient_psychiatric_institutional", "model.the_tuva_project.service_category__outpatient_psychiatric_professional", "model.the_tuva_project.service_category__outpatient_rehab_professional", "model.the_tuva_project.service_category__service_category_grouper", "model.the_tuva_project.service_category__service_category_grouper", "model.the_tuva_project.service_category__skilled_nursing_institutional", "model.the_tuva_project.service_category__skilled_nursing_professional", "model.the_tuva_project.service_category__urgent_care_institutional", "model.the_tuva_project.service_category__urgent_care_professional"], "model.the_tuva_project.service_category__dq_input_layer_results": [], "model.the_tuva_project.service_category__dq_multiple_service_categories_professional": [], "model.the_tuva_project.service_category__dq_multiple_service_categories_institutional": [], "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__service_category_grouper": ["model.the_tuva_project.acute_inpatient__stg_service_category", "model.the_tuva_project.core__stg_claims_medical_claim", "model.the_tuva_project.emergency_department__int_institutional_claims", "model.the_tuva_project.emergency_department__int_professional_encounter_id"], "model.the_tuva_project.service_category__hospice_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__home_health_professional": ["model.the_tuva_project.service_category__combined_professional"], "model.the_tuva_project.service_category__urgent_care_professional": ["model.the_tuva_project.service_category__combined_professional"], "model.the_tuva_project.service_category__duplicate_bill_types": ["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__lab_institutional": ["model.the_tuva_project.service_category__combined_institutional"], "model.the_tuva_project.service_category__inpatient_rehab_professional": ["model.the_tuva_project.service_category__combined_professional"], "model.the_tuva_project.service_category__dialysis_institutional": ["model.the_tuva_project.service_category__combined_institutional"], "model.the_tuva_project.service_category__dme_professional": ["model.the_tuva_project.service_category__ambulatory_surgery_professional", "model.the_tuva_project.service_category__combined_professional", "model.the_tuva_project.service_category__combined_professional", "model.the_tuva_project.service_category__combined_professional", "model.the_tuva_project.service_category__home_health_professional", "model.the_tuva_project.service_category__skilled_nursing_professional"], "model.the_tuva_project.service_category__home_health_institutional": ["model.the_tuva_project.service_category__combined_institutional"], "model.the_tuva_project.service_category__emergency_department_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__skilled_nursing_institutional": ["model.the_tuva_project.service_category__combined_institutional"], "model.the_tuva_project.service_category__hospice_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__skilled_nursing_professional": ["model.the_tuva_project.service_category__combined_professional"], "model.the_tuva_project.service_category__lab_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__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__acute_inpatient_institutional": ["model.the_tuva_project.service_category__combined_institutional", "model.the_tuva_project.service_category__emergency_department_institutional"], "model.the_tuva_project.service_category__office_visit_professional": ["model.the_tuva_project.service_category__combined_professional"], "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__ambulance_professional": ["model.the_tuva_project.service_category__combined_professional", "model.the_tuva_project.service_category__combined_professional"], "model.the_tuva_project.service_category__outpatient_psychiatric_professional": ["model.the_tuva_project.service_category__combined_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__urgent_care_institutional"], "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_rehab_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__acute_inpatient_professional": ["model.the_tuva_project.service_category__combined_professional"], "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": ["model.the_tuva_project.acute_inpatient__institutional_claims", "model.the_tuva_project.acute_inpatient__professional_encounter_id"], "model.the_tuva_project.acute_inpatient__stg_eligibility": ["model.the_tuva_project.acute_inpatient__summary"], "model.the_tuva_project.acute_inpatient__summary": ["model.the_tuva_project.core__stg_claims_encounter"], "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__last_claim_values": ["model.the_tuva_project.acute_inpatient__summary"], "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__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__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__claims_with_encounter_data": ["model.the_tuva_project.acute_inpatient__encounter_data_for_medical_claims"], "model.the_tuva_project.acute_inpatient__first_claim_values": ["model.the_tuva_project.acute_inpatient__summary"], "model.the_tuva_project.acute_inpatient__encounter_id": ["model.the_tuva_project.acute_inpatient__claims_with_encounter_data", "model.the_tuva_project.acute_inpatient__first_claim_values", "model.the_tuva_project.acute_inpatient__last_claim_values", "model.the_tuva_project.acute_inpatient__summary", "model.the_tuva_project.acute_inpatient__summary", "model.the_tuva_project.acute_inpatient__summary", "model.the_tuva_project.core__stg_claims_condition", "model.the_tuva_project.core__stg_claims_medical_claim", "model.the_tuva_project.core__stg_claims_procedure"], "model.the_tuva_project.acute_inpatient__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.quality_measures__stg_medical_claim": ["model.the_tuva_project.quality_measures__int_nqf0034__frailty", "model.the_tuva_project.quality_measures__int_nqf0034_denominator", "model.the_tuva_project.quality_measures__int_nqf0034_exclude_advanced_illness", "model.the_tuva_project.quality_measures__int_nqf0034_exclude_colectomy_cancer", "model.the_tuva_project.quality_measures__int_nqf0034_exclude_hospice_palliative", "model.the_tuva_project.quality_measures__int_nqf0034_exclude_institutional_snp", "model.the_tuva_project.quality_measures__int_nqf0034_numerator", "model.the_tuva_project.quality_measures__int_nqf2372__frailty", "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_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_core__patient": ["model.the_tuva_project.quality_measures__int_nqf0034_denominator", "model.the_tuva_project.quality_measures__int_nqf0034_long", "model.the_tuva_project.quality_measures__int_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__observation": ["model.the_tuva_project.quality_measures__int_nqf0034__frailty", "model.the_tuva_project.quality_measures__int_nqf0034_exclude_advanced_illness", "model.the_tuva_project.quality_measures__int_nqf0034_exclude_colectomy_cancer", "model.the_tuva_project.quality_measures__int_nqf0034_exclude_hospice_palliative", "model.the_tuva_project.quality_measures__int_nqf0034_numerator", "model.the_tuva_project.quality_measures__int_nqf2372__frailty", "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__medication": ["model.the_tuva_project.quality_measures__int_nqf0034_exclude_dementia", "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__condition": ["model.the_tuva_project.quality_measures__int_nqf0034__frailty", "model.the_tuva_project.quality_measures__int_nqf0034_exclude_advanced_illness", "model.the_tuva_project.quality_measures__int_nqf0034_exclude_colectomy_cancer", "model.the_tuva_project.quality_measures__int_nqf0034_exclude_hospice_palliative", "model.the_tuva_project.quality_measures__int_nqf2372__frailty", "model.the_tuva_project.quality_measures__int_nqf2372_exclude_advanced_illness", "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__lab_result": ["model.the_tuva_project.quality_measures__int_nqf0034_numerator"], "model.the_tuva_project.quality_measures__stg_pharmacy_claim": ["model.the_tuva_project.quality_measures__int_nqf0034_exclude_dementia", "model.the_tuva_project.quality_measures__int_nqf2372_exclude_dementia"], "model.the_tuva_project.quality_measures__stg_core__procedure": ["model.the_tuva_project.quality_measures__int_nqf0034__frailty", "model.the_tuva_project.quality_measures__int_nqf0034_denominator", "model.the_tuva_project.quality_measures__int_nqf0034_exclude_advanced_illness", "model.the_tuva_project.quality_measures__int_nqf0034_exclude_colectomy_cancer", "model.the_tuva_project.quality_measures__int_nqf0034_exclude_hospice_palliative", "model.the_tuva_project.quality_measures__int_nqf0034_numerator", "model.the_tuva_project.quality_measures__int_nqf2372__frailty", "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_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_core__encounter": ["model.the_tuva_project.quality_measures__int_nqf0034_denominator", "model.the_tuva_project.quality_measures__int_nqf2372_denominator", "test.the_tuva_project.not_null_quality_measures__stg_core__encounter_patient_id.a0d82e2159"], "model.the_tuva_project.quality_measures__summary_wide": [], "model.the_tuva_project.quality_measures__summary_counts": [], "model.the_tuva_project.quality_measures__summary_long": ["model.the_tuva_project.quality_measures__summary_counts", "model.the_tuva_project.quality_measures__summary_wide"], "model.the_tuva_project.quality_measures__int_nqf2372_exclude_mastectomy": ["model.the_tuva_project.quality_measures__int_nqf2372_exclusions"], "model.the_tuva_project.quality_measures__int_nqf2372__frailty": ["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_advanced_illness": ["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__performance_period": ["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_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_exclude_dementia": ["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_denominator": ["model.the_tuva_project.quality_measures__int_nqf2372__frailty", "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_hospice": ["model.the_tuva_project.quality_measures__int_nqf2372_exclusions"], "model.the_tuva_project.quality_measures__int_nqf0034_denominator": ["model.the_tuva_project.quality_measures__int_nqf0034__frailty", "model.the_tuva_project.quality_measures__int_nqf0034_exclude_institutional_snp", "model.the_tuva_project.quality_measures__int_nqf0034_exclusions", "model.the_tuva_project.quality_measures__int_nqf0034_long", "model.the_tuva_project.quality_measures__int_nqf0034_numerator"], "model.the_tuva_project.quality_measures__int_nqf0034_exclude_dementia": ["model.the_tuva_project.quality_measures__int_nqf0034_exclusions"], "model.the_tuva_project.quality_measures__int_nqf0034_long": ["model.the_tuva_project.quality_measures__summary_long"], "model.the_tuva_project.quality_measures__int_nqf0034__performance_period": ["model.the_tuva_project.quality_measures__int_nqf0034__frailty", "model.the_tuva_project.quality_measures__int_nqf0034__frailty", "model.the_tuva_project.quality_measures__int_nqf0034__frailty", "model.the_tuva_project.quality_measures__int_nqf0034__frailty", "model.the_tuva_project.quality_measures__int_nqf0034_denominator", "model.the_tuva_project.quality_measures__int_nqf0034_denominator", "model.the_tuva_project.quality_measures__int_nqf0034_denominator", "model.the_tuva_project.quality_measures__int_nqf0034_exclude_advanced_illness", "model.the_tuva_project.quality_measures__int_nqf0034_exclude_advanced_illness", "model.the_tuva_project.quality_measures__int_nqf0034_exclude_advanced_illness", "model.the_tuva_project.quality_measures__int_nqf0034_exclude_advanced_illness", "model.the_tuva_project.quality_measures__int_nqf0034_exclude_advanced_illness", "model.the_tuva_project.quality_measures__int_nqf0034_exclude_dementia", "model.the_tuva_project.quality_measures__int_nqf0034_exclude_dementia", "model.the_tuva_project.quality_measures__int_nqf0034_exclude_dementia", "model.the_tuva_project.quality_measures__int_nqf0034_exclude_dementia", "model.the_tuva_project.quality_measures__int_nqf0034_exclude_hospice_palliative", "model.the_tuva_project.quality_measures__int_nqf0034_exclude_hospice_palliative", "model.the_tuva_project.quality_measures__int_nqf0034_exclude_hospice_palliative", "model.the_tuva_project.quality_measures__int_nqf0034_exclude_hospice_palliative", "model.the_tuva_project.quality_measures__int_nqf0034_exclude_institutional_snp", "model.the_tuva_project.quality_measures__int_nqf0034_long", "model.the_tuva_project.quality_measures__int_nqf0034_numerator"], "model.the_tuva_project.quality_measures__int_nqf0034_exclusions": ["model.the_tuva_project.quality_measures__int_nqf0034_long"], "model.the_tuva_project.quality_measures__int_nqf0034__frailty": ["model.the_tuva_project.quality_measures__int_nqf0034_exclude_advanced_illness", "model.the_tuva_project.quality_measures__int_nqf0034_exclude_dementia"], "model.the_tuva_project.quality_measures__int_nqf0034_exclude_hospice_palliative": ["model.the_tuva_project.quality_measures__int_nqf0034_exclusions"], "model.the_tuva_project.quality_measures__int_nqf0034_exclude_advanced_illness": ["model.the_tuva_project.quality_measures__int_nqf0034_exclusions"], "model.the_tuva_project.quality_measures__int_nqf0034_exclude_institutional_snp": ["model.the_tuva_project.quality_measures__int_nqf0034_exclusions"], "model.the_tuva_project.quality_measures__int_nqf0034_exclude_colectomy_cancer": ["model.the_tuva_project.quality_measures__int_nqf0034_exclusions"], "model.the_tuva_project.quality_measures__int_nqf0034_numerator": ["model.the_tuva_project.quality_measures__int_nqf0034_long"], "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.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__long_condition_category": ["model.the_tuva_project.ccsr__singular_condition_category", "model.the_tuva_project.ed_classification__summary"], "model.the_tuva_project.ccsr__long_procedure_category": [], "model.the_tuva_project.ccsr__dx_vertical_pivot": ["model.the_tuva_project.ccsr__long_condition_category"], "model.the_tuva_project.ccsr__procedure_category_map": ["model.the_tuva_project.ccsr__long_procedure_category"], "model.the_tuva_project.financial_pmpm__stg_eligibility": ["model.the_tuva_project.financial_pmpm__member_months"], "model.the_tuva_project.financial_pmpm__stg_medical_claim": ["model.the_tuva_project.financial_pmpm__patient_spend_with_service_categories"], "model.the_tuva_project.financial_pmpm__stg_pharmacy_claim": ["model.the_tuva_project.financial_pmpm__patient_spend_with_service_categories"], "model.the_tuva_project.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___plan_.b941ddaf9e"], "model.the_tuva_project.financial_pmpm__member_months": ["model.the_tuva_project.financial_pmpm__pmpm_prep", "model.the_tuva_project.insights__count_claim_by_date_column", "model.the_tuva_project.insights__orphan_claim_by_claim_type", "model.the_tuva_project.insights__orphan_claim_by_claim_type"], "model.the_tuva_project.financial_pmpm__service_category_1_paid_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__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_2_allowed_pivot": ["model.the_tuva_project.financial_pmpm__pmpm_prep"], "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__patient": ["model.the_tuva_project.chronic_conditions__tuva_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.tuva_chronic_conditions__stg_core__condition": ["model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_long"], "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_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_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.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_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_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.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"], "seed.the_tuva_project.terminology__admit_type": ["model.the_tuva_project.acute_inpatient__summary", "model.the_tuva_project.data_profiling__medical_claim_invalid_values", "model.the_tuva_project.emergency_department__summary"], "seed.the_tuva_project.terminology__ssa_fips_state": [], "seed.the_tuva_project.terminology__medicare_orec": ["model.the_tuva_project.data_profiling__eligibility_invalid_values"], "seed.the_tuva_project.terminology__gender": ["model.the_tuva_project.data_profiling__eligibility_invalid_values"], "seed.the_tuva_project.terminology__ethnicity": [], "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.emergency_department__summary", "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__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__icd_9_cm": ["model.the_tuva_project.acute_inpatient__summary", "model.the_tuva_project.emergency_department__summary"], "seed.the_tuva_project.terminology__race": ["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__loinc_deprecated_mapping": [], "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__discharge_disposition": ["model.the_tuva_project.acute_inpatient__summary", "model.the_tuva_project.data_profiling__medical_claim_invalid_values", "model.the_tuva_project.emergency_department__summary", "model.the_tuva_project.readmissions__encounter_data_quality"], "seed.the_tuva_project.terminology__icd_9_pcs": [], "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__mdc": [], "seed.the_tuva_project.terminology__admit_source": ["model.the_tuva_project.acute_inpatient__summary", "model.the_tuva_project.data_profiling__medical_claim_invalid_values", "model.the_tuva_project.emergency_department__summary"], "seed.the_tuva_project.terminology__calendar": ["model.the_tuva_project.financial_pmpm__member_months", "model.the_tuva_project.insights__count_claim_by_date_column"], "seed.the_tuva_project.terminology__other_provider_taxonomy": [], "seed.the_tuva_project.terminology__icd_10_cm": ["model.the_tuva_project.acute_inpatient__summary", "model.the_tuva_project.core__stg_claims_condition", "model.the_tuva_project.data_profiling__medical_claim_invalid_values", "model.the_tuva_project.emergency_department__summary", "model.the_tuva_project.readmissions__encounter_with_ccs"], "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__hcpcs_level_2": ["model.the_tuva_project.service_category__dq_input_layer_tests"], "seed.the_tuva_project.terminology__fips_county": [], "seed.the_tuva_project.terminology__ansi_fips_state": [], "seed.the_tuva_project.terminology__encounter_type": [], "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__summary", "model.the_tuva_project.emergency_department__summary"], "seed.the_tuva_project.terminology__payer_type": ["model.the_tuva_project.data_profiling__eligibility_invalid_values"], "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.emergency_department__summary", "model.the_tuva_project.service_category__acute_inpatient_institutional", "model.the_tuva_project.service_category__dq_input_layer_tests"], "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__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__medicare_dual_eligibility": ["model.the_tuva_project.data_profiling__eligibility_invalid_values"], "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__loinc": [], "seed.the_tuva_project.data_profiling__test_catalog": [], "seed.the_tuva_project.service_category__service_categories": [], "seed.the_tuva_project.ed_classification__johnston_icd9": ["model.the_tuva_project.ed_classification__int_map_primary_dx", "test.the_tuva_project.not_null_ed_classification__johnston_icd9_icd9.a7feea49c0", "test.the_tuva_project.unique_ed_classification__johnston_icd9_icd9.08c1dc4617"], "seed.the_tuva_project.ed_classification__icd_10_cm_to_ccs": [], "seed.the_tuva_project.ed_classification__johnston_icd10": ["model.the_tuva_project.ed_classification__int_map_primary_dx", "test.the_tuva_project.not_null_ed_classification__johnston_icd10_icd10.d04e7f84c7", "test.the_tuva_project.unique_ed_classification__johnston_icd10_icd10.3d55f2b2dd"], "seed.the_tuva_project.ed_classification__categories": ["model.the_tuva_project.ed_classification__summary"], "seed.the_tuva_project.readmissions__potentially_planned_ccs_procedure_category": ["model.the_tuva_project.readmissions__planned_encounter"], "seed.the_tuva_project.readmissions__icd_10_cm_to_ccs": ["model.the_tuva_project.readmissions__encounter_with_ccs"], "seed.the_tuva_project.readmissions__potentially_planned_icd_10_pcs": ["model.the_tuva_project.readmissions__planned_encounter"], "seed.the_tuva_project.readmissions__acute_diagnosis_ccs": ["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__exclusion_ccs_diagnosis_category": ["model.the_tuva_project.readmissions__exclusion"], "seed.the_tuva_project.readmissions__acute_diagnosis_icd_10_cm": ["model.the_tuva_project.readmissions__planned_encounter"], "seed.the_tuva_project.readmissions__surgery_gynecology_cohort": ["model.the_tuva_project.readmissions__encounter_specialty_cohort"], "seed.the_tuva_project.readmissions__always_planned_ccs_procedure_category": ["model.the_tuva_project.readmissions__planned_encounter"], "seed.the_tuva_project.readmissions__icd_10_pcs_to_ccs": ["model.the_tuva_project.readmissions__procedure_ccs"], "seed.the_tuva_project.readmissions__always_planned_ccs_diagnosis_category": ["model.the_tuva_project.readmissions__planned_encounter"], "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_hierarchy": ["model.the_tuva_project.cms_hcc__int_hcc_hierarchy"], "seed.the_tuva_project.cms_hcc__icd_10_cm_mappings": ["model.the_tuva_project.cms_hcc__int_all_conditions", "model.the_tuva_project.cms_hcc__int_all_conditions", "model.the_tuva_project.cms_hcc__int_hcc_mapping"], "seed.the_tuva_project.cms_hcc__disease_factors": ["model.the_tuva_project.cms_hcc__int_all_conditions", "model.the_tuva_project.cms_hcc__int_disease_factors"], "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__cpt_hcpcs": ["model.the_tuva_project.cms_hcc__int_eligible_conditions"], "seed.the_tuva_project.cms_hcc__adjustment_rates": ["model.the_tuva_project.cms_hcc__patient_risk_scores"], "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__payment_hcc_count_factors": ["model.the_tuva_project.cms_hcc__int_hcc_count_factors"], "seed.the_tuva_project.cms_hcc__demographic_factors": ["model.the_tuva_project.cms_hcc__int_demographic_factors"], "seed.the_tuva_project.quality_measures__value_sets": ["model.the_tuva_project.quality_measures__int_nqf0034__frailty", "model.the_tuva_project.quality_measures__int_nqf0034_denominator", "model.the_tuva_project.quality_measures__int_nqf0034_exclude_advanced_illness", "model.the_tuva_project.quality_measures__int_nqf0034_exclude_advanced_illness", "model.the_tuva_project.quality_measures__int_nqf0034_exclude_colectomy_cancer", "model.the_tuva_project.quality_measures__int_nqf0034_exclude_dementia", "model.the_tuva_project.quality_measures__int_nqf0034_exclude_hospice_palliative", "model.the_tuva_project.quality_measures__int_nqf0034_numerator", "model.the_tuva_project.quality_measures__int_nqf2372__frailty", "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.quality_measures__measures": ["model.the_tuva_project.quality_measures__int_nqf0034_long", "model.the_tuva_project.quality_measures__int_nqf0034_long", "model.the_tuva_project.quality_measures__int_nqf0034_long", "model.the_tuva_project.quality_measures__int_nqf2372__performance_period", "model.the_tuva_project.quality_measures__int_nqf2372__performance_period", "model.the_tuva_project.quality_measures__int_nqf2372__performance_period"], "seed.the_tuva_project.quality_measures__concepts": [], "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.ccsr__dxccsr_v2023_1_body_systems": ["model.the_tuva_project.ccsr__long_condition_category"], "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.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"], "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.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": [], "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_financial_pmpm__pmpm_prep__patient_id___year_month___plan_.b941ddaf9e": [], "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_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": [], "model.input_layer.observation": ["model.the_tuva_project.core__stg_clinical_observation"], "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"], "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": [], "model.the_tuva_project.core__practitioner": [], "model.the_tuva_project.core__eligibility": ["model.the_tuva_project.cms_hcc__stg_core__eligibility", "model.the_tuva_project.financial_pmpm__stg_eligibility"], "model.the_tuva_project.core__stg_clinical_lab_result": ["model.the_tuva_project.core__lab_result"], "model.the_tuva_project.core__stg_claims_pharmacy_claim": ["model.the_tuva_project.core__pharmacy_claim"], "model.the_tuva_project.core__stg_clinical_patient": ["model.the_tuva_project.core__patient"], "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__pharmacy_claim": ["model.the_tuva_project.financial_pmpm__stg_pharmacy_claim", "model.the_tuva_project.insights__count_claim_by_claim_type", "model.the_tuva_project.insights__count_claim_by_date_column", "model.the_tuva_project.insights__count_claim_by_date_column", "model.the_tuva_project.insights__orphan_claim_by_claim_type", "model.the_tuva_project.insights__sum_amount_by_claim_type", "model.the_tuva_project.insights__trend_sum_amount_by_claim_type", "model.the_tuva_project.quality_measures__stg_pharmacy_claim"], "model.the_tuva_project.core__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__medical_claim": ["model.the_tuva_project.cms_hcc__stg_core__medical_claim", "model.the_tuva_project.financial_pmpm__stg_medical_claim", "model.the_tuva_project.insights__count_claim_by_claim_type", "model.the_tuva_project.insights__count_claim_by_date_column", "model.the_tuva_project.insights__count_claim_by_date_column", "model.the_tuva_project.insights__count_claim_by_date_column", "model.the_tuva_project.insights__count_claim_by_date_column", "model.the_tuva_project.insights__count_claim_by_date_column", "model.the_tuva_project.insights__count_claim_by_service_category", "model.the_tuva_project.insights__count_claim_by_service_category", "model.the_tuva_project.insights__orphan_claim_by_claim_type", "model.the_tuva_project.insights__sum_amount_by_claim_type", "model.the_tuva_project.insights__sum_amount_by_service_category", "model.the_tuva_project.insights__sum_amount_by_service_category", "model.the_tuva_project.insights__trend_count_claim_by_claim_type", "model.the_tuva_project.insights__trend_count_claim_by_service_category", "model.the_tuva_project.insights__trend_count_claim_by_service_category", "model.the_tuva_project.insights__trend_sum_amount_by_claim_type", "model.the_tuva_project.insights__trend_sum_amount_by_service_category", "model.the_tuva_project.insights__trend_sum_amount_by_service_category", "model.the_tuva_project.quality_measures__stg_medical_claim", "model.the_tuva_project.readmissions__stg_core__medical_claim", "test.the_tuva_project.unique_core__medical_claim__claim_id_claim_line_number_.b9ab42f1f0"], "model.the_tuva_project.core__stg_clinical_medication": ["model.the_tuva_project.core__medication"], "model.the_tuva_project.core__observation": ["model.the_tuva_project.quality_measures__stg_core__observation"], "model.the_tuva_project.core__stg_claims_eligibility": ["model.the_tuva_project.core__eligibility"], "model.the_tuva_project.core__stg_claims_patient": ["model.the_tuva_project.core__patient"], "model.the_tuva_project.core__stg_clinical_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_encounter": [], "model.the_tuva_project.core__stg_clinical_observation": ["model.the_tuva_project.core__observation"], "model.the_tuva_project.core__stg_claims_practitioner": ["model.the_tuva_project.core__practitioner"], "model.the_tuva_project.core__stg_claims_location": ["model.the_tuva_project.core__location"], "model.the_tuva_project.core__stg_claims_procedure": ["model.the_tuva_project.core__procedure"], "model.the_tuva_project.core__stg_clinical_procedure": ["model.the_tuva_project.core__procedure"], "model.the_tuva_project.core__lab_result": ["model.the_tuva_project.quality_measures__stg_core__lab_result"], "model.the_tuva_project.core__medication": ["model.the_tuva_project.quality_measures__stg_core__medication"], "model.the_tuva_project.core__location": [], "model.the_tuva_project.core__stg_clinical_condition": ["model.the_tuva_project.core__condition"], "model.the_tuva_project.core__patient": ["model.the_tuva_project.cms_chronic_conditions__stg_core__patient", "model.the_tuva_project.cms_hcc__stg_core__patient", "model.the_tuva_project.ed_classification__stg_patient", "model.the_tuva_project.quality_measures__stg_core__patient", "model.the_tuva_project.tuva_chronic_conditions__stg_core__patient"], "model.the_tuva_project.core__stg_claims_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__condition": ["model.the_tuva_project.ccsr__stg_core__condition", "model.the_tuva_project.cms_chronic_conditions__stg_core__condition", "model.the_tuva_project.cms_hcc__stg_core__condition", "model.the_tuva_project.quality_measures__stg_core__condition", "model.the_tuva_project.readmissions__stg_core__condition", "model.the_tuva_project.tuva_chronic_conditions__stg_core__condition"], "model.the_tuva_project.core__stg_clinical_practitioner": ["model.the_tuva_project.core__practitioner"], "test.the_tuva_project.unique_core__medical_claim__claim_id_claim_line_number_.b9ab42f1f0": []}} \ No newline at end of file +{"metadata": {"dbt_schema_version": "https://schemas.getdbt.com/dbt/manifest/v8.json", "dbt_version": "1.4.5", "generated_at": "2023-12-13T23:31:59.798647Z", "invocation_id": "f31303e4-74ec-429d-9417-b329af1ae438", "env": {}, "project_id": "c67fdb5d91230d67641e7c60c81d655e", "user_id": "7acd446d-f397-41c9-9f69-07656e135a86", "send_anonymous_usage_stats": true, "adapter_type": "snowflake"}, "nodes": {"seed.input_layer.eligibility_seed": {"database": "devforrest", "schema": "_tuva_synthetic", "name": "eligibility_seed", "resource_type": "seed", "package_name": "input_layer", "path": "eligibility_seed.csv", "original_file_path": "../seeds\\eligibility_seed.csv", "unique_id": "seed.input_layer.eligibility_seed", "fqn": ["input_layer", "eligibility_seed"], "alias": "eligibility_seed", "checksum": {"name": "sha256", "checksum": "0f576b654df2062fa4770c70b5ee48bbf37333a5d8362500909ba7c280cbad63"}, "config": {"enabled": true, "alias": null, "schema": "_tuva_synthetic", "database": null, "tags": [], "meta": {}, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"patient_id": "varchar(255)", "member_id": "varchar(255)", "gender": "varchar(255)", "race": "varchar(255)", "birth_date": "date", "death_date": "date", "death_flag": "integer", "enrollment_start_date": "date", "enrollment_end_date": "date", "payer": "varchar(255)", "payer_type": "varchar(255)", "plan": "varchar(255)", "original_reason_entitlement_code": "varchar(255)", "dual_status_code": "varchar(255)", "medicare_status_code": "varchar(255)", "first_name": "varchar(255)", "last_name": "varchar(255)", "address": "varchar(255)", "city": "varchar(255)", "state": "varchar(255)", "zip_code": "varchar(255)", "phone": "varchar(255)", "data_source": "varchar(255)"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "quote_columns": null, "post-hook": [], "pre-hook": []}, "tags": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "input_layer://../seeds\\_seeds.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "_tuva_synthetic", "enabled": true, "column_types": {"patient_id": "varchar(255)", "member_id": "varchar(255)", "gender": "varchar(255)", "race": "varchar(255)", "birth_date": "date", "death_date": "date", "death_flag": "integer", "enrollment_start_date": "date", "enrollment_end_date": "date", "payer": "varchar(255)", "payer_type": "varchar(255)", "plan": "varchar(255)", "original_reason_entitlement_code": "varchar(255)", "dual_status_code": "varchar(255)", "medicare_status_code": "varchar(255)", "first_name": "varchar(255)", "last_name": "varchar(255)", "address": "varchar(255)", "city": "varchar(255)", "state": "varchar(255)", "zip_code": "varchar(255)", "phone": "varchar(255)", "data_source": "varchar(255)"}}, "created_at": 1702481695.9297009, "relation_name": "devforrest._tuva_synthetic.eligibility_seed", "raw_code": "", "root_path": "C:\\Users\\forre\\PycharmProjects\\the_tuva_project\\integration_tests\\docs_generate", "depends_on": {"macros": []}}, "seed.input_layer.medical_claim_seed": {"database": "devforrest", "schema": "_tuva_synthetic", "name": "medical_claim_seed", "resource_type": "seed", "package_name": "input_layer", "path": "medical_claim_seed.csv", "original_file_path": "../seeds\\medical_claim_seed.csv", "unique_id": "seed.input_layer.medical_claim_seed", "fqn": ["input_layer", "medical_claim_seed"], "alias": "medical_claim_seed", "checksum": {"name": "sha256", "checksum": "45780ce7ad0ca8b131c6874acf7bb51734a98e280a4981c96f79e4f300524b9b"}, "config": {"enabled": true, "alias": null, "schema": "_tuva_synthetic", "database": null, "tags": [], "meta": {}, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"claim_id": "varchar(255)", "claim_line_number": "integer", "claim_type": "varchar(255)", "patient_id": "varchar(255)", "member_id": "varchar(255)", "payer": "varchar(255)", "plan": "varchar(255)", "claim_start_date": "date", "claim_end_date": "date", "claim_line_start_date": "date", "claim_line_end_date": "date", "admission_date": "date", "discharge_date": "date", "admit_source_code": "varchar(255)", "admit_type_code": "varchar(255)", "discharge_disposition_code": "varchar(255)", "place_of_service_code": "varchar(255)", "bill_type_code": "varchar(255)", "ms_drg_code": "varchar(255)", "apr_drg_code": "varchar(255)", "revenue_center_code": "varchar(255)", "service_unit_quantity": "integer", "hcpcs_code": "varchar(255)", "hcpcs_modifier_1": "varchar(255)", "hcpcs_modifier_2": "varchar(255)", "hcpcs_modifier_3": "varchar(255)", "hcpcs_modifier_4": "varchar(255)", "hcpcs_modifier_5": "varchar(255)", "rendering_npi": "varchar(255)", "billing_npi": "varchar(255)", "facility_npi": "varchar(255)", "paid_date": "date", "paid_amount": "float", "allowed_amount": "float", "charge_amount": "float", "coinsurance_amount": "float", "copayment_amount": "float", "deductible_amount": "float", "total_cost_amount": "float", "diagnosis_code_type": "varchar(255)", "diagnosis_code_1": "varchar(255)", "diagnosis_code_2": "varchar(255)", "diagnosis_code_3": "varchar(255)", "diagnosis_code_4": "varchar(255)", "diagnosis_code_5": "varchar(255)", "diagnosis_code_6": "varchar(255)", "diagnosis_code_7": "varchar(255)", "diagnosis_code_8": "varchar(255)", "diagnosis_code_9": "varchar(255)", "diagnosis_code_10": "varchar(255)", "diagnosis_code_11": "varchar(255)", "diagnosis_code_12": "varchar(255)", "diagnosis_code_13": "varchar(255)", "diagnosis_code_14": "varchar(255)", "diagnosis_code_15": "varchar(255)", "diagnosis_code_16": "varchar(255)", "diagnosis_code_17": "varchar(255)", "diagnosis_code_18": "varchar(255)", "diagnosis_code_19": "varchar(255)", "diagnosis_code_20": "varchar(255)", "diagnosis_code_21": "varchar(255)", "diagnosis_code_22": "varchar(255)", "diagnosis_code_23": "varchar(255)", "diagnosis_code_24": "varchar(255)", "diagnosis_code_25": "varchar(255)", "diagnosis_poa_1": "varchar(255)", "diagnosis_poa_2": "varchar(255)", "diagnosis_poa_3": "varchar(255)", "diagnosis_poa_4": "varchar(255)", "diagnosis_poa_5": "varchar(255)", "diagnosis_poa_6": "varchar(255)", "diagnosis_poa_7": "varchar(255)", "diagnosis_poa_8": "varchar(255)", "diagnosis_poa_9": "varchar(255)", "diagnosis_poa_10": "varchar(255)", "diagnosis_poa_11": "varchar(255)", "diagnosis_poa_12": "varchar(255)", "diagnosis_poa_13": "varchar(255)", "diagnosis_poa_14": "varchar(255)", "diagnosis_poa_15": "varchar(255)", "diagnosis_poa_16": "varchar(255)", "diagnosis_poa_17": "varchar(255)", "diagnosis_poa_18": "varchar(255)", "diagnosis_poa_19": "varchar(255)", "diagnosis_poa_20": "varchar(255)", "diagnosis_poa_21": "varchar(255)", "diagnosis_poa_22": "varchar(255)", "diagnosis_poa_23": "varchar(255)", "diagnosis_poa_24": "varchar(255)", "diagnosis_poa_25": "varchar(255)", "procedure_code_type": "varchar(255)", "procedure_code_1": "varchar(255)", "procedure_code_2": "varchar(255)", "procedure_code_3": "varchar(255)", "procedure_code_4": "varchar(255)", "procedure_code_5": "varchar(255)", "procedure_code_6": "varchar(255)", "procedure_code_7": "varchar(255)", "procedure_code_8": "varchar(255)", "procedure_code_9": "varchar(255)", "procedure_code_10": "varchar(255)", "procedure_code_11": "varchar(255)", "procedure_code_12": "varchar(255)", "procedure_code_13": "varchar(255)", "procedure_code_14": "varchar(255)", "procedure_code_15": "varchar(255)", "procedure_code_16": "varchar(255)", "procedure_code_17": "varchar(255)", "procedure_code_18": "varchar(255)", "procedure_code_19": "varchar(255)", "procedure_code_20": "varchar(255)", "procedure_code_21": "varchar(255)", "procedure_code_22": "varchar(255)", "procedure_code_23": "varchar(255)", "procedure_code_24": "varchar(255)", "procedure_code_25": "varchar(255)", "procedure_date_1": "date", "procedure_date_2": "date", "procedure_date_3": "date", "procedure_date_4": "date", "procedure_date_5": "date", "procedure_date_6": "date", "procedure_date_7": "date", "procedure_date_8": "date", "procedure_date_9": "date", "procedure_date_10": "date", "procedure_date_11": "date", "procedure_date_12": "date", "procedure_date_13": "date", "procedure_date_14": "date", "procedure_date_15": "date", "procedure_date_16": "date", "procedure_date_17": "date", "procedure_date_18": "date", "procedure_date_19": "date", "procedure_date_20": "date", "procedure_date_21": "date", "procedure_date_22": "date", "procedure_date_23": "date", "procedure_date_24": "date", "procedure_date_25": "date", "data_source": "varchar(255)"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "quote_columns": null, "post-hook": [], "pre-hook": []}, "tags": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "input_layer://../seeds\\_seeds.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "_tuva_synthetic", "enabled": true, "column_types": {"claim_id": "varchar(255)", "claim_line_number": "integer", "claim_type": "varchar(255)", "patient_id": "varchar(255)", "member_id": "varchar(255)", "payer": "varchar(255)", "plan": "varchar(255)", "claim_start_date": "date", "claim_end_date": "date", "claim_line_start_date": "date", "claim_line_end_date": "date", "admission_date": "date", "discharge_date": "date", "admit_source_code": "varchar(255)", "admit_type_code": "varchar(255)", "discharge_disposition_code": "varchar(255)", "place_of_service_code": "varchar(255)", "bill_type_code": "varchar(255)", "ms_drg_code": "varchar(255)", "apr_drg_code": "varchar(255)", "revenue_center_code": "varchar(255)", "service_unit_quantity": "integer", "hcpcs_code": "varchar(255)", "hcpcs_modifier_1": "varchar(255)", "hcpcs_modifier_2": "varchar(255)", "hcpcs_modifier_3": "varchar(255)", "hcpcs_modifier_4": "varchar(255)", "hcpcs_modifier_5": "varchar(255)", "rendering_npi": "varchar(255)", "billing_npi": "varchar(255)", "facility_npi": "varchar(255)", "paid_date": "date", "paid_amount": "float", "allowed_amount": "float", "charge_amount": "float", "coinsurance_amount": "float", "copayment_amount": "float", "deductible_amount": "float", "total_cost_amount": "float", "diagnosis_code_type": "varchar(255)", "diagnosis_code_1": "varchar(255)", "diagnosis_code_2": "varchar(255)", "diagnosis_code_3": "varchar(255)", "diagnosis_code_4": "varchar(255)", "diagnosis_code_5": "varchar(255)", "diagnosis_code_6": "varchar(255)", "diagnosis_code_7": "varchar(255)", "diagnosis_code_8": "varchar(255)", "diagnosis_code_9": "varchar(255)", "diagnosis_code_10": "varchar(255)", "diagnosis_code_11": "varchar(255)", "diagnosis_code_12": "varchar(255)", "diagnosis_code_13": "varchar(255)", "diagnosis_code_14": "varchar(255)", "diagnosis_code_15": "varchar(255)", "diagnosis_code_16": "varchar(255)", "diagnosis_code_17": "varchar(255)", "diagnosis_code_18": "varchar(255)", "diagnosis_code_19": "varchar(255)", "diagnosis_code_20": "varchar(255)", "diagnosis_code_21": "varchar(255)", "diagnosis_code_22": "varchar(255)", "diagnosis_code_23": "varchar(255)", "diagnosis_code_24": "varchar(255)", "diagnosis_code_25": "varchar(255)", "diagnosis_poa_1": "varchar(255)", "diagnosis_poa_2": "varchar(255)", "diagnosis_poa_3": "varchar(255)", "diagnosis_poa_4": "varchar(255)", "diagnosis_poa_5": "varchar(255)", "diagnosis_poa_6": "varchar(255)", "diagnosis_poa_7": "varchar(255)", "diagnosis_poa_8": "varchar(255)", "diagnosis_poa_9": "varchar(255)", "diagnosis_poa_10": "varchar(255)", "diagnosis_poa_11": "varchar(255)", "diagnosis_poa_12": "varchar(255)", "diagnosis_poa_13": "varchar(255)", "diagnosis_poa_14": "varchar(255)", "diagnosis_poa_15": "varchar(255)", "diagnosis_poa_16": "varchar(255)", "diagnosis_poa_17": "varchar(255)", "diagnosis_poa_18": "varchar(255)", "diagnosis_poa_19": "varchar(255)", "diagnosis_poa_20": "varchar(255)", "diagnosis_poa_21": "varchar(255)", "diagnosis_poa_22": "varchar(255)", "diagnosis_poa_23": "varchar(255)", "diagnosis_poa_24": "varchar(255)", "diagnosis_poa_25": "varchar(255)", "procedure_code_type": "varchar(255)", "procedure_code_1": "varchar(255)", "procedure_code_2": "varchar(255)", "procedure_code_3": "varchar(255)", "procedure_code_4": "varchar(255)", "procedure_code_5": "varchar(255)", "procedure_code_6": "varchar(255)", "procedure_code_7": "varchar(255)", "procedure_code_8": "varchar(255)", "procedure_code_9": "varchar(255)", "procedure_code_10": "varchar(255)", "procedure_code_11": "varchar(255)", "procedure_code_12": "varchar(255)", "procedure_code_13": "varchar(255)", "procedure_code_14": "varchar(255)", "procedure_code_15": "varchar(255)", "procedure_code_16": "varchar(255)", "procedure_code_17": "varchar(255)", "procedure_code_18": "varchar(255)", "procedure_code_19": "varchar(255)", "procedure_code_20": "varchar(255)", "procedure_code_21": "varchar(255)", "procedure_code_22": "varchar(255)", "procedure_code_23": "varchar(255)", "procedure_code_24": "varchar(255)", "procedure_code_25": "varchar(255)", "procedure_date_1": "date", "procedure_date_2": "date", "procedure_date_3": "date", "procedure_date_4": "date", "procedure_date_5": "date", "procedure_date_6": "date", "procedure_date_7": "date", "procedure_date_8": "date", "procedure_date_9": "date", "procedure_date_10": "date", "procedure_date_11": "date", "procedure_date_12": "date", "procedure_date_13": "date", "procedure_date_14": "date", "procedure_date_15": "date", "procedure_date_16": "date", "procedure_date_17": "date", "procedure_date_18": "date", "procedure_date_19": "date", "procedure_date_20": "date", "procedure_date_21": "date", "procedure_date_22": "date", "procedure_date_23": "date", "procedure_date_24": "date", "procedure_date_25": "date", "data_source": "varchar(255)"}}, "created_at": 1702481695.9945703, "relation_name": "devforrest._tuva_synthetic.medical_claim_seed", "raw_code": "", "root_path": "C:\\Users\\forre\\PycharmProjects\\the_tuva_project\\integration_tests\\docs_generate", "depends_on": {"macros": []}}, "seed.input_layer.pharmacy_claim_seed": {"database": "devforrest", "schema": "_tuva_synthetic", "name": "pharmacy_claim_seed", "resource_type": "seed", "package_name": "input_layer", "path": "pharmacy_claim_seed.csv", "original_file_path": "../seeds\\pharmacy_claim_seed.csv", "unique_id": "seed.input_layer.pharmacy_claim_seed", "fqn": ["input_layer", "pharmacy_claim_seed"], "alias": "pharmacy_claim_seed", "checksum": {"name": "sha256", "checksum": "66096b86d7bd198c82e3c67c5546791e094b980d06ab9379d00e3b58c054dfd0"}, "config": {"enabled": true, "alias": null, "schema": "_tuva_synthetic", "database": null, "tags": [], "meta": {}, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"claim_id": "varchar(255)", "claim_line_number": "integer", "patient_id": "varchar(255)", "member_id": "varchar(255)", "payer": "varchar(255)", "plan": "varchar(255)", "prescribing_provider_npi": "varchar(255)", "dispensing_provider_npi": "varchar(255)", "dispensing_date": "date", "ndc_code": "varchar(255)", "quantity": "integer", "days_supply": "integer", "refills": "integer", "paid_date": "date", "paid_amount": "float", "allowed_amount": "float", "data_source": "varchar(255)"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "quote_columns": null, "post-hook": [], "pre-hook": []}, "tags": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "input_layer://../seeds\\_seeds.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "_tuva_synthetic", "enabled": true, "column_types": {"claim_id": "varchar(255)", "claim_line_number": "integer", "patient_id": "varchar(255)", "member_id": "varchar(255)", "payer": "varchar(255)", "plan": "varchar(255)", "prescribing_provider_npi": "varchar(255)", "dispensing_provider_npi": "varchar(255)", "dispensing_date": "date", "ndc_code": "varchar(255)", "quantity": "integer", "days_supply": "integer", "refills": "integer", "paid_date": "date", "paid_amount": "float", "allowed_amount": "float", "data_source": "varchar(255)"}}, "created_at": 1702481696.0101008, "relation_name": "devforrest._tuva_synthetic.pharmacy_claim_seed", "raw_code": "", "root_path": "C:\\Users\\forre\\PycharmProjects\\the_tuva_project\\integration_tests\\docs_generate", "depends_on": {"macros": []}}, "model.the_tuva_project.ccsr__singular_condition_category": {"database": "devforrest", "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": "0c91aa87fc3f86e69171a3c6dc1efab19a1ca907cb50a41410b13682e83a6f54"}, "config": {"enabled": true, "alias": "singular_condition_category", "schema": "ccsr", "database": null, "tags": ["ccsr"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["ccsr"], "description": "This model contains only the CCSR's default category assignment for the ICD-10 code, and only for the first-listed ICD-10 code (`diagnosis_code = 1`).", "columns": {"encounter_id": {"name": "encounter_id", "description": "Unique identifier for an encounter.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "claim_id": {"name": "claim_id", "description": "Unique claim_id for each claim.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "patient_id": {"name": "patient_id", "description": "Unique identifier for each patient.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "body_system": {"name": "body_system", "description": "The body system to which each parent category belongs. The 22 body systems generally follow the structure of the ICD-10-CM diagnosis chapters. Note that the procedure tables don't have this column, but a conceptually related field in procedure models is `clinical_domain`.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "ccsr_parent_category": {"name": "ccsr_parent_category", "description": "The parent category code for each CCSR category. In practice, this is the three letter prefix to the category code.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "parent_category_description": {"name": "parent_category_description", "description": "A description of the parent category.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "ccsr_category": {"name": "ccsr_category", "description": "A CCSR category for the ICD-10-CM code. One ICD-10-CM code may have up 6 CCSR categories associated, ordinally ranked by the ccsr_category_rank. Will be null if a record has a `code` that isn't referenced in the CCSR seed file.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "ccsr_category_description": {"name": "ccsr_category_description", "description": "The human readable description of the `ccsr_category`.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "dxccsr_version": {"name": "dxccsr_version", "description": "The version number of the CCSR program from which the dbt model was derived.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The time at with the model was materialized. Generated by `dbt_utils.pretty_time` as the local time of the `dbt run` environment. Timezone is configurable via the `tuva_last_run` var.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://models\\ccsr\\ccsr_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "ccsr", "alias": "singular_condition_category", "tags": ["ccsr"], "materialized": "table", "enabled": true, "bind": false}, "created_at": 1702481696.1594605, "relation_name": "devforrest.ccsr.singular_condition_category", "raw_code": "{{ config(\r\n enabled = var('ccsr_enabled',var('claims_enabled',var('clinical_enabled',var('tuva_marts_enabled',False))))\r\n )\r\n}}\r\n\r\nselect \r\n encounter_id,\r\n claim_id,\r\n patient_id,\r\n ccsr_category,\r\n ccsr_category_description,\r\n ccsr_parent_category,\r\n parent_category_description,\r\n body_system,\r\n {{ var('dxccsr_version') }} as dxccsr_version,\r\n '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ref('ccsr__long_condition_category')}}\r\nwhere \r\n is_{{ var('record_type', 'ip') }}_default_category = true\r\n and condition_rank = 1", "language": "sql", "refs": [["ccsr__long_condition_category"]], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.ccsr__long_condition_category"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\ccsr\\final\\ccsr__singular_condition_category.sql", "compiled": true, "compiled_code": "\n\nselect \n encounter_id,\n claim_id,\n patient_id,\n ccsr_category,\n ccsr_category_description,\n ccsr_parent_category,\n parent_category_description,\n body_system,\n '2023.1' as dxccsr_version,\n '2023-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom devforrest.ccsr.long_condition_category\nwhere \n is_ip_default_category = true\n and condition_rank = 1", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.ccsr__dx_vertical_pivot": {"database": "devforrest", "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": "d907e2bf11a2b83eb2e95dd752216a14eb9e10be87d6201d74c4744f2acc5460"}, "config": {"enabled": true, "alias": "dx_vertical_pivot", "schema": "ccsr", "database": null, "tags": ["ccsr"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["ccsr"], "description": "This is an intermediate model that pivots the DXCCSR's wide-format mapping CSV\ninto a long format table. While the seed uses 6 columns to represent the 6 CCSR codes that\nmay be present, this generates one row for each CCSR category per ICD code, so up to\n6 rows per code. \n\nThis model includes details and descriptions of the CCSR parent category and body systems that are inherited by the final models.\n\nThis model may also be useful in looking up CCSR condition category, body system, and parent category information.\n", "columns": {"code": {"name": "code", "description": "The ICD-10-CM code", "meta": {}, "data_type": null, "quote": null, "tags": []}, "code_description": {"name": "code_description", "description": "The description of the ICD-10-CM code included in the seed file.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "ccsr_category": {"name": "ccsr_category", "description": "A CCSR category for the ICD-10-CM code. One ICD-10-CM code may have up 6 CCSR categories associated, ordinally ranked by the ccsr_category_rank. Will be null if a record has a `code` that isn't referenced in the CCSR seed file.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "ccsr_category_rank": {"name": "ccsr_category_rank", "description": "The ordinal rank of a given CCSR category mapped to an ICD-10-CM code. The CCSR seed CSV has the order of categories assigned to each ICD-10-CM code.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "ccsr_category_description": {"name": "ccsr_category_description", "description": "The human readable description of the `ccsr_category`.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "ccsr_parent_category": {"name": "ccsr_parent_category", "description": "The CCSR parent category - the three letter prefix for each alphanumeric category.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "is_ip_default_category": {"name": "is_ip_default_category", "description": "For each ICD-10-CM code, this field will return true for the CCSR category that is the default value for the code if the underlying record is an inpatient encounter.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "is_op_default_category": {"name": "is_op_default_category", "description": "For each ICD-10-CM code, this field will return true for the CCSR category that is the default value for the code if the underlying record is an outpatient encounter.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The time at with the model was materialized. Generated by `dbt_utils.pretty_time` as the local time of the `dbt run` environment. Timezone is configurable via the `tuva_last_run` var.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://models\\ccsr\\ccsr_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "ccsr", "alias": "dx_vertical_pivot", "tags": ["ccsr"], "materialized": "table", "enabled": true, "bind": false}, "created_at": 1702481696.1347008, "relation_name": "devforrest.ccsr.dx_vertical_pivot", "raw_code": "{{ config(\r\n enabled = var('ccsr_enabled',var('claims_enabled',var('clinical_enabled',var('tuva_marts_enabled',False))))\r\n )\r\n}}\r\n\r\nwith codes as (\r\n \r\n select\r\n icd_10_cm_code as code, \r\n icd_10_cm_code_description as code_description,\r\n -- loop to generate columns for CCSR categories 1-6\r\n {%- for i in range(1,7) %}\r\n ccsr_category_{{ i }},\r\n ccsr_category_{{ i }}_description,\r\n {%- endfor %}\r\n default_ccsr_category_ip,\r\n default_ccsr_category_op\r\n from {{ ref('ccsr__dxccsr_v2023_1_cleaned_map') }}\r\n\r\n), long_union as (\r\n -- generate select & union statements to pivot category columns to rows\r\n {% for i in range(1,7,1) %}\r\n select \r\n code,\r\n code_description,\r\n left(ccsr_category_{{ i }}, 3) as ccsr_parent_category,\r\n ccsr_category_{{ i }} as ccsr_category,\r\n ccsr_category_{{ i }}_description as ccsr_category_description,\r\n {{ i }} as ccsr_category_rank,\r\n (ccsr_category_{{ i }} = default_ccsr_category_ip) as is_ip_default_category,\r\n (ccsr_category_{{ i }} = default_ccsr_category_op) as is_op_default_category\r\n from codes \r\n {{ \"union all\" if not loop.last else \"\" }}\r\n {%- endfor %}\r\n\r\n)\r\n\r\nselect distinct\r\n *,\r\n '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom long_union\r\n-- as not all diagnosis codes have multiple categories, we can discard nulls\r\nwhere ccsr_category is not null", "language": "sql", "refs": [["ccsr__dxccsr_v2023_1_cleaned_map"]], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["seed.the_tuva_project.ccsr__dxccsr_v2023_1_cleaned_map"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\ccsr\\intermediate\\ccsr__dx_vertical_pivot.sql", "compiled": true, "compiled_code": "\n\nwith codes as (\n \n select\n icd_10_cm_code as code, \n icd_10_cm_code_description as code_description,\n -- loop to generate columns for CCSR categories 1-6\n ccsr_category_1,\n ccsr_category_1_description,\n ccsr_category_2,\n ccsr_category_2_description,\n ccsr_category_3,\n ccsr_category_3_description,\n ccsr_category_4,\n ccsr_category_4_description,\n ccsr_category_5,\n ccsr_category_5_description,\n ccsr_category_6,\n ccsr_category_6_description,\n default_ccsr_category_ip,\n default_ccsr_category_op\n from devforrest.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-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom long_union\n-- as not all diagnosis codes have multiple categories, we can discard nulls\nwhere ccsr_category is not null", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.ccsr__procedure_category_map": {"database": "devforrest", "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": "b48be3bd266bb0ea87f900133474f5d9e0241592317e21919086ee5a693288f4"}, "config": {"enabled": true, "alias": "procedure_category_map", "schema": "ccsr", "database": null, "tags": ["ccsr"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["ccsr"], "description": "This is an intermediate model that renames some PRCCSR columns to align with other TUVA models as well as the `ccsr__dx_vertical_pivot` model.", "columns": {"code": {"name": "code", "description": "The ICD-10-PCS code", "meta": {}, "data_type": null, "quote": null, "tags": []}, "code_description": {"name": "code_description", "description": "The description of the ICD-10-PCS code included in the seed file.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "ccsr_category": {"name": "ccsr_category", "description": "The CCSR category to which the ICD-10 code is mapped.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "ccsr_category_description": {"name": "ccsr_category_description", "description": "A description of the CCSR category.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "clinical_domain": {"name": "clinical_domain", "description": "The clinical domain to which the CCSR code belongs. Note that the condition models don't have this column, but the `body_system` is a conceptually related column in the condition tables.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "ccsr_parent_category": {"name": "ccsr_parent_category", "description": "The CCSR parent category - the three letter prefix for each alphanumeric category.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The time at with the model was materialized. Generated by `dbt_utils.pretty_time` as the local time of the `dbt run` environment. Timezone is configurable via the `tuva_last_run` var.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://models\\ccsr\\ccsr_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "ccsr", "alias": "procedure_category_map", "tags": ["ccsr"], "materialized": "table", "enabled": true, "bind": false}, "created_at": 1702481696.1347008, "relation_name": "devforrest.ccsr.procedure_category_map", "raw_code": "{{ config(\r\n enabled = var('ccsr_enabled',var('claims_enabled',var('clinical_enabled',var('tuva_marts_enabled',False))))\r\n )\r\n}}\r\n\r\nselect \r\n icd_10_pcs as code,\r\n icd_10_pcs_description as code_description,\r\n prccsr as ccsr_category,\r\n left(prccsr, 3) as ccsr_parent_category,\r\n prccsr_description as ccsr_category_description,\r\n clinical_domain,\r\n '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('ccsr__prccsr_v2023_1_cleaned_map')}}", "language": "sql", "refs": [["ccsr__prccsr_v2023_1_cleaned_map"]], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["seed.the_tuva_project.ccsr__prccsr_v2023_1_cleaned_map"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\ccsr\\intermediate\\ccsr__procedure_category_map.sql", "compiled": true, "compiled_code": "\n\nselect \n icd_10_pcs as code,\n icd_10_pcs_description as code_description,\n prccsr as ccsr_category,\n left(prccsr, 3) as ccsr_parent_category,\n prccsr_description as ccsr_category_description,\n clinical_domain,\n '2023-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom devforrest.ccsr._value_set_prccsr_v2023_1_cleaned_map", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.ccsr__stg_core__condition": {"database": "devforrest", "schema": "dbt_forrest", "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": "25cc04ed992e44534359aadc59a1df333c9a517b5d4b867cee03efbd639259a1"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["ccsr"], "meta": {}, "materialized": "ephemeral", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["ccsr"], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://models\\ccsr\\ccsr_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"tags": ["ccsr"], "materialized": "ephemeral", "enabled": true, "bind": false}, "created_at": 1702481696.1654665, "relation_name": null, "raw_code": "{{ config(\r\n enabled = var('ccsr_enabled',var('claims_enabled',var('clinical_enabled',var('tuva_marts_enabled',False))))\r\n )\r\n}}\r\n\r\nselect *, '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('core__condition') }}", "language": "sql", "refs": [["core__condition"]], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.core__condition"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\ccsr\\staging\\ccsr__stg_core__condition.sql", "compiled": true, "compiled_code": "\n\nselect *, '2023-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom devforrest.core.condition", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.ccsr__stg_core__procedure": {"database": "devforrest", "schema": "dbt_forrest", "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": "8f5cb3f11ca58b9347b71680636ee70b103277d32066b12235b8145fccbf2cef"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["ccsr"], "meta": {}, "materialized": "ephemeral", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["ccsr"], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://models\\ccsr\\ccsr_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"tags": ["ccsr"], "materialized": "ephemeral", "enabled": true, "bind": false}, "created_at": 1702481696.1664593, "relation_name": null, "raw_code": "{{ config(\r\n enabled = var('ccsr_enabled',var('claims_enabled',var('clinical_enabled',var('tuva_marts_enabled',False))))\r\n )\r\n}}\r\n\r\nselect *, '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('core__procedure') }}", "language": "sql", "refs": [["core__procedure"]], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.core__procedure"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\ccsr\\staging\\ccsr__stg_core__procedure.sql", "compiled": true, "compiled_code": "\n\nselect *, '2023-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom devforrest.core.procedure", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.chronic_conditions__cms_chronic_conditions_wide": {"database": "devforrest", "schema": "chronic_conditions", "name": "chronic_conditions__cms_chronic_conditions_wide", "resource_type": "model", "package_name": "the_tuva_project", "path": "chronic_conditions\\final\\chronic_conditions__cms_chronic_conditions_wide.sql", "original_file_path": "models\\chronic_conditions\\final\\chronic_conditions__cms_chronic_conditions_wide.sql", "unique_id": "model.the_tuva_project.chronic_conditions__cms_chronic_conditions_wide", "fqn": ["the_tuva_project", "chronic_conditions", "final", "chronic_conditions__cms_chronic_conditions_wide"], "alias": "cms_chronic_conditions_wide", "checksum": {"name": "sha256", "checksum": "9ea114b7ec20cfd07cca20bc83b57cc325759c758f8fe4014ed1fbf68c374d84"}, "config": {"enabled": true, "alias": "cms_chronic_conditions_wide", "schema": "chronic_conditions", "database": null, "tags": ["cms_chronic_conditions", "chronic_conditions"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#2e0e0e"}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["cms_chronic_conditions", "chronic_conditions"], "description": "This model pivots conditions on the patient level (i.e. one record per patient) with flags for each chronic condition.\n", "columns": {"patient_id": {"name": "patient_id", "description": "Unique ID for the patient.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "acute_myocardial_infarction": {"name": "acute_myocardial_infarction", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "adhd_conduct_disorders_and_hyperkinetic_syndrome": {"name": "adhd_conduct_disorders_and_hyperkinetic_syndrome", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "alcohol_use_disorders": {"name": "alcohol_use_disorders", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "alzheimers_disease": {"name": "alzheimers_disease", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "anemia": {"name": "anemia", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "anxiety_disorders": {"name": "anxiety_disorders", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "asthma": {"name": "asthma", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "atrial_fibrillation_and_flutter": {"name": "atrial_fibrillation_and_flutter", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "autism_spectrum_disorders": {"name": "autism_spectrum_disorders", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "benign_prostatic_hyperplasia": {"name": "benign_prostatic_hyperplasia", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "bipolar_disorder": {"name": "bipolar_disorder", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "cancer_breast": {"name": "cancer_breast", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "cancer_colorectal": {"name": "cancer_colorectal", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "cancer_endometrial": {"name": "cancer_endometrial", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "cancer_lung": {"name": "cancer_lung", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "cancer_prostate": {"name": "cancer_prostate", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "cancer_urologic_kidney_renal_pelvis_and_ureter": {"name": "cancer_urologic_kidney_renal_pelvis_and_ureter", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "cataract": {"name": "cataract", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "cerebral_palsy": {"name": "cerebral_palsy", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "chronic_kidney_disease": {"name": "chronic_kidney_disease", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "chronic_obstructive_pulmonary_disease": {"name": "chronic_obstructive_pulmonary_disease", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "cystic_fibrosis_and_other_metabolic_developmental_disorders": {"name": "cystic_fibrosis_and_other_metabolic_developmental_disorders", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "depression_bipolar_or_other_depressive_mood_disorders": {"name": "depression_bipolar_or_other_depressive_mood_disorders", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "depressive_disorders": {"name": "depressive_disorders", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "diabetes": {"name": "diabetes", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "drug_use_disorders": {"name": "drug_use_disorders", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "epilepsy": {"name": "epilepsy", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "fibromyalgia_and_chronic_pain_and_fatigue": {"name": "fibromyalgia_and_chronic_pain_and_fatigue", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "glaucoma": {"name": "glaucoma", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "heart_failure_and_non_ischemic_heart_disease": {"name": "heart_failure_and_non_ischemic_heart_disease", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "hepatitis_a": {"name": "hepatitis_a", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "hepatitis_b_acute_or_unspecified": {"name": "hepatitis_b_acute_or_unspecified", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "hepatitis_b_chronic": {"name": "hepatitis_b_chronic", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "hepatitis_c_acute": {"name": "hepatitis_c_acute", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "hepatitis_c_chronic": {"name": "hepatitis_c_chronic", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "hepatitis_c_unspecified": {"name": "hepatitis_c_unspecified", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "hepatitis_d": {"name": "hepatitis_d", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "hepatitis_e": {"name": "hepatitis_e", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "hip_pelvic_fracture": {"name": "hip_pelvic_fracture", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "human_immunodeficiency_virus_and_or_acquired_immunodeficiency_syndrome_hiv_aids": {"name": "human_immunodeficiency_virus_and_or_acquired_immunodeficiency_syndrome_hiv_aids", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "hyperlipidemia": {"name": "hyperlipidemia", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "hypertension": {"name": "hypertension", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "hypothyroidism": {"name": "hypothyroidism", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "intellectual_disabilities_and_related_conditions": {"name": "intellectual_disabilities_and_related_conditions", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "ischemic_heart_disease": {"name": "ischemic_heart_disease", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "learning_disabilities": {"name": "learning_disabilities", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "leukemias_and_lymphomas": {"name": "leukemias_and_lymphomas", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "liver_disease_cirrhosis_and_other_liver_conditions_except_viral_hepatitis": {"name": "liver_disease_cirrhosis_and_other_liver_conditions_except_viral_hepatitis", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "migraine_and_chronic_headache": {"name": "migraine_and_chronic_headache", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "mobility_impairments": {"name": "mobility_impairments", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "multiple_sclerosis_and_transverse_myelitis": {"name": "multiple_sclerosis_and_transverse_myelitis", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "muscular_dystrophy": {"name": "muscular_dystrophy", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "non_alzheimers_dementia": {"name": "non_alzheimers_dementia", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "obesity": {"name": "obesity", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "opioid_use_disorder_oud": {"name": "opioid_use_disorder_oud", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "osteoporosis_with_or_without_pathological_fracture": {"name": "osteoporosis_with_or_without_pathological_fracture", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "other_developmental_delays": {"name": "other_developmental_delays", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "parkinsons_disease_and_secondary_parkinsonism": {"name": "parkinsons_disease_and_secondary_parkinsonism", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "peripheral_vascular_disease_pvd": {"name": "peripheral_vascular_disease_pvd", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "personality_disorders": {"name": "personality_disorders", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "pneumonia_all_cause": {"name": "pneumonia_all_cause", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "post_traumatic_stress_disorder_ptsd": {"name": "post_traumatic_stress_disorder_ptsd", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "pressure_and_chronic_ulcers": {"name": "pressure_and_chronic_ulcers", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "rheumatoid_arthritis_osteoarthritis": {"name": "rheumatoid_arthritis_osteoarthritis", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "schizophrenia": {"name": "schizophrenia", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "schizophrenia_and_other_psychotic_disorders": {"name": "schizophrenia_and_other_psychotic_disorders", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "sensory_blindness_and_visual_impairment": {"name": "sensory_blindness_and_visual_impairment", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "sensory_deafness_and_hearing_impairment": {"name": "sensory_deafness_and_hearing_impairment", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "sickle_cell_disease": {"name": "sickle_cell_disease", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "spina_bifida_and_other_congenital_anomalies_of_the_nervous_system": {"name": "spina_bifida_and_other_congenital_anomalies_of_the_nervous_system", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "spinal_cord_injury": {"name": "spinal_cord_injury", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "stroke_transient_ischemic_attack": {"name": "stroke_transient_ischemic_attack", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "tobacco_use": {"name": "tobacco_use", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "traumatic_brain_injury_and_nonpsychotic_mental_disorders_due_to_brain_damage": {"name": "traumatic_brain_injury_and_nonpsychotic_mental_disorders_due_to_brain_damage", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "viral_hepatitis_general": {"name": "viral_hepatitis_general", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The time at with the model was materialized. Generated by `dbt_utils.pretty_time` as the local time of the `dbt run` environment. Timezone is configurable via the `tuva_last_run` var.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": "#2e0e0e"}, "patch_path": "the_tuva_project://models\\chronic_conditions\\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": 1702481696.2113042, "relation_name": "devforrest.chronic_conditions.cms_chronic_conditions_wide", "raw_code": "{{ config(\r\n enabled = var('cms_chronic_conditions_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r\n )\r\n}}\r\n\r\nwith chronic_conditions as (\r\n\r\n select distinct\r\n condition\r\n , condition_column_name\r\n from {{ ref('chronic_conditions__cms_chronic_conditions_hierarchy') }}\r\n\r\n)\r\n\r\n, conditions as (\r\n\r\n select\r\n chronic_conditions_unioned.patient_id\r\n , chronic_conditions.condition_column_name\r\n , 1 as condition_count\r\n from {{ ref('chronic_conditions__cms_chronic_conditions_long') }} as chronic_conditions_unioned\r\n inner join chronic_conditions as chronic_conditions\r\n on chronic_conditions_unioned.condition = chronic_conditions.condition\r\n\r\n)\r\n\r\nselect\r\n p.patient_id\r\n , {{ dbt_utils.pivot(\r\n column='condition_column_name'\r\n , values=dbt_utils.get_column_values(\r\n ref ('chronic_conditions__cms_chronic_conditions_hierarchy')\r\n , 'condition_column_name'\r\n , order_by= 'condition_column_name'\r\n )\r\n , agg='max'\r\n , then_value= 1\r\n , else_value= 0\r\n , quote_identifiers = False\r\n ) }}\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('cms_chronic_conditions__stg_core__patient') }} p\r\n left join conditions\r\n on p.patient_id = conditions.patient_id\r\ngroup by\r\n p.patient_id", "language": "sql", "refs": [["chronic_conditions__cms_chronic_conditions_hierarchy"], ["chronic_conditions__cms_chronic_conditions_long"], ["chronic_conditions__cms_chronic_conditions_hierarchy"], ["cms_chronic_conditions__stg_core__patient"]], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt_utils.get_column_values", "macro.dbt_utils.pivot"], "nodes": ["seed.the_tuva_project.chronic_conditions__cms_chronic_conditions_hierarchy", "model.the_tuva_project.chronic_conditions__cms_chronic_conditions_long", "seed.the_tuva_project.chronic_conditions__cms_chronic_conditions_hierarchy", "model.the_tuva_project.cms_chronic_conditions__stg_core__patient"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\chronic_conditions\\final\\chronic_conditions__cms_chronic_conditions_wide.sql", "compiled": true, "compiled_code": "\n\nwith __dbt__cte__cms_chronic_conditions__stg_core__patient as (\n\n\nselect \n patient_id\n , '2023-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom devforrest.core.patient\n),chronic_conditions as (\n\n select distinct\n condition\n , condition_column_name\n from devforrest.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 devforrest.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-12-13 23:31:59.089856+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-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom devforrest.core.patient\n)"}]}, "model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_wide": {"database": "devforrest", "schema": "chronic_conditions", "name": "chronic_conditions__tuva_chronic_conditions_wide", "resource_type": "model", "package_name": "the_tuva_project", "path": "chronic_conditions\\final\\chronic_conditions__tuva_chronic_conditions_wide.sql", "original_file_path": "models\\chronic_conditions\\final\\chronic_conditions__tuva_chronic_conditions_wide.sql", "unique_id": "model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_wide", "fqn": ["the_tuva_project", "chronic_conditions", "final", "chronic_conditions__tuva_chronic_conditions_wide"], "alias": "tuva_chronic_conditions_wide", "checksum": {"name": "sha256", "checksum": "dbafd459550d5c36fc38a417f517e896e772b6ab45d04ab8ffd6a293db958670"}, "config": {"enabled": true, "alias": "tuva_chronic_conditions_wide", "schema": "chronic_conditions", "database": null, "tags": ["tuva_chronic_conditions", "chronic_conditions"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#2e0e0e"}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["tuva_chronic_conditions", "chronic_conditions"], "description": "This model creates one record per patient with flags for all the conditions in the tuva chronic conditions hierarchy. A patient will have a 1 in the column for a certain condition if they have every been coded with a diagnosis that rolls up to that condition and a 0 if not.\n", "columns": {"patient_id": {"name": "patient_id", "description": "ID of the patient", "meta": {}, "data_type": null, "quote": null, "tags": []}, "acute_myocardial_infarction": {"name": "acute_myocardial_infarction", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "alcohol": {"name": "alcohol", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "alzheimers_disease": {"name": "alzheimers_disease", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "amyotrophic_lateral_sclerosis": {"name": "amyotrophic_lateral_sclerosis", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "anxiety": {"name": "anxiety", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "asthma": {"name": "asthma", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "atherosclerosis": {"name": "atherosclerosis", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "atrial_fibrillation": {"name": "atrial_fibrillation", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "attention_deficit_hyperactivity_disorder": {"name": "attention_deficit_hyperactivity_disorder", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "bipolar": {"name": "bipolar", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "breast_cancer": {"name": "breast_cancer", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "chronic_kidney_disease": {"name": "chronic_kidney_disease", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "chronic_obstructive_pulmonary_disease": {"name": "chronic_obstructive_pulmonary_disease", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "cocaine": {"name": "cocaine", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "colorectal_cancer": {"name": "colorectal_cancer", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "crohns_disease": {"name": "crohns_disease", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "cystic_fibrosis": {"name": "cystic_fibrosis", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "dementia": {"name": "dementia", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "depression": {"name": "depression", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "heart_failure": {"name": "heart_failure", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "hyperlipidemia": {"name": "hyperlipidemia", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "hypertension": {"name": "hypertension", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "lung_cancer": {"name": "lung_cancer", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "lupus": {"name": "lupus", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "metabolic_syndrome": {"name": "metabolic_syndrome", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "multiple_sclerosis": {"name": "multiple_sclerosis", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "muscular_dystrophy": {"name": "muscular_dystrophy", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "obesity": {"name": "obesity", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "obsessive_compulsive_disorder": {"name": "obsessive_compulsive_disorder", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "opioid": {"name": "opioid", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "parkinsons_disease": {"name": "parkinsons_disease", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "personality_disorder": {"name": "personality_disorder", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "post_traumatic_stress_disorder": {"name": "post_traumatic_stress_disorder", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "rheumatoid_arthritis": {"name": "rheumatoid_arthritis", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "schizophrenia": {"name": "schizophrenia", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "stroke": {"name": "stroke", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "tobacco": {"name": "tobacco", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "type_1_diabetes": {"name": "type_1_diabetes", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "type_2_diabetes": {"name": "type_2_diabetes", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "ulcerative_colitis": {"name": "ulcerative_colitis", "description": "flag indicating if the condition is present", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The time at with the model was materialized. Generated by `dbt_utils.pretty_time` as the local time of the `dbt run` environment. Timezone is configurable via the `tuva_last_run` var.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": "#2e0e0e"}, "patch_path": "the_tuva_project://models\\chronic_conditions\\tuva_chronic_conditions_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "chronic_conditions", "alias": "tuva_chronic_conditions_wide", "tags": ["tuva_chronic_conditions", "chronic_conditions"], "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#2e0e0e"}}, "created_at": 1702481696.3062632, "relation_name": "devforrest.chronic_conditions.tuva_chronic_conditions_wide", "raw_code": "{{ config(\r\n enabled = var('tuva_chronic_conditions_enabled',var('claims_enabled',var('clinical_enabled',var('tuva_marts_enabled',False))))\r\n )\r\n}}\r\n\r\nwith condition_columns as (\r\n\r\n select distinct\r\n condition\r\n , condition_column_name\r\n from {{ ref('chronic_conditions__tuva_chronic_conditions_hierarchy') }}\r\n\r\n)\r\n\r\nselect\r\n p.patient_id\r\n , {{ dbt_utils.pivot(\r\n column='cc.condition_column_name'\r\n , values=dbt_utils.get_column_values(\r\n ref('chronic_conditions__tuva_chronic_conditions_hierarchy')\r\n , 'condition_column_name'\r\n ,'condition_column_name'\r\n )\r\n , agg='max'\r\n , then_value= 1\r\n , else_value= 0\r\n , quote_identifiers = False\r\n ) }}\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('tuva_chronic_conditions__stg_core__patient') }} p\r\n left join {{ ref('chronic_conditions__tuva_chronic_conditions_long') }} l\r\n on p.patient_id = l.patient_id\r\n left join condition_columns cc\r\n on l.condition = cc.condition\r\ngroup by\r\n p.patient_id", "language": "sql", "refs": [["chronic_conditions__tuva_chronic_conditions_hierarchy"], ["chronic_conditions__tuva_chronic_conditions_hierarchy"], ["tuva_chronic_conditions__stg_core__patient"], ["chronic_conditions__tuva_chronic_conditions_long"]], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt_utils.get_column_values", "macro.dbt_utils.pivot"], "nodes": ["seed.the_tuva_project.chronic_conditions__tuva_chronic_conditions_hierarchy", "seed.the_tuva_project.chronic_conditions__tuva_chronic_conditions_hierarchy", "model.the_tuva_project.tuva_chronic_conditions__stg_core__patient", "model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_long"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\chronic_conditions\\final\\chronic_conditions__tuva_chronic_conditions_wide.sql", "compiled": true, "compiled_code": "\n\nwith __dbt__cte__tuva_chronic_conditions__stg_core__patient as (\n\n\nselect \n patient_id\n , '2023-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom devforrest.core.patient\n),condition_columns as (\n\n select distinct\n condition\n , condition_column_name\n from devforrest.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-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom __dbt__cte__tuva_chronic_conditions__stg_core__patient p\n left join devforrest.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-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom devforrest.core.patient\n)"}]}, "model.the_tuva_project.chronic_conditions__cms_chronic_conditions_all": {"database": "devforrest", "schema": "chronic_conditions", "name": "chronic_conditions__cms_chronic_conditions_all", "resource_type": "model", "package_name": "the_tuva_project", "path": "chronic_conditions\\intermediate\\chronic_conditions__cms_chronic_conditions_all.sql", "original_file_path": "models\\chronic_conditions\\intermediate\\chronic_conditions__cms_chronic_conditions_all.sql", "unique_id": "model.the_tuva_project.chronic_conditions__cms_chronic_conditions_all", "fqn": ["the_tuva_project", "chronic_conditions", "intermediate", "chronic_conditions__cms_chronic_conditions_all"], "alias": "_int_cms_chronic_condition_all", "checksum": {"name": "sha256", "checksum": "4066b0b7caf3a140a892da8303ed785c9970171825cdfb038f8f2fc0db06368e"}, "config": {"enabled": true, "alias": "_int_cms_chronic_condition_all", "schema": "chronic_conditions", "database": null, "tags": ["cms_chronic_conditions", "chronic_conditions"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#2e0e0e"}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["cms_chronic_conditions", "chronic_conditions"], "description": "This model contains logic for all chronic conditions where additional_logic is not 'None'. This model includes standard exclusions and maps ICD-10-CM diagnosis codes, ICD-10-PCS procedure codes, HCPCS codes, and MS DRG codes to chronic conditions.\n", "columns": {"patient_id": {"name": "patient_id", "description": "Unique ID for the patient.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "claim_id": {"name": "claim_id", "description": "Unique identifier for each claim.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "start_date": {"name": "start_date", "description": "Start date of the chronic condition derived from diagnosis, procedure, or medication.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "chronic_condition_type": {"name": "chronic_condition_type", "description": "The type of chronic condition as defined by CMS. ('Common' or 'Other chronic or potentially disabling conditions')\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "condition_category": {"name": "condition_category", "description": "The category of the condition (e.g. Cardiovascular Disease).\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "condition": {"name": "condition", "description": "The name of the chronic condition.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "data_source": {"name": "data_source", "description": "Indicates the name of the source dataset (e.g. Medicare Claims).\n", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": "#2e0e0e"}, "patch_path": "the_tuva_project://models\\chronic_conditions\\cms_chronic_conditions_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "chronic_conditions", "alias": "_int_cms_chronic_condition_all", "tags": ["cms_chronic_conditions", "chronic_conditions"], "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#2e0e0e"}}, "created_at": 1702481696.2214136, "relation_name": "devforrest.chronic_conditions._int_cms_chronic_condition_all", "raw_code": "{{ config(\r\n enabled = var('cms_chronic_conditions_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r\n )\r\n}}\r\n\r\nwith chronic_conditions as (\r\n\r\n select * from {{ ref('chronic_conditions__cms_chronic_conditions_hierarchy') }}\r\n\r\n)\r\n\r\n, patient_conditions as (\r\n\r\n select\r\n patient_id\r\n , claim_id\r\n , recorded_date as start_date\r\n , normalized_code_type as code_type\r\n , replace(normalized_code,'.','') as code\r\n , data_source\r\n from {{ ref('cms_chronic_conditions__stg_core__condition') }}\r\n\r\n)\r\n\r\n, patient_ms_drgs as (\r\n\r\n select\r\n patient_id\r\n , claim_id\r\n , claim_start_date as start_date\r\n , 'MS-DRG' as code_type\r\n , ms_drg_code as code\r\n , data_source\r\n from {{ ref('cms_chronic_conditions__stg_medical_claim') }}\r\n\r\n)\r\n\r\n, patient_procedures as (\r\n\r\n select\r\n patient_id\r\n , claim_id\r\n , procedure_date as start_date\r\n , normalized_code_type as code_type\r\n , replace(normalized_code,'.','') as code\r\n , data_source\r\n from {{ ref('cms_chronic_conditions__stg_core__procedure') }}\r\n\r\n)\r\n\r\n, inclusions_diagnosis as (\r\n\r\n select\r\n patient_conditions.patient_id\r\n , patient_conditions.claim_id\r\n , patient_conditions.start_date\r\n , patient_conditions.data_source\r\n , chronic_conditions.chronic_condition_type\r\n , chronic_conditions.condition_category\r\n , chronic_conditions.condition\r\n from patient_conditions\r\n inner join chronic_conditions\r\n on patient_conditions.code = chronic_conditions.code\r\n where chronic_conditions.inclusion_type = 'Include'\r\n and chronic_conditions.code_system = 'ICD-10-CM'\r\n and chronic_conditions.additional_logic = 'None'\r\n\r\n)\r\n\r\n, inclusions_ms_drg as (\r\n\r\n select\r\n patient_ms_drgs.patient_id\r\n , patient_ms_drgs.claim_id\r\n , patient_ms_drgs.start_date\r\n , patient_ms_drgs.data_source\r\n , chronic_conditions.chronic_condition_type\r\n , chronic_conditions.condition_category\r\n , chronic_conditions.condition\r\n from patient_ms_drgs\r\n inner join chronic_conditions\r\n on patient_ms_drgs.code = chronic_conditions.code\r\n where chronic_conditions.inclusion_type = 'Include'\r\n and chronic_conditions.code_system = 'MS-DRG'\r\n and chronic_conditions.additional_logic = 'None'\r\n\r\n)\r\n\r\n, inclusions_procedure as (\r\n\r\n select\r\n patient_procedures.patient_id\r\n , patient_procedures.claim_id\r\n , patient_procedures.start_date\r\n , patient_procedures.data_source\r\n , chronic_conditions.chronic_condition_type\r\n , chronic_conditions.condition_category\r\n , chronic_conditions.condition\r\n from patient_procedures\r\n inner join chronic_conditions\r\n on patient_procedures.code = chronic_conditions.code\r\n where chronic_conditions.inclusion_type = 'Include'\r\n and chronic_conditions.code_system in ('ICD-10-PCS', 'HCPCS')\r\n and chronic_conditions.additional_logic = 'None'\r\n\r\n)\r\n\r\n, exclusions_diagnosis as (\r\n\r\n select distinct\r\n patient_conditions.claim_id\r\n , chronic_conditions.condition\r\n from patient_conditions\r\n inner join chronic_conditions\r\n on patient_conditions.code = chronic_conditions.code\r\n where chronic_conditions.inclusion_type = 'Exclude'\r\n and chronic_conditions.code_system = 'ICD-10-CM'\r\n\r\n)\r\n\r\n, inclusions_unioned as (\r\n\r\n select * from inclusions_diagnosis\r\n union distinct\r\n select * from inclusions_procedure\r\n union distinct\r\n select * from inclusions_ms_drg\r\n\r\n)\r\n\r\nselect distinct\r\n cast(inclusions_unioned.patient_id as {{ dbt.type_string() }}) as patient_id\r\n , cast(inclusions_unioned.claim_id as {{ dbt.type_string() }}) as claim_id\r\n , cast(inclusions_unioned.start_date as date) as start_date\r\n , cast(inclusions_unioned.chronic_condition_type as {{ dbt.type_string() }}) as chronic_condition_type\r\n , cast(inclusions_unioned.condition_category as {{ dbt.type_string() }}) as condition_category\r\n , cast(inclusions_unioned.condition as {{ dbt.type_string() }}) as condition\r\n , cast(inclusions_unioned.data_source as {{ dbt.type_string() }}) as data_source\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom inclusions_unioned\r\n left join exclusions_diagnosis\r\n on inclusions_unioned.claim_id = exclusions_diagnosis.claim_id\r\n and inclusions_unioned.condition = exclusions_diagnosis.condition\r\nwhere exclusions_diagnosis.claim_id is null", "language": "sql", "refs": [["chronic_conditions__cms_chronic_conditions_hierarchy"], ["cms_chronic_conditions__stg_core__condition"], ["cms_chronic_conditions__stg_medical_claim"], ["cms_chronic_conditions__stg_core__procedure"]], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.type_string"], "nodes": ["seed.the_tuva_project.chronic_conditions__cms_chronic_conditions_hierarchy", "model.the_tuva_project.cms_chronic_conditions__stg_core__condition", "model.the_tuva_project.cms_chronic_conditions__stg_medical_claim", "model.the_tuva_project.cms_chronic_conditions__stg_core__procedure"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\chronic_conditions\\intermediate\\chronic_conditions__cms_chronic_conditions_all.sql", "compiled": true, "compiled_code": "\n\nwith __dbt__cte__cms_chronic_conditions__stg_core__condition as (\n\n\nselect\n claim_id\n , patient_id\n , recorded_date\n , normalized_code_type\n , normalized_code\n , data_source\n , '2023-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom devforrest.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-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom tuva.input_layer.medical_claim\n), __dbt__cte__cms_chronic_conditions__stg_core__procedure as (\n\n\nselect\n claim_id\n , patient_id\n , procedure_date\n , normalized_code_type\n , normalized_code\n , data_source\n , '2023-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom devforrest.core.procedure\n),chronic_conditions as (\n\n select * from devforrest.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-12-13 23:31:59.089856+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-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom devforrest.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-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom tuva.input_layer.medical_claim\n)"}, {"id": "model.the_tuva_project.cms_chronic_conditions__stg_core__procedure", "sql": " __dbt__cte__cms_chronic_conditions__stg_core__procedure as (\n\n\nselect\n claim_id\n , patient_id\n , procedure_date\n , normalized_code_type\n , normalized_code\n , data_source\n , '2023-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom devforrest.core.procedure\n)"}]}, "model.the_tuva_project.chronic_conditions__cms_chronic_conditions_hiv_aids": {"database": "devforrest", "schema": "chronic_conditions", "name": "chronic_conditions__cms_chronic_conditions_hiv_aids", "resource_type": "model", "package_name": "the_tuva_project", "path": "chronic_conditions\\intermediate\\chronic_conditions__cms_chronic_conditions_hiv_aids.sql", "original_file_path": "models\\chronic_conditions\\intermediate\\chronic_conditions__cms_chronic_conditions_hiv_aids.sql", "unique_id": "model.the_tuva_project.chronic_conditions__cms_chronic_conditions_hiv_aids", "fqn": ["the_tuva_project", "chronic_conditions", "intermediate", "chronic_conditions__cms_chronic_conditions_hiv_aids"], "alias": "_int_cms_chronic_condition_hiv_aids", "checksum": {"name": "sha256", "checksum": "650c4fd2c4e598a83cce3814a54ba40588aeb532c40567366cb6535b002a125f"}, "config": {"enabled": true, "alias": "_int_cms_chronic_condition_hiv_aids", "schema": "chronic_conditions", "database": null, "tags": ["cms_chronic_conditions", "chronic_conditions"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#2e0e0e"}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["cms_chronic_conditions", "chronic_conditions"], "description": "This model contains logic for the chronic condition Human Immunodeficiency Virus and/or Acquired Immunodeficiency Syndrome (HIV/AIDS). This model maps ICD-10-CM diagnosis codes and MS DRG codes to the chronic condition.\n", "columns": {"patient_id": {"name": "patient_id", "description": "Unique ID for the patient.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "claim_id": {"name": "claim_id", "description": "Unique identifier for each claim.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "start_date": {"name": "start_date", "description": "Start date of the chronic condition derived from diagnosis, procedure, or medication.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "chronic_condition_type": {"name": "chronic_condition_type", "description": "The type of chronic condition as defined by CMS. ('Common' or 'Other chronic or potentially disabling conditions')\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "condition_category": {"name": "condition_category", "description": "The category of the condition (e.g. Other).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "condition": {"name": "condition", "description": "The name of the chronic condition.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "data_source": {"name": "data_source", "description": "Indicates the name of the source dataset (e.g. Medicare Claims).\n", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": "#2e0e0e"}, "patch_path": "the_tuva_project://models\\chronic_conditions\\cms_chronic_conditions_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "chronic_conditions", "alias": "_int_cms_chronic_condition_hiv_aids", "tags": ["cms_chronic_conditions", "chronic_conditions"], "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#2e0e0e"}}, "created_at": 1702481696.2214136, "relation_name": "devforrest.chronic_conditions._int_cms_chronic_condition_hiv_aids", "raw_code": "{{ config(\r\n enabled = var('cms_chronic_conditions_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r\n )\r\n}}\r\n\r\n{%- set condition_filter = 'Human Immunodeficiency Virus and/or Acquired Immunodeficiency Syndrome (HIV/AIDS)' -%}\r\n\r\nwith chronic_conditions as (\r\n\r\n select * from {{ ref('chronic_conditions__cms_chronic_conditions_hierarchy') }}\r\n where condition = '{{ condition_filter }}'\r\n\r\n)\r\n\r\n, patient_conditions as (\r\n\r\n select\r\n patient_id\r\n , claim_id\r\n , recorded_date as start_date\r\n , normalized_code_type as code_type\r\n , replace(normalized_code,'.','') as code\r\n , data_source\r\n from {{ ref('cms_chronic_conditions__stg_core__condition') }}\r\n\r\n)\r\n\r\n, patient_ms_drgs as (\r\n\r\n select\r\n patient_id\r\n , claim_id\r\n , claim_start_date as start_date\r\n , 'MS-DRG' as code_type\r\n , ms_drg_code as code\r\n , data_source\r\n from {{ ref('cms_chronic_conditions__stg_medical_claim') }}\r\n\r\n)\r\n\r\n/*\r\n Exception logic: a claim with the diagnosis code R75 requires a second\r\n qualifying claim that is not R75 (a screening code)\r\n\r\n This CTE excludes encounters with the exception code. Those encounters\r\n will be evaluated separately.\r\n*/\r\n, inclusions_diagnosis as (\r\n\r\n select\r\n patient_conditions.patient_id\r\n , patient_conditions.claim_id\r\n , patient_conditions.start_date\r\n , patient_conditions.data_source\r\n , chronic_conditions.chronic_condition_type\r\n , chronic_conditions.condition_category\r\n , chronic_conditions.condition\r\n from patient_conditions\r\n inner join chronic_conditions\r\n on patient_conditions.code = chronic_conditions.code\r\n where chronic_conditions.inclusion_type = 'Include'\r\n and chronic_conditions.code_system = 'ICD-10-CM'\r\n and chronic_conditions.code <> 'R75'\r\n\r\n)\r\n\r\n, inclusions_ms_drg as (\r\n\r\n select\r\n patient_ms_drgs.patient_id\r\n , patient_ms_drgs.claim_id\r\n , patient_ms_drgs.start_date\r\n , patient_ms_drgs.data_source\r\n , chronic_conditions.chronic_condition_type\r\n , chronic_conditions.condition_category\r\n , chronic_conditions.condition\r\n from patient_ms_drgs\r\n inner join chronic_conditions\r\n on patient_ms_drgs.code = chronic_conditions.code\r\n where chronic_conditions.inclusion_type = 'Include'\r\n and chronic_conditions.code_system = 'MS-DRG'\r\n\r\n)\r\n\r\n/*\r\n Exception logic: a claim with the diagnosis code R75 requires a second\r\n qualifying claim that is not R75 (a screening code)\r\n\r\n This CTE includes encounters with the exception code only where that\r\n patient has another encounter that is not R75.\r\n*/\r\n, exception_diagnosis as (\r\n\r\n select\r\n patient_conditions.patient_id\r\n , patient_conditions.claim_id\r\n , patient_conditions.start_date\r\n , patient_conditions.data_source\r\n , chronic_conditions.chronic_condition_type\r\n , chronic_conditions.condition_category\r\n , chronic_conditions.condition\r\n from patient_conditions\r\n inner join chronic_conditions\r\n on patient_conditions.code = chronic_conditions.code\r\n inner join inclusions_diagnosis\r\n on patient_conditions.patient_id = inclusions_diagnosis.patient_id\r\n where chronic_conditions.inclusion_type = 'Include'\r\n and chronic_conditions.code_system = 'ICD-10-CM'\r\n and chronic_conditions.code = 'R75'\r\n\r\n)\r\n\r\n, inclusions_unioned as (\r\n\r\n select * from inclusions_diagnosis\r\n union distinct\r\n select * from inclusions_ms_drg\r\n union distinct\r\n select * from exception_diagnosis\r\n\r\n)\r\n\r\nselect distinct\r\n cast(inclusions_unioned.patient_id as {{ dbt.type_string() }}) as patient_id\r\n , cast(inclusions_unioned.claim_id as {{ dbt.type_string() }}) as claim_id\r\n , cast(inclusions_unioned.start_date as date) as start_date\r\n , cast(inclusions_unioned.chronic_condition_type as {{ dbt.type_string() }}) as chronic_condition_type\r\n , cast(inclusions_unioned.condition_category as {{ dbt.type_string() }}) as condition_category\r\n , cast(inclusions_unioned.condition as {{ dbt.type_string() }}) as condition\r\n , cast(inclusions_unioned.data_source as {{ dbt.type_string() }}) as data_source\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom inclusions_unioned", "language": "sql", "refs": [["chronic_conditions__cms_chronic_conditions_hierarchy"], ["cms_chronic_conditions__stg_core__condition"], ["cms_chronic_conditions__stg_medical_claim"]], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.type_string"], "nodes": ["seed.the_tuva_project.chronic_conditions__cms_chronic_conditions_hierarchy", "model.the_tuva_project.cms_chronic_conditions__stg_core__condition", "model.the_tuva_project.cms_chronic_conditions__stg_medical_claim"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\chronic_conditions\\intermediate\\chronic_conditions__cms_chronic_conditions_hiv_aids.sql", "compiled": true, "compiled_code": "with __dbt__cte__cms_chronic_conditions__stg_core__condition as (\n\n\nselect\n claim_id\n , patient_id\n , recorded_date\n , normalized_code_type\n , normalized_code\n , data_source\n , '2023-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom devforrest.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-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom tuva.input_layer.medical_claim\n),chronic_conditions as (\n\n select * from devforrest.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-12-13 23:31:59.089856+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-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom devforrest.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-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom tuva.input_layer.medical_claim\n)"}]}, "model.the_tuva_project.chronic_conditions__cms_chronic_conditions_oud": {"database": "devforrest", "schema": "chronic_conditions", "name": "chronic_conditions__cms_chronic_conditions_oud", "resource_type": "model", "package_name": "the_tuva_project", "path": "chronic_conditions\\intermediate\\chronic_conditions__cms_chronic_conditions_oud.sql", "original_file_path": "models\\chronic_conditions\\intermediate\\chronic_conditions__cms_chronic_conditions_oud.sql", "unique_id": "model.the_tuva_project.chronic_conditions__cms_chronic_conditions_oud", "fqn": ["the_tuva_project", "chronic_conditions", "intermediate", "chronic_conditions__cms_chronic_conditions_oud"], "alias": "_int_cms_chronic_condition_oud", "checksum": {"name": "sha256", "checksum": "0edbbe01903e631fdff00a390367aea7fcfff5ec1a5454994a1c357bb42f4df5"}, "config": {"enabled": true, "alias": "_int_cms_chronic_condition_oud", "schema": "chronic_conditions", "database": null, "tags": ["cms_chronic_conditions", "chronic_conditions"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#2e0e0e"}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["cms_chronic_conditions", "chronic_conditions"], "description": "This model contains logic for the chronic condition Opioid Use Disorder (OUD). This model maps ICD-10-CM diagnosis codes, ICD-10-PCS procedure codes, HCPCS codes, and NDC codes to the chronic condition.\n", "columns": {"patient_id": {"name": "patient_id", "description": "Unique ID for the patient.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "claim_id": {"name": "claim_id", "description": "Unique identifier for each claim.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "start_date": {"name": "start_date", "description": "Start date of the chronic condition derived from diagnosis, procedure, or medication.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "chronic_condition_type": {"name": "chronic_condition_type", "description": "The type of chronic condition as defined by CMS. ('Common' or 'Other chronic or potentially disabling conditions')\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "condition_category": {"name": "condition_category", "description": "The category of the condition (e.g. Substance Abuse).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "condition": {"name": "condition", "description": "The name of the chronic condition.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "data_source": {"name": "data_source", "description": "Indicates the name of the source dataset (e.g. Medicare Claims).\n", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": "#2e0e0e"}, "patch_path": "the_tuva_project://models\\chronic_conditions\\cms_chronic_conditions_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "chronic_conditions", "alias": "_int_cms_chronic_condition_oud", "tags": ["cms_chronic_conditions", "chronic_conditions"], "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#2e0e0e"}}, "created_at": 1702481696.2214136, "relation_name": "devforrest.chronic_conditions._int_cms_chronic_condition_oud", "raw_code": "{{ config(\r\n enabled = var('cms_chronic_conditions_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r\n )\r\n}}\r\n\r\n{%- set condition_filter = 'Opioid Use Disorder (OUD)' -%}\r\n\r\n{%- set naltrexone_ndcs = (\r\n '00056001122', '00056001130', '00056001170', '00056007950', '00056008050',\r\n '00185003901', '00185003930', '00406009201', '00406009203', '00406117001',\r\n '00406117003', '00555090201', '00555090202', '00904703604', '16729008101',\r\n '16729008110', '42291063230', '43063059115', '47335032683', '47335032688',\r\n '50090286600', '50436010501', '51224020630', '51224020650', '51285027501',\r\n '51285027502', '52152010502', '52152010504', '52152010530', '54868557400',\r\n '63459030042', '63629104601', '63629104701', '65694010003', '65694010010',\r\n '65757030001', '65757030202', '68084029111', '68084029121', '68094085362',\r\n '68115068030'\r\n )\r\n-%}\r\n\r\nwith chronic_conditions as (\r\n\r\n select * from {{ ref('chronic_conditions__cms_chronic_conditions_hierarchy') }}\r\n where condition = '{{ condition_filter }}'\r\n\r\n)\r\n\r\n, patient_conditions as (\r\n\r\n select\r\n patient_id\r\n , claim_id\r\n , recorded_date as start_date\r\n , normalized_code_type as code_type\r\n , replace(normalized_code,'.','') as code\r\n , data_source\r\n from {{ ref('cms_chronic_conditions__stg_core__condition') }}\r\n\r\n)\r\n\r\n, patient_medications as (\r\n\r\n select\r\n patient_id\r\n , claim_id\r\n , paid_date as start_date\r\n , replace(ndc_code,'.','') as code\r\n , data_source\r\n from {{ ref('cms_chronic_conditions__stg_pharmacy_claim') }}\r\n\r\n)\r\n\r\n, patient_procedures as (\r\n\r\n select\r\n patient_id\r\n , claim_id\r\n , procedure_date as start_date\r\n , normalized_code_type as code_type\r\n , replace(normalized_code,'.','') as code\r\n , data_source\r\n from {{ ref('cms_chronic_conditions__stg_core__procedure') }}\r\n\r\n)\r\n\r\n, inclusions_diagnosis as (\r\n\r\n select\r\n patient_conditions.patient_id\r\n , patient_conditions.claim_id\r\n , patient_conditions.start_date\r\n , patient_conditions.data_source\r\n , chronic_conditions.chronic_condition_type\r\n , chronic_conditions.condition_category\r\n , chronic_conditions.condition\r\n from patient_conditions\r\n inner join chronic_conditions\r\n on patient_conditions.code = chronic_conditions.code\r\n where chronic_conditions.inclusion_type = 'Include'\r\n and chronic_conditions.code_system = 'ICD-10-CM'\r\n\r\n)\r\n\r\n, inclusions_procedure as (\r\n\r\n select\r\n patient_procedures.patient_id\r\n , patient_procedures.claim_id\r\n , patient_procedures.start_date\r\n , patient_procedures.data_source\r\n , chronic_conditions.chronic_condition_type\r\n , chronic_conditions.condition_category\r\n , chronic_conditions.condition\r\n from patient_procedures\r\n inner join chronic_conditions\r\n on patient_procedures.code = chronic_conditions.code\r\n where chronic_conditions.inclusion_type = 'Include'\r\n and chronic_conditions.code_system in ('ICD-10-PCS', 'HCPCS')\r\n\r\n)\r\n\r\n/*\r\n Exclusion logic: Naltrexone NDCs are excluded if there is evidence of an\r\n alcohol or other drug use disorder where opioid DX is not present\r\n\r\n This CTE excludes medication encounters with the exception codes for\r\n Naltrexone. Those encounters will be evaluated separately.\r\n*/\r\n, inclusions_medication as (\r\n\r\n select\r\n patient_medications.patient_id\r\n , patient_medications.claim_id\r\n , patient_medications.start_date\r\n , patient_medications.data_source\r\n , chronic_conditions.chronic_condition_type\r\n , chronic_conditions.condition_category\r\n , chronic_conditions.condition\r\n from patient_medications\r\n inner join chronic_conditions\r\n on patient_medications.code = chronic_conditions.code\r\n where chronic_conditions.inclusion_type = 'Include'\r\n and chronic_conditions.code_system = 'NDC'\r\n and chronic_conditions.code not in {{ naltrexone_ndcs }}\r\n\r\n)\r\n\r\n/*\r\n Exclusion logic: Naltrexone NDCs are excluded if there is evidence of an\r\n alcohol or other drug use disorder where opioid DX is not present\r\n\r\n This CTE includes patients with evidence of the chronic conditions Alcohol\r\n Use Disorders or Drug Use Disorders.\r\n*/\r\n, exclusions_other_chronic_conditions as (\r\n\r\n select distinct patient_id\r\n from {{ ref('chronic_conditions__cms_chronic_conditions_all') }}\r\n where condition in (\r\n 'Alcohol Use Disorders'\r\n , 'Drug Use Disorders'\r\n )\r\n\r\n)\r\n\r\n/*\r\n Exclusion logic: Naltrexone NDCs are excluded if there is evidence of an\r\n alcohol or other drug use disorder where opioid DX is not present\r\n\r\n This CTE creates the exclusion list which consists of patients with\r\n medication encounters for Naltrexone having Alcohol Use Disorder or Drug\r\n Use Disorder and missing the Opioid Use Disorder diagnosis codes.\r\n*/\r\n, exclusions_medication as (\r\n select distinct\r\n patient_medications.patient_id\r\n from patient_medications\r\n inner join chronic_conditions\r\n on patient_medications.code = chronic_conditions.code\r\n inner join exclusions_other_chronic_conditions\r\n on patient_medications.patient_id = exclusions_other_chronic_conditions.patient_id\r\n left join inclusions_diagnosis\r\n on patient_medications.patient_id = inclusions_diagnosis.patient_id\r\n where chronic_conditions.inclusion_type = 'Include'\r\n and chronic_conditions.code_system = 'NDC'\r\n and chronic_conditions.code in {{ naltrexone_ndcs }}\r\n and inclusions_diagnosis.patient_id is null\r\n\r\n)\r\n\r\n, inclusions_unioned as (\r\n\r\n select * from inclusions_diagnosis\r\n union distinct\r\n select * from inclusions_procedure\r\n union distinct\r\n select * from inclusions_medication\r\n\r\n)\r\n\r\nselect distinct\r\n cast(inclusions_unioned.patient_id as {{ dbt.type_string() }}) as patient_id\r\n , cast(inclusions_unioned.claim_id as {{ dbt.type_string() }}) as claim_id\r\n , cast(inclusions_unioned.start_date as date) as start_date\r\n , cast(inclusions_unioned.chronic_condition_type as {{ dbt.type_string() }}) as chronic_condition_type\r\n , cast(inclusions_unioned.condition_category as {{ dbt.type_string() }}) as condition_category\r\n , cast(inclusions_unioned.condition as {{ dbt.type_string() }}) as condition\r\n , cast(inclusions_unioned.data_source as {{ dbt.type_string() }}) as data_source\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom inclusions_unioned\r\n left join exclusions_medication\r\n on inclusions_unioned.patient_id = exclusions_medication.patient_id\r\nwhere exclusions_medication.patient_id is null", "language": "sql", "refs": [["chronic_conditions__cms_chronic_conditions_hierarchy"], ["cms_chronic_conditions__stg_core__condition"], ["cms_chronic_conditions__stg_pharmacy_claim"], ["cms_chronic_conditions__stg_core__procedure"], ["chronic_conditions__cms_chronic_conditions_all"]], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.type_string"], "nodes": ["seed.the_tuva_project.chronic_conditions__cms_chronic_conditions_hierarchy", "model.the_tuva_project.cms_chronic_conditions__stg_core__condition", "model.the_tuva_project.cms_chronic_conditions__stg_pharmacy_claim", "model.the_tuva_project.cms_chronic_conditions__stg_core__procedure", "model.the_tuva_project.chronic_conditions__cms_chronic_conditions_all"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\chronic_conditions\\intermediate\\chronic_conditions__cms_chronic_conditions_oud.sql", "compiled": true, "compiled_code": "with __dbt__cte__cms_chronic_conditions__stg_core__condition as (\n\n\nselect\n claim_id\n , patient_id\n , recorded_date\n , normalized_code_type\n , normalized_code\n , data_source\n , '2023-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom devforrest.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-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom tuva.input_layer.pharmacy_claim\n), __dbt__cte__cms_chronic_conditions__stg_core__procedure as (\n\n\nselect\n claim_id\n , patient_id\n , procedure_date\n , normalized_code_type\n , normalized_code\n , data_source\n , '2023-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom devforrest.core.procedure\n),chronic_conditions as (\n\n select * from devforrest.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 devforrest.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-12-13 23:31:59.089856+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-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom devforrest.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-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom tuva.input_layer.pharmacy_claim\n)"}, {"id": "model.the_tuva_project.cms_chronic_conditions__stg_core__procedure", "sql": " __dbt__cte__cms_chronic_conditions__stg_core__procedure as (\n\n\nselect\n claim_id\n , patient_id\n , procedure_date\n , normalized_code_type\n , normalized_code\n , data_source\n , '2023-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom devforrest.core.procedure\n)"}]}, "model.the_tuva_project.cms_chronic_conditions__stg_core__condition": {"database": "devforrest", "schema": "dbt_forrest", "name": "cms_chronic_conditions__stg_core__condition", "resource_type": "model", "package_name": "the_tuva_project", "path": "chronic_conditions\\staging\\cms_chronic_conditions__stg_core__condition.sql", "original_file_path": "models\\chronic_conditions\\staging\\cms_chronic_conditions__stg_core__condition.sql", "unique_id": "model.the_tuva_project.cms_chronic_conditions__stg_core__condition", "fqn": ["the_tuva_project", "chronic_conditions", "staging", "cms_chronic_conditions__stg_core__condition"], "alias": "cms_chronic_conditions__stg_core__condition", "checksum": {"name": "sha256", "checksum": "14bc859c362a0bf063c1f1b5573c4c3c579fe36fd016b68a559c9d342ad97a8a"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["cms_chronic_conditions", "chronic_conditions"], "meta": {}, "materialized": "ephemeral", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#2e0e0e"}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["cms_chronic_conditions", "chronic_conditions"], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#2e0e0e"}, "patch_path": "the_tuva_project://models\\chronic_conditions\\cms_chronic_conditions_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"tags": ["cms_chronic_conditions", "chronic_conditions"], "materialized": "ephemeral", "enabled": true, "bind": false, "docs": {"node_color": "#2e0e0e"}}, "created_at": 1702481696.2214136, "relation_name": null, "raw_code": "{{ config(\r\n enabled = var('cms_chronic_conditions_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r\n )\r\n}}\r\n\r\nselect\r\n claim_id\r\n , patient_id\r\n , recorded_date\r\n , normalized_code_type\r\n , normalized_code\r\n , data_source\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('core__condition') }}", "language": "sql", "refs": [["core__condition"]], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.core__condition"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\chronic_conditions\\staging\\cms_chronic_conditions__stg_core__condition.sql", "compiled": true, "compiled_code": "\n\nselect\n claim_id\n , patient_id\n , recorded_date\n , normalized_code_type\n , normalized_code\n , data_source\n , '2023-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom devforrest.core.condition", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.cms_chronic_conditions__stg_core__patient": {"database": "devforrest", "schema": "dbt_forrest", "name": "cms_chronic_conditions__stg_core__patient", "resource_type": "model", "package_name": "the_tuva_project", "path": "chronic_conditions\\staging\\cms_chronic_conditions__stg_core__patient.sql", "original_file_path": "models\\chronic_conditions\\staging\\cms_chronic_conditions__stg_core__patient.sql", "unique_id": "model.the_tuva_project.cms_chronic_conditions__stg_core__patient", "fqn": ["the_tuva_project", "chronic_conditions", "staging", "cms_chronic_conditions__stg_core__patient"], "alias": "cms_chronic_conditions__stg_core__patient", "checksum": {"name": "sha256", "checksum": "c1179facf8d0fe84d23bb48595d8788b7ea24239af870f2765aeda6b3202b689"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["cms_chronic_conditions", "chronic_conditions"], "meta": {}, "materialized": "ephemeral", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#2e0e0e"}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["cms_chronic_conditions", "chronic_conditions"], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#2e0e0e"}, "patch_path": "the_tuva_project://models\\chronic_conditions\\cms_chronic_conditions_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"tags": ["cms_chronic_conditions", "chronic_conditions"], "materialized": "ephemeral", "enabled": true, "bind": false, "docs": {"node_color": "#2e0e0e"}}, "created_at": 1702481696.2214136, "relation_name": null, "raw_code": "{{ config(\r\n enabled = var('cms_chronic_conditions_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r\n )\r\n}}\r\n\r\nselect \r\n patient_id\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('core__patient') }}", "language": "sql", "refs": [["core__patient"]], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.core__patient"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\chronic_conditions\\staging\\cms_chronic_conditions__stg_core__patient.sql", "compiled": true, "compiled_code": "\n\nselect \n patient_id\n , '2023-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom devforrest.core.patient", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.cms_chronic_conditions__stg_core__procedure": {"database": "devforrest", "schema": "dbt_forrest", "name": "cms_chronic_conditions__stg_core__procedure", "resource_type": "model", "package_name": "the_tuva_project", "path": "chronic_conditions\\staging\\cms_chronic_conditions__stg_core__procedure.sql", "original_file_path": "models\\chronic_conditions\\staging\\cms_chronic_conditions__stg_core__procedure.sql", "unique_id": "model.the_tuva_project.cms_chronic_conditions__stg_core__procedure", "fqn": ["the_tuva_project", "chronic_conditions", "staging", "cms_chronic_conditions__stg_core__procedure"], "alias": "cms_chronic_conditions__stg_core__procedure", "checksum": {"name": "sha256", "checksum": "a2edc7f43347634a329a5572d5f6d1070cb7b922b028572a264d75b6574765f1"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["cms_chronic_conditions", "chronic_conditions"], "meta": {}, "materialized": "ephemeral", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#2e0e0e"}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["cms_chronic_conditions", "chronic_conditions"], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#2e0e0e"}, "patch_path": "the_tuva_project://models\\chronic_conditions\\cms_chronic_conditions_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"tags": ["cms_chronic_conditions", "chronic_conditions"], "materialized": "ephemeral", "enabled": true, "bind": false, "docs": {"node_color": "#2e0e0e"}}, "created_at": 1702481696.2371247, "relation_name": null, "raw_code": "{{ config(\r\n enabled = var('cms_chronic_conditions_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r\n )\r\n}}\r\n\r\nselect\r\n claim_id\r\n , patient_id\r\n , procedure_date\r\n , normalized_code_type\r\n , normalized_code\r\n , data_source\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('core__procedure') }}", "language": "sql", "refs": [["core__procedure"]], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.core__procedure"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\chronic_conditions\\staging\\cms_chronic_conditions__stg_core__procedure.sql", "compiled": true, "compiled_code": "\n\nselect\n claim_id\n , patient_id\n , procedure_date\n , normalized_code_type\n , normalized_code\n , data_source\n , '2023-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom devforrest.core.procedure", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.cms_chronic_conditions__stg_medical_claim": {"database": "devforrest", "schema": "dbt_forrest", "name": "cms_chronic_conditions__stg_medical_claim", "resource_type": "model", "package_name": "the_tuva_project", "path": "chronic_conditions\\staging\\cms_chronic_conditions__stg_medical_claim.sql", "original_file_path": "models\\chronic_conditions\\staging\\cms_chronic_conditions__stg_medical_claim.sql", "unique_id": "model.the_tuva_project.cms_chronic_conditions__stg_medical_claim", "fqn": ["the_tuva_project", "chronic_conditions", "staging", "cms_chronic_conditions__stg_medical_claim"], "alias": "cms_chronic_conditions__stg_medical_claim", "checksum": {"name": "sha256", "checksum": "837370350f0cfe6af7920826ec0af6ad83b3c1e27127cfdf58e08341fcaa0257"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["cms_chronic_conditions", "chronic_conditions"], "meta": {}, "materialized": "ephemeral", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#2e0e0e"}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["cms_chronic_conditions", "chronic_conditions"], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#2e0e0e"}, "patch_path": "the_tuva_project://models\\chronic_conditions\\cms_chronic_conditions_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"tags": ["cms_chronic_conditions", "chronic_conditions"], "materialized": "ephemeral", "enabled": true, "bind": false, "docs": {"node_color": "#2e0e0e"}}, "created_at": 1702481696.2371247, "relation_name": null, "raw_code": "{{ config(\r\n enabled = var('cms_chronic_conditions_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r\n )\r\n}}\r\n\r\nselect\r\n claim_id\r\n , patient_id\r\n , claim_start_date\r\n , ms_drg_code\r\n , data_source\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('medical_claim') }}", "language": "sql", "refs": [["medical_claim"]], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.input_layer.medical_claim"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\chronic_conditions\\staging\\cms_chronic_conditions__stg_medical_claim.sql", "compiled": true, "compiled_code": "\n\nselect\n claim_id\n , patient_id\n , claim_start_date\n , ms_drg_code\n , data_source\n , '2023-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom tuva.input_layer.medical_claim", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.cms_chronic_conditions__stg_pharmacy_claim": {"database": "devforrest", "schema": "dbt_forrest", "name": "cms_chronic_conditions__stg_pharmacy_claim", "resource_type": "model", "package_name": "the_tuva_project", "path": "chronic_conditions\\staging\\cms_chronic_conditions__stg_pharmacy_claim.sql", "original_file_path": "models\\chronic_conditions\\staging\\cms_chronic_conditions__stg_pharmacy_claim.sql", "unique_id": "model.the_tuva_project.cms_chronic_conditions__stg_pharmacy_claim", "fqn": ["the_tuva_project", "chronic_conditions", "staging", "cms_chronic_conditions__stg_pharmacy_claim"], "alias": "cms_chronic_conditions__stg_pharmacy_claim", "checksum": {"name": "sha256", "checksum": "31b3681bfce9e02877c6b2a296a731d66d53751cec210a6ee7367f78271c1198"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["cms_chronic_conditions", "chronic_conditions"], "meta": {}, "materialized": "ephemeral", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#2e0e0e"}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["cms_chronic_conditions", "chronic_conditions"], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#2e0e0e"}, "patch_path": "the_tuva_project://models\\chronic_conditions\\cms_chronic_conditions_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"tags": ["cms_chronic_conditions", "chronic_conditions"], "materialized": "ephemeral", "enabled": true, "bind": false, "docs": {"node_color": "#2e0e0e"}}, "created_at": 1702481696.2371247, "relation_name": null, "raw_code": "{{ config(\r\n enabled = var('cms_chronic_conditions_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r\n )\r\n}}\r\n\r\nselect\r\n claim_id\r\n , patient_id\r\n , paid_date\r\n , ndc_code\r\n , data_source\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('pharmacy_claim') }}", "language": "sql", "refs": [["pharmacy_claim"]], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.input_layer.pharmacy_claim"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\chronic_conditions\\staging\\cms_chronic_conditions__stg_pharmacy_claim.sql", "compiled": true, "compiled_code": "\n\nselect\n claim_id\n , patient_id\n , paid_date\n , ndc_code\n , data_source\n , '2023-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom tuva.input_layer.pharmacy_claim", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.tuva_chronic_conditions__stg_core__condition": {"database": "devforrest", "schema": "dbt_forrest", "name": "tuva_chronic_conditions__stg_core__condition", "resource_type": "model", "package_name": "the_tuva_project", "path": "chronic_conditions\\staging\\tuva_chronic_conditions__stg_core__condition.sql", "original_file_path": "models\\chronic_conditions\\staging\\tuva_chronic_conditions__stg_core__condition.sql", "unique_id": "model.the_tuva_project.tuva_chronic_conditions__stg_core__condition", "fqn": ["the_tuva_project", "chronic_conditions", "staging", "tuva_chronic_conditions__stg_core__condition"], "alias": "tuva_chronic_conditions__stg_core__condition", "checksum": {"name": "sha256", "checksum": "48dd1d737654e1702b462ae927368771052d05c66bd16365187e51f67470f5ea"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["tuva_chronic_conditions"], "meta": {}, "materialized": "ephemeral", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#2e0e0e"}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["tuva_chronic_conditions"], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#2e0e0e"}, "patch_path": "the_tuva_project://models\\chronic_conditions\\tuva_chronic_conditions_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"tags": "tuva_chronic_conditions", "materialized": "ephemeral", "enabled": true, "bind": false, "docs": {"node_color": "#2e0e0e"}}, "created_at": 1702481696.3082469, "relation_name": null, "raw_code": "{{ config(\r\n enabled = var('tuva_chronic_conditions_enabled',var('claims_enabled',var('clinical_enabled',var('tuva_marts_enabled',False))))\r\n )\r\n}}\r\n\r\nselect \r\n patient_id\r\n , normalized_code\r\n , recorded_date\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('core__condition')}}", "language": "sql", "refs": [["core__condition"]], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.core__condition"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\chronic_conditions\\staging\\tuva_chronic_conditions__stg_core__condition.sql", "compiled": true, "compiled_code": "\n\nselect \n patient_id\n , normalized_code\n , recorded_date\n , '2023-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom devforrest.core.condition", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.tuva_chronic_conditions__stg_core__patient": {"database": "devforrest", "schema": "dbt_forrest", "name": "tuva_chronic_conditions__stg_core__patient", "resource_type": "model", "package_name": "the_tuva_project", "path": "chronic_conditions\\staging\\tuva_chronic_conditions__stg_core__patient.sql", "original_file_path": "models\\chronic_conditions\\staging\\tuva_chronic_conditions__stg_core__patient.sql", "unique_id": "model.the_tuva_project.tuva_chronic_conditions__stg_core__patient", "fqn": ["the_tuva_project", "chronic_conditions", "staging", "tuva_chronic_conditions__stg_core__patient"], "alias": "tuva_chronic_conditions__stg_core__patient", "checksum": {"name": "sha256", "checksum": "1f922ebd0ff235d61d3cecfacf5b7fb056cf6b55b1dc14c054df6b07b38e4a0b"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["tuva_chronic_conditions"], "meta": {}, "materialized": "ephemeral", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#2e0e0e"}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["tuva_chronic_conditions"], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#2e0e0e"}, "patch_path": "the_tuva_project://models\\chronic_conditions\\tuva_chronic_conditions_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"tags": "tuva_chronic_conditions", "materialized": "ephemeral", "enabled": true, "bind": false, "docs": {"node_color": "#2e0e0e"}}, "created_at": 1702481696.3102791, "relation_name": null, "raw_code": "{{ config(\r\n enabled = var('tuva_chronic_conditions_enabled',var('claims_enabled',var('clinical_enabled',var('tuva_marts_enabled',False))))\r\n )\r\n}}\r\n\r\nselect \r\n patient_id\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('core__patient') }}", "language": "sql", "refs": [["core__patient"]], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.core__patient"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\chronic_conditions\\staging\\tuva_chronic_conditions__stg_core__patient.sql", "compiled": true, "compiled_code": "\n\nselect \n patient_id\n , '2023-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom devforrest.core.patient", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.acute_inpatient__claims_with_encounter_data": {"database": "devforrest", "schema": "claims_preprocessing", "name": "acute_inpatient__claims_with_encounter_data", "resource_type": "model", "package_name": "the_tuva_project", "path": "claims_preprocessing\\acute_inpatient\\intermediate\\acute_inpatient__claims_with_encounter_data.sql", "original_file_path": "models\\claims_preprocessing\\acute_inpatient\\intermediate\\acute_inpatient__claims_with_encounter_data.sql", "unique_id": "model.the_tuva_project.acute_inpatient__claims_with_encounter_data", "fqn": ["the_tuva_project", "claims_preprocessing", "acute_inpatient", "intermediate", "acute_inpatient__claims_with_encounter_data"], "alias": "_int_acute_inpatient_claims_with_encounter_data", "checksum": {"name": "sha256", "checksum": "ab00894727d4eecd7ecf78a6182ddfc159c3138154a556548aac139e1414203f"}, "config": {"enabled": true, "alias": "_int_acute_inpatient_claims_with_encounter_data", "schema": "claims_preprocessing", "database": null, "tags": ["acute_inpatient", "claims_preprocessing"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#0f3d0b"}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["acute_inpatient", "claims_preprocessing"], "description": "Add all relevant encounter data to each acute inpatient claim_id", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#0f3d0b"}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_acute_inpatient_claims_with_encounter_data", "tags": ["acute_inpatient", "claims_preprocessing"], "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#0f3d0b"}}, "created_at": 1702481696.353864, "relation_name": "devforrest.claims_preprocessing._int_acute_inpatient_claims_with_encounter_data", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r\n )\r\n}}\r\n\r\n-- *************************************************\r\n-- This dbt model returns relevant encounter-level\r\n-- data for every professional or institutional\r\n-- acute inpatient claim that is part of an encounter\r\n-- (note that all institutional acute inpatienet claims\r\n-- are part of an acute inpatient encounter, but only\r\n-- professional acute inpatient claims that are not\r\n-- orphan claims and that belong to one and only\r\n-- one encounter, i.e. have encounter_count = 1,\r\n-- are part of an acute inpatient encounter).\r\n-- It returns a table with these columns:\r\n-- patient_id\r\n-- claim_id\r\n-- start_date (date used for merging claims into encounters)\r\n-- end_date (date used for merging claims into encounters)\r\n-- encounter_id\r\n-- encounter_start_date,\r\n-- encounter_end_date,\r\n-- encounter_admit_source_code,\r\n-- encounter_admit_type_code,\r\n-- encounter_discharge_disposition_code\r\n-- *************************************************\r\n\r\n\r\n\r\n\r\nwith useful_fields_at_claim_id_level as (\r\nselect\r\n aa.patient_id,\r\n aa.claim_id,\r\n aa.admit_type_code,\r\n aa.admit_source_code,\r\n aa.discharge_disposition_code,\r\n aa.start_date,\r\n aa.end_date,\r\n\r\n bb.encounter_id,\r\n\r\n cc.encounter_start_date,\r\n cc.encounter_end_date\r\n\r\nfrom {{ ref('acute_inpatient__institutional_claims') }} aa\r\n\r\nleft join\r\n{{ ref('acute_inpatient__encounter_id') }} bb\r\non aa.claim_id = bb.claim_id\r\nand aa.patient_id = bb.patient_id\r\n\r\nleft join\r\n{{ ref('acute_inpatient__encounter_start_and_end_dates') }} cc\r\non bb.encounter_id = cc.encounter_id\r\nand bb.patient_id = cc.patient_id\r\n),\r\n\r\n\r\n\r\nadmit_codes as (\r\nselect\r\n encounter_id,\r\n max(admit_source_code) as encounter_admit_source_code,\r\n max(admit_type_code) as encounter_admit_type_code\r\nfrom useful_fields_at_claim_id_level\r\nwhere start_date = encounter_start_date\r\ngroup by encounter_id\r\n),\r\n\r\n\r\ndischarge_code as (\r\nselect\r\n encounter_id,\r\n max(discharge_disposition_code) as encounter_discharge_disposition_code\r\nfrom useful_fields_at_claim_id_level\r\nwhere end_date = encounter_end_date\r\ngroup by encounter_id\r\n),\r\n\r\n\r\nall_useful_fields_at_claim_id_level as (\r\nselect\r\n aa.patient_id,\r\n aa.claim_id,\r\n aa.start_date,\r\n aa.end_date,\r\n aa.encounter_id,\r\n aa.encounter_start_date,\r\n aa.encounter_end_date,\r\n\r\n bb.encounter_admit_source_code,\r\n bb.encounter_admit_type_code,\r\n \r\n cc.encounter_discharge_disposition_code\r\n\r\nfrom useful_fields_at_claim_id_level aa \r\n left join admit_codes bb on aa.encounter_id = bb.encounter_id\r\n left join discharge_code cc on aa.encounter_id = cc.encounter_id\r\n)\r\n\r\n\r\n\r\nselect \r\n *, '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom all_useful_fields_at_claim_id_level", "language": "sql", "refs": [["acute_inpatient__institutional_claims"], ["acute_inpatient__encounter_id"], ["acute_inpatient__encounter_start_and_end_dates"]], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.acute_inpatient__institutional_claims", "model.the_tuva_project.acute_inpatient__encounter_id", "model.the_tuva_project.acute_inpatient__encounter_start_and_end_dates"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\acute_inpatient\\intermediate\\acute_inpatient__claims_with_encounter_data.sql", "compiled": true, "compiled_code": "\n\n-- *************************************************\n-- This dbt model returns relevant encounter-level\n-- data for every professional or institutional\n-- acute inpatient claim that is part of an encounter\n-- (note that all institutional acute inpatienet claims\n-- are part of an acute inpatient encounter, but only\n-- professional acute inpatient claims that are not\n-- orphan claims and that belong to one and only\n-- one encounter, i.e. have encounter_count = 1,\n-- are part of an acute inpatient encounter).\n-- It returns a table with these columns:\n-- patient_id\n-- claim_id\n-- start_date (date used for merging claims into encounters)\n-- end_date (date used for merging claims into encounters)\n-- encounter_id\n-- encounter_start_date,\n-- encounter_end_date,\n-- encounter_admit_source_code,\n-- encounter_admit_type_code,\n-- encounter_discharge_disposition_code\n-- *************************************************\n\n\n\n\nwith useful_fields_at_claim_id_level as (\nselect\n aa.patient_id,\n aa.claim_id,\n aa.admit_type_code,\n aa.admit_source_code,\n aa.discharge_disposition_code,\n aa.start_date,\n aa.end_date,\n\n bb.encounter_id,\n\n cc.encounter_start_date,\n cc.encounter_end_date\n\nfrom devforrest.claims_preprocessing._int_acute_inpatient_institutional_claims aa\n\nleft join\ndevforrest.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\ndevforrest.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-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom all_useful_fields_at_claim_id_level", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.acute_inpatient__data_quality_summary": {"database": "devforrest", "schema": "claims_preprocessing", "name": "acute_inpatient__data_quality_summary", "resource_type": "model", "package_name": "the_tuva_project", "path": "claims_preprocessing\\acute_inpatient\\intermediate\\acute_inpatient__data_quality_summary.sql", "original_file_path": "models\\claims_preprocessing\\acute_inpatient\\intermediate\\acute_inpatient__data_quality_summary.sql", "unique_id": "model.the_tuva_project.acute_inpatient__data_quality_summary", "fqn": ["the_tuva_project", "claims_preprocessing", "acute_inpatient", "intermediate", "acute_inpatient__data_quality_summary"], "alias": "_int_acute_inpatient_data_quality_summary", "checksum": {"name": "sha256", "checksum": "2769efc3ae1d7465fafb2afef5c686d9f2e66cb61006a02ea0350c6a0eeb7653"}, "config": {"enabled": true, "alias": "_int_acute_inpatient_data_quality_summary", "schema": "claims_preprocessing", "database": null, "tags": ["acute_inpatient", "claims_preprocessing"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#0f3d0b"}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["acute_inpatient", "claims_preprocessing"], "description": "Summary of data quality issues with acute inpatient claims", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#0f3d0b"}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_acute_inpatient_data_quality_summary", "tags": ["acute_inpatient", "claims_preprocessing"], "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#0f3d0b"}}, "created_at": 1702481696.336049, "relation_name": "devforrest.claims_preprocessing._int_acute_inpatient_data_quality_summary", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r\n )\r\n}}\r\n\r\n-- *************************************************\r\n-- This dbt model summarizes data quality issues\r\n-- that could affect claims preprocessing.\r\n-- The table returns 2 fields:\r\n-- field\r\n-- total_count\r\n--\r\n-- If we order the results by 'field', the first\r\n-- 3 rows give us a high level summary:\r\n--\r\n-- 01 Total acute inpatient institutional claims:\r\n-- This is the total number of acute inpatient\r\n-- institutional claims\r\n-- 02 Acute inpatient institutional claims with insights:\r\n-- This is the number of acute inpatient institutional\r\n-- claims for which something is not ideal (e.g. they\r\n-- are missing a claim_start_date) but it's not something\r\n-- that prevents the claim from being used in the\r\n-- encounter grouper.\r\n\r\n-- 03 Acute inpatient institutional claims with problems:\r\n-- This is the number of acute inpatient institutional\r\n-- claims that have a data quality problem that\r\n-- prevents them from being used in the encounter grouper.\r\n\r\n-- The rest of the rows in the table give us counts\r\n-- of the number of acute inpatient institutional claims\r\n-- that have specific data quality problems.\r\n-- *************************************************\r\n\r\n\r\n\r\n\r\nwith total_acute_inpatient__institutional_claims as (\r\nselect\r\n '01 Total acute inpatient institutional claims' as field,\r\n count(*) as total_count\r\nfrom {{ ref('acute_inpatient__institutional_claims') }}\r\n),\r\n\r\n\r\ntotal_claims_with_insights as (\r\nselect\r\n '02 Acute inpatient institutional claims with insights' as field,\r\n count(*) as total_count\r\nfrom {{ ref('acute_inpatient__institutional_claims') }}\r\nwhere dq_insight = 1\r\n),\r\n\r\n\r\ntotal_claims_with_problems as (\r\nselect\r\n '03 Acute inpatient institutional claims with problems' as field,\r\n count(*) as total_count\r\nfrom {{ ref('acute_inpatient__institutional_claims') }}\r\nwhere dq_problem = 1\r\n),\r\n\r\n\r\npatient_id_not_unique as (\r\nselect\r\n '04 patient_id_not_unique' as field,\r\n sum(patient_id_not_unique) as total_count\r\nfrom {{ ref('acute_inpatient__institutional_claims') }}\r\n),\r\n\r\n\r\npatient_id_missing as (\r\nselect\r\n '05 patient_id_missing' as field,\r\n sum(patient_id_missing) as total_count\r\nfrom {{ ref('acute_inpatient__institutional_claims') }}\r\n),\r\n\r\n\r\nclaim_start_date_not_unique as (\r\nselect\r\n '06 claim_start_date_not_unique' as field,\r\n sum(claim_start_date_not_unique) as total_count\r\nfrom {{ ref('acute_inpatient__institutional_claims') }}\r\n),\r\n\r\n\r\nclaim_start_date_missing as (\r\nselect\r\n '07 claim_start_date_missing' as field,\r\n sum(claim_start_date_missing) as total_count\r\nfrom {{ ref('acute_inpatient__institutional_claims') }}\r\n),\r\n\r\n\r\nclaim_end_date_not_unique as (\r\nselect\r\n '08 claim_end_date_not_unique' as field,\r\n sum(claim_end_date_not_unique) as total_count\r\nfrom {{ ref('acute_inpatient__institutional_claims') }}\r\n),\r\n\r\n\r\nclaim_end_date_missing as (\r\nselect\r\n '09 claim_end_date_missing' as field,\r\n sum(claim_end_date_missing) as total_count\r\nfrom {{ ref('acute_inpatient__institutional_claims') }}\r\n),\r\n\r\n\r\nclaim_start_date_after_claim_end_date as (\r\nselect\r\n '10 claim_start_date_after_claim_end_date' as field,\r\n sum(claim_start_date_after_claim_end_date) as total_count\r\nfrom {{ ref('acute_inpatient__institutional_claims') }}\r\n),\r\n\r\n\r\nadmission_date_not_unique as (\r\nselect\r\n '11 admission_date_not_unique' as field,\r\n sum(admission_date_not_unique) as total_count\r\nfrom {{ ref('acute_inpatient__institutional_claims') }}\r\n),\r\n\r\n\r\nadmission_date_missing as (\r\nselect\r\n '12 admission_date_missing' as field,\r\n sum(admission_date_missing) as total_count\r\nfrom {{ ref('acute_inpatient__institutional_claims') }}\r\n),\r\n\r\n\r\ndischarge_date_not_unique as (\r\nselect\r\n '13 discharge_date_not_unique' as field,\r\n sum(discharge_date_not_unique) as total_count\r\nfrom {{ ref('acute_inpatient__institutional_claims') }}\r\n),\r\n\r\n\r\ndischarge_date_missing as (\r\nselect\r\n '14 discharge_date_missing' as field,\r\n sum(discharge_date_missing) as total_count\r\nfrom {{ ref('acute_inpatient__institutional_claims') }}\r\n),\r\n\r\n\r\nadmission_date_after_discharge_date as (\r\nselect\r\n '15 admission_date_after_discharge_date' as field,\r\n sum(admission_date_after_discharge_date) as total_count\r\nfrom {{ ref('acute_inpatient__institutional_claims') }}\r\n),\r\n\r\n\r\nadmit_type_code_not_unique as (\r\nselect\r\n '16 admit_type_code_not_unique' as field,\r\n sum(admit_type_code_not_unique) as total_count\r\nfrom {{ ref('acute_inpatient__institutional_claims') }}\r\n),\r\n\r\n\r\nadmit_type_code_missing as (\r\nselect\r\n '17 admit_type_code_missing' as field,\r\n sum(admit_type_code_missing) as total_count\r\nfrom {{ ref('acute_inpatient__institutional_claims') }}\r\n),\r\n\r\n\r\nadmit_source_code_not_unique as (\r\nselect\r\n '18 admit_source_code_not_unique' as field,\r\n sum(admit_source_code_not_unique) as total_count\r\nfrom {{ ref('acute_inpatient__institutional_claims') }}\r\n),\r\n\r\n\r\nadmit_source_code_missing as (\r\nselect\r\n '19 admit_source_code_missing' as field,\r\n sum(admit_source_code_missing) as total_count\r\nfrom {{ ref('acute_inpatient__institutional_claims') }}\r\n),\r\n\r\n\r\ndischarge_disposition_code_not_unique as (\r\nselect\r\n '20 discharge_disposition_code_not_unique' as field,\r\n sum(discharge_disposition_code_not_unique) as total_count\r\nfrom {{ ref('acute_inpatient__institutional_claims') }}\r\n),\r\n\r\n\r\ndischarge_disposition_code_missing as (\r\nselect\r\n '21 discharge_disposition_code_missing' as field,\r\n sum(discharge_disposition_code_missing) as total_count\r\nfrom {{ ref('acute_inpatient__institutional_claims') }}\r\n),\r\n\r\n\r\nfacility_npi_not_unique as (\r\nselect\r\n '22 facility_npi_not_unique' as field,\r\n sum(facility_npi_not_unique) as total_count\r\nfrom {{ ref('acute_inpatient__institutional_claims') }}\r\n),\r\n\r\n\r\nfacility_npi_missing as (\r\nselect\r\n '23 facility_npi_missing' as field,\r\n sum(facility_npi_missing) as total_count\r\nfrom {{ ref('acute_inpatient__institutional_claims') }}\r\n),\r\n\r\n\r\nclaim_type_not_unique as (\r\nselect\r\n '24 claim_type_not_unique' as field,\r\n sum(claim_type_not_unique) as total_count\r\nfrom {{ ref('acute_inpatient__institutional_claims') }}\r\n),\r\n\r\n\r\nclaim_type_missing as (\r\nselect\r\n '25 claim_type_missing' as field,\r\n sum(claim_type_missing) as total_count\r\nfrom {{ ref('acute_inpatient__institutional_claims') }}\r\n),\r\n\r\n\r\nclaim_type_not_institutional as (\r\nselect\r\n '26 claim_type_not_institutional' as field,\r\n sum(claim_type_not_institutional) as total_count\r\nfrom {{ ref('acute_inpatient__institutional_claims') }}\r\n),\r\n\r\n\r\nstart_date_not_determined as (\r\nselect\r\n '27 start_date_not_determined' as field,\r\n sum(start_date_not_determined) as total_count\r\nfrom {{ ref('acute_inpatient__institutional_claims') }}\r\n),\r\n\r\n\r\nend_date_not_determined as (\r\nselect\r\n '28 end_date_not_determined' as field,\r\n sum(end_date_not_determined) as total_count\r\nfrom {{ ref('acute_inpatient__institutional_claims') }}\r\n),\r\n\r\n\r\nstart_date_after_end_date as (\r\nselect\r\n '29 start_date_after_end_date' as field,\r\n sum(start_date_after_end_date) as total_count\r\nfrom {{ ref('acute_inpatient__institutional_claims') }}\r\n),\r\n\r\n\r\n\r\nunion_cte as (\r\nselect *\r\nfrom total_acute_inpatient__institutional_claims\r\n\r\nunion all\r\n\r\nselect *\r\nfrom total_claims_with_insights\r\n\r\nunion all\r\n\r\nselect *\r\nfrom total_claims_with_problems\r\n\r\nunion all\r\n\r\nselect *\r\nfrom patient_id_not_unique\r\n\r\nunion all\r\n\r\nselect *\r\nfrom patient_id_missing\r\n\r\nunion all\r\n\r\nselect *\r\nfrom claim_start_date_not_unique\r\n\r\nunion all\r\n\r\nselect *\r\nfrom claim_start_date_missing\r\n\r\nunion all\r\n\r\nselect *\r\nfrom claim_end_date_not_unique\r\n\r\nunion all\r\n\r\nselect *\r\nfrom claim_end_date_missing\r\n\r\nunion all\r\n\r\nselect *\r\nfrom claim_start_date_after_claim_end_date\r\n\r\nunion all\r\n\r\nselect *\r\nfrom admission_date_not_unique\r\n\r\nunion all\r\n\r\nselect *\r\nfrom admission_date_missing\r\n\r\nunion all\r\n\r\nselect *\r\nfrom discharge_date_not_unique\r\n\r\nunion all\r\n\r\nselect *\r\nfrom discharge_date_missing\r\n\r\nunion all\r\n\r\nselect *\r\nfrom admission_date_after_discharge_date\r\n\r\nunion all\r\n\r\nselect *\r\nfrom admit_type_code_not_unique\r\n\r\nunion all\r\n\r\nselect *\r\nfrom admit_type_code_missing\r\n\r\nunion all\r\n\r\nselect *\r\nfrom admit_source_code_not_unique\r\n\r\nunion all\r\n\r\nselect *\r\nfrom admit_source_code_missing\r\n\r\nunion all\r\n\r\nselect *\r\nfrom discharge_disposition_code_not_unique\r\n\r\nunion all\r\n\r\nselect *\r\nfrom discharge_disposition_code_missing\r\n\r\nunion all\r\n\r\nselect *\r\nfrom facility_npi_not_unique\r\n\r\nunion all\r\n\r\nselect *\r\nfrom facility_npi_missing\r\n\r\nunion all\r\n\r\nselect *\r\nfrom claim_type_not_unique\r\n\r\nunion all\r\n\r\nselect *\r\nfrom claim_type_missing\r\n\r\nunion all\r\n\r\nselect *\r\nfrom claim_type_not_institutional\r\n\r\nunion all\r\n\r\nselect *\r\nfrom start_date_not_determined\r\n\r\nunion all\r\n\r\nselect *\r\nfrom end_date_not_determined\r\n\r\nunion all\r\n\r\nselect *\r\nfrom start_date_after_end_date\r\n)\r\n\r\n\r\n\r\nselect *, '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom union_cte", "language": "sql", "refs": [["acute_inpatient__institutional_claims"], ["acute_inpatient__institutional_claims"], ["acute_inpatient__institutional_claims"], ["acute_inpatient__institutional_claims"], ["acute_inpatient__institutional_claims"], ["acute_inpatient__institutional_claims"], ["acute_inpatient__institutional_claims"], ["acute_inpatient__institutional_claims"], ["acute_inpatient__institutional_claims"], ["acute_inpatient__institutional_claims"], ["acute_inpatient__institutional_claims"], ["acute_inpatient__institutional_claims"], ["acute_inpatient__institutional_claims"], ["acute_inpatient__institutional_claims"], ["acute_inpatient__institutional_claims"], ["acute_inpatient__institutional_claims"], ["acute_inpatient__institutional_claims"], ["acute_inpatient__institutional_claims"], ["acute_inpatient__institutional_claims"], ["acute_inpatient__institutional_claims"], ["acute_inpatient__institutional_claims"], ["acute_inpatient__institutional_claims"], ["acute_inpatient__institutional_claims"], ["acute_inpatient__institutional_claims"], ["acute_inpatient__institutional_claims"], ["acute_inpatient__institutional_claims"], ["acute_inpatient__institutional_claims"], ["acute_inpatient__institutional_claims"], ["acute_inpatient__institutional_claims"]], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.acute_inpatient__institutional_claims", "model.the_tuva_project.acute_inpatient__institutional_claims", "model.the_tuva_project.acute_inpatient__institutional_claims", "model.the_tuva_project.acute_inpatient__institutional_claims", "model.the_tuva_project.acute_inpatient__institutional_claims", "model.the_tuva_project.acute_inpatient__institutional_claims", "model.the_tuva_project.acute_inpatient__institutional_claims", "model.the_tuva_project.acute_inpatient__institutional_claims", "model.the_tuva_project.acute_inpatient__institutional_claims", "model.the_tuva_project.acute_inpatient__institutional_claims", "model.the_tuva_project.acute_inpatient__institutional_claims", "model.the_tuva_project.acute_inpatient__institutional_claims", "model.the_tuva_project.acute_inpatient__institutional_claims", "model.the_tuva_project.acute_inpatient__institutional_claims", "model.the_tuva_project.acute_inpatient__institutional_claims", "model.the_tuva_project.acute_inpatient__institutional_claims", "model.the_tuva_project.acute_inpatient__institutional_claims", "model.the_tuva_project.acute_inpatient__institutional_claims", "model.the_tuva_project.acute_inpatient__institutional_claims", "model.the_tuva_project.acute_inpatient__institutional_claims", "model.the_tuva_project.acute_inpatient__institutional_claims", "model.the_tuva_project.acute_inpatient__institutional_claims", "model.the_tuva_project.acute_inpatient__institutional_claims", "model.the_tuva_project.acute_inpatient__institutional_claims", "model.the_tuva_project.acute_inpatient__institutional_claims", "model.the_tuva_project.acute_inpatient__institutional_claims", "model.the_tuva_project.acute_inpatient__institutional_claims", "model.the_tuva_project.acute_inpatient__institutional_claims", "model.the_tuva_project.acute_inpatient__institutional_claims"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\acute_inpatient\\intermediate\\acute_inpatient__data_quality_summary.sql", "compiled": true, "compiled_code": "\n\n-- *************************************************\n-- This dbt model summarizes data quality issues\n-- that could affect claims preprocessing.\n-- The table returns 2 fields:\n-- field\n-- total_count\n--\n-- If we order the results by 'field', the first\n-- 3 rows give us a high level summary:\n--\n-- 01 Total acute inpatient institutional claims:\n-- This is the total number of acute inpatient\n-- institutional claims\n-- 02 Acute inpatient institutional claims with insights:\n-- This is the number of acute inpatient institutional\n-- claims for which something is not ideal (e.g. they\n-- are missing a claim_start_date) but it's not something\n-- that prevents the claim from being used in the\n-- encounter grouper.\n\n-- 03 Acute inpatient institutional claims with problems:\n-- This is the number of acute inpatient institutional\n-- claims that have a data quality problem that\n-- prevents them from being used in the encounter grouper.\n\n-- The rest of the rows in the table give us counts\n-- of the number of acute inpatient institutional claims\n-- that have specific data quality problems.\n-- *************************************************\n\n\n\n\nwith total_acute_inpatient__institutional_claims as (\nselect\n '01 Total acute inpatient institutional claims' as field,\n count(*) as total_count\nfrom devforrest.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 devforrest.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 devforrest.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 devforrest.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 devforrest.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 devforrest.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 devforrest.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 devforrest.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 devforrest.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 devforrest.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 devforrest.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 devforrest.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 devforrest.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 devforrest.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 devforrest.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 devforrest.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 devforrest.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 devforrest.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 devforrest.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 devforrest.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 devforrest.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 devforrest.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 devforrest.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 devforrest.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 devforrest.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 devforrest.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 devforrest.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 devforrest.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 devforrest.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-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom union_cte", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.acute_inpatient__encounter_data_for_medical_claims": {"database": "devforrest", "schema": "claims_preprocessing", "name": "acute_inpatient__encounter_data_for_medical_claims", "resource_type": "model", "package_name": "the_tuva_project", "path": "claims_preprocessing\\acute_inpatient\\intermediate\\acute_inpatient__encounter_data_for_medical_claims.sql", "original_file_path": "models\\claims_preprocessing\\acute_inpatient\\intermediate\\acute_inpatient__encounter_data_for_medical_claims.sql", "unique_id": "model.the_tuva_project.acute_inpatient__encounter_data_for_medical_claims", "fqn": ["the_tuva_project", "claims_preprocessing", "acute_inpatient", "intermediate", "acute_inpatient__encounter_data_for_medical_claims"], "alias": "_int_encounter_data_for_medical_claims", "checksum": {"name": "sha256", "checksum": "a25796e8c81144e4f18d2391087fed8d9e9a18a98c8627e917a4ac528662c509"}, "config": {"enabled": true, "alias": "_int_encounter_data_for_medical_claims", "schema": "claims_preprocessing", "database": null, "tags": ["acute_inpatient", "claims_preprocessing"], "meta": {}, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#0f3d0b"}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["acute_inpatient", "claims_preprocessing"], "description": "All encounter-related fields that will be added to medical_claim", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#0f3d0b"}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_encounter_data_for_medical_claims", "tags": ["acute_inpatient", "claims_preprocessing"], "materialized": "view", "enabled": true, "bind": false, "docs": {"node_color": "#0f3d0b"}}, "created_at": 1702481696.3569796, "relation_name": "devforrest.claims_preprocessing._int_encounter_data_for_medical_claims", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r\n )\r\n}}\r\n\r\n-- *************************************************\r\n-- This dbt model returns all the columns with relevant\r\n-- encounter fields that we will append to the medical_claim\r\n-- table.\r\n\r\n-- It returns a table with these columns:\r\n-- patient_id\r\n-- claim_id\r\n-- encounter_type\r\n-- encounter_id\r\n-- start_date (date used for merging claims into encounters)\r\n-- end_date (date used for merging claims into encounters)\r\n-- encounter_start_date,\r\n-- encounter_end_date,\r\n-- encounter_admit_source_code,\r\n-- encounter_admit_type_code,\r\n-- encounter_discharge_disposition_code\r\n-- orphan_claim_flag (always 0 or 1) (never null)\r\n-- encounter_count (could be 0,1,2,3,...) (never null)\r\n-- *************************************************\r\n\r\n\r\n\r\n\r\nwith acute_inpatient_claims_with_encounter_id as (\r\nselect\r\n patient_id,\r\n claim_id,\r\n start_date,\r\n end_date, \r\n-- Relevant encounter-level fields for\r\n-- professional and institutional acute inpatient\r\n-- claims that are assigned to an encounter:\r\n 'acute inpatient' as encounter_type,\r\n encounter_id,\r\n encounter_start_date,\r\n encounter_end_date,\r\n encounter_admit_source_code,\r\n encounter_admit_type_code,\r\n encounter_discharge_disposition_code,\r\n-- Fields that are only relevant for professional\r\n-- acute inpatient claims that are not assigned to\r\n-- an encounter because they are orphan claims or because\r\n-- they overlap with more than one encounter:\r\n 0 as orphan_claim_flag,\r\n 1 as encounter_count\r\nfrom {{ ref('acute_inpatient__claims_with_encounter_data') }}\r\n),\r\n\r\n\r\nacute_inpatient_claims_without_encounter_id as (\r\nselect\r\n patient_id,\r\n claim_id,\r\n start_date,\r\n end_date, \r\n-- Relevant encounter-level fields for\r\n-- professional and institutional acute inpatient\r\n-- claims that are assigned to an encounter:\r\n 'acute inpatient' encounter_type,\r\n cast(null as {{ dbt.type_string() }}) as encounter_id,\r\n cast(null as date) as encounter_start_date,\r\n cast(null as date) as encounter_end_date,\r\n cast(null as {{ dbt.type_string() }}) as encounter_admit_source_code,\r\n cast(null as {{ dbt.type_string() }}) as encounter_admit_type_code,\r\n cast(null as {{ dbt.type_string() }}) as encounter_discharge_disposition_code,\r\n-- Fields that are only relevant for professional\r\n-- acute inpatient claims that are not assigned to\r\n-- an encounter because they are orphan claims or because\r\n-- they overlap with more than one encounter:\r\n orphan_claim_flag,\r\n encounter_count\r\n \r\nfrom {{ ref('acute_inpatient__professional_encounter_id') }}\r\nwhere (orphan_claim_flag = 1) or (encounter_count > 1)\r\n)\r\n\r\n\r\nselect *, '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom acute_inpatient_claims_with_encounter_id\r\n\r\nunion all\r\n\r\nselect *, '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom acute_inpatient_claims_without_encounter_id", "language": "sql", "refs": [["acute_inpatient__claims_with_encounter_data"], ["acute_inpatient__professional_encounter_id"]], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.type_string"], "nodes": ["model.the_tuva_project.acute_inpatient__claims_with_encounter_data", "model.the_tuva_project.acute_inpatient__professional_encounter_id"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\acute_inpatient\\intermediate\\acute_inpatient__encounter_data_for_medical_claims.sql", "compiled": true, "compiled_code": "\n\n-- *************************************************\n-- This dbt model returns all the columns with relevant\n-- encounter fields that we will append to the medical_claim\n-- table.\n\n-- It returns a table with these columns:\n-- patient_id\n-- claim_id\n-- encounter_type\n-- encounter_id\n-- start_date (date used for merging claims into encounters)\n-- end_date (date used for merging claims into encounters)\n-- encounter_start_date,\n-- encounter_end_date,\n-- encounter_admit_source_code,\n-- encounter_admit_type_code,\n-- encounter_discharge_disposition_code\n-- orphan_claim_flag (always 0 or 1) (never null)\n-- encounter_count (could be 0,1,2,3,...) (never null)\n-- *************************************************\n\n\n\n\nwith acute_inpatient_claims_with_encounter_id as (\nselect\n patient_id,\n claim_id,\n start_date,\n end_date, \n-- Relevant encounter-level fields for\n-- professional and institutional acute inpatient\n-- claims that are assigned to an encounter:\n 'acute inpatient' as encounter_type,\n encounter_id,\n encounter_start_date,\n encounter_end_date,\n encounter_admit_source_code,\n encounter_admit_type_code,\n encounter_discharge_disposition_code,\n-- Fields that are only relevant for professional\n-- acute inpatient claims that are not assigned to\n-- an encounter because they are orphan claims or because\n-- they overlap with more than one encounter:\n 0 as orphan_claim_flag,\n 1 as encounter_count\nfrom devforrest.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 devforrest.claims_preprocessing._int_acute_inpatient_professional_encounter_id\nwhere (orphan_claim_flag = 1) or (encounter_count > 1)\n)\n\n\nselect *, '2023-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom acute_inpatient_claims_with_encounter_id\n\nunion all\n\nselect *, '2023-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom acute_inpatient_claims_without_encounter_id", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.acute_inpatient__encounter_id": {"database": "devforrest", "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": "a77eac85d6045f98cb88a6e6d722b6320ec15441b4f2c56a0186d8821fa262bf"}, "config": {"enabled": true, "alias": "_int_acute_inpatient_encounter_id", "schema": "claims_preprocessing", "database": null, "tags": ["acute_inpatient", "claims_preprocessing"], "meta": {}, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#0f3d0b"}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["acute_inpatient", "claims_preprocessing"], "description": "Fix encounter_id so each professional claim can only belong to one encounter", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#0f3d0b"}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_acute_inpatient_encounter_id", "tags": ["acute_inpatient", "claims_preprocessing"], "materialized": "view", "enabled": true, "bind": false, "docs": {"node_color": "#0f3d0b"}}, "created_at": 1702481696.3493662, "relation_name": "devforrest.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 inst.patient_id,\r\n inst.claim_id,\r\n med.claim_line_number,\r\n inst.encounter_id,\r\n '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('acute_inpatient__institutional_encounter_id') }} inst\r\nleft join {{ ref('medical_claim') }} med\r\n on inst.claim_id = med.claim_id\r\n\r\nunion distinct\r\n\r\nselect\r\n patient_id,\r\n claim_id,\r\n claim_line_number,\r\n encounter_id,\r\n '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('acute_inpatient__professional_encounter_id') }}\r\nwhere (orphan_claim_flag = 0) and (encounter_count = 1)", "language": "sql", "refs": [["acute_inpatient__institutional_encounter_id"], ["medical_claim"], ["acute_inpatient__professional_encounter_id"]], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.acute_inpatient__institutional_encounter_id", "model.input_layer.medical_claim", "model.the_tuva_project.acute_inpatient__professional_encounter_id"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\acute_inpatient\\intermediate\\acute_inpatient__encounter_id.sql", "compiled": true, "compiled_code": "\n\n-- *************************************************\n-- This dbt model assigns an encounter_id to each\n-- institutional or professional acute inpatient claim\n-- that is eligible to be part of an encounter.\n-- Professional acute inpatient claims that are\n-- orphan claims (don't overlap with an institutional\n-- acute inpatient claim) or that have\n-- encounter_count > 1 (overlap with more than one different\n-- acute inpatient encounter) are not included here.\n-- It returns a table with these 3 columns:\n-- patient_id\n-- claim_id\n-- encounter_id\n-- *************************************************\n\n\n\n\nselect\n inst.patient_id,\n inst.claim_id,\n med.claim_line_number,\n inst.encounter_id,\n '2023-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom devforrest.claims_preprocessing._int_acute_inpatient_institutional_encounter_id inst\nleft join tuva.input_layer.medical_claim med\n on inst.claim_id = med.claim_id\n\nunion distinct\n\nselect\n patient_id,\n claim_id,\n claim_line_number,\n encounter_id,\n '2023-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom devforrest.claims_preprocessing._int_acute_inpatient_professional_encounter_id\nwhere (orphan_claim_flag = 0) and (encounter_count = 1)", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.acute_inpatient__encounter_start_and_end_dates": {"database": "devforrest", "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": "b0848158652e642d65cdb656d6d0be241d0ea0cbfb3c25a5e6c7e7754fed7a5d"}, "config": {"enabled": true, "alias": "_int_acute_inpatient_encounter_start_and_end_dates", "schema": "claims_preprocessing", "database": null, "tags": ["acute_inpatient", "claims_preprocessing"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#0f3d0b"}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["acute_inpatient", "claims_preprocessing"], "description": "Defines encounter start and end dates for acute inpatient encounters", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#0f3d0b"}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_acute_inpatient_encounter_start_and_end_dates", "tags": ["acute_inpatient", "claims_preprocessing"], "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#0f3d0b"}}, "created_at": 1702481696.3382642, "relation_name": "devforrest.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\r\n patient_id\r\n , encounter_id\r\n , encounter_start_date\r\n , encounter_end_date\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom encounter_start_and_end_dates", "language": "sql", "refs": [["acute_inpatient__institutional_claims"], ["acute_inpatient__institutional_encounter_id"]], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.acute_inpatient__institutional_claims", "model.the_tuva_project.acute_inpatient__institutional_encounter_id"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\acute_inpatient\\intermediate\\acute_inpatient__encounter_start_and_end_dates.sql", "compiled": true, "compiled_code": "\n\n-- *************************************************\n-- This dbt model assigns an encounter_start_date and\n-- an encounter_end_date to each acute inpatient\n-- encounter_id.\n-- This returns a table with 4 fields:\n-- patient_id\n-- encounter_id\n-- encounter_start_date\n-- encounter_end_date\n-- The number of rows in the table should be equal\n-- to the number of acute inpatient encounters.\n-- *************************************************\n\n\nwith add_encounter_id_to_acute_inpatient_encounters as (\nselect\n aip.claim_id as claim_id,\n aip.patient_id as patient_id,\n aip.start_date as start_date,\n aip.end_date as end_date,\n eid.encounter_id as encounter_id\nfrom devforrest.claims_preprocessing._int_acute_inpatient_institutional_claims aip\nleft join devforrest.claims_preprocessing._int_acute_inpatient_institutional_encounter_id eid\n on aip.patient_id = eid.patient_id\n and aip.claim_id = eid.claim_id\n),\n\nencounter_start_and_end_dates as (\nselect\n patient_id,\n encounter_id,\n min(start_date) as encounter_start_date,\n max(end_date) as encounter_end_date\nfrom add_encounter_id_to_acute_inpatient_encounters\ngroup by patient_id, encounter_id\n)\n\nselect\n patient_id\n , encounter_id\n , encounter_start_date\n , encounter_end_date\n , '2023-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom encounter_start_and_end_dates", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.acute_inpatient__first_claim_values": {"database": "devforrest", "schema": "claims_preprocessing", "name": "acute_inpatient__first_claim_values", "resource_type": "model", "package_name": "the_tuva_project", "path": "claims_preprocessing\\acute_inpatient\\intermediate\\acute_inpatient__first_claim_values.sql", "original_file_path": "models\\claims_preprocessing\\acute_inpatient\\intermediate\\acute_inpatient__first_claim_values.sql", "unique_id": "model.the_tuva_project.acute_inpatient__first_claim_values", "fqn": ["the_tuva_project", "claims_preprocessing", "acute_inpatient", "intermediate", "acute_inpatient__first_claim_values"], "alias": "_int_acute_inpatient_first_claim_values", "checksum": {"name": "sha256", "checksum": "5cf9e4c3ca2d2e978eb35a242daaa27a19ea2e5851a56b6d68b7ec9e3cd4a3eb"}, "config": {"enabled": true, "alias": "_int_acute_inpatient_first_claim_values", "schema": "claims_preprocessing", "database": null, "tags": ["acute_inpatient", "claims_preprocessing"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#0f3d0b"}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["acute_inpatient", "claims_preprocessing"], "description": "Orders claims to pull out encounter details (admit type, drg, etc)", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#0f3d0b"}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_acute_inpatient_first_claim_values", "tags": ["acute_inpatient", "claims_preprocessing"], "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#0f3d0b"}}, "created_at": 1702481696.3599973, "relation_name": "devforrest.claims_preprocessing._int_acute_inpatient_first_claim_values", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r\n )\r\n}}\r\n\r\nwith first_claim_values as(\r\n select distinct\r\n e.encounter_id\r\n , coalesce(claim_start_date, admission_date) as claim_start\r\n , diagnosis_code_1\r\n , diagnosis_code_type\r\n , admit_source_code\r\n , admit_type_code\r\n , facility_npi\r\n , ms_drg_code\r\n , apr_drg_code\r\n from {{ ref('acute_inpatient__encounter_id')}} e\r\n inner join {{ ref('medical_claim') }} m\r\n on e.claim_id = m.claim_id\r\n where claim_type = 'institutional'\r\n)\r\n\r\nselect\r\n encounter_id\r\n , claim_start\r\n , diagnosis_code_1\r\n , diagnosis_code_type\r\n , admit_source_code\r\n , admit_type_code\r\n , facility_npi\r\n , ms_drg_code\r\n , apr_drg_code\r\n , row_number() over (partition by encounter_id order by claim_start) as claim_row\r\nfrom first_claim_values", "language": "sql", "refs": [["acute_inpatient__encounter_id"], ["medical_claim"]], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.acute_inpatient__encounter_id", "model.input_layer.medical_claim"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\acute_inpatient\\intermediate\\acute_inpatient__first_claim_values.sql", "compiled": true, "compiled_code": "\n\nwith first_claim_values as(\n select distinct\n e.encounter_id\n , coalesce(claim_start_date, admission_date) as claim_start\n , diagnosis_code_1\n , diagnosis_code_type\n , admit_source_code\n , admit_type_code\n , facility_npi\n , ms_drg_code\n , apr_drg_code\n from devforrest.claims_preprocessing._int_acute_inpatient_encounter_id e\n inner join tuva.input_layer.medical_claim m\n on e.claim_id = m.claim_id\n where claim_type = 'institutional'\n)\n\nselect\n encounter_id\n , claim_start\n , diagnosis_code_1\n , diagnosis_code_type\n , admit_source_code\n , admit_type_code\n , facility_npi\n , ms_drg_code\n , apr_drg_code\n , row_number() over (partition by encounter_id order by claim_start) as claim_row\nfrom first_claim_values", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.acute_inpatient__institutional_claims": {"database": "devforrest", "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": "95522608f080bf51f2ddb94f4b2145faa396d9668766f9a65d0b4798a4b23729"}, "config": {"enabled": true, "alias": "_int_acute_inpatient_institutional_claims", "schema": "claims_preprocessing", "database": null, "tags": ["acute_inpatient", "claims_preprocessing"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#0f3d0b"}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["acute_inpatient", "claims_preprocessing"], "description": "All acute inpatient institutional claim_ids with header values and data quality flags", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#0f3d0b"}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_acute_inpatient_institutional_claims", "tags": ["acute_inpatient", "claims_preprocessing"], "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#0f3d0b"}}, "created_at": 1702481696.3325677, "relation_name": "devforrest.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')}} sc\r\n on mc.claim_id = sc.claim_id\r\nwhere mc.claim_type = 'institutional'\r\n and sc.service_category_2 = 'Acute Inpatient'\r\n),\r\n\r\ndata_quality_flags as (\r\nselect\r\n claim_id,\r\n-- patient_id_not_unique:\r\n case\r\n when count(distinct patient_id) > 1 then 1\r\n else 0\r\n end as patient_id_not_unique,\r\n-- patient_id_missing: \r\n case\r\n when max(patient_id) is null then 1\r\n else 0\r\n end as patient_id_missing, \r\n-- claim_start_date_not_unique:\r\n case\r\n when count(distinct claim_start_date) > 1 then 1\r\n else 0\r\n end as claim_start_date_not_unique,\r\n-- claim_start_date_missing: \r\n case\r\n when max(claim_start_date) is null then 1\r\n else 0\r\n end as claim_start_date_missing,\r\n-- claim_end_date_not_unique:\r\n case\r\n when count(distinct claim_end_date) > 1 then 1\r\n else 0\r\n end as claim_end_date_not_unique,\r\n-- claim_end_date_missing: \r\n case\r\n when max(claim_end_date) is null then 1\r\n else 0\r\n end as claim_end_date_missing,\r\n-- claim_start_date_after_claim_end_date:\r\n case\r\n when min(claim_start_date) > max(claim_end_date) then 1\r\n else 0\r\n end as claim_start_date_after_claim_end_date,\r\n-- admission_date_not_unique:\r\n case\r\n when count(distinct admission_date) > 1 then 1\r\n else 0\r\n end as admission_date_not_unique,\r\n-- admission_date_missing: \r\n case\r\n when max(admission_date) is null then 1\r\n else 0\r\n end as admission_date_missing,\r\n-- discharge_date_not_unique:\r\n case\r\n when count(distinct discharge_date) > 1 then 1\r\n else 0\r\n end as discharge_date_not_unique,\r\n-- discharge_date_missing: \r\n case\r\n when max(discharge_date) is null then 1\r\n else 0\r\n end as discharge_date_missing,\r\n-- admission_date_after_discharge_date:\r\n case\r\n when min(admission_date) > max(discharge_date) then 1\r\n else 0\r\n end as admission_date_after_discharge_date,\r\n-- admit_type_code_not_unique:\r\n case\r\n when count(distinct admit_type_code) > 1 then 1\r\n else 0\r\n end as admit_type_code_not_unique,\r\n-- admit_type_code_missing: \r\n case\r\n when max(admit_type_code) is null then 1\r\n else 0\r\n end as admit_type_code_missing, \r\n-- admit_source_code_not_unique:\r\n case\r\n when count(distinct admit_source_code) > 1 then 1\r\n else 0\r\n end as admit_source_code_not_unique,\r\n-- admit_source_code_missing: \r\n case\r\n when max(admit_source_code) is null then 1\r\n else 0\r\n end as admit_source_code_missing, \r\n-- discharge_disposition_code_not_unique:\r\n case\r\n when count(distinct discharge_disposition_code) > 1 then 1\r\n else 0\r\n end as discharge_disposition_code_not_unique,\r\n-- discharge_disposition_code_missing: \r\n case\r\n when max(discharge_disposition_code) is null then 1\r\n else 0\r\n end as discharge_disposition_code_missing,\r\n-- facility_npi_not_unique:\r\n case\r\n when count(distinct facility_npi) > 1 then 1\r\n else 0\r\n end as facility_npi_not_unique,\r\n-- facility_npi_missing: \r\n case\r\n when max(facility_npi) is null then 1\r\n else 0\r\n end as facility_npi_missing,\r\n-- claim_type_not_unique:\r\n case\r\n when count(distinct claim_type) > 1 then 1\r\n else 0\r\n end as claim_type_not_unique,\r\n-- claim_type_missing: \r\n case\r\n when max(claim_type) is null then 1\r\n else 0\r\n end as claim_type_missing,\r\n-- claim_type_not_institutional:\r\n case\r\n when max(claim_type) <> 'institutional'\r\n and min(claim_type) <> 'institutional' then 1\r\n else 0\r\n end as claim_type_not_institutional\r\nfrom acute_inpatient_claim_lines\r\ngroup by claim_id\r\n),\r\n\r\n\r\nheader_level_values as (\r\nselect\r\n claim_id,\r\n max(patient_id) as patient_id,\r\n min(claim_start_date) as claim_start_date,\r\n max(claim_end_date) as claim_end_date,\r\n min(admission_date) as admission_date,\r\n max(discharge_date) as discharge_date,\r\n max(admit_source_code) as admit_source_code,\r\n max(admit_type_code) as admit_type_code,\r\n max(discharge_disposition_code) as discharge_disposition_code,\r\n max(facility_npi) as facility_npi,\r\n max(claim_type) as claim_type,\r\n coalesce(min(admission_date),\r\n min(claim_start_date)) as start_date,\r\n coalesce(max(discharge_date),\r\n max(claim_end_date)) as end_date,\r\n case\r\n when min(admission_date) is not null then 'admission_date'\r\n when min(claim_start_date) is not null then 'claim_start_date'\r\n else null\r\n end as date_used_as_start_date,\r\n case\r\n when max(discharge_date) is not null then 'discharge_date'\r\n when max(claim_end_date) is not null then 'claim_end_date'\r\n else null\r\n end as date_used_as_end_date,\r\n data_source\r\nfrom acute_inpatient_claim_lines\r\ngroup by claim_id, data_source\r\n)\r\n\r\nselect\r\n h.patient_id as patient_id,\r\n h.claim_id as claim_id, \r\n h.claim_start_date as claim_start_date,\r\n h.claim_end_date as claim_end_date,\r\n h.admission_date as admission_date,\r\n h.discharge_date as discharge_date,\r\n h.admit_source_code as admit_source_code,\r\n h.admit_type_code as admit_type_code,\r\n h.discharge_disposition_code as discharge_disposition_code,\r\n h.facility_npi as facility_npi,\r\n h.claim_type as claim_type,\r\n h.start_date as start_date,\r\n h.end_date as end_date,\r\n h.date_used_as_start_date,\r\n h.date_used_as_end_date, \r\n\r\n case\r\n when\r\n ( (dq.patient_id_not_unique = 1) or\r\n (dq.patient_id_missing = 1) or\r\n (dq.discharge_disposition_code_not_unique = 1) or\r\n (dq.discharge_disposition_code_missing = 1) or\r\n (dq.facility_npi_not_unique = 1) or\r\n (dq.facility_npi_missing = 1) or\r\n (h.date_used_as_start_date is null) or\r\n\t(h.date_used_as_end_date is null) or\r\n\t(h.start_date > h.end_date) ) then 1\r\n else 0\r\n end as dq_problem,\r\n\r\n case\r\n when\r\n ( (dq.claim_start_date_not_unique = 1) or\r\n\t(dq.claim_start_date_missing = 1) or\r\n (dq.claim_end_date_not_unique = 1) or\r\n (dq.claim_end_date_missing = 1) or\r\n (dq.claim_start_date_after_claim_end_date = 1) or\r\n (dq.admission_date_not_unique = 1) or\r\n (dq.admission_date_missing = 1) or\r\n (dq.discharge_date_not_unique = 1) or\r\n (dq.discharge_date_missing = 1) or\r\n (dq.admission_date_after_discharge_date = 1) or\r\n (dq.admit_type_code_not_unique = 1) or\r\n (dq.admit_type_code_missing = 1) or\r\n (dq.admit_source_code_not_unique = 1) or\r\n (dq.admit_source_code_missing = 1) or\t\r\n (dq.claim_type_not_unique = 1) or\r\n (dq.claim_type_missing = 1) or\r\n (dq.claim_type_not_institutional = 1) ) then 1\r\n else 0\r\n end as dq_insight,\r\n\r\n case\r\n when (h.date_used_as_start_date is null) then 1\r\n else 0\r\n end as start_date_not_determined,\r\n \r\n case\r\n when (h.date_used_as_end_date is null) then 1\r\n else 0\r\n end as end_date_not_determined,\r\n\r\n case\r\n when (h.start_date > h.end_date) then 1\r\n else 0\r\n end as start_date_after_end_date,\r\n \r\n dq.patient_id_not_unique as patient_id_not_unique,\r\n dq.patient_id_missing as patient_id_missing,\r\n dq.claim_start_date_not_unique as claim_start_date_not_unique,\r\n dq.claim_start_date_missing as claim_start_date_missing,\r\n dq.claim_end_date_not_unique as claim_end_date_not_unique,\r\n dq.claim_end_date_missing as claim_end_date_missing,\r\n dq.claim_start_date_after_claim_end_date\r\n as claim_start_date_after_claim_end_date,\r\n dq.admission_date_not_unique as admission_date_not_unique,\r\n dq.admission_date_missing as admission_date_missing,\r\n dq.discharge_date_not_unique as discharge_date_not_unique,\r\n dq.discharge_date_missing as discharge_date_missing,\r\n dq.admission_date_after_discharge_date\r\n as admission_date_after_discharge_date,\r\n dq.admit_type_code_not_unique\r\n as admit_type_code_not_unique,\r\n dq.admit_type_code_missing\r\n as admit_type_code_missing,\r\n dq.admit_source_code_not_unique\r\n as admit_source_code_not_unique,\r\n dq.admit_source_code_missing\r\n as admit_source_code_missing,\r\n dq.discharge_disposition_code_not_unique\r\n as discharge_disposition_code_not_unique,\r\n dq.discharge_disposition_code_missing\r\n as discharge_disposition_code_missing,\r\n dq.facility_npi_not_unique as facility_npi_not_unique,\r\n dq.facility_npi_missing as facility_npi_missing,\r\n dq.claim_type_not_unique as claim_type_not_unique,\r\n dq.claim_type_missing as claim_type_missing,\r\n dq.claim_type_not_institutional as claim_type_not_institutional,\r\n h.data_source,\r\n '{{ var('tuva_last_run')}}' as tuva_last_run\r\n\r\nfrom header_level_values h\r\nleft join data_quality_flags dq\r\n on h.claim_id = dq.claim_id", "language": "sql", "refs": [["acute_inpatient__stg_medical_claim"], ["acute_inpatient__stg_service_category"]], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.acute_inpatient__stg_medical_claim", "model.the_tuva_project.acute_inpatient__stg_service_category"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\acute_inpatient\\intermediate\\acute_inpatient__institutional_claims.sql", "compiled": true, "compiled_code": "\n\n-- *************************************************\n-- This dbt model gives us all acute inpatient institutional claims.\n-- We have one row per claim_id (for all claim_ids belonging to\n-- acute inpatient institutinal claims).\n-- The number of rows in the table is equal to the number of unique\n-- claim_ids (i.e. claim_id is a primary key).\n-- Note that we are assuming that a claim_id is unique across\n-- all people in the datset, i.e.\n-- that no two people can have the same claim_id.\n-- *************************************************\n\nwith __dbt__cte__acute_inpatient__stg_medical_claim as (\n\n\nselect \n claim_id\n, claim_line_number\n, patient_id\n, claim_type\n, claim_start_date\n, claim_end_date\n, admission_date\n, discharge_date\n, facility_npi\n, ms_drg_code\n, apr_drg_code\n, admit_source_code\n, admit_type_code\n, discharge_disposition_code\n, paid_amount\n, allowed_amount\n, charge_amount\n, data_source\n, '2023-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom tuva.input_layer.medical_claim\n), __dbt__cte__acute_inpatient__stg_service_category as (\n\n\n\nSELECT\n claim_id\n, claim_type\n, claim_line_number\n, service_category_2\n, '2023-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom devforrest.claims_preprocessing.service_category_grouper\n),acute_inpatient_claim_lines as (\nselect\n mc.patient_id,\n mc.claim_id,\n mc.claim_line_number,\n mc.claim_start_date,\n mc.claim_end_date,\n mc.admission_date,\n mc.discharge_date,\n mc.admit_source_code,\n mc.admit_type_code,\n mc.discharge_disposition_code,\n mc.facility_npi,\n mc.claim_type,\n mc.data_source\nfrom __dbt__cte__acute_inpatient__stg_medical_claim mc\ninner join __dbt__cte__acute_inpatient__stg_service_category sc\n on mc.claim_id = sc.claim_id\nwhere mc.claim_type = 'institutional'\n and sc.service_category_2 = 'Acute Inpatient'\n),\n\ndata_quality_flags as (\nselect\n claim_id,\n-- patient_id_not_unique:\n case\n when count(distinct patient_id) > 1 then 1\n else 0\n end as patient_id_not_unique,\n-- patient_id_missing: \n case\n when max(patient_id) is null then 1\n else 0\n end as patient_id_missing, \n-- claim_start_date_not_unique:\n case\n when count(distinct claim_start_date) > 1 then 1\n else 0\n end as claim_start_date_not_unique,\n-- claim_start_date_missing: \n case\n when max(claim_start_date) is null then 1\n else 0\n end as claim_start_date_missing,\n-- claim_end_date_not_unique:\n case\n when count(distinct claim_end_date) > 1 then 1\n else 0\n end as claim_end_date_not_unique,\n-- claim_end_date_missing: \n case\n when max(claim_end_date) is null then 1\n else 0\n end as claim_end_date_missing,\n-- claim_start_date_after_claim_end_date:\n case\n when min(claim_start_date) > max(claim_end_date) then 1\n else 0\n end as claim_start_date_after_claim_end_date,\n-- admission_date_not_unique:\n case\n when count(distinct admission_date) > 1 then 1\n else 0\n end as admission_date_not_unique,\n-- admission_date_missing: \n case\n when max(admission_date) is null then 1\n else 0\n end as admission_date_missing,\n-- discharge_date_not_unique:\n case\n when count(distinct discharge_date) > 1 then 1\n else 0\n end as discharge_date_not_unique,\n-- discharge_date_missing: \n case\n when max(discharge_date) is null then 1\n else 0\n end as discharge_date_missing,\n-- admission_date_after_discharge_date:\n case\n when min(admission_date) > max(discharge_date) then 1\n else 0\n end as admission_date_after_discharge_date,\n-- admit_type_code_not_unique:\n case\n when count(distinct admit_type_code) > 1 then 1\n else 0\n end as admit_type_code_not_unique,\n-- admit_type_code_missing: \n case\n when max(admit_type_code) is null then 1\n else 0\n end as admit_type_code_missing, \n-- admit_source_code_not_unique:\n case\n when count(distinct admit_source_code) > 1 then 1\n else 0\n end as admit_source_code_not_unique,\n-- admit_source_code_missing: \n case\n when max(admit_source_code) is null then 1\n else 0\n end as admit_source_code_missing, \n-- discharge_disposition_code_not_unique:\n case\n when count(distinct discharge_disposition_code) > 1 then 1\n else 0\n end as discharge_disposition_code_not_unique,\n-- discharge_disposition_code_missing: \n case\n when max(discharge_disposition_code) is null then 1\n else 0\n end as discharge_disposition_code_missing,\n-- facility_npi_not_unique:\n case\n when count(distinct facility_npi) > 1 then 1\n else 0\n end as facility_npi_not_unique,\n-- facility_npi_missing: \n case\n when max(facility_npi) is null then 1\n else 0\n end as facility_npi_missing,\n-- claim_type_not_unique:\n case\n when count(distinct claim_type) > 1 then 1\n else 0\n end as claim_type_not_unique,\n-- claim_type_missing: \n case\n when max(claim_type) is null then 1\n else 0\n end as claim_type_missing,\n-- claim_type_not_institutional:\n case\n when max(claim_type) <> 'institutional'\n and min(claim_type) <> 'institutional' then 1\n else 0\n end as claim_type_not_institutional\nfrom acute_inpatient_claim_lines\ngroup by claim_id\n),\n\n\nheader_level_values as (\nselect\n claim_id,\n max(patient_id) as patient_id,\n min(claim_start_date) as claim_start_date,\n max(claim_end_date) as claim_end_date,\n min(admission_date) as admission_date,\n max(discharge_date) as discharge_date,\n max(admit_source_code) as admit_source_code,\n max(admit_type_code) as admit_type_code,\n max(discharge_disposition_code) as discharge_disposition_code,\n max(facility_npi) as facility_npi,\n max(claim_type) as claim_type,\n coalesce(min(admission_date),\n min(claim_start_date)) as start_date,\n coalesce(max(discharge_date),\n max(claim_end_date)) as end_date,\n case\n when min(admission_date) is not null then 'admission_date'\n when min(claim_start_date) is not null then 'claim_start_date'\n else null\n end as date_used_as_start_date,\n case\n when max(discharge_date) is not null then 'discharge_date'\n when max(claim_end_date) is not null then 'claim_end_date'\n else null\n end as date_used_as_end_date,\n data_source\nfrom acute_inpatient_claim_lines\ngroup by claim_id, data_source\n)\n\nselect\n h.patient_id as patient_id,\n h.claim_id as claim_id, \n h.claim_start_date as claim_start_date,\n h.claim_end_date as claim_end_date,\n h.admission_date as admission_date,\n h.discharge_date as discharge_date,\n h.admit_source_code as admit_source_code,\n h.admit_type_code as admit_type_code,\n h.discharge_disposition_code as discharge_disposition_code,\n h.facility_npi as facility_npi,\n h.claim_type as claim_type,\n h.start_date as start_date,\n h.end_date as end_date,\n h.date_used_as_start_date,\n h.date_used_as_end_date, \n\n case\n when\n ( (dq.patient_id_not_unique = 1) or\n (dq.patient_id_missing = 1) or\n (dq.discharge_disposition_code_not_unique = 1) or\n (dq.discharge_disposition_code_missing = 1) or\n (dq.facility_npi_not_unique = 1) or\n (dq.facility_npi_missing = 1) or\n (h.date_used_as_start_date is null) or\n\t(h.date_used_as_end_date is null) or\n\t(h.start_date > h.end_date) ) then 1\n else 0\n end as dq_problem,\n\n case\n when\n ( (dq.claim_start_date_not_unique = 1) or\n\t(dq.claim_start_date_missing = 1) or\n (dq.claim_end_date_not_unique = 1) or\n (dq.claim_end_date_missing = 1) or\n (dq.claim_start_date_after_claim_end_date = 1) or\n (dq.admission_date_not_unique = 1) or\n (dq.admission_date_missing = 1) or\n (dq.discharge_date_not_unique = 1) or\n (dq.discharge_date_missing = 1) or\n (dq.admission_date_after_discharge_date = 1) or\n (dq.admit_type_code_not_unique = 1) or\n (dq.admit_type_code_missing = 1) or\n (dq.admit_source_code_not_unique = 1) or\n (dq.admit_source_code_missing = 1) or\t\n (dq.claim_type_not_unique = 1) or\n (dq.claim_type_missing = 1) or\n (dq.claim_type_not_institutional = 1) ) then 1\n else 0\n end as dq_insight,\n\n case\n when (h.date_used_as_start_date is null) then 1\n else 0\n end as start_date_not_determined,\n \n case\n when (h.date_used_as_end_date is null) then 1\n else 0\n end as end_date_not_determined,\n\n case\n when (h.start_date > h.end_date) then 1\n else 0\n end as start_date_after_end_date,\n \n dq.patient_id_not_unique as patient_id_not_unique,\n dq.patient_id_missing as patient_id_missing,\n dq.claim_start_date_not_unique as claim_start_date_not_unique,\n dq.claim_start_date_missing as claim_start_date_missing,\n dq.claim_end_date_not_unique as claim_end_date_not_unique,\n dq.claim_end_date_missing as claim_end_date_missing,\n dq.claim_start_date_after_claim_end_date\n as claim_start_date_after_claim_end_date,\n dq.admission_date_not_unique as admission_date_not_unique,\n dq.admission_date_missing as admission_date_missing,\n dq.discharge_date_not_unique as discharge_date_not_unique,\n dq.discharge_date_missing as discharge_date_missing,\n dq.admission_date_after_discharge_date\n as admission_date_after_discharge_date,\n dq.admit_type_code_not_unique\n as admit_type_code_not_unique,\n dq.admit_type_code_missing\n as admit_type_code_missing,\n dq.admit_source_code_not_unique\n as admit_source_code_not_unique,\n dq.admit_source_code_missing\n as admit_source_code_missing,\n dq.discharge_disposition_code_not_unique\n as discharge_disposition_code_not_unique,\n dq.discharge_disposition_code_missing\n as discharge_disposition_code_missing,\n dq.facility_npi_not_unique as facility_npi_not_unique,\n dq.facility_npi_missing as facility_npi_missing,\n dq.claim_type_not_unique as claim_type_not_unique,\n dq.claim_type_missing as claim_type_missing,\n dq.claim_type_not_institutional as claim_type_not_institutional,\n h.data_source,\n '2023-12-13 23:31:59.089856+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-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom tuva.input_layer.medical_claim\n)"}, {"id": "model.the_tuva_project.acute_inpatient__stg_service_category", "sql": " __dbt__cte__acute_inpatient__stg_service_category as (\n\n\n\nSELECT\n claim_id\n, claim_type\n, claim_line_number\n, service_category_2\n, '2023-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom devforrest.claims_preprocessing.service_category_grouper\n)"}]}, "model.the_tuva_project.acute_inpatient__institutional_encounter_id": {"database": "devforrest", "schema": "claims_preprocessing", "name": "acute_inpatient__institutional_encounter_id", "resource_type": "model", "package_name": "the_tuva_project", "path": "claims_preprocessing\\acute_inpatient\\intermediate\\acute_inpatient__institutional_encounter_id.sql", "original_file_path": "models\\claims_preprocessing\\acute_inpatient\\intermediate\\acute_inpatient__institutional_encounter_id.sql", "unique_id": "model.the_tuva_project.acute_inpatient__institutional_encounter_id", "fqn": ["the_tuva_project", "claims_preprocessing", "acute_inpatient", "intermediate", "acute_inpatient__institutional_encounter_id"], "alias": "_int_acute_inpatient_institutional_encounter_id", "checksum": {"name": "sha256", "checksum": "1baaa1b09d4afdf40bd98eccfa3cda55d0c489532b292e686babab51ee31405e"}, "config": {"enabled": true, "alias": "_int_acute_inpatient_institutional_encounter_id", "schema": "claims_preprocessing", "database": null, "tags": ["acute_inpatient", "claims_preprocessing"], "meta": {}, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#0f3d0b"}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["acute_inpatient", "claims_preprocessing"], "description": "Assigns encounter_id to every acute inpatient institutional claim", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#0f3d0b"}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_acute_inpatient_institutional_encounter_id", "tags": ["acute_inpatient", "claims_preprocessing"], "enabled": true, "bind": false, "docs": {"node_color": "#0f3d0b"}}, "created_at": 1702481696.3382642, "relation_name": "devforrest.claims_preprocessing._int_acute_inpatient_institutional_encounter_id", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r\n )\r\n}}\r\n\r\n-- *************************************************\r\n-- This dbt model groups acute inpatient institutional\r\n-- claims into encounters. It assigns an encounter_id\r\n-- to each acute inpatient institutional claim.\r\n-- This returns a table with 3 fields:\r\n-- patient_id\r\n-- claim_id\r\n-- encounter_id\r\n-- The number of rows in the table should be equal\r\n-- to the number of acute inpatient institutional claims.\r\n-- *************************************************\r\n\r\n\r\nwith add_row_num as (\r\nselect\r\n patient_id,\r\n claim_id,\r\n start_date,\r\n end_date,\r\n discharge_disposition_code,\r\n facility_npi,\r\n row_number() over (partition by patient_id order by end_date, start_date, claim_id) as row_num\r\nfrom {{ ref('acute_inpatient__institutional_claims') }}\r\n),\r\n\r\ncheck_for_merges_with_larger_row_num as (\r\nselect\r\n aa.patient_id,\r\n aa.claim_id as claim_id_a,\r\n bb.claim_id as claim_id_b,\r\n aa.row_num as row_num_a,\r\n bb.row_num as row_num_b,\r\n case\r\n -- Claims with same end_date and same facility_npi should be merged:\r\n when (aa.end_date = bb.end_date\r\n and aa.facility_npi = bb.facility_npi) then 1\r\n\r\n -- Claims with different end_date and start_date that are\r\n -- adjacent (i.e. separated by 1 day) should be merged:\r\n when (aa.end_date + 1 = bb.start_date\r\n and aa.facility_npi = bb.facility_npi\r\n\t and aa.discharge_disposition_code = '30') then 1\r\n\r\n -- Claims with different end_date \r\n -- should be merged if they overlap:\r\n when ( (aa.end_date <> bb.end_date) and \r\n (aa.end_date >= bb.start_date) and --overlap requirement\r\n (aa.facility_npi = bb.facility_npi)\r\n\t )then 1\r\n else 0\r\n end as merge_flag\r\nfrom add_row_num aa\r\n inner join add_row_num bb\r\n on aa.patient_id = bb.patient_id\r\n and aa.row_num < bb.row_num\r\n),\r\n\r\nmerges_with_larger_row_num as (\r\nselect\r\n patient_id,\r\n claim_id_a,\r\n claim_id_b,\r\n row_num_a,\r\n row_num_b,\r\n merge_flag\r\nfrom check_for_merges_with_larger_row_num\r\nwhere merge_flag = 1\r\n),\r\n\r\n\r\nclaim_ids_that_merge_with_larger_row_num as (\r\nselect distinct claim_id_a as claim_id\r\nfrom merges_with_larger_row_num\r\n),\r\n\r\n\r\nclaim_ids_having_a_smaller_row_num_merging_with_a_larger_row_num as (\r\nselect distinct aa.claim_id as claim_id\r\nfrom add_row_num aa\r\n inner join\r\n merges_with_larger_row_num bb\r\n on aa.patient_id = bb.patient_id\r\n and bb.row_num_a < aa.row_num\r\n and bb.row_num_b > aa.row_num\r\n),\r\n\r\n\r\nclose_flags as (\r\nselect\r\n aa.patient_id,\r\n aa.claim_id,\r\n aa.start_date,\r\n aa.end_date,\r\n aa.discharge_disposition_code,\r\n aa.facility_npi,\r\n aa.row_num,\r\n case when (bb.claim_id is null and cc.claim_id is null) then 1\r\n else 0\r\n end as close_flag\r\n\r\nfrom add_row_num aa\r\n\r\nleft join claim_ids_that_merge_with_larger_row_num bb\r\non aa.claim_id = bb.claim_id\r\n\r\nleft join claim_ids_having_a_smaller_row_num_merging_with_a_larger_row_num cc\r\non aa.claim_id = cc.claim_id\r\n),\r\n\r\n\r\njoin_every_row_to_later_closes as (\r\nselect\r\n aa.patient_id as patient_id,\r\n aa.claim_id as claim_id,\r\n aa.row_num as row_num,\r\n bb.row_num as row_num_b\r\nfrom close_flags aa inner join close_flags bb\r\n on aa.patient_id = bb.patient_id\r\n and aa.row_num <= bb.row_num\r\nwhere bb.close_flag = 1\r\n),\r\n\r\n\r\nfind_min_closing_row_num_for_every_claim as (\r\nselect\r\n patient_id,\r\n claim_id,\r\n min(row_num_b) as min_closing_row\r\nfrom join_every_row_to_later_closes\r\ngroup by patient_id, claim_id\r\n),\r\n\r\n\r\nadd_min_closing_row_to_every_claim as (\r\nselect\r\n aa.patient_id as patient_id,\r\n aa.claim_id as claim_id,\r\n aa.start_date as start_date,\r\n aa.end_date as end_date,\r\n aa.discharge_disposition_code as discharge_disposition_code,\r\n aa.facility_npi as facility_npi,\r\n aa.row_num as row_num,\r\n aa.close_flag as close_flag,\r\n bb.min_closing_row as min_closing_row\r\nfrom close_flags aa\r\n left join find_min_closing_row_num_for_every_claim bb\r\n on aa.patient_id = bb.patient_id\r\n and aa.claim_id = bb.claim_id\r\n),\r\n\r\n\r\nadd_encounter_id as (\r\nselect\r\n aa.patient_id as patient_id,\r\n aa.claim_id as claim_id,\r\n aa.start_date as start_date,\r\n aa.end_date as end_date,\r\n aa.discharge_disposition_code as discharge_disposition_code,\r\n aa.facility_npi as facility_npi,\r\n aa.row_num as row_num,\r\n aa.close_flag as close_flag,\r\n aa.min_closing_row as min_closing_row,\r\n bb.claim_id as encounter_id\r\nfrom add_min_closing_row_to_every_claim aa\r\n left join add_min_closing_row_to_every_claim bb\r\n on aa.patient_id = bb.patient_id\r\n and aa.min_closing_row = bb.row_num\r\n)\r\n\r\nselect *, '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom add_encounter_id", "language": "sql", "refs": [["acute_inpatient__institutional_claims"]], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.acute_inpatient__institutional_claims"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\acute_inpatient\\intermediate\\acute_inpatient__institutional_encounter_id.sql", "compiled": true, "compiled_code": "\n\n-- *************************************************\n-- This dbt model groups acute inpatient institutional\n-- claims into encounters. It assigns an encounter_id\n-- to each acute inpatient institutional claim.\n-- This returns a table with 3 fields:\n-- patient_id\n-- claim_id\n-- encounter_id\n-- The number of rows in the table should be equal\n-- to the number of acute inpatient institutional claims.\n-- *************************************************\n\n\nwith add_row_num as (\nselect\n patient_id,\n claim_id,\n start_date,\n end_date,\n discharge_disposition_code,\n facility_npi,\n row_number() over (partition by patient_id order by end_date, start_date, claim_id) as row_num\nfrom devforrest.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-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom add_encounter_id", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.acute_inpatient__last_claim_values": {"database": "devforrest", "schema": "claims_preprocessing", "name": "acute_inpatient__last_claim_values", "resource_type": "model", "package_name": "the_tuva_project", "path": "claims_preprocessing\\acute_inpatient\\intermediate\\acute_inpatient__last_claim_values.sql", "original_file_path": "models\\claims_preprocessing\\acute_inpatient\\intermediate\\acute_inpatient__last_claim_values.sql", "unique_id": "model.the_tuva_project.acute_inpatient__last_claim_values", "fqn": ["the_tuva_project", "claims_preprocessing", "acute_inpatient", "intermediate", "acute_inpatient__last_claim_values"], "alias": "_int_acute_inpatient_last_claim_values", "checksum": {"name": "sha256", "checksum": "9230809de94464b7f37e8b30f0cb8a8cfbf550233db3519d89c09a1efc85d166"}, "config": {"enabled": true, "alias": "_int_acute_inpatient_last_claim_values", "schema": "claims_preprocessing", "database": null, "tags": ["acute_inpatient", "claims_preprocessing"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#0f3d0b"}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["acute_inpatient", "claims_preprocessing"], "description": "Orders claims to pull out encounter details (admit type, drg, etc)", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#0f3d0b"}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_acute_inpatient_last_claim_values", "tags": ["acute_inpatient", "claims_preprocessing"], "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#0f3d0b"}}, "created_at": 1702481696.363963, "relation_name": "devforrest.claims_preprocessing._int_acute_inpatient_last_claim_values", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r\n )\r\n}}\r\n\r\nwith first_claim_values as(\r\n select distinct\r\n e.encounter_id\r\n , coalesce(claim_start_date, admission_date) as claim_start\r\n , discharge_disposition_code\r\n from {{ ref('acute_inpatient__encounter_id')}} e\r\n inner join {{ ref('medical_claim') }} m\r\n on e.claim_id = m.claim_id\r\n where claim_type = 'institutional'\r\n)\r\n\r\nselect\r\n encounter_id\r\n , claim_start\r\n , discharge_disposition_code\r\n , row_number() over (partition by encounter_id order by claim_start desc) as claim_row\r\nfrom first_claim_values", "language": "sql", "refs": [["acute_inpatient__encounter_id"], ["medical_claim"]], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.acute_inpatient__encounter_id", "model.input_layer.medical_claim"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\acute_inpatient\\intermediate\\acute_inpatient__last_claim_values.sql", "compiled": true, "compiled_code": "\n\nwith first_claim_values as(\n select distinct\n e.encounter_id\n , coalesce(claim_start_date, admission_date) as claim_start\n , discharge_disposition_code\n from devforrest.claims_preprocessing._int_acute_inpatient_encounter_id e\n inner join tuva.input_layer.medical_claim m\n on e.claim_id = m.claim_id\n where claim_type = 'institutional'\n)\n\nselect\n encounter_id\n , claim_start\n , discharge_disposition_code\n , row_number() over (partition by encounter_id order by claim_start desc) as claim_row\nfrom first_claim_values", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.acute_inpatient__professional_encounter_id": {"database": "devforrest", "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": "f5b17d0338b9da0fb0bcd06a4b6d3bb2a67b729261870ddb3841f8db9c182fdb"}, "config": {"enabled": true, "alias": "_int_acute_inpatient_professional_encounter_id", "schema": "claims_preprocessing", "database": null, "tags": ["acute_inpatient", "claims_preprocessing"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#0f3d0b"}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["acute_inpatient", "claims_preprocessing"], "description": "Assigns encounter_id to every acute inpatient professional claim", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#0f3d0b"}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_acute_inpatient_professional_encounter_id", "tags": ["acute_inpatient", "claims_preprocessing"], "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#0f3d0b"}}, "created_at": 1702481696.3382642, "relation_name": "devforrest.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 \r\n claim_id\r\n , claim_line_number\r\nfrom {{ ref('acute_inpatient__stg_service_category') }} \r\nwhere claim_type = 'professional'\r\n and service_category_2 = 'Acute Inpatient'\r\n),\r\n\r\nacute_inpatient_professional_claim_lines as (\r\nselect\r\n mc.claim_id,\r\n mc.claim_line_number,\r\n mc.patient_id,\r\n mc.claim_start_date as start_date,\r\n mc.claim_end_date as end_date\t \r\nfrom {{ ref('acute_inpatient__stg_medical_claim') }} mc\r\ninner join acute_inpatient_professional_claim_ids prof\r\n on mc.claim_id = prof.claim_id\r\n and mc.claim_line_number = prof.claim_line_number\r\n),\r\n\r\n\r\nacute_inpatient_professional_claim_dates as (\r\nselect\r\n claim_id,\r\n claim_line_number,\r\n patient_id,\r\n min(start_date) as start_date,\r\n max(end_date) as end_date\r\nfrom acute_inpatient_professional_claim_lines\r\ngroup by claim_id, claim_line_number, patient_id\r\n),\r\n\r\n\r\nroll_up_professional_claims_to_institutional_claims as (\r\nselect\r\n aa.patient_id,\r\n aa.claim_id,\r\n aa.claim_line_number,\r\n aa.start_date,\r\n aa.end_date,\r\n bb.encounter_id,\r\n case\r\n when bb.encounter_id is null then 1\r\n else 0\r\n end as orphan_claim_flag\r\nfrom acute_inpatient_professional_claim_dates aa\r\nleft join {{ ref('acute_inpatient__encounter_start_and_end_dates') }} bb\r\n on aa.patient_id = bb.patient_id\r\n and (coalesce(aa.start_date, aa.end_date) between bb.encounter_start_date and bb.encounter_end_date)\r\n and (coalesce(aa.end_date, aa.start_date) between bb.encounter_start_date and bb.encounter_end_date)\r\n),\r\n\r\nprofessional_claims_in_more_than_one_encounter as (\r\nselect\r\n patient_id,\r\n claim_id,\r\n claim_line_number,\r\n min(start_date) as start_date,\r\n max(end_date) as end_date,\r\n count(distinct encounter_id) as encounter_count\r\nfrom roll_up_professional_claims_to_institutional_claims\r\ngroup by patient_id, claim_line_number, claim_id\r\nhaving count(distinct encounter_id) > 1\r\n),\r\n\r\n\r\nprofessional_claims_not_in_more_than_one_encounter as (\r\nselect\r\n aa.patient_id,\r\n aa.claim_id,\r\n aa.claim_line_number,\r\n aa.start_date,\r\n aa.end_date,\r\n aa.encounter_id,\r\n aa.orphan_claim_flag,\r\n case\r\n when (aa.orphan_claim_flag = 1) then 0\r\n else 1\r\n end as encounter_count\r\nfrom roll_up_professional_claims_to_institutional_claims aa\r\nleft join professional_claims_in_more_than_one_encounter bb\r\non aa.claim_id = bb.claim_id\r\nand aa.claim_line_number = bb.claim_line_number\r\nand aa.patient_id = bb.patient_id\r\nwhere (bb.patient_id is null) and (bb.claim_id is null)\r\n),\r\n\r\n\r\nall_acute_inpatient_professional_claims as (\r\nselect\r\n patient_id,\r\n claim_id,\r\n claim_line_number,\r\n start_date,\r\n end_date,\r\n encounter_id,\r\n orphan_claim_flag,\r\n encounter_count\r\nfrom professional_claims_not_in_more_than_one_encounter\r\n\r\nunion all\r\n\r\nselect\r\n patient_id,\r\n claim_id,\r\n claim_line_number,\r\n start_date,\r\n end_date,\r\n null as encounter_id,\r\n 0 as orphan_claim_count,\r\n encounter_count\r\nfrom professional_claims_in_more_than_one_encounter\r\n)\r\n\r\n\r\n\r\nselect *, '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom all_acute_inpatient_professional_claims", "language": "sql", "refs": [["acute_inpatient__stg_service_category"], ["acute_inpatient__stg_medical_claim"], ["acute_inpatient__encounter_start_and_end_dates"]], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.acute_inpatient__stg_service_category", "model.the_tuva_project.acute_inpatient__stg_medical_claim", "model.the_tuva_project.acute_inpatient__encounter_start_and_end_dates"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\acute_inpatient\\intermediate\\acute_inpatient__professional_encounter_id.sql", "compiled": true, "compiled_code": "\n\n-- *************************************************\n-- This dbt model assigns professional acute inpatient\n-- claims to acute inpatient encounters.\n-- Some acute inpatient professional claims do not fall\n-- within an acute inpatient encounter. We call these\n-- orphan claims, and they do not have an encounter_id.\n-- Some acute inpatient professional claims fall within\n-- more than one acute inpatient encounter. Since we do not\n-- know what encounter these claims should be mapped to\n-- we do not assign them an encounter_id. These claims\n-- have encounter_count > 1.\n-- This model returns a table with 5 fields:\n-- patient_id\n-- claim_id\n-- encounter_id (is null for orphan claims or claims\n-- that fall within more than one encounter)\n-- orphan_claim_flag (is always 0 or 1)\n-- encounter_count (an integer that represents the number\n-- of acute inpatient encounters this\n-- professional claim could fall into:\n-- could be 0,1,2,3,... but is never null\n-- for acute inpatient professional claims)\n-- *************************************************\n\n\n\n\nwith __dbt__cte__acute_inpatient__stg_service_category as (\n\n\n\nSELECT\n claim_id\n, claim_type\n, claim_line_number\n, service_category_2\n, '2023-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom devforrest.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-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom tuva.input_layer.medical_claim\n),acute_inpatient_professional_claim_ids as (\nselect distinct \n claim_id\n , claim_line_number\nfrom __dbt__cte__acute_inpatient__stg_service_category \nwhere claim_type = 'professional'\n and service_category_2 = 'Acute Inpatient'\n),\n\nacute_inpatient_professional_claim_lines as (\nselect\n mc.claim_id,\n mc.claim_line_number,\n mc.patient_id,\n mc.claim_start_date as start_date,\n mc.claim_end_date as end_date\t \nfrom __dbt__cte__acute_inpatient__stg_medical_claim mc\ninner join acute_inpatient_professional_claim_ids prof\n on mc.claim_id = prof.claim_id\n and mc.claim_line_number = prof.claim_line_number\n),\n\n\nacute_inpatient_professional_claim_dates as (\nselect\n claim_id,\n claim_line_number,\n patient_id,\n min(start_date) as start_date,\n max(end_date) as end_date\nfrom acute_inpatient_professional_claim_lines\ngroup by claim_id, claim_line_number, patient_id\n),\n\n\nroll_up_professional_claims_to_institutional_claims as (\nselect\n aa.patient_id,\n aa.claim_id,\n aa.claim_line_number,\n aa.start_date,\n aa.end_date,\n bb.encounter_id,\n case\n when bb.encounter_id is null then 1\n else 0\n end as orphan_claim_flag\nfrom acute_inpatient_professional_claim_dates aa\nleft join devforrest.claims_preprocessing._int_acute_inpatient_encounter_start_and_end_dates bb\n on aa.patient_id = bb.patient_id\n and (coalesce(aa.start_date, aa.end_date) between bb.encounter_start_date and bb.encounter_end_date)\n and (coalesce(aa.end_date, aa.start_date) between bb.encounter_start_date and bb.encounter_end_date)\n),\n\nprofessional_claims_in_more_than_one_encounter as (\nselect\n patient_id,\n claim_id,\n claim_line_number,\n min(start_date) as start_date,\n max(end_date) as end_date,\n count(distinct encounter_id) as encounter_count\nfrom roll_up_professional_claims_to_institutional_claims\ngroup by patient_id, claim_line_number, claim_id\nhaving count(distinct encounter_id) > 1\n),\n\n\nprofessional_claims_not_in_more_than_one_encounter as (\nselect\n aa.patient_id,\n aa.claim_id,\n aa.claim_line_number,\n aa.start_date,\n aa.end_date,\n aa.encounter_id,\n aa.orphan_claim_flag,\n case\n when (aa.orphan_claim_flag = 1) then 0\n else 1\n end as encounter_count\nfrom roll_up_professional_claims_to_institutional_claims aa\nleft join professional_claims_in_more_than_one_encounter bb\non aa.claim_id = bb.claim_id\nand aa.claim_line_number = bb.claim_line_number\nand aa.patient_id = bb.patient_id\nwhere (bb.patient_id is null) and (bb.claim_id is null)\n),\n\n\nall_acute_inpatient_professional_claims as (\nselect\n patient_id,\n claim_id,\n claim_line_number,\n start_date,\n end_date,\n encounter_id,\n orphan_claim_flag,\n encounter_count\nfrom professional_claims_not_in_more_than_one_encounter\n\nunion all\n\nselect\n patient_id,\n claim_id,\n claim_line_number,\n start_date,\n end_date,\n null as encounter_id,\n 0 as orphan_claim_count,\n encounter_count\nfrom professional_claims_in_more_than_one_encounter\n)\n\n\n\nselect *, '2023-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom all_acute_inpatient_professional_claims", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.the_tuva_project.acute_inpatient__stg_service_category", "sql": " __dbt__cte__acute_inpatient__stg_service_category as (\n\n\n\nSELECT\n claim_id\n, claim_type\n, claim_line_number\n, service_category_2\n, '2023-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom devforrest.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-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom tuva.input_layer.medical_claim\n)"}]}, "model.the_tuva_project.acute_inpatient__stg_eligibility": {"database": "devforrest", "schema": "dbt_forrest", "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", "claims_preprocessing"], "meta": {}, "materialized": "ephemeral", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#0f3d0b"}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["acute_inpatient", "claims_preprocessing"], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#0f3d0b"}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"alias": "_stg_eligibility", "tags": ["acute_inpatient", "claims_preprocessing"], "materialized": "ephemeral", "enabled": true, "bind": false, "docs": {"node_color": "#0f3d0b"}}, "created_at": 1702481696.3659663, "relation_name": null, "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r\n )\r\n}}\r\n\r\nselect\r\n patient_id\r\n, birth_date\r\n, gender\r\n, race\r\n, '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('eligibility') }}", "language": "sql", "refs": [["eligibility"]], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.input_layer.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-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom tuva.input_layer.eligibility", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.acute_inpatient__stg_medical_claim": {"database": "devforrest", "schema": "dbt_forrest", "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", "claims_preprocessing"], "meta": {}, "materialized": "ephemeral", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#0f3d0b"}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["acute_inpatient", "claims_preprocessing"], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#0f3d0b"}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"alias": "_stg_medical_claim", "tags": ["acute_inpatient", "claims_preprocessing"], "materialized": "ephemeral", "enabled": true, "bind": false, "docs": {"node_color": "#0f3d0b"}}, "created_at": 1702481696.3679714, "relation_name": null, "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r\n )\r\n}}\r\n\r\nselect \r\n claim_id\r\n, claim_line_number\r\n, patient_id\r\n, claim_type\r\n, claim_start_date\r\n, claim_end_date\r\n, admission_date\r\n, discharge_date\r\n, facility_npi\r\n, ms_drg_code\r\n, apr_drg_code\r\n, admit_source_code\r\n, admit_type_code\r\n, discharge_disposition_code\r\n, paid_amount\r\n, allowed_amount\r\n, charge_amount\r\n, data_source\r\n, '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('medical_claim') }}", "language": "sql", "refs": [["medical_claim"]], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.input_layer.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-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom tuva.input_layer.medical_claim", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.acute_inpatient__stg_service_category": {"database": "devforrest", "schema": "dbt_forrest", "name": "acute_inpatient__stg_service_category", "resource_type": "model", "package_name": "the_tuva_project", "path": "claims_preprocessing\\acute_inpatient\\staging\\acute_inpatient__stg_service_category.sql", "original_file_path": "models\\claims_preprocessing\\acute_inpatient\\staging\\acute_inpatient__stg_service_category.sql", "unique_id": "model.the_tuva_project.acute_inpatient__stg_service_category", "fqn": ["the_tuva_project", "claims_preprocessing", "acute_inpatient", "staging", "acute_inpatient__stg_service_category"], "alias": "_stg_service_category", "checksum": {"name": "sha256", "checksum": "e7bfa19c19ca41a6488c228bdbbf72aa91691ec8994fb1290a7707ba25966155"}, "config": {"enabled": true, "alias": "_stg_service_category", "schema": null, "database": null, "tags": ["acute_inpatient", "claims_preprocessing"], "meta": {}, "materialized": "ephemeral", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#0f3d0b"}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["acute_inpatient", "claims_preprocessing"], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#0f3d0b"}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"alias": "_stg_service_category", "tags": ["acute_inpatient", "claims_preprocessing"], "materialized": "ephemeral", "enabled": true, "bind": false, "docs": {"node_color": "#0f3d0b"}}, "created_at": 1702481696.37084, "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, claim_line_number\r\n, service_category_2\r\n, '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('service_category__service_category_grouper')}}", "language": "sql", "refs": [["service_category__service_category_grouper"]], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.service_category__service_category_grouper"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\acute_inpatient\\staging\\acute_inpatient__stg_service_category.sql", "compiled": true, "compiled_code": "\n\n\nSELECT\n claim_id\n, claim_type\n, claim_line_number\n, service_category_2\n, '2023-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom devforrest.claims_preprocessing.service_category_grouper", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.data_profiling__summary": {"database": "devforrest", "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": "data_profiling_summary", "checksum": {"name": "sha256", "checksum": "5c618cfae1045c519ea0f22fcd0490f1665c15241fd5ea5b9a22f15cf17a6a42"}, "config": {"enabled": true, "alias": "data_profiling_summary", "schema": "claims_preprocessing", "database": null, "tags": ["data_profiling", "claims_preprocessing"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#141161"}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["data_profiling", "claims_preprocessing"], "description": "", "columns": {"source_table": {"name": "source_table", "description": "Table this test category is in reference to", "meta": {}, "data_type": null, "quote": null, "tags": []}, "test_category": {"name": "test_category", "description": "Category of test", "meta": {}, "data_type": null, "quote": null, "tags": []}, "counts": {"name": "counts", "description": "Aggregated counts of all tests in this category and table that failed", "meta": {}, "data_type": "integer", "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The time at with the model was materialized. Generated by `dbt_utils.pretty_time` as the local time of the `dbt run` environment. Timezone is configurable via the `tuva_last_run` var.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": "#141161"}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "data_profiling_summary", "tags": ["data_profiling", "claims_preprocessing"], "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#141161"}}, "created_at": 1702481696.4587793, "relation_name": "devforrest.claims_preprocessing.data_profiling_summary", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r\n )\r\n}}\r\n\r\nwith test_failure_summary as (\r\n select\r\n cast(source_table as {{ dbt.type_string() }} ) as source_table\r\n , cast(grain as {{ dbt.type_string() }} ) as grain\r\n , cast(test_category as {{ dbt.type_string() }} ) as test_category\r\n , cast(count(distinct foreign_key) as int) as counts\r\n from {{ ref('data_profiling__test_detail' )}} \r\n group by\r\n source_table\r\n ,grain\r\n ,test_category\r\n)\r\n\r\n, summary_union as(\r\n select\r\n cast(source_table as {{ dbt.type_string() }} ) as source_table\r\n , cast(grain as {{ dbt.type_string() }} ) as grain\r\n , cast(test_category as {{ dbt.type_string() }} ) as test_category\r\n , cast(counts as int) as counts\r\n from test_failure_summary\r\n\r\n /******* The tables below populate the test when no failures are present ******/\r\n union all\r\n\r\n select * from (\r\n select\r\n cast('medical_claim' as {{ dbt.type_string() }} ) as source_table\r\n , cast('claim_id' as {{ dbt.type_string() }} ) as grain\r\n , cast('duplicate_claims' as {{ dbt.type_string() }} ) as test_category\r\n , cast(0 as int) as counts\r\n ) failure_stub\r\n where not exists (select 1 from {{ ref('data_profiling__medical_claim_duplicates' )}} )\r\n union all\r\n select * from (\r\n select\r\n cast('medical_claim' as {{ dbt.type_string() }} ) as source_table\r\n , cast('claim_id' as {{ dbt.type_string() }} ) as grain\r\n , cast('claim_type' as {{ dbt.type_string() }} ) as test_category\r\n , cast(0 as int) as counts \r\n ) failure_stub\r\n where not exists (select 1 from {{ ref('data_profiling__claim_type_mapping_failures' )}} )\r\n and not exists (select 1 from {{ ref('data_profiling__claim_type_unmapped' )}} )\r\n and not exists (select 1 from {{ ref('data_profiling__medical_claim_inst_missing_values' )}} where test_category = 'claim_type')\r\n and not exists (select 1 from {{ ref('data_profiling__medical_claim_prof_missing_values' )}} where test_category = 'claim_type')\r\n union all\r\n select * from (\r\n select\r\n cast('medical_claim' as {{ dbt.type_string() }} ) as source_table\r\n , cast('claim_id' as {{ dbt.type_string() }} ) as grain\r\n , cast('header' as {{ dbt.type_string() }} ) as test_category\r\n , cast(0 as int) as counts\r\n ) failure_stub\r\n where not exists (select 1 from {{ ref('data_profiling__institutional_header_fail_details' )}} )\r\n and not exists (select 1 from {{ ref('data_profiling__professional_header_fail_details' )}} )\r\n union all\r\n select * from (\r\n select\r\n cast('medical_claim' as {{ dbt.type_string() }} ) as source_table\r\n , cast('claim_id' as {{ dbt.type_string() }} ) as grain\r\n , cast('invalid_values' as {{ dbt.type_string() }} ) as test_category\r\n , cast(0 as int) as counts\r\n ) failure_stub\r\n where not exists (select 1 from {{ ref('data_profiling__medical_claim_invalid_values' )}} )\r\n union all\r\n select * from (\r\n select\r\n cast('medical_claim' as {{ dbt.type_string() }} ) as source_table\r\n , cast('claim_id' as {{ dbt.type_string() }} ) as grain\r\n , cast('missing_values' as {{ dbt.type_string() }} ) as test_category\r\n , cast(0 as int) as counts\r\n ) failure_stub\r\n where not exists (select 1 from {{ ref('data_profiling__medical_claim_inst_missing_values' )}} )\r\n and not exists (select 1 from {{ ref('data_profiling__medical_claim_prof_missing_values' )}} )\r\n\r\n /**** eligibility ****/\r\n union all\r\n select * from (\r\n select\r\n cast('eligibility' as {{ dbt.type_string() }} ) as source_table\r\n , cast('patient_id' as {{ dbt.type_string() }} ) as grain\r\n , cast('duplicate_eligibility' as {{ dbt.type_string() }} ) as test_category\r\n , cast(0 as int) as counts\r\n ) failure_stub\r\n where not exists (select 1 from {{ ref('data_profiling__eligibility_duplicates' )}} )\r\n union all\r\n select * from (\r\n select\r\n cast('eligibility' as {{ dbt.type_string() }} ) as source_table\r\n , cast('patient_id' as {{ dbt.type_string() }} ) as grain\r\n , cast('invalid_values' as {{ dbt.type_string() }} ) as test_category\r\n , cast(0 as int) as counts\r\n ) failure_stub\r\n where not exists (select 1 from {{ ref('data_profiling__eligibility_invalid_values' )}} )\r\n union all\r\n select * from (\r\n select\r\n cast('eligibility' as {{ dbt.type_string() }} ) as source_table\r\n , cast('patient_id' as {{ dbt.type_string() }} ) as grain\r\n , cast('missing_values' as {{ dbt.type_string() }} ) as test_category\r\n , cast(0 as int) as counts\r\n ) failure_stub\r\n where not exists (select 1 from {{ ref('data_profiling__eligibility_missing_values' )}} )\r\n\r\n /**** pharmacy_claim ****/\r\n union all\r\n select * from (\r\n select\r\n cast('pharmacy_claim' as {{ dbt.type_string() }} ) as source_table\r\n , cast('claim_id' as {{ dbt.type_string() }} ) as grain\r\n , cast('duplicate_claims' as {{ dbt.type_string() }} ) as test_category\r\n , cast(0 as int) as counts\r\n ) failure_stub\r\n where not exists (select 1 from {{ ref('data_profiling__pharmacy_claim_duplicates' )}} )\r\n union all\r\n select * from (\r\n select\r\n cast('pharmacy_claim' as {{ dbt.type_string() }} ) as source_table\r\n , cast('claim_id' as {{ dbt.type_string() }} ) as grain\r\n , cast('missing_values' as {{ dbt.type_string() }} ) as test_category\r\n , cast(0 as int) as counts\r\n ) failure_stub\r\n where not exists (select 1 from {{ ref('data_profiling__pharmacy_claim_missing_values' )}} )\r\n)\r\n\r\nselect \r\n cast(source_table as {{ dbt.type_string() }} ) as source_table\r\n , cast(case \r\n when source_table = 'medical_claim' and test_category = 'duplicate_claims'\r\n then '1_duplicate_claims'\r\n when source_table = 'medical_claim' and test_category = 'claim_type'\r\n then '2_claim_type'\r\n when source_table = 'medical_claim' and test_category = 'header'\r\n then '3_header'\r\n when source_table = 'medical_claim' and test_category = 'invalid_values'\r\n then '4_invalid_values'\r\n when source_table = 'medical_claim' and test_category = 'missing_values'\r\n then '5_missing_values'\r\n when source_table = 'medical_claim' and test_category = 'plausibility'\r\n then '6_plausibility' \r\n when source_table = 'medical_claim' and test_category = 'good'\r\n then '7_good' \r\n when source_table = 'eligibility' and test_category = 'duplicate_eligibility'\r\n then '1_duplicate_eligibility'\r\n when source_table = 'eligibility' and test_category = 'invalid_values'\r\n then '2_invalid_values'\r\n when source_table = 'eligibility' and test_category = 'missing_values'\r\n then '3_missing_values'\r\n when source_table = 'eligibility' and test_category = 'plausibility'\r\n then '4_plausibility' \r\n when source_table = 'eligibility' and test_category = 'good'\r\n then '5_good'\r\n when source_table = 'pharmacy_claim' and test_category = 'duplicate_claims'\r\n then '1_duplicate_claims'\r\n when source_table = 'pharmacy_claim' and test_category = 'missing_values'\r\n then '2_missing_values'\r\n when source_table = 'pharmacy_claim' and test_category = 'plausibility'\r\n then '3_plausibility' \r\n when source_table = 'pharmacy_claim' and test_category = 'good'\r\n then '4_good'\r\n else test_category \r\n end as {{ dbt.type_string() }} ) as test_category\r\n , cast(counts as int) as counts\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom summary_union", "language": "sql", "refs": [["data_profiling__test_detail"], ["data_profiling__medical_claim_duplicates"], ["data_profiling__claim_type_mapping_failures"], ["data_profiling__claim_type_unmapped"], ["data_profiling__medical_claim_inst_missing_values"], ["data_profiling__medical_claim_prof_missing_values"], ["data_profiling__institutional_header_fail_details"], ["data_profiling__professional_header_fail_details"], ["data_profiling__medical_claim_invalid_values"], ["data_profiling__medical_claim_inst_missing_values"], ["data_profiling__medical_claim_prof_missing_values"], ["data_profiling__eligibility_duplicates"], ["data_profiling__eligibility_invalid_values"], ["data_profiling__eligibility_missing_values"], ["data_profiling__pharmacy_claim_duplicates"], ["data_profiling__pharmacy_claim_missing_values"]], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.type_string"], "nodes": ["model.the_tuva_project.data_profiling__test_detail", "model.the_tuva_project.data_profiling__medical_claim_duplicates", "model.the_tuva_project.data_profiling__claim_type_mapping_failures", "model.the_tuva_project.data_profiling__claim_type_unmapped", "model.the_tuva_project.data_profiling__medical_claim_inst_missing_values", "model.the_tuva_project.data_profiling__medical_claim_prof_missing_values", "model.the_tuva_project.data_profiling__institutional_header_fail_details", "model.the_tuva_project.data_profiling__professional_header_fail_details", "model.the_tuva_project.data_profiling__medical_claim_invalid_values", "model.the_tuva_project.data_profiling__medical_claim_inst_missing_values", "model.the_tuva_project.data_profiling__medical_claim_prof_missing_values", "model.the_tuva_project.data_profiling__eligibility_duplicates", "model.the_tuva_project.data_profiling__eligibility_invalid_values", "model.the_tuva_project.data_profiling__eligibility_missing_values", "model.the_tuva_project.data_profiling__pharmacy_claim_duplicates", "model.the_tuva_project.data_profiling__pharmacy_claim_missing_values"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\data_profiling\\final\\data_profiling__summary.sql", "compiled": true, "compiled_code": "\n\nwith test_failure_summary as (\n select\n cast(source_table as TEXT ) as source_table\n , cast(grain as TEXT ) as grain\n , cast(test_category as TEXT ) as test_category\n , cast(count(distinct foreign_key) as int) as counts\n from devforrest.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 devforrest.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 devforrest.claims_preprocessing._int_claim_type_mapping_failures )\n and not exists (select 1 from devforrest.claims_preprocessing._int_claim_type_unmapped )\n and not exists (select 1 from devforrest.claims_preprocessing._int_medical_claim_inst_missing_values where test_category = 'claim_type')\n and not exists (select 1 from devforrest.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 devforrest.claims_preprocessing._int_institutional_header_fail_details )\n and not exists (select 1 from devforrest.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 devforrest.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 devforrest.claims_preprocessing._int_medical_claim_inst_missing_values )\n and not exists (select 1 from devforrest.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 devforrest.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 devforrest.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 devforrest.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 devforrest.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 devforrest.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-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom summary_union", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.data_profiling__test_detail": {"database": "devforrest", "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", "claims_preprocessing"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#141161"}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["data_profiling", "claims_preprocessing"], "description": "", "columns": {"source_table": {"name": "source_table", "description": "Table this test is in reference to", "meta": {}, "data_type": null, "quote": null, "tags": []}, "test_category": {"name": "test_category", "description": "Category of test", "meta": {}, "data_type": null, "quote": null, "tags": []}, "test_name": {"name": "test_name", "description": "Name of the test being performed", "meta": {}, "data_type": null, "quote": null, "tags": []}, "grain": {"name": "grain", "description": "Grain of the test", "meta": {}, "data_type": null, "quote": null, "tags": []}, "claim_type": {"name": "claim_type", "description": "Specific claim type, if any, that this test is specific to", "meta": {}, "data_type": null, "quote": null, "tags": []}, "foreign_key": {"name": "foreign_key", "description": "The column this table can be used to join back to the source table", "meta": {}, "data_type": null, "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The time at with the model was materialized. Generated by `dbt_utils.pretty_time` as the local time of the `dbt run` environment. Timezone is configurable via the `tuva_last_run` var.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": "#141161"}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "test_detail", "tags": ["data_profiling", "claims_preprocessing"], "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#141161"}}, "created_at": 1702481696.4637733, "relation_name": "devforrest.claims_preprocessing.test_detail", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r\n )\r\n}}\r\n\r\nwith test_detail_union as(\r\n\r\nselect * from {{ ref('data_profiling__test_detail_stage_medical_claim') }}\r\nunion all\r\nselect * from {{ ref('data_profiling__test_detail_stage_eligibility') }}\r\nunion all\r\nselect * from {{ ref('data_profiling__test_detail_stage_pharmacy_claim') }}\r\n\r\n\r\n)\r\n\r\nselect \r\n source_table\r\n , case \r\n when source_table = 'medical_claim' and test_category = 'duplicate_claims'\r\n then '1_duplicate_claims'\r\n when source_table = 'medical_claim' and test_category = 'claim_type'\r\n then '2_claim_type'\r\n when source_table = 'medical_claim' and test_category = 'header'\r\n then '3_header'\r\n when source_table = 'medical_claim' and test_category = 'invalid_values'\r\n then '4_invalid_values'\r\n when source_table = 'medical_claim' and test_category = 'missing_values'\r\n then '5_missing_values'\r\n when source_table = 'medical_claim' and test_category = 'plausibility'\r\n then '6_plausibility' \r\n when source_table = 'eligibility' and test_category = 'duplicate_eligibility'\r\n then '1_duplicate_eligibility'\r\n when source_table = 'eligibility' and test_category = 'invalid_values'\r\n then '2_invalid_values'\r\n when source_table = 'eligibility' and test_category = 'missing_values'\r\n then '3_missing_values'\r\n when source_table = 'eligibility' and test_category = 'plausibility'\r\n then '4_plausibility'\r\n when source_table = 'pharmacy_claim' and test_category = 'duplicate_claims'\r\n then '1_duplicate_claims'\r\n when source_table = 'pharmacy_claim' and test_category = 'missing_values'\r\n then '2_missing_values'\r\n when source_table = 'pharmacy_claim' and test_category = 'plausibility'\r\n then '3_plausibility'\r\n else test_category \r\n end as test_category\r\n , test_name \r\n , grain\r\n , claim_type\r\n , claim_id as foreign_key\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom test_detail_union", "language": "sql", "refs": [["data_profiling__test_detail_stage_medical_claim"], ["data_profiling__test_detail_stage_eligibility"], ["data_profiling__test_detail_stage_pharmacy_claim"]], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.data_profiling__test_detail_stage_medical_claim", "model.the_tuva_project.data_profiling__test_detail_stage_eligibility", "model.the_tuva_project.data_profiling__test_detail_stage_pharmacy_claim"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\data_profiling\\final\\data_profiling__test_detail.sql", "compiled": true, "compiled_code": "\n\nwith test_detail_union as(\n\nselect * from devforrest.claims_preprocessing._int_test_detail_stage_medical_claim\nunion all\nselect * from devforrest.claims_preprocessing._int_test_detail_stage_eligibility\nunion all\nselect * from devforrest.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-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom test_detail_union", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.data_profiling__test_result": {"database": "devforrest", "schema": "claims_preprocessing", "name": "data_profiling__test_result", "resource_type": "model", "package_name": "the_tuva_project", "path": "claims_preprocessing\\data_profiling\\final\\data_profiling__test_result.sql", "original_file_path": "models\\claims_preprocessing\\data_profiling\\final\\data_profiling__test_result.sql", "unique_id": "model.the_tuva_project.data_profiling__test_result", "fqn": ["the_tuva_project", "claims_preprocessing", "data_profiling", "final", "data_profiling__test_result"], "alias": "test_result", "checksum": {"name": "sha256", "checksum": "e3e47acca220ab867995a28e451c6637feb732a6e7d27972703bfef69c144bc2"}, "config": {"enabled": true, "alias": "test_result", "schema": "claims_preprocessing", "database": null, "tags": ["data_profiling", "claims_preprocessing"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#141161"}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["data_profiling", "claims_preprocessing"], "description": "", "columns": {"source_table": {"name": "source_table", "description": "Table this test is in reference to", "meta": {}, "data_type": null, "quote": null, "tags": []}, "grain": {"name": "grain", "description": "Grain of the test", "meta": {}, "data_type": null, "quote": null, "tags": []}, "test_category": {"name": "test_category", "description": "Category of test", "meta": {}, "data_type": null, "quote": null, "tags": []}, "test_name": {"name": "test_name", "description": "Name of the test being performed", "meta": {}, "data_type": null, "quote": null, "tags": []}, "claim_type": {"name": "claim_type", "description": "Specific claim type, if any, that this test is specific to", "meta": {}, "data_type": null, "quote": null, "tags": []}, "failures": {"name": "failures", "description": "Number of failures of this test", "meta": {}, "data_type": "integer", "quote": null, "tags": []}, "denominator": {"name": "denominator", "description": "Total number of records analyzed for this test", "meta": {}, "data_type": "integer", "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The time at with the model was materialized. Generated by `dbt_utils.pretty_time` as the local time of the `dbt run` environment. Timezone is configurable via the `tuva_last_run` var.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": "#141161"}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "test_result", "tags": ["data_profiling", "claims_preprocessing"], "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#141161"}}, "created_at": 1702481696.4700634, "relation_name": "devforrest.claims_preprocessing.test_result", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r\n )\r\n}}\r\n\r\nselect * from {{ ref('data_profiling__test_result_stage_medical_claim') }}\r\n\r\nunion all\r\n\r\nselect * from {{ ref('data_profiling__test_result_stage_eligibility') }}\r\n\r\nunion all\r\n\r\nselect * from {{ ref('data_profiling__test_result_stage_pharmacy_claim') }}", "language": "sql", "refs": [["data_profiling__test_result_stage_medical_claim"], ["data_profiling__test_result_stage_eligibility"], ["data_profiling__test_result_stage_pharmacy_claim"]], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.data_profiling__test_result_stage_medical_claim", "model.the_tuva_project.data_profiling__test_result_stage_eligibility", "model.the_tuva_project.data_profiling__test_result_stage_pharmacy_claim"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\data_profiling\\final\\data_profiling__test_result.sql", "compiled": true, "compiled_code": "\n\nselect * from devforrest.claims_preprocessing._int_test_result_stage_medical_claim\n\nunion all\n\nselect * from devforrest.claims_preprocessing._int_test_result_stage_eligibility\n\nunion all\n\nselect * from devforrest.claims_preprocessing._int_test_result_stage_pharmacy_claim", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.data_profiling__use_case": {"database": "devforrest", "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", "claims_preprocessing"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#141161"}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["data_profiling", "claims_preprocessing"], "description": "", "columns": {"use_case": {"name": "use_case", "description": "The mart or logic that would be affected by test failures", "meta": {}, "data_type": null, "quote": null, "tags": []}, "source_table": {"name": "source_table", "description": "Table this use case is in reference to", "meta": {}, "data_type": null, "quote": null, "tags": []}, "test_name": {"name": "test_name", "description": "Name of the test being performed", "meta": {}, "data_type": null, "quote": null, "tags": []}, "failures": {"name": "failures", "description": "Number of failures of this test", "meta": {}, "data_type": "integer", "quote": null, "tags": []}, "denominator": {"name": "denominator", "description": "Total number of records analyzed for this test", "meta": {}, "data_type": "integer", "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": "#141161"}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "use_case", "tags": ["data_profiling", "claims_preprocessing"], "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#141161"}}, "created_at": 1702481696.47508, "relation_name": "devforrest.claims_preprocessing.use_case", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r\n )\r\n}}\r\nwith use_case_stage as(\r\n select\r\n 'encounters' as use_case\r\n , source_table\r\n , test_name\r\n , count(distinct foreign_key) as failures\r\n , (select count(distinct claim_id) from {{ ref('medical_claim') }}) as denominator\r\n from {{ ref('data_profiling__test_detail')}}\r\n where 1=1\r\n and test_name in ('revenue_center_code missing'\r\n ,'revenue_center_code invalid'\r\n ,'discharge_disposition_code missing'\r\n ,'discharge_disposition_code invalid'\r\n ,'ms_drg_code missing'\r\n ,'ms_drg_code invalid'\r\n ,'bill_type_code missing'\r\n ,'bill_type_code invalid'\r\n ,'place_of_service_code missing'\r\n ,'place_of_service_code invalid'\r\n ,'claim_type invalid'\r\n ,'claim_type missing'\r\n ,'claim_id missing'\r\n ,'patient_id missing'\r\n ,'claim_start_date missing'\r\n ,'claim_end_date missing'\r\n ,'facility_npi missing'\r\n )\r\n and source_table = 'medical_claim'\r\n group by\r\n source_table\r\n , test_name\r\n\r\n union all\r\n\r\n select \r\n 'service_grouper' as use_case\r\n , source_table\r\n , test_name\r\n , count(distinct foreign_key) as failures\r\n , (select count(distinct claim_id) from {{ ref('medical_claim') }} ) as denominator\r\n from {{ ref('data_profiling__test_detail')}}\r\n where 1=1\r\n and test_name in ('revenue_center_code missing'\r\n ,'revenue_center_code invalid'\r\n ,'bill_type_code missing'\r\n ,'bill_type_code invalid'\r\n ,'place_of_service_code missing'\r\n ,'place_of_service_code invalid'\r\n ,'claim_type invalid'\r\n ,'claim_type missing'\r\n ,'claim_id missing'\r\n ,'patient_id missing'\r\n ,'hcpcs_code missing'\r\n )\r\n and source_table = 'medical_claim'\r\n group by\r\n source_table\r\n , test_name\r\n\r\n union all \r\n\r\n select \r\n 'readmissions' as use_case\r\n , source_table\r\n , test_name\r\n , count(distinct foreign_key) as failures\r\n , (select count(distinct claim_id) from {{ ref('medical_claim') }} ) as denominator\r\n from {{ ref('data_profiling__test_detail')}}\r\n where 1=1\r\n and test_name in ('diagnosis_code_1 missing'\r\n ,'diagnosis_code_1 invalid'\r\n ,'revenue_center_code missing'\r\n ,'revenue_center_code invalid'\r\n ,'discharge_disposition_code missing'\r\n ,'discharge_disposition_code invalid'\r\n ,'ms_drg_code missing'\r\n ,'ms_drg_code invalid'\r\n ,'bill_type_code missing'\r\n ,'bill_type_code invalid'\r\n ,'place_of_service_code missing'\r\n ,'place_of_service_code invalid'\r\n ,'claim_type invalid'\r\n ,'claim_type missing'\r\n ,'claim_id missing'\r\n ,'patient_id missing'\r\n ,'claim_start_date missing'\r\n ,'claim_end_date missing'\r\n ,'facility_npi missing'\r\n )\r\n and source_table = 'medical_claim'\r\n group by\r\n source_table\r\n , test_name\r\n\r\n union all \r\n\r\n select \r\n 'pmpm' as use_case\r\n , source_table\r\n , test_name\r\n , count(distinct foreign_key) as failures\r\n , (select count(distinct claim_id) from {{ ref('medical_claim') }} ) as denominator\r\n from {{ ref('data_profiling__test_detail')}}\r\n where 1=1\r\n and test_name in ('patient_id missing'\r\n ,'claim_start_date missing'\r\n ,'claim_type invalid'\r\n ,'claim_type missing'\r\n\r\n )\r\n and source_table = 'medical_claim'\r\n group by\r\n source_table\r\n , test_name\r\n\r\n union all \r\n\r\n select \r\n 'readmissions' as use_case\r\n , source_table\r\n , test_name\r\n , count(distinct foreign_key) as failures\r\n , (select count(distinct claim_id) from {{ ref('pharmacy_claim') }} ) as denominator\r\n from {{ ref('data_profiling__test_detail')}}\r\n where 1=1\r\n and test_name in ('patient_id missing'\r\n ,'dispensing_date missing'\r\n ,'claim_type invalid'\r\n ,'claim_type missing'\r\n ,'paid_amount missing'\r\n )\r\n and source_table = 'pharmacy_claim'\r\n group by\r\n source_table\r\n , test_name\r\n\r\n union all \r\n\r\n select \r\n 'member_months' as use_case\r\n , source_table\r\n , test_name\r\n , count(distinct foreign_key) as failures\r\n , (select count(distinct patient_id) from {{ ref('eligibility') }} ) as denominator\r\n from {{ ref('data_profiling__test_detail')}}\r\n where 1=1\r\n and test_name in ('patient_id missing'\r\n ,'enrollment_start_date missing'\r\n ,'enrollment_end_date invalid'\r\n ,'payer missing'\r\n ,'payer missing'\r\n ,'payer_type invalid'\r\n )\r\n and source_table = 'eligibility'\r\n group by\r\n source_table\r\n , test_name\r\n\r\n union all \r\n\r\n select \r\n 'chronic_conditions' as use_case\r\n , source_table\r\n , test_name\r\n , count(distinct foreign_key) as failures\r\n , (select count(distinct claim_id) from {{ ref('medical_claim') }} ) as denominator\r\n from {{ ref('data_profiling__test_detail')}}\r\n where 1=1\r\n and test_name in ('diagnosis_code_1 missing'\r\n ,'diagnosis_code_1 invalid'\r\n ,'claim_start_date missing'\r\n ,'claim_start_date invalid'\r\n ,'patient_id missing'\r\n ,'patient_id invalid'\r\n ,'diagnosis_code_type missing'\r\n ,'diagnosis_code_type invalid'\r\n ,'procedure_code_1 missing'\r\n ,'procedure_code_1 invalid'\r\n ,'procedure_code_type invalid'\r\n ,'procedure_code_type missing'\r\n /** encounter fields **/\r\n ,'diagnosis_code_1 missing'\r\n ,'diagnosis_code_1 invalid'\r\n ,'revenue_center_code missing'\r\n ,'revenue_center_code invalid'\r\n ,'discharge_disposition_code missing'\r\n ,'discharge_disposition_code invalid'\r\n ,'ms_drg_code missing'\r\n ,'ms_drg_code invalid'\r\n ,'bill_type_code missing'\r\n ,'bill_type_code invalid'\r\n ,'place_of_service_code missing'\r\n ,'place_of_service_code invalid'\r\n ,'claim_type invalid'\r\n ,'claim_type missing'\r\n ,'claim_id missing'\r\n ,'patient_id missing'\r\n ,'claim_start_date missing'\r\n ,'claim_end_date missing'\r\n ,'facility_npi missing'\r\n )\r\n and source_table = 'medical_claim'\r\n group by\r\n source_table\r\n , test_name\r\n\r\n union all \r\n\r\n select \r\n 'chronic_conditions' as use_case\r\n , source_table\r\n , test_name\r\n , count(distinct foreign_key) as failures\r\n , (select count(distinct claim_id) from {{ ref('pharmacy_claim') }} ) as denominator\r\n from {{ ref('data_profiling__test_detail')}}\r\n where 1=1\r\n and test_name in ('ndc_code missing'\r\n ,'patient_id missing'\r\n ,'paid_date missing'\r\n )\r\n and source_table = 'pharmacy_claim'\r\n group by\r\n source_table\r\n , test_name\r\n)\r\n\r\nselect *, '{{ var('tuva_last_run')}}' as tuva_last_run from use_case_stage", "language": "sql", "refs": [["medical_claim"], ["data_profiling__test_detail"], ["medical_claim"], ["data_profiling__test_detail"], ["medical_claim"], ["data_profiling__test_detail"], ["medical_claim"], ["data_profiling__test_detail"], ["pharmacy_claim"], ["data_profiling__test_detail"], ["eligibility"], ["data_profiling__test_detail"], ["medical_claim"], ["data_profiling__test_detail"], ["pharmacy_claim"], ["data_profiling__test_detail"]], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.input_layer.medical_claim", "model.the_tuva_project.data_profiling__test_detail", "model.input_layer.medical_claim", "model.the_tuva_project.data_profiling__test_detail", "model.input_layer.medical_claim", "model.the_tuva_project.data_profiling__test_detail", "model.input_layer.medical_claim", "model.the_tuva_project.data_profiling__test_detail", "model.input_layer.pharmacy_claim", "model.the_tuva_project.data_profiling__test_detail", "model.input_layer.eligibility", "model.the_tuva_project.data_profiling__test_detail", "model.input_layer.medical_claim", "model.the_tuva_project.data_profiling__test_detail", "model.input_layer.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.input_layer.medical_claim) as denominator\n from devforrest.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.input_layer.medical_claim ) as denominator\n from devforrest.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.input_layer.medical_claim ) as denominator\n from devforrest.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.input_layer.medical_claim ) as denominator\n from devforrest.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.input_layer.pharmacy_claim ) as denominator\n from devforrest.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.input_layer.eligibility ) as denominator\n from devforrest.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.input_layer.medical_claim ) as denominator\n from devforrest.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.input_layer.pharmacy_claim ) as denominator\n from devforrest.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-12-13 23:31:59.089856+00:00' as tuva_last_run from use_case_stage", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.data_profiling__claim_type_mapping_failures": {"database": "devforrest", "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", "claims_preprocessing"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#141161"}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["data_profiling", "claims_preprocessing"], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#141161"}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_claim_type_mapping_failures", "tags": ["data_profiling", "claims_preprocessing"], "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#141161"}}, "created_at": 1702481696.4009402, "relation_name": "devforrest.claims_preprocessing._int_claim_type_mapping_failures", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r\n )\r\n}}\r\n\r\nwith claim_type_mapping as(\r\n select \r\n claim_id\r\n , claim_line_number\r\n , claim_type as source_claim_type\r\n , case\r\n when bill_type_code is not null or revenue_center_code is not null \r\n then 'institutional'\r\n when place_of_service_code is not null\r\n then 'professional'\r\n else null\r\n end as data_profiling_claim_type\r\n from {{ ref('medical_claim') }} \r\n )\r\n\r\nselect\r\n 'medical_claim' as source_table\r\n , 'all' as claim_type\r\n , 'claim_id' as grain\r\n , claim_id \r\n , 'claim_type' as test_category\r\n , 'claim_type mapping incorrect' as test_name\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom claim_type_mapping\r\nwhere source_claim_type <> data_profiling_claim_type\r\ngroup by\r\n claim_id", "language": "sql", "refs": [["medical_claim"]], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.input_layer.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.input_layer.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-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom claim_type_mapping\nwhere source_claim_type <> data_profiling_claim_type\ngroup by\n claim_id", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.data_profiling__claim_type_unmapped": {"database": "devforrest", "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", "claims_preprocessing"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#141161"}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["data_profiling", "claims_preprocessing"], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#141161"}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_claim_type_unmapped", "tags": ["data_profiling", "claims_preprocessing"], "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#141161"}}, "created_at": 1702481696.3739305, "relation_name": "devforrest.claims_preprocessing._int_claim_type_unmapped", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r\n )\r\n}}\r\n\r\nselect\r\n 'medical_claim' as source_table\r\n , 'all' as claim_type\r\n , 'claim_id' as grain\r\n , claim_id \r\n , 'claim_type' as test_category\r\n , 'claim_type missing' as test_name\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('medical_claim') }} \r\nwhere claim_type is null\r\ngroup by\r\n claim_id", "language": "sql", "refs": [["medical_claim"]], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.input_layer.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-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom tuva.input_layer.medical_claim \nwhere claim_type is null\ngroup by\n claim_id", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.data_profiling__eligibility_denominators": {"database": "devforrest", "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": "50b17e72c27200e05170bfee4d27f01108bea9e6d763042b46ec918a3d361a31"}, "config": {"enabled": true, "alias": "_int_eligibility_denominators", "schema": "claims_preprocessing", "database": null, "tags": ["data_profiling", "claims_preprocessing"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#141161"}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["data_profiling", "claims_preprocessing"], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#141161"}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_eligibility_denominators", "tags": ["data_profiling", "claims_preprocessing"], "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#141161"}}, "created_at": 1702481696.433436, "relation_name": "devforrest.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, orec_denominator as(\r\n select\r\n cast('orec 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 original_reason_entitlement_code 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 orec_denominator\r\nunion all\r\nselect * from dual_status_denominator\r\nunion all \r\nselect * from medicare_status_denominator", "language": "sql", "refs": [["eligibility"], ["eligibility"], ["eligibility"], ["eligibility"], ["eligibility"], ["eligibility"], ["eligibility"]], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.type_string"], "nodes": ["model.input_layer.eligibility", "model.input_layer.eligibility", "model.input_layer.eligibility", "model.input_layer.eligibility", "model.input_layer.eligibility", "model.input_layer.eligibility", "model.input_layer.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-12-13 23:31:59.089856+00:00' as tuva_last_run\n from tuva.input_layer.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-12-13 23:31:59.089856+00:00' as tuva_last_run\n from tuva.input_layer.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-12-13 23:31:59.089856+00:00' as tuva_last_run\n from tuva.input_layer.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-12-13 23:31:59.089856+00:00' as tuva_last_run\n from tuva.input_layer.eligibility\n where payer_type is not null\n)\n, orec_denominator as(\n select\n cast('orec invalid' as TEXT ) as test_denominator_name\n , count(distinct patient_id) as denominator\n , '2023-12-13 23:31:59.089856+00:00' as tuva_last_run\n from tuva.input_layer.eligibility\n where original_reason_entitlement_code 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-12-13 23:31:59.089856+00:00' as tuva_last_run\n from tuva.input_layer.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-12-13 23:31:59.089856+00:00' as tuva_last_run\n from tuva.input_layer.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 orec_denominator\nunion all\nselect * from dual_status_denominator\nunion all \nselect * from medicare_status_denominator", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.data_profiling__eligibility_duplicates": {"database": "devforrest", "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", "claims_preprocessing"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#141161"}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["data_profiling", "claims_preprocessing"], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#141161"}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_eligibility_duplicates", "tags": ["data_profiling", "claims_preprocessing"], "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#141161"}}, "created_at": 1702481696.417806, "relation_name": "devforrest.claims_preprocessing._int_eligibility_duplicates", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r\n )\r\n}}\r\n\r\nselect distinct\r\n 'eligibility' as source_table\r\n , 'all' as claim_type\r\n , 'patient_id' as grain\r\n , patient_id \r\n , 'duplicate_values' as test_category\r\n , 'duplicate eligibility' as test_name\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('eligibility') }} \r\ngroup by\r\n patient_id\r\n , member_id\r\n , enrollment_start_date\r\n , enrollment_end_date\r\n , payer\r\n , payer_type\r\nhaving count(*) > 1", "language": "sql", "refs": [["eligibility"]], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.input_layer.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-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom tuva.input_layer.eligibility \ngroup by\n patient_id\n , member_id\n , enrollment_start_date\n , enrollment_end_date\n , payer\n , payer_type\nhaving count(*) > 1", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.data_profiling__eligibility_invalid_values": {"database": "devforrest", "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": "b67c514bb14089eb9d451e9fdfee9cd716cf920198ca36d384e780a9689271d1"}, "config": {"enabled": true, "alias": "_int_eligibility_invalid_values", "schema": "claims_preprocessing", "database": null, "tags": ["data_profiling", "claims_preprocessing"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#141161"}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["data_profiling", "claims_preprocessing"], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#141161"}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_eligibility_invalid_values", "tags": ["data_profiling", "claims_preprocessing"], "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#141161"}}, "created_at": 1702481696.417806, "relation_name": "devforrest.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_orec as(\r\n select\r\n 'orec 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.original_reason_entitlement_code\r\n , count(elig.original_reason_entitlement_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_orec') }} orec\r\n on elig.original_reason_entitlement_code = orec.original_reason_entitlement_code\r\n where orec.original_reason_entitlement_code is null\r\n and elig.original_reason_entitlement_code is not null\r\n group by\r\n patient_id\r\n , elig.original_reason_entitlement_code\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_orec\r\nunion all\r\nselect * from valid_dual_status_code\r\nunion all\r\nselect * from valid_medicare_status_code", "language": "sql", "refs": [["eligibility"], ["terminology__gender"], ["eligibility"], ["terminology__race"], ["eligibility"], ["terminology__payer_type"], ["eligibility"], ["terminology__medicare_orec"], ["eligibility"], ["terminology__medicare_dual_eligibility"], ["eligibility"], ["terminology__medicare_status"]], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.input_layer.eligibility", "seed.the_tuva_project.terminology__gender", "model.input_layer.eligibility", "seed.the_tuva_project.terminology__race", "model.input_layer.eligibility", "seed.the_tuva_project.terminology__payer_type", "model.input_layer.eligibility", "seed.the_tuva_project.terminology__medicare_orec", "model.input_layer.eligibility", "seed.the_tuva_project.terminology__medicare_dual_eligibility", "model.input_layer.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-12-13 23:31:59.089856+00:00' as tuva_last_run\n from tuva.input_layer.eligibility elig\n left join devforrest.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-12-13 23:31:59.089856+00:00' as tuva_last_run\n from tuva.input_layer.eligibility elig\n left join devforrest.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-12-13 23:31:59.089856+00:00' as tuva_last_run\n from tuva.input_layer.eligibility elig\n left join devforrest.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_orec as(\n select\n 'orec 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.original_reason_entitlement_code\n , count(elig.original_reason_entitlement_code) as filled_row_count\n , '2023-12-13 23:31:59.089856+00:00' as tuva_last_run\n from tuva.input_layer.eligibility elig\n left join devforrest.terminology.medicare_orec orec\n on elig.original_reason_entitlement_code = orec.original_reason_entitlement_code\n where orec.original_reason_entitlement_code is null\n and elig.original_reason_entitlement_code is not null\n group by\n patient_id\n , elig.original_reason_entitlement_code\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-12-13 23:31:59.089856+00:00' as tuva_last_run\n from tuva.input_layer.eligibility elig\n left join devforrest.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-12-13 23:31:59.089856+00:00' as tuva_last_run\n from tuva.input_layer.eligibility elig\n left join devforrest.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_orec\nunion all\nselect * from valid_dual_status_code\nunion all\nselect * from valid_medicare_status_code", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.data_profiling__eligibility_missing_values": {"database": "devforrest", "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", "claims_preprocessing"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#141161"}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["data_profiling", "claims_preprocessing"], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#141161"}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_eligibility_missing_values", "tags": ["data_profiling", "claims_preprocessing"], "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#141161"}}, "created_at": 1702481696.417806, "relation_name": "devforrest.claims_preprocessing._int_eligibility_missing_values", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r\n )\r\n}}\r\n\r\n{% set eligibility_missing_column_list = [\r\n 'patient_id'\r\n , 'member_id'\r\n , 'gender'\r\n , 'race'\r\n , 'birth_date'\r\n , 'death_date'\r\n , 'death_flag'\r\n , 'enrollment_start_date'\r\n , 'enrollment_end_date'\r\n , 'payer'\r\n , 'payer_type'\r\n , 'dual_status_code'\r\n , 'medicare_status_code'\r\n , 'first_name'\r\n , 'last_name'\r\n , 'address'\r\n , 'city'\r\n , 'state'\r\n , 'zip_code'\r\n , 'phone'\r\n , 'data_source'\r\n] -%}\r\n\r\n\r\n\r\nwith eligibility_missing as(\r\n\r\n {{ eligibility_missing_column_check(builtins.ref('eligibility'), eligibility_missing_column_list) }}\r\n\r\n)\r\n\r\n\r\nselect\r\n 'eligibility' as source_table\r\n , 'all' as claim_type\r\n , 'patient_id' as grain\r\n , patient_id \r\n , 'missing_values' as test_category\r\n , column_checked||' missing' as test_name\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom eligibility_missing\r\ngroup by\r\n patient_id\r\n , column_checked||' missing'", "language": "sql", "refs": [["eligibility"]], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.the_tuva_project.eligibility_missing_column_check"], "nodes": ["model.input_layer.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.input_layer.eligibility\n where patient_id is null\n union all\n select\n patient_id\n , 'member_id' as column_checked\n from tuva.input_layer.eligibility\n where member_id is null\n union all\n select\n patient_id\n , 'gender' as column_checked\n from tuva.input_layer.eligibility\n where gender is null\n union all\n select\n patient_id\n , 'race' as column_checked\n from tuva.input_layer.eligibility\n where race is null\n union all\n select\n patient_id\n , 'birth_date' as column_checked\n from tuva.input_layer.eligibility\n where birth_date is null\n union all\n select\n patient_id\n , 'death_date' as column_checked\n from tuva.input_layer.eligibility\n where death_date is null\n union all\n select\n patient_id\n , 'death_flag' as column_checked\n from tuva.input_layer.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.input_layer.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.input_layer.eligibility\n where enrollment_end_date is null\n union all\n select\n patient_id\n , 'payer' as column_checked\n from tuva.input_layer.eligibility\n where payer is null\n union all\n select\n patient_id\n , 'payer_type' as column_checked\n from tuva.input_layer.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.input_layer.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.input_layer.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.input_layer.eligibility\n where first_name is null\n union all\n select\n patient_id\n , 'last_name' as column_checked\n from tuva.input_layer.eligibility\n where last_name is null\n union all\n select\n patient_id\n , 'address' as column_checked\n from tuva.input_layer.eligibility\n where address is null\n union all\n select\n patient_id\n , 'city' as column_checked\n from tuva.input_layer.eligibility\n where city is null\n union all\n select\n patient_id\n , 'state' as column_checked\n from tuva.input_layer.eligibility\n where state is null\n union all\n select\n patient_id\n , 'zip_code' as column_checked\n from tuva.input_layer.eligibility\n where zip_code is null\n union all\n select\n patient_id\n , 'phone' as column_checked\n from tuva.input_layer.eligibility\n where phone is null\n union all\n select\n patient_id\n , 'data_source' as column_checked\n from tuva.input_layer.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-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom eligibility_missing\ngroup by\n patient_id\n , column_checked||' missing'", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.data_profiling__eligibility_plausibility": {"database": "devforrest", "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", "claims_preprocessing"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#141161"}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["data_profiling", "claims_preprocessing"], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#141161"}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_eligibility_plausibility", "tags": ["data_profiling", "claims_preprocessing"], "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#141161"}}, "created_at": 1702481696.433436, "relation_name": "devforrest.claims_preprocessing._int_eligibility_plausibility", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r\n )\r\n}}\r\n\r\nwith multiple_genders_test as (\r\n select\r\n 'multiple genders' as test_name\r\n , 'eligibility' as source_table\r\n , 'all' as claim_type\r\n , 'plausibility' as test_category\r\n , 'patient_id' as grain\r\n , patient_id\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\n from {{ ref('eligibility') }}\r\n group by\r\n patient_id\r\n having count(distinct gender) > 1\r\n)\r\n, multiple_races_test as(\r\n select\r\n 'multiple races' as test_name\r\n , 'eligibility' as source_table\r\n , 'all' as claim_type\r\n , 'plausibility' as test_category\r\n , 'patient_id' as grain\r\n , patient_id\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\n from {{ ref('eligibility') }} \r\n group by\r\n patient_id\r\n having count(distinct race) > 1\r\n)\r\n, multiple_birth_dates_test as(\r\n select\r\n 'multiple birth dates' as test_name\r\n , 'eligibility' as source_table\r\n , 'all' as claim_type\r\n , 'plausibility' as test_category\r\n , 'patient_id' as grain\r\n , patient_id\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\n from {{ ref('eligibility') }}\r\n group by\r\n patient_id\r\n having count(distinct birth_date) > 1\r\n)\r\n, multiple_death_dates_test as(\r\n select\r\n 'multiple death dates' as test_name\r\n , 'eligibility' as source_table\r\n , 'all' as claim_type\r\n , 'plausibility' as test_category\r\n , 'patient_id' as grain\r\n , patient_id\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\n from {{ ref('eligibility') }}\r\n group by\r\n patient_id\r\n having count(distinct death_date) > 1\r\n)\r\n, birth_date_after_death_date as(\r\n select\r\n 'birth date after death date' as test_name\r\n , 'eligibility' as source_table\r\n , 'all' as claim_type\r\n , 'plausibility' as test_category\r\n , 'patient_id' as grain\r\n , patient_id\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\n from {{ ref('eligibility') }}\r\n where birth_date > death_date\r\n group by\r\n patient_id\r\n having count(distinct gender) > 1\r\n)\r\nselect * from multiple_genders_test\r\nunion all\r\nselect * from multiple_races_test\r\nunion all\r\nselect * from multiple_birth_dates_test\r\nunion all\r\nselect * from multiple_death_dates_test\r\nunion all\r\nselect * from birth_date_after_death_date", "language": "sql", "refs": [["eligibility"], ["eligibility"], ["eligibility"], ["eligibility"], ["eligibility"]], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.input_layer.eligibility", "model.input_layer.eligibility", "model.input_layer.eligibility", "model.input_layer.eligibility", "model.input_layer.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-12-13 23:31:59.089856+00:00' as tuva_last_run\n from tuva.input_layer.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-12-13 23:31:59.089856+00:00' as tuva_last_run\n from tuva.input_layer.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-12-13 23:31:59.089856+00:00' as tuva_last_run\n from tuva.input_layer.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-12-13 23:31:59.089856+00:00' as tuva_last_run\n from tuva.input_layer.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-12-13 23:31:59.089856+00:00' as tuva_last_run\n from tuva.input_layer.eligibility\n where birth_date > death_date\n group by\n patient_id\n having count(distinct gender) > 1\n)\nselect * from multiple_genders_test\nunion all\nselect * from multiple_races_test\nunion all\nselect * from multiple_birth_dates_test\nunion all\nselect * from multiple_death_dates_test\nunion all\nselect * from birth_date_after_death_date", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.data_profiling__institutional_header_failures": {"database": "devforrest", "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", "claims_preprocessing"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#141161"}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["data_profiling", "claims_preprocessing"], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#141161"}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_institutional_header_failures", "tags": ["data_profiling", "claims_preprocessing"], "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#141161"}}, "created_at": 1702481696.3779383, "relation_name": "devforrest.claims_preprocessing._int_institutional_header_failures", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r\n )\r\n}}\r\n\r\nwith stage as(\r\n select distinct\r\n claim_id\r\n , claim_type\r\n , patient_id\r\n , member_id\r\n , claim_start_date\r\n , claim_end_date\r\n , admission_date\r\n , discharge_date\r\n , admit_source_code\r\n , admit_type_code\r\n , discharge_disposition_code\r\n , bill_type_code\r\n , ms_drg_code\r\n , facility_npi\r\n , billing_npi\r\n , rendering_npi\r\n , diagnosis_code_type\r\n , diagnosis_code_1\r\n , diagnosis_code_2\r\n , diagnosis_code_3\r\n , diagnosis_code_4\r\n , diagnosis_code_5\r\n , diagnosis_code_6\r\n , diagnosis_code_7\r\n , diagnosis_code_8\r\n , diagnosis_code_9\r\n , diagnosis_code_10\r\n , diagnosis_code_11\r\n , diagnosis_code_12\r\n , diagnosis_code_13\r\n , diagnosis_code_14\r\n , diagnosis_code_15\r\n , diagnosis_code_16\r\n , diagnosis_code_17\r\n , diagnosis_code_18\r\n , diagnosis_code_19\r\n , diagnosis_code_20\r\n , diagnosis_code_21\r\n , diagnosis_code_22\r\n , diagnosis_code_23\r\n , diagnosis_code_24\r\n , diagnosis_code_25\r\n , diagnosis_poa_1\r\n , diagnosis_poa_2\r\n , diagnosis_poa_3\r\n , diagnosis_poa_4\r\n , diagnosis_poa_5\r\n , diagnosis_poa_6\r\n , diagnosis_poa_7\r\n , diagnosis_poa_8\r\n , diagnosis_poa_9\r\n , diagnosis_poa_10\r\n , diagnosis_poa_11\r\n , diagnosis_poa_12\r\n , diagnosis_poa_13\r\n , diagnosis_poa_14\r\n , diagnosis_poa_15\r\n , diagnosis_poa_16\r\n , diagnosis_poa_17\r\n , diagnosis_poa_18\r\n , diagnosis_poa_19\r\n , diagnosis_poa_20\r\n , diagnosis_poa_21\r\n , diagnosis_poa_22\r\n , diagnosis_poa_23\r\n , diagnosis_poa_24\r\n , diagnosis_poa_25\r\n , procedure_code_type\r\n , procedure_code_1\r\n , procedure_code_2\r\n , procedure_code_3\r\n , procedure_code_4\r\n , procedure_code_5\r\n , procedure_code_6\r\n , procedure_code_7\r\n , procedure_code_8\r\n , procedure_code_9\r\n , procedure_code_10\r\n , procedure_code_11\r\n , procedure_code_12\r\n , procedure_code_13\r\n , procedure_code_14\r\n , procedure_code_15\r\n , procedure_code_16\r\n , procedure_code_17\r\n , procedure_code_18\r\n , procedure_code_19\r\n , procedure_code_20\r\n , procedure_code_21\r\n , procedure_code_22\r\n , procedure_code_23\r\n , procedure_code_24\r\n , procedure_code_25\r\n , procedure_date_1\r\n , procedure_date_2\r\n , procedure_date_3\r\n , procedure_date_4\r\n , procedure_date_5\r\n , procedure_date_6\r\n , procedure_date_7\r\n , procedure_date_8\r\n , procedure_date_9\r\n , procedure_date_10\r\n , procedure_date_11\r\n , procedure_date_12\r\n , procedure_date_13\r\n , procedure_date_14\r\n , procedure_date_15\r\n , procedure_date_16\r\n , procedure_date_17\r\n , procedure_date_18\r\n , procedure_date_19\r\n , procedure_date_20\r\n , procedure_date_21\r\n , procedure_date_22\r\n , procedure_date_23\r\n , procedure_date_24\r\n , procedure_date_25\r\n , data_source\r\n from {{ ref('medical_claim') }} \r\n where claim_type = 'institutional'\r\n ) \r\n, claims_with_duplicates as (\r\nselect \r\n claim_id\r\n , 1 as invalid_header\r\nfrom stage\r\ngroup by claim_id\r\nhaving count(*) > 1\r\n)\r\n\r\nselect med.*, '{{ var('tuva_last_run')}}' as tuva_last_run from claims_with_duplicates dupe\r\ninner join {{ ref('medical_claim') }} med\r\n on dupe.claim_id = med.claim_id", "language": "sql", "refs": [["medical_claim"], ["medical_claim"]], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.input_layer.medical_claim", "model.input_layer.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.input_layer.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-12-13 23:31:59.089856+00:00' as tuva_last_run from claims_with_duplicates dupe\ninner join tuva.input_layer.medical_claim med\n on dupe.claim_id = med.claim_id", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.data_profiling__institutional_header_fail_details": {"database": "devforrest", "schema": "claims_preprocessing", "name": "data_profiling__institutional_header_fail_details", "resource_type": "model", "package_name": "the_tuva_project", "path": "claims_preprocessing\\data_profiling\\intermediate\\data_profiling__institutional_header_fail_details.sql", "original_file_path": "models\\claims_preprocessing\\data_profiling\\intermediate\\data_profiling__institutional_header_fail_details.sql", "unique_id": "model.the_tuva_project.data_profiling__institutional_header_fail_details", "fqn": ["the_tuva_project", "claims_preprocessing", "data_profiling", "intermediate", "data_profiling__institutional_header_fail_details"], "alias": "_int_institutional_header_fail_details", "checksum": {"name": "sha256", "checksum": "2438594d9d3c5c5d9d277e44bf079790c55a44c0f55e560e9c851002224a9b50"}, "config": {"enabled": true, "alias": "_int_institutional_header_fail_details", "schema": "claims_preprocessing", "database": null, "tags": ["data_profiling", "claims_preprocessing"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#141161"}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["data_profiling", "claims_preprocessing"], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#141161"}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_institutional_header_fail_details", "tags": ["data_profiling", "claims_preprocessing"], "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#141161"}}, "created_at": 1702481696.3839343, "relation_name": "devforrest.claims_preprocessing._int_institutional_header_fail_details", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r\n )\r\n}}\r\n\r\n{% set institutional_header_column_list = [\r\n 'claim_id'\r\n , 'claim_type'\r\n , 'patient_id'\r\n , 'member_id'\r\n , 'claim_start_date'\r\n , 'claim_end_date'\r\n , 'admission_date'\r\n , 'discharge_date'\r\n , 'admit_source_code'\r\n , 'admit_type_code'\r\n , 'discharge_disposition_code'\r\n , 'bill_type_code'\r\n , 'ms_drg_code'\r\n , 'facility_npi'\r\n , 'billing_npi'\r\n , 'rendering_npi'\r\n , 'diagnosis_code_type'\r\n , 'diagnosis_code_1'\r\n , 'diagnosis_code_2'\r\n , 'diagnosis_code_3'\r\n , 'diagnosis_code_4'\r\n , 'diagnosis_code_5'\r\n , 'diagnosis_code_6'\r\n , 'diagnosis_code_7'\r\n , 'diagnosis_code_8'\r\n , 'diagnosis_code_9'\r\n , 'diagnosis_code_10'\r\n , 'diagnosis_code_11'\r\n , 'diagnosis_code_12'\r\n , 'diagnosis_code_13'\r\n , 'diagnosis_code_14'\r\n , 'diagnosis_code_15'\r\n , 'diagnosis_code_16'\r\n , 'diagnosis_code_17'\r\n , 'diagnosis_code_18'\r\n , 'diagnosis_code_19'\r\n , 'diagnosis_code_20'\r\n , 'diagnosis_code_21'\r\n , 'diagnosis_code_22'\r\n , 'diagnosis_code_23'\r\n , 'diagnosis_code_24'\r\n , 'diagnosis_code_25'\r\n , 'diagnosis_poa_1'\r\n , 'diagnosis_poa_2'\r\n , 'diagnosis_poa_3'\r\n , 'diagnosis_poa_4'\r\n , 'diagnosis_poa_5'\r\n , 'diagnosis_poa_6'\r\n , 'diagnosis_poa_7'\r\n , 'diagnosis_poa_8'\r\n , 'diagnosis_poa_9'\r\n , 'diagnosis_poa_10'\r\n , 'diagnosis_poa_11'\r\n , 'diagnosis_poa_12'\r\n , 'diagnosis_poa_13'\r\n , 'diagnosis_poa_14'\r\n , 'diagnosis_poa_15'\r\n , 'diagnosis_poa_16'\r\n , 'diagnosis_poa_17'\r\n , 'diagnosis_poa_18'\r\n , 'diagnosis_poa_19'\r\n , 'diagnosis_poa_20'\r\n , 'diagnosis_poa_21'\r\n , 'diagnosis_poa_22'\r\n , 'diagnosis_poa_23'\r\n , 'diagnosis_poa_24'\r\n , 'diagnosis_poa_25'\r\n , 'procedure_code_type'\r\n , 'procedure_code_1'\r\n , 'procedure_code_2'\r\n , 'procedure_code_3'\r\n , 'procedure_code_4'\r\n , 'procedure_code_5'\r\n , 'procedure_code_6'\r\n , 'procedure_code_7'\r\n , 'procedure_code_8'\r\n , 'procedure_code_9'\r\n , 'procedure_code_10'\r\n , 'procedure_code_11'\r\n , 'procedure_code_12'\r\n , 'procedure_code_13'\r\n , 'procedure_code_14'\r\n , 'procedure_code_15'\r\n , 'procedure_code_16'\r\n , 'procedure_code_17'\r\n , 'procedure_code_18'\r\n , 'procedure_code_19'\r\n , 'procedure_code_20'\r\n , 'procedure_code_21'\r\n , 'procedure_code_22'\r\n , 'procedure_code_23'\r\n , 'procedure_code_24'\r\n , 'procedure_code_25'\r\n , 'procedure_date_1'\r\n , 'procedure_date_2'\r\n , 'procedure_date_3'\r\n , 'procedure_date_4'\r\n , 'procedure_date_5'\r\n , 'procedure_date_6'\r\n , 'procedure_date_7'\r\n , 'procedure_date_8'\r\n , 'procedure_date_9'\r\n , 'procedure_date_10'\r\n , 'procedure_date_11'\r\n , 'procedure_date_12'\r\n , 'procedure_date_13'\r\n , 'procedure_date_14'\r\n , 'procedure_date_15'\r\n , 'procedure_date_16'\r\n , 'procedure_date_17'\r\n , 'procedure_date_18'\r\n , 'procedure_date_19'\r\n , 'procedure_date_20'\r\n , 'procedure_date_21'\r\n , 'procedure_date_22'\r\n , 'procedure_date_23'\r\n , 'procedure_date_24'\r\n , 'procedure_date_25'\r\n , 'data_source'\r\n] -%}\r\n\r\n\r\nwith institutional_header_duplicates as(\r\n\r\n {{ header_duplicate_check(builtins.ref('data_profiling__institutional_header_failures'), institutional_header_column_list, 'institutional') }}\r\n\r\n)\r\n\r\nselect\r\n 'medical_claim' as source_table\r\n , 'institutional' as claim_type\r\n , 'claim_id' as grain\r\n , claim_id\r\n , 'header' as test_category\r\n , column_checked||' duplicated' as test_name\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom institutional_header_duplicates\r\ngroup by \r\n claim_id\r\n , column_checked||' duplicated'", "language": "sql", "refs": [["data_profiling__institutional_header_failures"]], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.the_tuva_project.header_duplicate_check"], "nodes": ["model.the_tuva_project.data_profiling__institutional_header_failures"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\data_profiling\\intermediate\\data_profiling__institutional_header_fail_details.sql", "compiled": true, "compiled_code": "\n\nwith institutional_header_duplicates as(\n\n \n select\n claim_id\n , 'claim_id' as column_checked\n , count(distinct claim_id) as duplicate_count\n from devforrest.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 devforrest.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 devforrest.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 devforrest.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 devforrest.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 devforrest.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 devforrest.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 devforrest.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 devforrest.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 devforrest.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 devforrest.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 devforrest.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 devforrest.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 devforrest.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 devforrest.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 devforrest.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 devforrest.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 devforrest.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 devforrest.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 devforrest.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 devforrest.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 devforrest.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 devforrest.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 devforrest.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 devforrest.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 devforrest.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 devforrest.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 devforrest.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 devforrest.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 devforrest.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 devforrest.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 devforrest.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 devforrest.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 devforrest.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 devforrest.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 devforrest.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 devforrest.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 devforrest.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 devforrest.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 devforrest.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 devforrest.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 devforrest.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 devforrest.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 devforrest.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 devforrest.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 devforrest.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 devforrest.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 devforrest.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 devforrest.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 devforrest.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 devforrest.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 devforrest.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 devforrest.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 devforrest.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 devforrest.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 devforrest.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 devforrest.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 devforrest.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 devforrest.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 devforrest.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 devforrest.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 devforrest.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 devforrest.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 devforrest.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 devforrest.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 devforrest.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 devforrest.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 devforrest.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 devforrest.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 devforrest.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 devforrest.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 devforrest.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 devforrest.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 devforrest.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 devforrest.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 devforrest.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 devforrest.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 devforrest.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 devforrest.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 devforrest.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 devforrest.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 devforrest.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 devforrest.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 devforrest.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 devforrest.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 devforrest.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 devforrest.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 devforrest.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 devforrest.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 devforrest.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 devforrest.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 devforrest.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 devforrest.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 devforrest.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 devforrest.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 devforrest.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 devforrest.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 devforrest.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 devforrest.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 devforrest.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 devforrest.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 devforrest.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 devforrest.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 devforrest.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 devforrest.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 devforrest.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 devforrest.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 devforrest.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 devforrest.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 devforrest.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 devforrest.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 devforrest.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 devforrest.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 devforrest.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 devforrest.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 devforrest.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 devforrest.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 devforrest.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 devforrest.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-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom institutional_header_duplicates\ngroup by \n claim_id\n , column_checked||' duplicated'", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.data_profiling__medical_claim_denominators": {"database": "devforrest", "schema": "claims_preprocessing", "name": "data_profiling__medical_claim_denominators", "resource_type": "model", "package_name": "the_tuva_project", "path": "claims_preprocessing\\data_profiling\\intermediate\\data_profiling__medical_claim_denominators.sql", "original_file_path": "models\\claims_preprocessing\\data_profiling\\intermediate\\data_profiling__medical_claim_denominators.sql", "unique_id": "model.the_tuva_project.data_profiling__medical_claim_denominators", "fqn": ["the_tuva_project", "claims_preprocessing", "data_profiling", "intermediate", "data_profiling__medical_claim_denominators"], "alias": "_int_medical_claim_denominators", "checksum": {"name": "sha256", "checksum": "ca1857f87248fede22aa2d9babcf31d46a5cfb86bd7afe67c21b8826359f2bca"}, "config": {"enabled": true, "alias": "_int_medical_claim_denominators", "schema": "claims_preprocessing", "database": null, "tags": ["data_profiling", "claims_preprocessing"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#141161"}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["data_profiling", "claims_preprocessing"], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#141161"}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_medical_claim_denominators", "tags": ["data_profiling", "claims_preprocessing"], "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#141161"}}, "created_at": 1702481696.4020946, "relation_name": "devforrest.claims_preprocessing._int_medical_claim_denominators", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r\n )\r\n}}\r\n\r\nwith professional_denominator as(\r\n select \r\n cast('professional' as {{ dbt.type_string() }} ) as test_denominator_name\r\n , cast(count(distinct claim_id) as int) as denominator\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\n from {{ ref('medical_claim') }}\r\n where claim_type = 'professional'\r\n)\r\n\r\n, institutional_denominator as(\r\n select \r\n cast('institutional' as {{ dbt.type_string() }} ) as test_denominator_name\r\n , count(distinct claim_id) as denominator\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\n from {{ ref('medical_claim') }}\r\n where claim_type = 'institutional'\r\n)\r\n\r\n, all_claim_denominator as(\r\n select \r\n cast('all' as {{ dbt.type_string() }} ) as test_denominator_name\r\n , count(distinct claim_id) as denominator\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\n from {{ ref('medical_claim') }}\r\n where claim_type is not null\r\n)\r\n\r\n, bill_type_denominator as(\r\n select\r\n cast('bill_type_code invalid' as {{ dbt.type_string() }} ) as test_denominator_name\r\n , count(distinct claim_id) as denominator\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\n from {{ ref('medical_claim') }}\r\n where bill_type_code is not null\r\n)\r\n\r\n, revenue_center_denominator as(\r\n select\r\n cast('revenue_center_code invalid' as {{ dbt.type_string() }} ) as test_denominator_name\r\n , count(distinct claim_id) as denominator\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\n from {{ ref('medical_claim') }}\r\n where revenue_center_code is not null\r\n)\r\n\r\n, discharge_disposition_denominator as(\r\n select\r\n cast('discharge_disposition_code invalid' as {{ dbt.type_string() }} ) as test_denominator_name\r\n , count(distinct claim_id) as denominator\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\n from {{ ref('medical_claim') }}\r\n where discharge_disposition_code is not null\r\n)\r\n, admit_source_denominator as( \r\n select\r\n cast('admit_source_code invalid' as {{ dbt.type_string() }} ) as test_denominator_name\r\n , count(distinct claim_id) as denominator\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\n from {{ ref('medical_claim') }}\r\n where admit_source_code is not null\r\n)\r\n\r\n, admit_type_denominator as(\r\n select\r\n cast('admit_type_code invalid' as {{ dbt.type_string() }} ) as test_denominator_name\r\n , count(distinct claim_id) as denominator\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\n from {{ ref('medical_claim') }}\r\n where admit_type_code is not null\r\n)\r\n\r\n, ms_drg_denominator as(\r\n select\r\n cast('ms_drg_code invalid' as {{ dbt.type_string() }} ) as test_denominator_name\r\n , count(distinct claim_id) as denominator\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\n from {{ ref('medical_claim') }}\r\n where ms_drg_code is not null\r\n)\r\n, present_on_admission_denominator as(\r\n select\r\n cast('diagnosis_poa_1 invalid' as {{ dbt.type_string() }} ) as test_denominator_name\r\n , count(distinct claim_id) as denominator\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\n from {{ ref('medical_claim') }}\r\n where diagnosis_poa_1 is not null\r\n)\r\n\r\n, procedure_code_type_denominator as(\r\n select\r\n cast('procedure_code_type invalid' as {{ dbt.type_string() }} ) as test_denominator_name\r\n , count(distinct claim_id) as denominator\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\n from {{ ref('medical_claim') }}\r\n where procedure_code_type is not null\r\n)\r\n, place_of_service_denominator as(\r\n select\r\n cast('place_of_service_code invalid' as {{ dbt.type_string() }} ) as test_denominator_name\r\n , count(distinct claim_id) as denominator\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\n from {{ ref('medical_claim') }}\r\n where place_of_service_code is not null\r\n)\r\n, diagnosis_code_type_denominator as(\r\n select\r\n cast('diagnosis_code_type invalid' as {{ dbt.type_string() }} ) as test_denominator_name\r\n , count(distinct claim_id) as denominator\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\n from {{ ref('medical_claim') }}\r\n where diagnosis_code_type is not null\r\n)\r\n\r\n, diagnosis_code_denominator as(\r\n select\r\n cast('diagnosis_code_1 invalid' as {{ dbt.type_string() }} ) as test_denominator_name\r\n , count(distinct claim_id) as denominator\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\n from {{ ref('medical_claim') }}\r\n where diagnosis_code_1 is not null\r\n\r\n)\r\n\r\n, claim_type_denominator as(\r\n select\r\n cast('claim_type invalid' as {{ dbt.type_string() }} ) as test_denominator_name\r\n , count(distinct claim_id) as denominator\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\n from {{ ref('medical_claim') }}\r\n where claim_type is not null\r\n)\r\n\r\nselect * from institutional_denominator\r\nunion all \r\nselect * from professional_denominator\r\nunion all\r\nselect * from bill_type_denominator\r\nunion all\r\nselect * from revenue_center_denominator\r\nunion all\r\nselect * from discharge_disposition_denominator\r\nunion all\r\nselect * from admit_source_denominator\r\nunion all\r\nselect * from admit_type_denominator\r\nunion all\r\nselect * from ms_drg_denominator\r\nunion all\r\nselect * from present_on_admission_denominator\r\nunion all\r\nselect * from procedure_code_type_denominator\r\nunion all\r\nselect * from place_of_service_denominator\r\nunion all\r\nselect * from diagnosis_code_type_denominator\r\nunion all\r\nselect * from diagnosis_code_denominator\r\nunion all\r\nselect * from claim_type_denominator", "language": "sql", "refs": [["medical_claim"], ["medical_claim"], ["medical_claim"], ["medical_claim"], ["medical_claim"], ["medical_claim"], ["medical_claim"], ["medical_claim"], ["medical_claim"], ["medical_claim"], ["medical_claim"], ["medical_claim"], ["medical_claim"], ["medical_claim"], ["medical_claim"]], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.type_string"], "nodes": ["model.input_layer.medical_claim", "model.input_layer.medical_claim", "model.input_layer.medical_claim", "model.input_layer.medical_claim", "model.input_layer.medical_claim", "model.input_layer.medical_claim", "model.input_layer.medical_claim", "model.input_layer.medical_claim", "model.input_layer.medical_claim", "model.input_layer.medical_claim", "model.input_layer.medical_claim", "model.input_layer.medical_claim", "model.input_layer.medical_claim", "model.input_layer.medical_claim", "model.input_layer.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-12-13 23:31:59.089856+00:00' as tuva_last_run\n from tuva.input_layer.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-12-13 23:31:59.089856+00:00' as tuva_last_run\n from tuva.input_layer.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-12-13 23:31:59.089856+00:00' as tuva_last_run\n from tuva.input_layer.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-12-13 23:31:59.089856+00:00' as tuva_last_run\n from tuva.input_layer.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-12-13 23:31:59.089856+00:00' as tuva_last_run\n from tuva.input_layer.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-12-13 23:31:59.089856+00:00' as tuva_last_run\n from tuva.input_layer.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-12-13 23:31:59.089856+00:00' as tuva_last_run\n from tuva.input_layer.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-12-13 23:31:59.089856+00:00' as tuva_last_run\n from tuva.input_layer.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-12-13 23:31:59.089856+00:00' as tuva_last_run\n from tuva.input_layer.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-12-13 23:31:59.089856+00:00' as tuva_last_run\n from tuva.input_layer.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-12-13 23:31:59.089856+00:00' as tuva_last_run\n from tuva.input_layer.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-12-13 23:31:59.089856+00:00' as tuva_last_run\n from tuva.input_layer.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-12-13 23:31:59.089856+00:00' as tuva_last_run\n from tuva.input_layer.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-12-13 23:31:59.089856+00:00' as tuva_last_run\n from tuva.input_layer.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-12-13 23:31:59.089856+00:00' as tuva_last_run\n from tuva.input_layer.medical_claim\n where claim_type is not null\n)\n\nselect * from institutional_denominator\nunion all \nselect * from professional_denominator\nunion all\nselect * from bill_type_denominator\nunion all\nselect * from revenue_center_denominator\nunion all\nselect * from discharge_disposition_denominator\nunion all\nselect * from admit_source_denominator\nunion all\nselect * from admit_type_denominator\nunion all\nselect * from ms_drg_denominator\nunion all\nselect * from present_on_admission_denominator\nunion all\nselect * from procedure_code_type_denominator\nunion all\nselect * from place_of_service_denominator\nunion all\nselect * from diagnosis_code_type_denominator\nunion all\nselect * from diagnosis_code_denominator\nunion all\nselect * from claim_type_denominator", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.data_profiling__medical_claim_duplicates": {"database": "devforrest", "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", "claims_preprocessing"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#141161"}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["data_profiling", "claims_preprocessing"], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#141161"}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_medical_claim_duplicates", "tags": ["data_profiling", "claims_preprocessing"], "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#141161"}}, "created_at": 1702481696.4020946, "relation_name": "devforrest.claims_preprocessing._int_medical_claim_duplicates", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r\n )\r\n}}\r\n\r\nselect distinct\r\n 'medical_claim' as source_table\r\n , 'all' as claim_type\r\n , 'claim_id' as grain\r\n , claim_id \r\n , 'duplicate_values' as test_category\r\n , 'duplicate medical claims' as test_name\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('medical_claim') }} \r\ngroup by\r\n claim_id\r\n , claim_line_number\r\nhaving count(*) > 1", "language": "sql", "refs": [["medical_claim"]], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.input_layer.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-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom tuva.input_layer.medical_claim \ngroup by\n claim_id\n , claim_line_number\nhaving count(*) > 1", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.data_profiling__medical_claim_inst_missing_values": {"database": "devforrest", "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", "claims_preprocessing"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#141161"}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["data_profiling", "claims_preprocessing"], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#141161"}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_medical_claim_inst_missing_values", "tags": ["data_profiling", "claims_preprocessing"], "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#141161"}}, "created_at": 1702481696.3939474, "relation_name": "devforrest.claims_preprocessing._int_medical_claim_inst_missing_values", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r\n )\r\n}}\r\n\r\n{% set institutional_missing_column_list = [\r\n 'claim_id'\r\n , 'claim_line_number'\r\n , 'patient_id'\r\n , 'member_id'\r\n , 'claim_start_date'\r\n , 'claim_end_date'\r\n , 'bill_type_code'\r\n , 'revenue_center_code'\r\n , 'hcpcs_code'\r\n , 'rendering_npi'\r\n , 'billing_npi'\r\n , 'facility_npi'\r\n , 'paid_date'\r\n , 'paid_amount'\r\n , 'diagnosis_code_type'\r\n , 'diagnosis_code_1'\r\n , 'data_source'\r\n] -%}\r\n\r\nwith institutional_missing as(\r\n\r\n {{ medical_claim_missing_column_check(builtins.ref('medical_claim'), institutional_missing_column_list, 'institutional') }}\r\n\r\n)\r\n\r\nselect\r\n 'medical_claim' as source_table\r\n , 'institutional' as claim_type\r\n , 'claim_id' as grain\r\n , claim_id \r\n , 'missing_values' as test_category\r\n , column_checked||' missing' as test_name\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom institutional_missing\r\ngroup by\r\n claim_id\r\n , column_checked||' missing'", "language": "sql", "refs": [["medical_claim"]], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.the_tuva_project.medical_claim_missing_column_check"], "nodes": ["model.input_layer.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.input_layer.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.input_layer.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.input_layer.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.input_layer.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.input_layer.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.input_layer.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.input_layer.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.input_layer.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.input_layer.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.input_layer.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.input_layer.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.input_layer.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.input_layer.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.input_layer.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.input_layer.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.input_layer.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.input_layer.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-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom institutional_missing\ngroup by\n claim_id\n , column_checked||' missing'", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.data_profiling__medical_claim_invalid_values": {"database": "devforrest", "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", "claims_preprocessing"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#141161"}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["data_profiling", "claims_preprocessing"], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#141161"}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_medical_claim_invalid_values", "tags": ["data_profiling", "claims_preprocessing"], "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#141161"}}, "created_at": 1702481696.3909295, "relation_name": "devforrest.claims_preprocessing._int_medical_claim_invalid_values", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r\n )\r\n}}\r\n\r\nwith valid_bill_type as(\r\n select\r\n 'bill_type_code invalid' as test_name\r\n , 'medical_claim' as source_table\r\n , 'institutional' as claim_type\r\n , 'invalid_values' as test_category\r\n , 'claim_id' as grain\r\n , claim_id\r\n , count(med.bill_type_code) as filled_row_count\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\n from {{ ref('medical_claim') }} med\r\n left join {{ ref('terminology__bill_type')}} tob\r\n on med.bill_type_code = tob.bill_type_code\r\n where med.claim_type = 'institutional'\r\n and tob.bill_type_code is null\r\n and med.bill_type_code is not null\r\n group by\r\n claim_id\r\n\r\n)\r\n, valid_revenue_center as(\r\n select \r\n 'revenue_center_code invalid' as test_name \r\n , 'medical_claim' as source_table\r\n , 'institutional' as claim_type\r\n , 'invalid_values' as test_category\r\n , 'claim_id' as grain\r\n , claim_id\r\n , count(med.revenue_center_code) as filled_row_count\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\n from {{ ref('medical_claim') }} med\r\n left join {{ ref('terminology__revenue_center') }} rev\r\n on med.revenue_center_code = rev.revenue_center_code\r\n where med.claim_type = 'institutional'\r\n and rev.revenue_center_code is null\r\n and med.revenue_center_code is not null\r\n group by\r\n claim_id\r\n)\r\n, valid_discharge_disposition as(\r\n select \r\n 'discharge_disposition_code invalid' as test_name \r\n , 'medical_claim' as source_table\r\n , 'institutional' as claim_type\r\n , 'invalid_values' as test_category\r\n , 'claim_id' as grain\r\n , claim_id\r\n , count(med.discharge_disposition_code) as filled_row_count\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\n from {{ ref('medical_claim') }} med\r\n left join {{ ref('terminology__discharge_disposition') }} discharge\r\n on med.discharge_disposition_code = discharge.discharge_disposition_code\r\n where med.claim_type = 'institutional'\r\n and discharge.discharge_disposition_code is null\r\n and med.discharge_disposition_code is not null\r\n group by\r\n claim_id\r\n\r\n)\r\n, valid_admit_source as(\r\n select \r\n 'admit_source_code invalid' as test_name \r\n , 'medical_claim' as source_table\r\n , 'institutional' as claim_type\r\n , 'invalid_values' as test_category\r\n , 'claim_id' as grain\r\n , claim_id\r\n , count(med.admit_source_code) as filled_row_count\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\n from {{ ref('medical_claim') }} med\r\n left join {{ ref('terminology__admit_source') }} adsource\r\n on med.admit_source_code = adsource.admit_source_code\r\n where med.claim_type = 'institutional'\r\n and adsource.admit_source_code is null\r\n and med.admit_source_code is not null\r\n group by\r\n claim_id\r\n)\r\n, valid_admit_type as(\r\n select \r\n 'admit_type_code invalid' as test_name \r\n , 'medical_claim' as source_table\r\n , 'institutional' as claim_type\r\n , 'invalid_values' as test_category\r\n , 'claim_id' as grain\r\n , claim_id\r\n , count(med.admit_type_code) as filled_row_count\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\n from {{ ref('medical_claim') }} med\r\n left join {{ ref('terminology__admit_type') }} adtype\r\n on med.admit_type_code = adtype.admit_type_code\r\n where med.claim_type = 'institutional'\r\n and adtype.admit_type_code is null\r\n and med.admit_type_code is not null\r\n group by\r\n claim_id\r\n)\r\n, valid_ms_drg as(\r\n select \r\n 'ms_drg_code invalid' as test_name \r\n , 'medical_claim' as source_table\r\n , 'institutional' as claim_type\r\n , 'invalid_values' as test_category\r\n , 'claim_id' as grain\r\n , claim_id\r\n , count(med.ms_drg_code) as filled_row_count\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\n from {{ ref('medical_claim') }} med\r\n left join {{ ref('terminology__ms_drg') }} msdrg\r\n on med.ms_drg_code = msdrg.ms_drg_code\r\n where med.claim_type = 'institutional'\r\n and msdrg.ms_drg_code is null\r\n and med.ms_drg_code is not null\r\n group by\r\n claim_id\r\n)\r\n, valid_apr_drg as(\r\n select \r\n 'apr_drg_code invalid' as test_name \r\n , 'medical_claim' as source_table\r\n , 'institutional' as claim_type\r\n , 'invalid_values' as test_category\r\n , 'claim_id' as grain\r\n , claim_id\r\n , count(med.apr_drg_code) as filled_row_count\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\n from {{ ref('medical_claim') }} med\r\n left join {{ ref('terminology__apr_drg') }} aprdrg\r\n on med.apr_drg_code = aprdrg.apr_drg_code\r\n and severity = '1'\r\n where med.claim_type = 'institutional'\r\n and aprdrg.apr_drg_code is null\r\n and med.apr_drg_code is not null\r\n group by\r\n claim_id\r\n)\r\n, valid_present_on_admission as(\r\n select \r\n 'diagnosis_poa_1 invalid' as test_name \r\n , 'medical_claim' as source_table\r\n , 'institutional' as claim_type\r\n , 'invalid_values' as test_category\r\n , 'claim_id' as grain\r\n , claim_id\r\n , count(med.diagnosis_poa_1) as filled_row_count\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\n from {{ ref('medical_claim') }} med\r\n left join {{ ref('terminology__present_on_admission') }} poa\r\n on med.diagnosis_poa_1 = poa.present_on_admit_code\r\n where med.claim_type = 'institutional'\r\n and poa.present_on_admit_code is null\r\n and med.diagnosis_poa_1 is not null\r\n group by\r\n claim_id\r\n)\r\n, valid_procedure_code_type as(\r\n select \r\n 'procedure_code_type invalid' as test_name \r\n , 'medical_claim' as source_table\r\n , 'institutional' as claim_type\r\n , 'invalid_values' as test_category\r\n , 'claim_id' as grain\r\n , claim_id\r\n , count(med.procedure_code_type) as filled_row_count\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\n from {{ ref('medical_claim') }} med\r\n left join {{ ref('terminology__code_type') }} codetype\r\n on med.procedure_code_type = codetype.code_type\r\n where claim_type = 'institutional'\r\n and codetype.code_type is null\r\n and med.procedure_code_type is not null\r\n group by\r\n claim_id\r\n)\r\n, valid_place_of_service as(\r\n select \r\n 'place_of_service_code invalid' as test_name \r\n , 'medical_claim' as source_table\r\n , 'professional' as claim_type\r\n , 'invalid_values' as test_category\r\n , 'claim_id' as grain\r\n , claim_id\r\n , count(med.place_of_service_code) as filled_row_count\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\n from {{ ref('medical_claim') }} med\r\n left join {{ ref('terminology__place_of_service') }} pos\r\n on med.place_of_service_code = pos.place_of_service_code\r\n where claim_type = 'professional'\r\n and pos.place_of_service_code is null\r\n and med.place_of_service_code is not null\r\n group by\r\n claim_id\r\n)\r\n, valid_diagnosis_code_type as(\r\n select \r\n 'diagnosis_code_type invalid' as test_name \r\n , 'medical_claim' as source_table\r\n , 'all' as claim_type\r\n , 'invalid_values' as test_category\r\n , 'claim_id' as grain\r\n , claim_id\r\n , count(med.diagnosis_code_type) as filled_row_count\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\n from {{ ref('medical_claim') }} med\r\n left join {{ ref('terminology__code_type') }} codetype\r\n on med.diagnosis_code_type = codetype.code_type\r\n where codetype.code_type is null\r\n and med.diagnosis_code_type is not null\r\n group by\r\n claim_id\r\n)\r\n\r\n, valid_diagnosis_code as(\r\n select \r\n 'diagnosis_code_1 invalid' as test_name \r\n , 'medical_claim' as source_table\r\n , 'all' as claim_type\r\n , 'invalid_values' as test_category\r\n , 'claim_id' as grain\r\n , claim_id\r\n , count(med.diagnosis_code_1) as filled_row_count\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\n from {{ ref('medical_claim') }} med\r\n left join {{ ref('terminology__icd_10_cm') }} icd\r\n on med.diagnosis_code_1 = icd.icd_10_cm\r\n where diagnosis_code_type = 'icd-10-cm'\r\n and icd.icd_10_cm is null\r\n and med.diagnosis_code_1 is not null\r\n group by\r\n claim_id\r\n\r\n)\r\n\r\n, valid_claim_type as(\r\n select \r\n 'claim_type invalid' as test_name \r\n , 'medical_claim' as source_table\r\n , 'all' as claim_type\r\n , 'claim_type' as test_category\r\n , 'claim_id' as grain\r\n , claim_id\r\n , count(med.claim_type) as filled_row_count\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\n from {{ ref('medical_claim') }} med\r\n left join {{ ref('terminology__claim_type') }} claimtype\r\n on med.claim_type = claimtype.claim_type\r\n where claimtype.claim_type is null\r\n and med.claim_type is not null\r\n group by\r\n claim_id\r\n)\r\nselect * from valid_bill_type\r\nunion all \r\nselect * from valid_revenue_center\r\nunion all \r\nselect * from valid_discharge_disposition\r\nunion all \r\nselect * from valid_admit_source\r\nunion all \r\nselect * from valid_admit_type\r\nunion all \r\nselect * from valid_ms_drg\r\nunion all \r\nselect * from valid_apr_drg\r\nunion all \r\nselect * from valid_present_on_admission\r\nunion all \r\nselect * from valid_diagnosis_code_type\r\nunion all \r\nselect * from valid_procedure_code_type\r\nunion all \r\nselect * from valid_diagnosis_code\r\nunion all \r\nselect * from valid_claim_type\r\nunion all \r\nselect * from valid_place_of_service", "language": "sql", "refs": [["medical_claim"], ["terminology__bill_type"], ["medical_claim"], ["terminology__revenue_center"], ["medical_claim"], ["terminology__discharge_disposition"], ["medical_claim"], ["terminology__admit_source"], ["medical_claim"], ["terminology__admit_type"], ["medical_claim"], ["terminology__ms_drg"], ["medical_claim"], ["terminology__apr_drg"], ["medical_claim"], ["terminology__present_on_admission"], ["medical_claim"], ["terminology__code_type"], ["medical_claim"], ["terminology__place_of_service"], ["medical_claim"], ["terminology__code_type"], ["medical_claim"], ["terminology__icd_10_cm"], ["medical_claim"], ["terminology__claim_type"]], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.input_layer.medical_claim", "seed.the_tuva_project.terminology__bill_type", "model.input_layer.medical_claim", "seed.the_tuva_project.terminology__revenue_center", "model.input_layer.medical_claim", "seed.the_tuva_project.terminology__discharge_disposition", "model.input_layer.medical_claim", "seed.the_tuva_project.terminology__admit_source", "model.input_layer.medical_claim", "seed.the_tuva_project.terminology__admit_type", "model.input_layer.medical_claim", "seed.the_tuva_project.terminology__ms_drg", "model.input_layer.medical_claim", "seed.the_tuva_project.terminology__apr_drg", "model.input_layer.medical_claim", "seed.the_tuva_project.terminology__present_on_admission", "model.input_layer.medical_claim", "seed.the_tuva_project.terminology__code_type", "model.input_layer.medical_claim", "seed.the_tuva_project.terminology__place_of_service", "model.input_layer.medical_claim", "seed.the_tuva_project.terminology__code_type", "model.input_layer.medical_claim", "seed.the_tuva_project.terminology__icd_10_cm", "model.input_layer.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-12-13 23:31:59.089856+00:00' as tuva_last_run\n from tuva.input_layer.medical_claim med\n left join devforrest.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-12-13 23:31:59.089856+00:00' as tuva_last_run\n from tuva.input_layer.medical_claim med\n left join devforrest.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-12-13 23:31:59.089856+00:00' as tuva_last_run\n from tuva.input_layer.medical_claim med\n left join devforrest.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-12-13 23:31:59.089856+00:00' as tuva_last_run\n from tuva.input_layer.medical_claim med\n left join devforrest.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-12-13 23:31:59.089856+00:00' as tuva_last_run\n from tuva.input_layer.medical_claim med\n left join devforrest.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-12-13 23:31:59.089856+00:00' as tuva_last_run\n from tuva.input_layer.medical_claim med\n left join devforrest.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-12-13 23:31:59.089856+00:00' as tuva_last_run\n from tuva.input_layer.medical_claim med\n left join devforrest.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-12-13 23:31:59.089856+00:00' as tuva_last_run\n from tuva.input_layer.medical_claim med\n left join devforrest.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-12-13 23:31:59.089856+00:00' as tuva_last_run\n from tuva.input_layer.medical_claim med\n left join devforrest.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-12-13 23:31:59.089856+00:00' as tuva_last_run\n from tuva.input_layer.medical_claim med\n left join devforrest.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-12-13 23:31:59.089856+00:00' as tuva_last_run\n from tuva.input_layer.medical_claim med\n left join devforrest.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-12-13 23:31:59.089856+00:00' as tuva_last_run\n from tuva.input_layer.medical_claim med\n left join devforrest.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-12-13 23:31:59.089856+00:00' as tuva_last_run\n from tuva.input_layer.medical_claim med\n left join devforrest.terminology.claim_type claimtype\n on med.claim_type = claimtype.claim_type\n where claimtype.claim_type is null\n and med.claim_type is not null\n group by\n claim_id\n)\nselect * from valid_bill_type\nunion all \nselect * from valid_revenue_center\nunion all \nselect * from valid_discharge_disposition\nunion all \nselect * from valid_admit_source\nunion all \nselect * from valid_admit_type\nunion all \nselect * from valid_ms_drg\nunion all \nselect * from valid_apr_drg\nunion all \nselect * from valid_present_on_admission\nunion all \nselect * from valid_diagnosis_code_type\nunion all \nselect * from valid_procedure_code_type\nunion all \nselect * from valid_diagnosis_code\nunion all \nselect * from valid_claim_type\nunion all \nselect * from valid_place_of_service", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.data_profiling__medical_claim_plausibility": {"database": "devforrest", "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", "claims_preprocessing"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#141161"}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["data_profiling", "claims_preprocessing"], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#141161"}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_medical_claim_plausibility", "tags": ["data_profiling", "claims_preprocessing"], "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#141161"}}, "created_at": 1702481696.4020946, "relation_name": "devforrest.claims_preprocessing._int_medical_claim_plausibility", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r\n )\r\n}}\r\n\r\nwith claim_start_date_after_claim_end_date as (\r\n select\r\n 'claim start date after claim end date' as test_name\r\n , 'medical_claim' as source_table\r\n , 'all' as claim_type\r\n , 'plausibility' as test_category\r\n , 'claim_id' as grain\r\n , claim_id\r\n , count(*) as counts\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\n from {{ ref('medical_claim') }}\r\n where claim_start_date > claim_end_date\r\n group by\r\n claim_id\r\n)\r\n, admission_date_after_discharge_date as (\r\n select\r\n 'admission date after discharge date' as test_name\r\n , 'medical_claim' as source_table\r\n , 'institutional' as claim_type\r\n , 'plausibility' as test_category\r\n , 'claim_id' as grain\r\n , claim_id\r\n , count(*) as counts\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\n from {{ ref('medical_claim') }}\r\n where claim_type = 'institutional'\r\n and admission_date > discharge_date\r\n group by\r\n claim_id\r\n)\r\n\r\nselect * from claim_start_date_after_claim_end_date\r\nunion all\r\nselect * from admission_date_after_discharge_date", "language": "sql", "refs": [["medical_claim"], ["medical_claim"]], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.input_layer.medical_claim", "model.input_layer.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-12-13 23:31:59.089856+00:00' as tuva_last_run\n from tuva.input_layer.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-12-13 23:31:59.089856+00:00' as tuva_last_run\n from tuva.input_layer.medical_claim\n where claim_type = 'institutional'\n and admission_date > discharge_date\n group by\n claim_id\n)\n\nselect * from claim_start_date_after_claim_end_date\nunion all\nselect * from admission_date_after_discharge_date", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.data_profiling__medical_claim_prof_missing_values": {"database": "devforrest", "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", "claims_preprocessing"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#141161"}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["data_profiling", "claims_preprocessing"], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#141161"}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_medical_claim_prof_missing_values", "tags": ["data_profiling", "claims_preprocessing"], "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#141161"}}, "created_at": 1702481696.39794, "relation_name": "devforrest.claims_preprocessing._int_medical_claim_prof_missing_values", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r\n )\r\n}}\r\n\r\n{% set professional_missing_column_list = [\r\n 'claim_id'\r\n , 'claim_line_number'\r\n , 'patient_id'\r\n , 'member_id'\r\n , 'claim_start_date'\r\n , 'claim_end_date'\r\n , 'place_of_service_code'\r\n , 'hcpcs_code'\r\n , 'rendering_npi'\r\n , 'billing_npi'\r\n , 'paid_date'\r\n , 'paid_amount'\r\n , 'diagnosis_code_type'\r\n , 'diagnosis_code_1'\r\n , 'data_source'\r\n] -%}\r\n\r\nwith professional_missing as(\r\n\r\n {{ medical_claim_missing_column_check(builtins.ref('medical_claim'), professional_missing_column_list, 'professional') }}\r\n\r\n)\r\n\r\nselect\r\n 'medical_claim' as source_table\r\n , 'professional' as claim_type\r\n , 'claim_id' as grain\r\n , claim_id \r\n , 'missing_values' as test_category\r\n , column_checked||' missing' as test_name\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom professional_missing\r\ngroup by\r\n claim_id\r\n , column_checked||' missing'", "language": "sql", "refs": [["medical_claim"]], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.the_tuva_project.medical_claim_missing_column_check"], "nodes": ["model.input_layer.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.input_layer.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.input_layer.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.input_layer.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.input_layer.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.input_layer.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.input_layer.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.input_layer.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.input_layer.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.input_layer.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.input_layer.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.input_layer.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.input_layer.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.input_layer.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.input_layer.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.input_layer.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-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom professional_missing\ngroup by\n claim_id\n , column_checked||' missing'", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.data_profiling__pharmacy_claim_duplicates": {"database": "devforrest", "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", "claims_preprocessing"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#141161"}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["data_profiling", "claims_preprocessing"], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#141161"}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_pharmacy_claim_duplicates", "tags": ["data_profiling", "claims_preprocessing"], "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#141161"}}, "created_at": 1702481696.433436, "relation_name": "devforrest.claims_preprocessing._int_pharmacy_claim_duplicates", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r\n )\r\n}}\r\n\r\nselect distinct\r\n 'pharmacy_claim' as source_table\r\n , 'all' as claim_type\r\n , 'claim_id' as grain\r\n , claim_id \r\n , 'duplicate_values' as test_category\r\n , 'duplicate pharmacy claims' as test_name\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('pharmacy_claim') }} \r\ngroup by\r\n claim_id\r\n , claim_line_number\r\nhaving count(*) > 1", "language": "sql", "refs": [["pharmacy_claim"]], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.input_layer.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-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom tuva.input_layer.pharmacy_claim \ngroup by\n claim_id\n , claim_line_number\nhaving count(*) > 1", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.data_profiling__pharmacy_claim_missing_values": {"database": "devforrest", "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", "claims_preprocessing"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#141161"}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["data_profiling", "claims_preprocessing"], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#141161"}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_pharmacy_claim_missing_values", "tags": ["data_profiling", "claims_preprocessing"], "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#141161"}}, "created_at": 1702481696.433436, "relation_name": "devforrest.claims_preprocessing._int_pharmacy_claim_missing_values", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r\n )\r\n}}\r\n\r\n{% set pharmacy_claim_missing_column_list = [\r\n 'claim_id'\r\n , 'claim_line_number'\r\n , 'patient_id'\r\n , 'member_id'\r\n , 'prescribing_provider_npi'\r\n , 'dispensing_provider_npi'\r\n , 'dispensing_date'\r\n , 'ndc_code'\r\n , 'quantity'\r\n , 'days_supply'\r\n , 'refills'\r\n , 'paid_date'\r\n , 'paid_amount'\r\n , 'allowed_amount'\r\n , 'data_source'\r\n] -%}\r\n\r\n\r\n\r\nwith eligibility_missing as(\r\n\r\n {{ pharmacy_claim_missing_column_check(builtins.ref('pharmacy_claim'), pharmacy_claim_missing_column_list) }}\r\n\r\n)\r\n\r\n\r\nselect\r\n 'pharmacy_claim' as source_table\r\n , 'all' as claim_type\r\n , 'claim_id' as grain\r\n , claim_id \r\n , 'missing_values' as test_category\r\n , column_checked||' missing' as test_name\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom eligibility_missing\r\ngroup by\r\n claim_id\r\n , column_checked||' missing'", "language": "sql", "refs": [["pharmacy_claim"]], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.the_tuva_project.pharmacy_claim_missing_column_check"], "nodes": ["model.input_layer.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.input_layer.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.input_layer.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.input_layer.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.input_layer.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.input_layer.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.input_layer.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.input_layer.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.input_layer.pharmacy_claim\n where ndc_code is null\n union all\n select\n claim_id\n , 'quantity' as column_checked\n from tuva.input_layer.pharmacy_claim\n where quantity is null\n union all\n select\n claim_id\n , 'days_supply' as column_checked\n from tuva.input_layer.pharmacy_claim\n where days_supply is null\n union all\n select\n claim_id\n , 'refills' as column_checked\n from tuva.input_layer.pharmacy_claim\n where refills is null\n union all\n select\n claim_id\n , 'paid_date' as column_checked\n from tuva.input_layer.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.input_layer.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.input_layer.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.input_layer.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-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom eligibility_missing\ngroup by\n claim_id\n , column_checked||' missing'", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.data_profiling__professional_header_failures": {"database": "devforrest", "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", "claims_preprocessing"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#141161"}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["data_profiling", "claims_preprocessing"], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#141161"}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_professional_header_failures", "tags": ["data_profiling", "claims_preprocessing"], "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#141161"}}, "created_at": 1702481696.3809361, "relation_name": "devforrest.claims_preprocessing._int_professional_header_failures", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r\n )\r\n}}\r\n\r\nwith stage as(\r\n select distinct\r\n claim_id\r\n , claim_type\r\n , patient_id\r\n , member_id\r\n , claim_start_date\r\n , claim_end_date\r\n , paid_date\r\n , diagnosis_code_type\r\n , diagnosis_code_1\r\n , diagnosis_code_2\r\n , diagnosis_code_3\r\n , diagnosis_code_4\r\n , diagnosis_code_5\r\n , diagnosis_code_6\r\n , diagnosis_code_7\r\n , diagnosis_code_8\r\n , diagnosis_code_9\r\n , diagnosis_code_10\r\n , diagnosis_code_11\r\n , diagnosis_code_12\r\n , diagnosis_code_13\r\n , diagnosis_code_14\r\n , diagnosis_code_15\r\n , diagnosis_code_16\r\n , diagnosis_code_17\r\n , diagnosis_code_18\r\n , diagnosis_code_19\r\n , diagnosis_code_20\r\n , diagnosis_code_21\r\n , diagnosis_code_22\r\n , diagnosis_code_23\r\n , diagnosis_code_24\r\n , diagnosis_code_25\r\n , data_source\r\n from {{ ref('medical_claim') }} med\r\n where claim_type = 'professional'\r\n ) \r\n, claims_with_duplicates as (\r\nselect \r\n claim_id\r\n , 1 as invalid_header\r\nfrom stage\r\ngroup by claim_id\r\nhaving count(*) > 1\r\n)\r\n\r\nselect med.*, '{{ var('tuva_last_run')}}' as tuva_last_run from claims_with_duplicates dupe\r\ninner join {{ ref('medical_claim') }} med\r\n on dupe.claim_id = med.claim_id", "language": "sql", "refs": [["medical_claim"], ["medical_claim"]], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.input_layer.medical_claim", "model.input_layer.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.input_layer.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-12-13 23:31:59.089856+00:00' as tuva_last_run from claims_with_duplicates dupe\ninner join tuva.input_layer.medical_claim med\n on dupe.claim_id = med.claim_id", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.data_profiling__professional_header_fail_details": {"database": "devforrest", "schema": "claims_preprocessing", "name": "data_profiling__professional_header_fail_details", "resource_type": "model", "package_name": "the_tuva_project", "path": "claims_preprocessing\\data_profiling\\intermediate\\data_profiling__professional_header_fail_details.sql", "original_file_path": "models\\claims_preprocessing\\data_profiling\\intermediate\\data_profiling__professional_header_fail_details.sql", "unique_id": "model.the_tuva_project.data_profiling__professional_header_fail_details", "fqn": ["the_tuva_project", "claims_preprocessing", "data_profiling", "intermediate", "data_profiling__professional_header_fail_details"], "alias": "_int_professional_header_fail_details", "checksum": {"name": "sha256", "checksum": "dc413eb5f882b83d9d50e0d454924477c2f41ee13e2232246d6c7905acbb5a8f"}, "config": {"enabled": true, "alias": "_int_professional_header_fail_details", "schema": "claims_preprocessing", "database": null, "tags": ["data_profiling", "claims_preprocessing"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#141161"}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["data_profiling", "claims_preprocessing"], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#141161"}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_professional_header_fail_details", "tags": ["data_profiling", "claims_preprocessing"], "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#141161"}}, "created_at": 1702481696.387894, "relation_name": "devforrest.claims_preprocessing._int_professional_header_fail_details", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r\n )\r\n}}\r\n\r\n{% set professional_header_column_list = [\r\n 'claim_id'\r\n , 'claim_type'\r\n , 'patient_id'\r\n , 'member_id'\r\n , 'claim_start_date'\r\n , 'claim_end_date'\r\n , 'place_of_service_code'\r\n , 'billing_npi'\r\n , 'paid_date'\r\n , 'diagnosis_code_type'\r\n , 'diagnosis_code_1'\r\n , 'diagnosis_code_2'\r\n , 'diagnosis_code_3'\r\n , 'diagnosis_code_4'\r\n , 'diagnosis_code_5'\r\n , 'diagnosis_code_6'\r\n , 'diagnosis_code_7'\r\n , 'diagnosis_code_8'\r\n , 'diagnosis_code_9'\r\n , 'diagnosis_code_10'\r\n , 'diagnosis_code_11'\r\n , 'diagnosis_code_12'\r\n , 'diagnosis_code_13'\r\n , 'diagnosis_code_14'\r\n , 'diagnosis_code_15'\r\n , 'diagnosis_code_16'\r\n , 'diagnosis_code_17'\r\n , 'diagnosis_code_18'\r\n , 'diagnosis_code_19'\r\n , 'diagnosis_code_20'\r\n , 'diagnosis_code_21'\r\n , 'diagnosis_code_22'\r\n , 'diagnosis_code_23'\r\n , 'diagnosis_code_24'\r\n , 'diagnosis_code_25'\r\n , 'data_source'\r\n] -%}\r\n\r\nwith professional_header_duplicates as(\r\n\r\n {{ header_duplicate_check(builtins.ref('data_profiling__professional_header_failures'), professional_header_column_list, 'professional') }}\r\n\r\n)\r\n\r\nselect\r\n 'medical_claim' as source_table\r\n , 'professional' as claim_type\r\n , 'claim_id' as grain\r\n , claim_id\r\n , 'header' as test_category\r\n , column_checked||' duplicated' as test_name\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom professional_header_duplicates\r\ngroup by \r\n claim_id\r\n , column_checked||' duplicated'", "language": "sql", "refs": [["data_profiling__professional_header_failures"]], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.the_tuva_project.header_duplicate_check"], "nodes": ["model.the_tuva_project.data_profiling__professional_header_failures"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\data_profiling\\intermediate\\data_profiling__professional_header_fail_details.sql", "compiled": true, "compiled_code": "\n\nwith professional_header_duplicates as(\n\n \n select\n claim_id\n , 'claim_id' as column_checked\n , count(distinct claim_id) as duplicate_count\n from devforrest.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 devforrest.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 devforrest.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 devforrest.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 devforrest.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 devforrest.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 devforrest.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 devforrest.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 devforrest.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 devforrest.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 devforrest.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 devforrest.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 devforrest.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 devforrest.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 devforrest.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 devforrest.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 devforrest.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 devforrest.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 devforrest.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 devforrest.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 devforrest.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 devforrest.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 devforrest.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 devforrest.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 devforrest.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 devforrest.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 devforrest.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 devforrest.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 devforrest.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 devforrest.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 devforrest.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 devforrest.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 devforrest.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 devforrest.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 devforrest.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 devforrest.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-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom professional_header_duplicates\ngroup by \n claim_id\n , column_checked||' duplicated'", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.data_profiling__test_detail_stage_eligibility": {"database": "devforrest", "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", "claims_preprocessing"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#141161"}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["data_profiling", "claims_preprocessing"], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#141161"}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_test_detail_stage_eligibility", "tags": ["data_profiling", "claims_preprocessing"], "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#141161"}}, "created_at": 1702481696.433436, "relation_name": "devforrest.claims_preprocessing._int_test_detail_stage_eligibility", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r\n )\r\n}}\r\n\r\n\r\nselect distinct\r\n source_table\r\n , claim_type\r\n , grain\r\n , patient_id\r\n , test_category\r\n , test_name \r\n from {{ ref('data_profiling__eligibility_duplicates') }}\r\n union all\r\n select distinct\r\n source_table\r\n , claim_type\r\n , grain\r\n , patient_id\r\n , test_category\r\n , test_name \r\n from {{ ref('data_profiling__eligibility_missing_values') }}\r\n union all\r\n select distinct\r\n source_table\r\n , claim_type\r\n , grain\r\n , patient_id\r\n , test_category\r\n , test_name \r\n from {{ ref('data_profiling__eligibility_invalid_values') }}\r\n union all\r\n select distinct\r\n source_table\r\n , claim_type\r\n , grain\r\n , patient_id\r\n , test_category\r\n , test_name \r\n from {{ ref('data_profiling__eligibility_plausibility') }}", "language": "sql", "refs": [["data_profiling__eligibility_duplicates"], ["data_profiling__eligibility_missing_values"], ["data_profiling__eligibility_invalid_values"], ["data_profiling__eligibility_plausibility"]], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.data_profiling__eligibility_duplicates", "model.the_tuva_project.data_profiling__eligibility_missing_values", "model.the_tuva_project.data_profiling__eligibility_invalid_values", "model.the_tuva_project.data_profiling__eligibility_plausibility"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\data_profiling\\intermediate\\data_profiling__test_detail_stage_eligibility.sql", "compiled": true, "compiled_code": "\n\n\nselect distinct\n source_table\n , claim_type\n , grain\n , patient_id\n , test_category\n , test_name \n from devforrest.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 devforrest.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 devforrest.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 devforrest.claims_preprocessing._int_eligibility_plausibility", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.data_profiling__test_detail_stage_medical_claim": {"database": "devforrest", "schema": "claims_preprocessing", "name": "data_profiling__test_detail_stage_medical_claim", "resource_type": "model", "package_name": "the_tuva_project", "path": "claims_preprocessing\\data_profiling\\intermediate\\data_profiling__test_detail_stage_medical_claim.sql", "original_file_path": "models\\claims_preprocessing\\data_profiling\\intermediate\\data_profiling__test_detail_stage_medical_claim.sql", "unique_id": "model.the_tuva_project.data_profiling__test_detail_stage_medical_claim", "fqn": ["the_tuva_project", "claims_preprocessing", "data_profiling", "intermediate", "data_profiling__test_detail_stage_medical_claim"], "alias": "_int_test_detail_stage_medical_claim", "checksum": {"name": "sha256", "checksum": "be30aefba51ac1c3e53870f9210c97a3996ecc8c98247451522ab9d97322e7b3"}, "config": {"enabled": true, "alias": "_int_test_detail_stage_medical_claim", "schema": "claims_preprocessing", "database": null, "tags": ["data_profiling", "claims_preprocessing"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#141161"}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["data_profiling", "claims_preprocessing"], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#141161"}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_test_detail_stage_medical_claim", "tags": ["data_profiling", "claims_preprocessing"], "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#141161"}}, "created_at": 1702481696.4020946, "relation_name": "devforrest.claims_preprocessing._int_test_detail_stage_medical_claim", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r\n )\r\n}}\r\n \r\nselect distinct\r\n source_table\r\n , claim_type\r\n , grain\r\n , claim_id\r\n , test_category\r\n , test_name \r\nfrom {{ ref('data_profiling__institutional_header_fail_details') }}\r\nunion all\r\nselect distinct\r\n source_table\r\n , claim_type\r\n , grain\r\n , claim_id\r\n , test_category\r\n , test_name \r\nfrom {{ ref('data_profiling__professional_header_fail_details') }}\r\nunion all\r\nselect distinct\r\n source_table\r\n , claim_type\r\n , grain\r\n , claim_id\r\n , test_category\r\n , test_name \r\nfrom {{ ref('data_profiling__medical_claim_inst_missing_values') }}\r\nunion all\r\nselect distinct\r\n source_table\r\n , claim_type\r\n , grain\r\n , claim_id\r\n , test_category\r\n , test_name \r\nfrom {{ ref('data_profiling__medical_claim_prof_missing_values') }}\r\nunion all\r\nselect distinct\r\n source_table\r\n , claim_type\r\n , grain\r\n , claim_id\r\n , test_category\r\n , test_name \r\nfrom {{ ref('data_profiling__medical_claim_invalid_values') }}\r\nunion all\r\nselect distinct\r\n source_table\r\n , claim_type\r\n , grain\r\n , claim_id\r\n , test_category\r\n , test_name \r\nfrom {{ ref('data_profiling__claim_type_unmapped') }}\r\nunion all\r\nselect distinct\r\n source_table\r\n , claim_type\r\n , grain\r\n , claim_id\r\n , test_category\r\n , test_name \r\nfrom {{ ref('data_profiling__claim_type_mapping_failures') }}\r\nunion all\r\nselect distinct\r\n source_table\r\n , claim_type\r\n , grain\r\n , claim_id\r\n , test_category\r\n , test_name \r\nfrom {{ ref('data_profiling__medical_claim_duplicates') }}\r\nunion all\r\nselect distinct\r\n source_table\r\n , claim_type\r\n , grain\r\n , claim_id\r\n , test_category\r\n , test_name \r\nfrom {{ ref('data_profiling__medical_claim_plausibility') }}", "language": "sql", "refs": [["data_profiling__institutional_header_fail_details"], ["data_profiling__professional_header_fail_details"], ["data_profiling__medical_claim_inst_missing_values"], ["data_profiling__medical_claim_prof_missing_values"], ["data_profiling__medical_claim_invalid_values"], ["data_profiling__claim_type_unmapped"], ["data_profiling__claim_type_mapping_failures"], ["data_profiling__medical_claim_duplicates"], ["data_profiling__medical_claim_plausibility"]], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.data_profiling__institutional_header_fail_details", "model.the_tuva_project.data_profiling__professional_header_fail_details", "model.the_tuva_project.data_profiling__medical_claim_inst_missing_values", "model.the_tuva_project.data_profiling__medical_claim_prof_missing_values", "model.the_tuva_project.data_profiling__medical_claim_invalid_values", "model.the_tuva_project.data_profiling__claim_type_unmapped", "model.the_tuva_project.data_profiling__claim_type_mapping_failures", "model.the_tuva_project.data_profiling__medical_claim_duplicates", "model.the_tuva_project.data_profiling__medical_claim_plausibility"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\data_profiling\\intermediate\\data_profiling__test_detail_stage_medical_claim.sql", "compiled": true, "compiled_code": "\n \nselect distinct\n source_table\n , claim_type\n , grain\n , claim_id\n , test_category\n , test_name \nfrom devforrest.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 devforrest.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 devforrest.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 devforrest.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 devforrest.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 devforrest.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 devforrest.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 devforrest.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 devforrest.claims_preprocessing._int_medical_claim_plausibility", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.data_profiling__test_detail_stage_pharmacy_claim": {"database": "devforrest", "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", "claims_preprocessing"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#141161"}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["data_profiling", "claims_preprocessing"], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#141161"}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_test_detail_stage_pharmacy_claim", "tags": ["data_profiling", "claims_preprocessing"], "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#141161"}}, "created_at": 1702481696.4537508, "relation_name": "devforrest.claims_preprocessing._int_test_detail_stage_pharmacy_claim", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r\n )\r\n}}\r\n\r\nselect distinct\r\n source_table\r\n , claim_type\r\n , grain\r\n , claim_id\r\n , test_category\r\n , test_name \r\nfrom {{ ref('data_profiling__pharmacy_claim_duplicates') }}\r\nunion all\r\nselect distinct\r\n source_table\r\n , claim_type\r\n , grain\r\n , claim_id\r\n , test_category\r\n , test_name \r\nfrom {{ ref('data_profiling__pharmacy_claim_missing_values') }}", "language": "sql", "refs": [["data_profiling__pharmacy_claim_duplicates"], ["data_profiling__pharmacy_claim_missing_values"]], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.data_profiling__pharmacy_claim_duplicates", "model.the_tuva_project.data_profiling__pharmacy_claim_missing_values"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\data_profiling\\intermediate\\data_profiling__test_detail_stage_pharmacy_claim.sql", "compiled": true, "compiled_code": "\n\nselect distinct\n source_table\n , claim_type\n , grain\n , claim_id\n , test_category\n , test_name \nfrom devforrest.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 devforrest.claims_preprocessing._int_pharmacy_claim_missing_values", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.data_profiling__test_result_stage_eligibility": {"database": "devforrest", "schema": "claims_preprocessing", "name": "data_profiling__test_result_stage_eligibility", "resource_type": "model", "package_name": "the_tuva_project", "path": "claims_preprocessing\\data_profiling\\intermediate\\data_profiling__test_result_stage_eligibility.sql", "original_file_path": "models\\claims_preprocessing\\data_profiling\\intermediate\\data_profiling__test_result_stage_eligibility.sql", "unique_id": "model.the_tuva_project.data_profiling__test_result_stage_eligibility", "fqn": ["the_tuva_project", "claims_preprocessing", "data_profiling", "intermediate", "data_profiling__test_result_stage_eligibility"], "alias": "_int_test_result_stage_eligibility", "checksum": {"name": "sha256", "checksum": "d858540b5b651733e373f80b562f2df639042c582bd632f3381a3c8c87521f11"}, "config": {"enabled": true, "alias": "_int_test_result_stage_eligibility", "schema": "claims_preprocessing", "database": null, "tags": ["data_profiling", "claims_preprocessing"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#141161"}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["data_profiling", "claims_preprocessing"], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#141161"}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_test_result_stage_eligibility", "tags": ["data_profiling", "claims_preprocessing"], "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#141161"}}, "created_at": 1702481696.417806, "relation_name": "devforrest.claims_preprocessing._int_test_result_stage_eligibility", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r\n )\r\n}}\r\n\r\nselect\r\n source_table\r\n , grain\r\n , test_category\r\n , test_name\r\n , claim_type\r\n , count(distinct foreign_key) as failures\r\n , denom.denominator\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('data_profiling__test_detail') }} det\r\ninner join {{ ref('data_profiling__eligibility_denominators') }} denom\r\n on det.claim_type = denom.test_denominator_name\r\nwhere source_table = 'eligibility'\r\nand test_name not like '%invalid'\r\ngroup by\r\n source_table\r\n , grain\r\n , test_category\r\n , test_name\r\n , claim_type\r\n , denom.denominator\r\n\r\nunion all\r\n\r\nselect\r\n source_table\r\n , grain\r\n , test_category\r\n , test_name\r\n , claim_type\r\n , count(distinct foreign_key) as failures\r\n , denom.denominator\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('data_profiling__test_detail') }} det\r\ninner join {{ ref('data_profiling__eligibility_denominators') }} denom\r\n on det.test_name = denom.test_denominator_name\r\nwhere source_table = 'eligibility'\r\nand test_name like '%invalid'\r\ngroup by\r\n source_table\r\n , grain\r\n , test_category\r\n , test_name\r\n , claim_type\r\n , denom.denominator", "language": "sql", "refs": [["data_profiling__test_detail"], ["data_profiling__eligibility_denominators"], ["data_profiling__test_detail"], ["data_profiling__eligibility_denominators"]], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.data_profiling__test_detail", "model.the_tuva_project.data_profiling__eligibility_denominators", "model.the_tuva_project.data_profiling__test_detail", "model.the_tuva_project.data_profiling__eligibility_denominators"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\data_profiling\\intermediate\\data_profiling__test_result_stage_eligibility.sql", "compiled": true, "compiled_code": "\n\nselect\n source_table\n , grain\n , test_category\n , test_name\n , claim_type\n , count(distinct foreign_key) as failures\n , denom.denominator\n , '2023-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom devforrest.claims_preprocessing.test_detail det\ninner join devforrest.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-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom devforrest.claims_preprocessing.test_detail det\ninner join devforrest.claims_preprocessing._int_eligibility_denominators denom\n on det.test_name = denom.test_denominator_name\nwhere source_table = 'eligibility'\nand test_name like '%invalid'\ngroup by\n source_table\n , grain\n , test_category\n , test_name\n , claim_type\n , denom.denominator", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.data_profiling__test_result_stage_medical_claim": {"database": "devforrest", "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", "claims_preprocessing"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#141161"}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["data_profiling", "claims_preprocessing"], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#141161"}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_test_result_stage_medical_claim", "tags": ["data_profiling", "claims_preprocessing"], "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#141161"}}, "created_at": 1702481696.4020946, "relation_name": "devforrest.claims_preprocessing._int_test_result_stage_medical_claim", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r\n )\r\n}}\r\n\r\nselect\r\n source_table\r\n , grain\r\n , test_category\r\n , test_name\r\n , claim_type\r\n , count(distinct foreign_key) as failures\r\n , denom.denominator\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('data_profiling__test_detail') }} det\r\ninner join {{ ref('data_profiling__medical_claim_denominators') }} denom\r\n on det.claim_type = denom.test_denominator_name\r\nwhere source_table = 'medical_claim'\r\nand test_name not like '%invalid'\r\ngroup by\r\n source_table\r\n , grain\r\n , test_category\r\n , test_name\r\n , claim_type\r\n , denom.denominator\r\n\r\nunion all\r\n\r\nselect\r\n source_table\r\n , grain\r\n , test_category\r\n , test_name\r\n , claim_type\r\n , count(distinct foreign_key) as failures\r\n , denom.denominator\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('data_profiling__test_detail') }} det\r\ninner join {{ ref('data_profiling__medical_claim_denominators') }} denom\r\n on det.test_name = denom.test_denominator_name\r\nwhere source_table = 'medical_claim'\r\nand test_name like '%invalid'\r\ngroup by\r\n source_table\r\n , grain\r\n , test_category\r\n , test_name\r\n , claim_type\r\n , denom.denominator", "language": "sql", "refs": [["data_profiling__test_detail"], ["data_profiling__medical_claim_denominators"], ["data_profiling__test_detail"], ["data_profiling__medical_claim_denominators"]], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.data_profiling__test_detail", "model.the_tuva_project.data_profiling__medical_claim_denominators", "model.the_tuva_project.data_profiling__test_detail", "model.the_tuva_project.data_profiling__medical_claim_denominators"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\data_profiling\\intermediate\\data_profiling__test_result_stage_medical_claim.sql", "compiled": true, "compiled_code": "\n\nselect\n source_table\n , grain\n , test_category\n , test_name\n , claim_type\n , count(distinct foreign_key) as failures\n , denom.denominator\n , '2023-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom devforrest.claims_preprocessing.test_detail det\ninner join devforrest.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-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom devforrest.claims_preprocessing.test_detail det\ninner join devforrest.claims_preprocessing._int_medical_claim_denominators denom\n on det.test_name = denom.test_denominator_name\nwhere source_table = 'medical_claim'\nand test_name like '%invalid'\ngroup by\n source_table\n , grain\n , test_category\n , test_name\n , claim_type\n , denom.denominator", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.data_profiling__test_result_stage_pharmacy_claim": {"database": "devforrest", "schema": "claims_preprocessing", "name": "data_profiling__test_result_stage_pharmacy_claim", "resource_type": "model", "package_name": "the_tuva_project", "path": "claims_preprocessing\\data_profiling\\intermediate\\data_profiling__test_result_stage_pharmacy_claim.sql", "original_file_path": "models\\claims_preprocessing\\data_profiling\\intermediate\\data_profiling__test_result_stage_pharmacy_claim.sql", "unique_id": "model.the_tuva_project.data_profiling__test_result_stage_pharmacy_claim", "fqn": ["the_tuva_project", "claims_preprocessing", "data_profiling", "intermediate", "data_profiling__test_result_stage_pharmacy_claim"], "alias": "_int_test_result_stage_pharmacy_claim", "checksum": {"name": "sha256", "checksum": "a8f1577d9baa5e5aca5be82b3ce4fb2cecc5146c888c4fe10fae578753bf0f4c"}, "config": {"enabled": true, "alias": "_int_test_result_stage_pharmacy_claim", "schema": "claims_preprocessing", "database": null, "tags": ["data_profiling", "claims_preprocessing"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#141161"}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["data_profiling", "claims_preprocessing"], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#141161"}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_test_result_stage_pharmacy_claim", "tags": ["data_profiling", "claims_preprocessing"], "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#141161"}}, "created_at": 1702481696.4496586, "relation_name": "devforrest.claims_preprocessing._int_test_result_stage_pharmacy_claim", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r\n )\r\n}}\r\n\r\nwith pharmacy_claim_denominator as(\r\n select \r\n cast('all' as {{ dbt.type_string() }} ) as claim_type\r\n , cast(count(distinct claim_id) as int) as count\r\n , cast('{{ var('tuva_last_run')}}' as {{ dbt.type_string() }} ) as tuva_last_run\r\n from {{ ref('pharmacy_claim') }}\r\n)\r\n\r\n, distinct_patient_per_category as(\r\n select\r\n source_table\r\n , grain\r\n , test_category\r\n , test_name\r\n , claim_type\r\n , count(distinct foreign_key) as failures\r\n from {{ ref('data_profiling__test_detail') }}\r\n where source_table = 'pharmacy_claim'\r\n group by\r\n source_table\r\n , grain\r\n , test_category\r\n , test_name\r\n , claim_type\r\n )\r\n\r\n select\r\n source_table\r\n , grain\r\n , claim.test_category\r\n , claim.test_name\r\n , claim.claim_type\r\n , claim.failures\r\n , elig.count as denominator\r\n , tuva_last_run\r\n from distinct_patient_per_category claim\r\n left join pharmacy_claim_denominator elig\r\n on claim.claim_type = elig.claim_type\r\n group by\r\n source_table\r\n , grain\r\n , claim.test_category\r\n , claim.test_name\r\n , claim.claim_type\r\n , claim.failures\r\n , elig.count\r\n , tuva_last_run", "language": "sql", "refs": [["pharmacy_claim"], ["data_profiling__test_detail"]], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.type_string"], "nodes": ["model.input_layer.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-12-13 23:31:59.089856+00:00' as TEXT ) as tuva_last_run\n from tuva.input_layer.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 devforrest.claims_preprocessing.test_detail\n where source_table = 'pharmacy_claim'\n group by\n source_table\n , grain\n , test_category\n , test_name\n , claim_type\n )\n\n select\n source_table\n , grain\n , claim.test_category\n , claim.test_name\n , claim.claim_type\n , claim.failures\n , elig.count as denominator\n , tuva_last_run\n from distinct_patient_per_category claim\n left join pharmacy_claim_denominator elig\n on claim.claim_type = elig.claim_type\n group by\n source_table\n , grain\n , claim.test_category\n , claim.test_name\n , claim.claim_type\n , claim.failures\n , elig.count\n , tuva_last_run", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.emergency_department__summary": {"database": "devforrest", "schema": "claims_preprocessing", "name": "emergency_department__summary", "resource_type": "model", "package_name": "the_tuva_project", "path": "claims_preprocessing\\emergency_department\\final\\emergency_department__summary.sql", "original_file_path": "models\\claims_preprocessing\\emergency_department\\final\\emergency_department__summary.sql", "unique_id": "model.the_tuva_project.emergency_department__summary", "fqn": ["the_tuva_project", "claims_preprocessing", "emergency_department", "final", "emergency_department__summary"], "alias": "emergency_department_summary", "checksum": {"name": "sha256", "checksum": "8ebd499a3126efc3cee2bf74ba9ef7d569bb29e63d71db01f89a18215705e715"}, "config": {"enabled": true, "alias": "emergency_department_summary", "schema": "claims_preprocessing", "database": null, "tags": ["emergency_department", "claims_preprocessing"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["emergency_department", "claims_preprocessing"], "description": "This table pulls together all the data needed to perform acute inpatient analytics into a single table.", "columns": {"encounter_id": {"name": "encounter_id", "description": "Unique identifier for the emergency_department encounter.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "encounter_start_date": {"name": "encounter_start_date", "description": "Date when the patient was admitted.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "encounter_end_date": {"name": "encounter_end_date", "description": "Date when the patient was discharged.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "patient_id": {"name": "patient_id", "description": "Unique identifier for each patient in the dataset.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "admit_age": {"name": "admit_age", "description": "The age of the patient as of their admission date.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "gender": {"name": "gender", "description": "The gender of the patient.", "meta": {"terminology": "/terminology/demographics/gender"}, "data_type": null, "quote": null, "tags": []}, "race": {"name": "race", "description": "The race of the patient.", "meta": {"terminology": "/terminology/demographics/race"}, "data_type": null, "quote": null, "tags": []}, "facility_npi": {"name": "facility_npi", "description": "The NPI for the facility where the encounter occurred.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "provider_first_name": {"name": "provider_first_name", "description": "The first name of the provider.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "provider_last_name": {"name": "provider_last_name", "description": "The last name of the provider.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "ms_drg_code": {"name": "ms_drg_code", "description": "The MS-DRG code associted with the inpatient visit", "meta": {"terminology": "/terminology/conditions-and-procedures/ms-drg"}, "data_type": null, "quote": null, "tags": []}, "ms_drg_description": {"name": "ms_drg_description", "description": "The MS-DRG description associted with the inpatient visit", "meta": {"terminology": "/terminology/conditions-and-procedures/ms-drg"}, "data_type": null, "quote": null, "tags": []}, "medical_surgical": {"name": "medical_surgical", "description": "Indicates whether the MS-DRG is medical or surgical in nature.", "meta": {"terminology": "/terminology/conditions-and-procedures/ms-drg"}, "data_type": null, "quote": null, "tags": []}, "apr_drg_code": {"name": "apr_drg_code", "description": "The APR-DRG code associted with the inpatient visit", "meta": {"terminology": "/terminology/conditions-and-procedures/apr-drg"}, "data_type": null, "quote": null, "tags": []}, "apr_drg_description": {"name": "apr_drg_description", "description": "The APR-DRG description associted with the inpatient visit", "meta": {"terminology": "/terminology/conditions-and-procedures/apr-drg"}, "data_type": null, "quote": null, "tags": []}, "admit_source_code": {"name": "admit_source_code", "description": "Admission source code for the encounter.", "meta": {"terminology": "/terminology/administrative-codes/admit-source"}, "data_type": null, "quote": null, "tags": []}, "admit_source_description": {"name": "admit_source_description", "description": "Admission source description for the encounter.", "meta": {"terminology": "/terminology/administrative-codes/admit-source"}, "data_type": null, "quote": null, "tags": []}, "admit_type_code": {"name": "admit_type_code", "description": "Admission type code for the encounter.", "meta": {"terminology": "/terminology/administrative-codes/admit-type"}, "data_type": null, "quote": null, "tags": []}, "admit_type_description": {"name": "admit_type_description", "description": "Admission type description for the encounter.", "meta": {"terminology": "/terminology/administrative-codes/admit-type"}, "data_type": null, "quote": null, "tags": []}, "discharge_disposition_code": {"name": "discharge_disposition_code", "description": "Discharge disposition code for the encounter.", "meta": {"terminology": "/terminology/administrative-codes/discharge-disposition"}, "data_type": null, "quote": null, "tags": []}, "discharge_disposition_description": {"name": "discharge_disposition_description", "description": "Discharge disposition description for the encounter.", "meta": {"terminology": "/terminology/administrative-codes/discharge-disposition"}, "data_type": null, "quote": null, "tags": []}, "total_paid_amount": {"name": "total_paid_amount", "description": "The total paid amount across all claims for the encounter.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "total_allowed_amount": {"name": "total_allowed_amount", "description": "The total allowed amount across all claims for the encounter.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "total_charge_amount": {"name": "total_charge_amount", "description": "The total charge amount across all claims for the encounter.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "length_of_stay": {"name": "length_of_stay", "description": "The length of stay for the encoujnter.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "mortality_flag": {"name": "mortality_flag", "description": "1 if a patient died during the encounter, 0 otherwise.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "data_source": {"name": "data_source", "description": "User-configured field that indicates the data source (e.g. typically named after the payer and state \"BCBS Tennessee\").", "meta": {}, "data_type": null, "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The time at with the model was materialized. Generated by `dbt_utils.pretty_time` as the local time of the `dbt run` environment. Timezone is configurable via the `tuva_last_run` var.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "emergency_department_summary", "tags": ["emergency_department", "claims_preprocessing"], "materialized": "table", "enabled": true, "bind": false}, "created_at": 1702481696.488072, "relation_name": "devforrest.claims_preprocessing.emergency_department_summary", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r\n )\r\n}}\r\n\r\nwith distinct_encounters as (\r\nselect distinct\r\n a.encounter_id\r\n, a.patient_id\r\n, b.encounter_start_date\r\n, b.encounter_end_date\r\nfrom {{ ref('emergency_department__int_encounter_id') }} a\r\ninner join {{ ref('emergency_department__int_encounter_start_and_end_dates') }} b\r\n on a.encounter_id = b.encounter_id\r\n)\r\n\r\n, institutional_claim_details as (\r\n select\r\n b.encounter_id\r\n , first.diagnosis_code_1\r\n , first.diagnosis_code_type\r\n , first.facility_npi as facility_npi\r\n , first.ms_drg_code as ms_drg_code\r\n , first.apr_drg_code as apr_drg_code\r\n , first.admit_source_code as admit_source_code\r\n , first.admit_type_code as admit_type_code\r\n , last.discharge_disposition_code as discharge_disposition_code\r\n , sum(paid_amount) as inst_paid_amount\r\n , sum(allowed_amount) as inst_allowed_amount\r\n , sum(charge_amount) as inst_charge_amount\r\n , max(data_source) as data_source\r\n from {{ ref('medical_claim') }} a\r\n inner join {{ ref('emergency_department__int_encounter_id') }} b\r\n on a.claim_id = b.claim_id\r\n and a.claim_line_number = b.claim_line_number\r\n and a.claim_type = 'institutional'\r\n inner join {{ ref('emergency_department__int_first_claim_values') }} first\r\n on b.encounter_id = first.encounter_id\r\n and first.claim_row = 1\r\n inner join {{ ref('emergency_department__int_last_claim_values') }} last\r\n on b.encounter_id = last.encounter_id\r\n and last.claim_row = 1\r\n group by\r\n b.encounter_id\r\n , first.diagnosis_code_1\r\n , first.diagnosis_code_type\r\n , first.facility_npi\r\n , first.ms_drg_code\r\n , first.apr_drg_code\r\n , first.admit_source_code\r\n , first.admit_type_code\r\n , last.discharge_disposition_code\r\n)\r\n\r\n, professional_claim_details as (\r\nselect\r\n b.encounter_id\r\n, sum(paid_amount) as prof_paid_amount\r\n, sum(allowed_amount) as prof_allowed_amount\r\n, sum(charge_amount) as prof_charge_amount\r\nfrom {{ ref('medical_claim') }} a\r\ninner join {{ ref('emergency_department__int_encounter_id') }} b\r\n on a.claim_id = b.claim_id\r\n and a.claim_line_number = b.claim_line_number\r\n and a.claim_type = 'professional'\r\ngroup by 1\r\n)\r\n\r\n, patient as (\r\nselect distinct\r\n patient_id\r\n, birth_date\r\n, gender\r\n, race\r\nfrom {{ ref('eligibility') }}\r\n)\r\n\r\n, provider as (\r\nselect\r\n a.encounter_id\r\n, max(a.facility_npi) as facility_npi\r\n, b.provider_first_name\r\n, b.provider_last_name\r\n, count(distinct facility_npi) as npi_count\r\nfrom {{ ref('emergency_department__int_institutional_encounter_id') }} a\r\nleft join {{ ref('terminology__provider') }} b\r\n on a.facility_npi = b.npi\r\ngroup by 1,3,4\r\n)\r\n\r\nselect\r\n a.encounter_id\r\n , a.encounter_start_date\r\n , a.encounter_end_date\r\n , a.patient_id\r\n , {{ dbt.datediff(\"birth_date\",\"encounter_end_date\",\"day\")}}/365 as admit_age\r\n , e.gender\r\n , e.race\r\n , c.diagnosis_code_type as primary_diagnosis_code_type\r\n , c.diagnosis_code_1 as primary_diagnosis_code\r\n , coalesce(icd10cm.description, icd9cm.long_description) as primary_diagnosis_description\r\n , f.facility_npi\r\n , f.provider_first_name\r\n , f.provider_last_name\r\n , c.ms_drg_code\r\n , j.ms_drg_description\r\n , j.medical_surgical\r\n , c.apr_drg_code\r\n , k.apr_drg_description\r\n , c.admit_source_code\r\n , h.admit_source_description\r\n , c.admit_type_code\r\n , i.admit_type_description\r\n , c.discharge_disposition_code\r\n , g.discharge_disposition_description\r\n , c.inst_paid_amount + coalesce(d.prof_paid_amount,0) as total_paid_amount\r\n , c.inst_allowed_amount + coalesce(d.prof_allowed_amount,0) as total_allowed_amount\r\n , c.inst_charge_amount + coalesce(d.prof_charge_amount,0) as total_charge_amount\r\n , {{ dbt.datediff(\"a.encounter_start_date\",\"a.encounter_end_date\",\"day\") }} as length_of_stay\r\n , case\r\n when c.discharge_disposition_code = '20' then 1\r\n else 0\r\n end mortality_flag\r\n , data_source\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom distinct_encounters a\r\nleft join institutional_claim_details c\r\n on a.encounter_id = c.encounter_id\r\nleft join professional_claim_details d\r\n on a.encounter_id = d.encounter_id\r\nleft join patient e\r\n on a.patient_id = e.patient_id\r\nleft join provider f\r\n on a.encounter_id = f.encounter_id\r\nleft join {{ ref('terminology__discharge_disposition') }} g\r\n on c.discharge_disposition_code = g.discharge_disposition_code\r\nleft join {{ ref('terminology__admit_source') }} h\r\n on c.admit_source_code = h.admit_source_code\r\nleft join {{ ref('terminology__admit_type') }} i\r\n on c.admit_type_code = i.admit_type_code\r\nleft join {{ ref('terminology__ms_drg') }} j\r\n on c.ms_drg_code = j.ms_drg_code\r\nleft join {{ ref('terminology__apr_drg') }} k\r\n on c.apr_drg_code = k.apr_drg_code\r\nleft join {{ ref('terminology__icd_10_cm')}} icd10cm\r\n on c.diagnosis_code_1 = icd10cm.icd_10_cm\r\n and c.diagnosis_code_type = 'icd-10-cm'\r\nleft join {{ ref('terminology__icd_9_cm')}} icd9cm\r\n on c.diagnosis_code_1 = icd9cm.icd_9_cm\r\n and c.diagnosis_code_type = 'icd-9-cm'", "language": "sql", "refs": [["emergency_department__int_encounter_id"], ["emergency_department__int_encounter_start_and_end_dates"], ["medical_claim"], ["emergency_department__int_encounter_id"], ["emergency_department__int_first_claim_values"], ["emergency_department__int_last_claim_values"], ["medical_claim"], ["emergency_department__int_encounter_id"], ["eligibility"], ["emergency_department__int_institutional_encounter_id"], ["terminology__provider"], ["terminology__discharge_disposition"], ["terminology__admit_source"], ["terminology__admit_type"], ["terminology__ms_drg"], ["terminology__apr_drg"], ["terminology__icd_10_cm"], ["terminology__icd_9_cm"]], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.datediff"], "nodes": ["model.the_tuva_project.emergency_department__int_encounter_id", "model.the_tuva_project.emergency_department__int_encounter_start_and_end_dates", "model.input_layer.medical_claim", "model.the_tuva_project.emergency_department__int_encounter_id", "model.the_tuva_project.emergency_department__int_first_claim_values", "model.the_tuva_project.emergency_department__int_last_claim_values", "model.input_layer.medical_claim", "model.the_tuva_project.emergency_department__int_encounter_id", "model.input_layer.eligibility", "model.the_tuva_project.emergency_department__int_institutional_encounter_id", "seed.the_tuva_project.terminology__provider", "seed.the_tuva_project.terminology__discharge_disposition", "seed.the_tuva_project.terminology__admit_source", "seed.the_tuva_project.terminology__admit_type", "seed.the_tuva_project.terminology__ms_drg", "seed.the_tuva_project.terminology__apr_drg", "seed.the_tuva_project.terminology__icd_10_cm", "seed.the_tuva_project.terminology__icd_9_cm"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\emergency_department\\final\\emergency_department__summary.sql", "compiled": true, "compiled_code": "\n\nwith distinct_encounters as (\nselect distinct\n a.encounter_id\n, a.patient_id\n, b.encounter_start_date\n, b.encounter_end_date\nfrom devforrest.claims_preprocessing._int_emergency_department_encounter_id a\ninner join devforrest.claims_preprocessing._int_emergency_department_encounter_start_and_end_dates b\n on a.encounter_id = b.encounter_id\n)\n\n, institutional_claim_details as (\n select\n b.encounter_id\n , first.diagnosis_code_1\n , first.diagnosis_code_type\n , first.facility_npi as facility_npi\n , first.ms_drg_code as ms_drg_code\n , first.apr_drg_code as apr_drg_code\n , first.admit_source_code as admit_source_code\n , first.admit_type_code as admit_type_code\n , last.discharge_disposition_code as discharge_disposition_code\n , sum(paid_amount) as inst_paid_amount\n , sum(allowed_amount) as inst_allowed_amount\n , sum(charge_amount) as inst_charge_amount\n , max(data_source) as data_source\n from tuva.input_layer.medical_claim a\n inner join devforrest.claims_preprocessing._int_emergency_department_encounter_id b\n on a.claim_id = b.claim_id\n and a.claim_line_number = b.claim_line_number\n and a.claim_type = 'institutional'\n inner join devforrest.claims_preprocessing._int_emergency_department_first_claim_values first\n on b.encounter_id = first.encounter_id\n and first.claim_row = 1\n inner join devforrest.claims_preprocessing._int_emergency_department_last_claim_values last\n on b.encounter_id = last.encounter_id\n and last.claim_row = 1\n group by\n b.encounter_id\n , first.diagnosis_code_1\n , first.diagnosis_code_type\n , first.facility_npi\n , first.ms_drg_code\n , first.apr_drg_code\n , first.admit_source_code\n , first.admit_type_code\n , last.discharge_disposition_code\n)\n\n, professional_claim_details as (\nselect\n b.encounter_id\n, sum(paid_amount) as prof_paid_amount\n, sum(allowed_amount) as prof_allowed_amount\n, sum(charge_amount) as prof_charge_amount\nfrom tuva.input_layer.medical_claim a\ninner join devforrest.claims_preprocessing._int_emergency_department_encounter_id b\n on a.claim_id = b.claim_id\n and a.claim_line_number = b.claim_line_number\n and a.claim_type = 'professional'\ngroup by 1\n)\n\n, patient as (\nselect distinct\n patient_id\n, birth_date\n, gender\n, race\nfrom tuva.input_layer.eligibility\n)\n\n, provider as (\nselect\n a.encounter_id\n, max(a.facility_npi) as facility_npi\n, b.provider_first_name\n, b.provider_last_name\n, count(distinct facility_npi) as npi_count\nfrom devforrest.claims_preprocessing._int_emergency_department_institutional_encounter_id a\nleft join devforrest.terminology.provider b\n on a.facility_npi = b.npi\ngroup by 1,3,4\n)\n\nselect\n a.encounter_id\n , a.encounter_start_date\n , a.encounter_end_date\n , a.patient_id\n , datediff(\n day,\n birth_date,\n encounter_end_date\n )/365 as admit_age\n , e.gender\n , e.race\n , c.diagnosis_code_type as primary_diagnosis_code_type\n , c.diagnosis_code_1 as primary_diagnosis_code\n , coalesce(icd10cm.description, icd9cm.long_description) as primary_diagnosis_description\n , f.facility_npi\n , f.provider_first_name\n , f.provider_last_name\n , c.ms_drg_code\n , j.ms_drg_description\n , j.medical_surgical\n , c.apr_drg_code\n , k.apr_drg_description\n , c.admit_source_code\n , h.admit_source_description\n , c.admit_type_code\n , i.admit_type_description\n , c.discharge_disposition_code\n , g.discharge_disposition_description\n , c.inst_paid_amount + coalesce(d.prof_paid_amount,0) as total_paid_amount\n , c.inst_allowed_amount + coalesce(d.prof_allowed_amount,0) as total_allowed_amount\n , c.inst_charge_amount + coalesce(d.prof_charge_amount,0) as total_charge_amount\n , datediff(\n day,\n a.encounter_start_date,\n a.encounter_end_date\n ) as length_of_stay\n , case\n when c.discharge_disposition_code = '20' then 1\n else 0\n end mortality_flag\n , data_source\n , '2023-12-13 23:31:59.089856+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 devforrest.terminology.discharge_disposition g\n on c.discharge_disposition_code = g.discharge_disposition_code\nleft join devforrest.terminology.admit_source h\n on c.admit_source_code = h.admit_source_code\nleft join devforrest.terminology.admit_type i\n on c.admit_type_code = i.admit_type_code\nleft join devforrest.terminology.ms_drg j\n on c.ms_drg_code = j.ms_drg_code\nleft join devforrest.terminology.apr_drg k\n on c.apr_drg_code = k.apr_drg_code\nleft join devforrest.terminology.icd_10_cm icd10cm\n on c.diagnosis_code_1 = icd10cm.icd_10_cm\n and c.diagnosis_code_type = 'icd-10-cm'\nleft join devforrest.terminology.icd_9_cm icd9cm\n on c.diagnosis_code_1 = icd9cm.icd_9_cm\n and c.diagnosis_code_type = 'icd-9-cm'", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.emergency_department__int_encounter_id": {"database": "devforrest", "schema": "claims_preprocessing", "name": "emergency_department__int_encounter_id", "resource_type": "model", "package_name": "the_tuva_project", "path": "claims_preprocessing\\emergency_department\\intermediate\\emergency_department__int_encounter_id.sql", "original_file_path": "models\\claims_preprocessing\\emergency_department\\intermediate\\emergency_department__int_encounter_id.sql", "unique_id": "model.the_tuva_project.emergency_department__int_encounter_id", "fqn": ["the_tuva_project", "claims_preprocessing", "emergency_department", "intermediate", "emergency_department__int_encounter_id"], "alias": "_int_emergency_department_encounter_id", "checksum": {"name": "sha256", "checksum": "adc3dbea15a367a6ea68c6c322af263f3fa674a9507c8fcf806d993a929f5bec"}, "config": {"enabled": true, "alias": "_int_emergency_department_encounter_id", "schema": "claims_preprocessing", "database": null, "tags": ["emergency_department", "claims_preprocessing"], "meta": {}, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["emergency_department", "claims_preprocessing"], "description": "Fix encounter_id so each professional claim can only belong to one encounter", "columns": {}, "meta": {}, "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_encounter_id", "tags": ["emergency_department", "claims_preprocessing"], "materialized": "view", "enabled": true, "bind": false}, "created_at": 1702481696.4910696, "relation_name": "devforrest.claims_preprocessing._int_emergency_department_encounter_id", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r\n )\r\n}}\r\n\r\n\r\nselect\r\n inst.patient_id,\r\n inst.claim_id,\r\n med.claim_line_number,\r\n inst.encounter_id,\r\n '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('emergency_department__int_institutional_encounter_id') }} inst\r\nleft join {{ ref('medical_claim') }} med\r\n on inst.claim_id = med.claim_id\r\n\r\nunion distinct\r\n\r\nselect\r\n patient_id,\r\n claim_id,\r\n claim_line_number,\r\n encounter_id,\r\n '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('emergency_department__int_professional_encounter_id') }}\r\nwhere (orphan_claim_flag = 0) and (encounter_count = 1)", "language": "sql", "refs": [["emergency_department__int_institutional_encounter_id"], ["medical_claim"], ["emergency_department__int_professional_encounter_id"]], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.emergency_department__int_institutional_encounter_id", "model.input_layer.medical_claim", "model.the_tuva_project.emergency_department__int_professional_encounter_id"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\emergency_department\\intermediate\\emergency_department__int_encounter_id.sql", "compiled": true, "compiled_code": "\n\n\nselect\n inst.patient_id,\n inst.claim_id,\n med.claim_line_number,\n inst.encounter_id,\n '2023-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom devforrest.claims_preprocessing._int_emergency_department_institutional_encounter_id inst\nleft join tuva.input_layer.medical_claim med\n on inst.claim_id = med.claim_id\n\nunion distinct\n\nselect\n patient_id,\n claim_id,\n claim_line_number,\n encounter_id,\n '2023-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom devforrest.claims_preprocessing._int_emergency_department_professional_encounter_id\nwhere (orphan_claim_flag = 0) and (encounter_count = 1)", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.emergency_department__int_encounter_start_and_end_dates": {"database": "devforrest", "schema": "claims_preprocessing", "name": "emergency_department__int_encounter_start_and_end_dates", "resource_type": "model", "package_name": "the_tuva_project", "path": "claims_preprocessing\\emergency_department\\intermediate\\emergency_department__int_encounter_start_and_end_dates.sql", "original_file_path": "models\\claims_preprocessing\\emergency_department\\intermediate\\emergency_department__int_encounter_start_and_end_dates.sql", "unique_id": "model.the_tuva_project.emergency_department__int_encounter_start_and_end_dates", "fqn": ["the_tuva_project", "claims_preprocessing", "emergency_department", "intermediate", "emergency_department__int_encounter_start_and_end_dates"], "alias": "_int_emergency_department_encounter_start_and_end_dates", "checksum": {"name": "sha256", "checksum": "ad00019be1b1cb0144f2ae596cea2ee9b8ad12b82791296e85d6f830d61b9ba1"}, "config": {"enabled": true, "alias": "_int_emergency_department_encounter_start_and_end_dates", "schema": "claims_preprocessing", "database": null, "tags": ["emergency_department", "claims_preprocessing"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["emergency_department", "claims_preprocessing"], "description": "Defines encounter start and end dates for emergency_department encounters", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_emergency_department_encounter_start_and_end_dates", "tags": ["emergency_department", "claims_preprocessing"], "materialized": "table", "enabled": true, "bind": false}, "created_at": 1702481696.4940832, "relation_name": "devforrest.claims_preprocessing._int_emergency_department_encounter_start_and_end_dates", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r\n )\r\n}}\r\n\r\n\r\nwith add_encounter_id_to_emergency_department_encounters as (\r\nselect\r\n aip.claim_id as claim_id,\r\n aip.patient_id as patient_id,\r\n aip.start_date as start_date,\r\n aip.end_date as end_date,\r\n eid.encounter_id as encounter_id\r\nfrom {{ ref('emergency_department__int_institutional_claims') }} aip\r\nleft join {{ ref('emergency_department__int_institutional_encounter_id') }} eid\r\n on aip.patient_id = eid.patient_id\r\n and aip.claim_id = eid.claim_id\r\n),\r\n\r\nencounter_start_and_end_dates as (\r\nselect\r\n patient_id,\r\n encounter_id,\r\n min(start_date) as encounter_start_date,\r\n max(end_date) as encounter_end_date\r\nfrom add_encounter_id_to_emergency_department_encounters\r\ngroup by patient_id, encounter_id\r\n)\r\n\r\nselect \r\n patient_id\r\n , encounter_id\r\n , encounter_start_date\r\n , encounter_end_date\r\n , coalesce(encounter_start_date, encounter_end_date) as determined_encounter_start_date\r\n , coalesce(encounter_end_date, encounter_start_date) as determined_encounter_end_date\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom encounter_start_and_end_dates", "language": "sql", "refs": [["emergency_department__int_institutional_claims"], ["emergency_department__int_institutional_encounter_id"]], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.emergency_department__int_institutional_claims", "model.the_tuva_project.emergency_department__int_institutional_encounter_id"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\emergency_department\\intermediate\\emergency_department__int_encounter_start_and_end_dates.sql", "compiled": true, "compiled_code": "\n\n\nwith add_encounter_id_to_emergency_department_encounters as (\nselect\n aip.claim_id as claim_id,\n aip.patient_id as patient_id,\n aip.start_date as start_date,\n aip.end_date as end_date,\n eid.encounter_id as encounter_id\nfrom devforrest.claims_preprocessing._int_emergency_department_institutional_claims aip\nleft join devforrest.claims_preprocessing._int_emergency_department_institutional_encounter_id eid\n on aip.patient_id = eid.patient_id\n and aip.claim_id = eid.claim_id\n),\n\nencounter_start_and_end_dates as (\nselect\n patient_id,\n encounter_id,\n min(start_date) as encounter_start_date,\n max(end_date) as encounter_end_date\nfrom add_encounter_id_to_emergency_department_encounters\ngroup by patient_id, encounter_id\n)\n\nselect \n patient_id\n , encounter_id\n , encounter_start_date\n , encounter_end_date\n , coalesce(encounter_start_date, encounter_end_date) as determined_encounter_start_date\n , coalesce(encounter_end_date, encounter_start_date) as determined_encounter_end_date\n , '2023-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom encounter_start_and_end_dates", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.emergency_department__int_first_claim_values": {"database": "devforrest", "schema": "claims_preprocessing", "name": "emergency_department__int_first_claim_values", "resource_type": "model", "package_name": "the_tuva_project", "path": "claims_preprocessing\\emergency_department\\intermediate\\emergency_department__int_first_claim_values.sql", "original_file_path": "models\\claims_preprocessing\\emergency_department\\intermediate\\emergency_department__int_first_claim_values.sql", "unique_id": "model.the_tuva_project.emergency_department__int_first_claim_values", "fqn": ["the_tuva_project", "claims_preprocessing", "emergency_department", "intermediate", "emergency_department__int_first_claim_values"], "alias": "_int_emergency_department_first_claim_values", "checksum": {"name": "sha256", "checksum": "9cddf3276eba155c0599138672c4887df4a6a3cd5f11aae6b0a5cd5d76614d2f"}, "config": {"enabled": true, "alias": "_int_emergency_department_first_claim_values", "schema": "claims_preprocessing", "database": null, "tags": ["emergency_department", "claims_preprocessing"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["emergency_department", "claims_preprocessing"], "description": "Orders claims to pull out encounter details (admit type, drg, etc)", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_emergency_department_first_claim_values", "tags": ["emergency_department", "claims_preprocessing"], "materialized": "table", "enabled": true, "bind": false}, "created_at": 1702481696.4980726, "relation_name": "devforrest.claims_preprocessing._int_emergency_department_first_claim_values", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r\n )\r\n}}\r\n\r\nwith first_claim_values as(\r\n select distinct\r\n e.encounter_id\r\n , coalesce(claim_start_date, admission_date) as claim_start\r\n , diagnosis_code_1\r\n , diagnosis_code_type\r\n , admit_source_code\r\n , admit_type_code\r\n , facility_npi\r\n , ms_drg_code\r\n , apr_drg_code\r\n from {{ ref('emergency_department__int_encounter_id')}} e\r\n inner join {{ ref('medical_claim') }} m\r\n on e.claim_id = m.claim_id\r\n where claim_type = 'institutional'\r\n)\r\n\r\nselect\r\n encounter_id\r\n , claim_start\r\n , diagnosis_code_1\r\n , diagnosis_code_type\r\n , admit_source_code\r\n , admit_type_code\r\n , facility_npi\r\n , ms_drg_code\r\n , apr_drg_code\r\n , row_number() over (partition by encounter_id order by claim_start) as claim_row\r\nfrom first_claim_values", "language": "sql", "refs": [["emergency_department__int_encounter_id"], ["medical_claim"]], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.emergency_department__int_encounter_id", "model.input_layer.medical_claim"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\emergency_department\\intermediate\\emergency_department__int_first_claim_values.sql", "compiled": true, "compiled_code": "\n\nwith first_claim_values as(\n select distinct\n e.encounter_id\n , coalesce(claim_start_date, admission_date) as claim_start\n , diagnosis_code_1\n , diagnosis_code_type\n , admit_source_code\n , admit_type_code\n , facility_npi\n , ms_drg_code\n , apr_drg_code\n from devforrest.claims_preprocessing._int_emergency_department_encounter_id e\n inner join tuva.input_layer.medical_claim m\n on e.claim_id = m.claim_id\n where claim_type = 'institutional'\n)\n\nselect\n encounter_id\n , claim_start\n , diagnosis_code_1\n , diagnosis_code_type\n , admit_source_code\n , admit_type_code\n , facility_npi\n , ms_drg_code\n , apr_drg_code\n , row_number() over (partition by encounter_id order by claim_start) as claim_row\nfrom first_claim_values", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.emergency_department__int_institutional_claims": {"database": "devforrest", "schema": "claims_preprocessing", "name": "emergency_department__int_institutional_claims", "resource_type": "model", "package_name": "the_tuva_project", "path": "claims_preprocessing\\emergency_department\\intermediate\\emergency_department__int_institutional_claims.sql", "original_file_path": "models\\claims_preprocessing\\emergency_department\\intermediate\\emergency_department__int_institutional_claims.sql", "unique_id": "model.the_tuva_project.emergency_department__int_institutional_claims", "fqn": ["the_tuva_project", "claims_preprocessing", "emergency_department", "intermediate", "emergency_department__int_institutional_claims"], "alias": "_int_emergency_department_institutional_claims", "checksum": {"name": "sha256", "checksum": "398f97d285ec419ae74565b0ddd06e91672451e7a2f91e6b6d001881933f0186"}, "config": {"enabled": true, "alias": "_int_emergency_department_institutional_claims", "schema": "claims_preprocessing", "database": null, "tags": ["emergency_department", "claims_preprocessing"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["emergency_department", "claims_preprocessing"], "description": "All emergency_department institutional claim_ids with header values and data quality flags", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_emergency_department_institutional_claims", "tags": ["emergency_department", "claims_preprocessing"], "materialized": "table", "enabled": true, "bind": false}, "created_at": 1702481696.5010793, "relation_name": "devforrest.claims_preprocessing._int_emergency_department_institutional_claims", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r\n )\r\n}}\r\n\r\n\r\nwith emergency_department_claim_lines as (\r\nselect\r\n mc.patient_id,\r\n mc.claim_id,\r\n mc.claim_line_number,\r\n mc.claim_start_date,\r\n mc.claim_end_date,\r\n mc.admission_date,\r\n mc.discharge_date,\r\n mc.admit_source_code,\r\n mc.admit_type_code,\r\n mc.discharge_disposition_code,\r\n mc.facility_npi,\r\n mc.claim_type,\r\n mc.data_source\r\nfrom {{ ref('medical_claim') }} mc\r\ninner join {{ ref('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 = 'Emergency Department'\r\n),\r\n\r\ndata_quality_flags as (\r\nselect\r\n claim_id,\r\n-- patient_id_not_unique:\r\n case\r\n when count(distinct patient_id) > 1 then 1\r\n else 0\r\n end as patient_id_not_unique,\r\n-- patient_id_missing: \r\n case\r\n when max(patient_id) is null then 1\r\n else 0\r\n end as patient_id_missing, \r\n-- claim_start_date_not_unique:\r\n case\r\n when count(distinct claim_start_date) > 1 then 1\r\n else 0\r\n end as claim_start_date_not_unique,\r\n-- claim_start_date_missing: \r\n case\r\n when max(claim_start_date) is null then 1\r\n else 0\r\n end as claim_start_date_missing,\r\n-- claim_end_date_not_unique:\r\n case\r\n when count(distinct claim_end_date) > 1 then 1\r\n else 0\r\n end as claim_end_date_not_unique,\r\n-- claim_end_date_missing: \r\n case\r\n when max(claim_end_date) is null then 1\r\n else 0\r\n end as claim_end_date_missing,\r\n-- claim_start_date_after_claim_end_date:\r\n case\r\n when min(claim_start_date) > max(claim_end_date) then 1\r\n else 0\r\n end as claim_start_date_after_claim_end_date,\r\n-- admission_date_not_unique:\r\n case\r\n when count(distinct admission_date) > 1 then 1\r\n else 0\r\n end as admission_date_not_unique,\r\n-- admission_date_missing: \r\n case\r\n when max(admission_date) is null then 1\r\n else 0\r\n end as admission_date_missing,\r\n-- discharge_date_not_unique:\r\n case\r\n when count(distinct discharge_date) > 1 then 1\r\n else 0\r\n end as discharge_date_not_unique,\r\n-- discharge_date_missing: \r\n case\r\n when max(discharge_date) is null then 1\r\n else 0\r\n end as discharge_date_missing,\r\n-- admission_date_after_discharge_date:\r\n case\r\n when min(admission_date) > max(discharge_date) then 1\r\n else 0\r\n end as admission_date_after_discharge_date,\r\n-- admit_type_code_not_unique:\r\n case\r\n when count(distinct admit_type_code) > 1 then 1\r\n else 0\r\n end as admit_type_code_not_unique,\r\n-- admit_type_code_missing: \r\n case\r\n when max(admit_type_code) is null then 1\r\n else 0\r\n end as admit_type_code_missing, \r\n-- admit_source_code_not_unique:\r\n case\r\n when count(distinct admit_source_code) > 1 then 1\r\n else 0\r\n end as admit_source_code_not_unique,\r\n-- admit_source_code_missing: \r\n case\r\n when max(admit_source_code) is null then 1\r\n else 0\r\n end as admit_source_code_missing, \r\n-- discharge_disposition_code_not_unique:\r\n case\r\n when count(distinct discharge_disposition_code) > 1 then 1\r\n else 0\r\n end as discharge_disposition_code_not_unique,\r\n-- discharge_disposition_code_missing: \r\n case\r\n when max(discharge_disposition_code) is null then 1\r\n else 0\r\n end as discharge_disposition_code_missing,\r\n-- facility_npi_not_unique:\r\n case\r\n when count(distinct facility_npi) > 1 then 1\r\n else 0\r\n end as facility_npi_not_unique,\r\n-- facility_npi_missing: \r\n case\r\n when max(facility_npi) is null then 1\r\n else 0\r\n end as facility_npi_missing,\r\n-- claim_type_not_unique:\r\n case\r\n when count(distinct claim_type) > 1 then 1\r\n else 0\r\n end as claim_type_not_unique,\r\n-- claim_type_missing: \r\n case\r\n when max(claim_type) is null then 1\r\n else 0\r\n end as claim_type_missing,\r\n-- claim_type_not_institutional:\r\n case\r\n when max(claim_type) <> 'institutional'\r\n and min(claim_type) <> 'institutional' then 1\r\n else 0\r\n end as claim_type_not_institutional\r\nfrom emergency_department_claim_lines\r\ngroup by claim_id\r\n),\r\n\r\n\r\nheader_level_values as (\r\nselect\r\n claim_id,\r\n max(patient_id) as patient_id,\r\n min(claim_start_date) as claim_start_date,\r\n max(claim_end_date) as claim_end_date,\r\n min(admission_date) as admission_date,\r\n max(discharge_date) as discharge_date,\r\n max(admit_source_code) as admit_source_code,\r\n max(admit_type_code) as admit_type_code,\r\n max(discharge_disposition_code) as discharge_disposition_code,\r\n max(facility_npi) as facility_npi,\r\n max(claim_type) as claim_type,\r\n coalesce(min(admission_date),\r\n min(claim_start_date)) as start_date,\r\n coalesce(max(discharge_date),\r\n max(claim_end_date)) as end_date,\r\n case\r\n when min(admission_date) is not null then 'admission_date'\r\n when min(claim_start_date) is not null then 'claim_start_date'\r\n else null\r\n end as date_used_as_start_date,\r\n case\r\n when max(discharge_date) is not null then 'discharge_date'\r\n when max(claim_end_date) is not null then 'claim_end_date'\r\n else null\r\n end as date_used_as_end_date,\r\n data_source\r\nfrom emergency_department_claim_lines\r\ngroup by claim_id, data_source\r\n)\r\n\r\nselect\r\n h.patient_id as patient_id,\r\n h.claim_id as claim_id, \r\n h.claim_start_date as claim_start_date,\r\n h.claim_end_date as claim_end_date,\r\n h.admission_date as admission_date,\r\n h.discharge_date as discharge_date,\r\n h.admit_source_code as admit_source_code,\r\n h.admit_type_code as admit_type_code,\r\n h.discharge_disposition_code as discharge_disposition_code,\r\n h.facility_npi as facility_npi,\r\n h.claim_type as claim_type,\r\n h.start_date as start_date,\r\n h.end_date as end_date,\r\n h.date_used_as_start_date,\r\n h.date_used_as_end_date, \r\n\r\n case\r\n when\r\n ( (dq.patient_id_not_unique = 1) or\r\n (dq.patient_id_missing = 1) or\r\n (dq.discharge_disposition_code_not_unique = 1) or\r\n (dq.discharge_disposition_code_missing = 1) or\r\n (dq.facility_npi_not_unique = 1) or\r\n (dq.facility_npi_missing = 1) or\r\n (h.date_used_as_start_date is null) or\r\n\t(h.date_used_as_end_date is null) or\r\n\t(h.start_date > h.end_date) ) then 1\r\n else 0\r\n end as dq_problem,\r\n\r\n case\r\n when\r\n ( (dq.claim_start_date_not_unique = 1) or\r\n\t(dq.claim_start_date_missing = 1) or\r\n (dq.claim_end_date_not_unique = 1) or\r\n (dq.claim_end_date_missing = 1) or\r\n (dq.claim_start_date_after_claim_end_date = 1) or\r\n (dq.admission_date_not_unique = 1) or\r\n (dq.admission_date_missing = 1) or\r\n (dq.discharge_date_not_unique = 1) or\r\n (dq.discharge_date_missing = 1) or\r\n (dq.admission_date_after_discharge_date = 1) or\r\n (dq.admit_type_code_not_unique = 1) or\r\n (dq.admit_type_code_missing = 1) or\r\n (dq.admit_source_code_not_unique = 1) or\r\n (dq.admit_source_code_missing = 1) or\t\r\n (dq.claim_type_not_unique = 1) or\r\n (dq.claim_type_missing = 1) or\r\n (dq.claim_type_not_institutional = 1) ) then 1\r\n else 0\r\n end as dq_insight,\r\n\r\n case\r\n when (h.date_used_as_start_date is null) then 1\r\n else 0\r\n end as start_date_not_determined,\r\n \r\n case\r\n when (h.date_used_as_end_date is null) then 1\r\n else 0\r\n end as end_date_not_determined,\r\n\r\n case\r\n when (h.start_date > h.end_date) then 1\r\n else 0\r\n end as start_date_after_end_date,\r\n \r\n dq.patient_id_not_unique as patient_id_not_unique,\r\n dq.patient_id_missing as patient_id_missing,\r\n dq.claim_start_date_not_unique as claim_start_date_not_unique,\r\n dq.claim_start_date_missing as claim_start_date_missing,\r\n dq.claim_end_date_not_unique as claim_end_date_not_unique,\r\n dq.claim_end_date_missing as claim_end_date_missing,\r\n dq.claim_start_date_after_claim_end_date\r\n as claim_start_date_after_claim_end_date,\r\n dq.admission_date_not_unique as admission_date_not_unique,\r\n dq.admission_date_missing as admission_date_missing,\r\n dq.discharge_date_not_unique as discharge_date_not_unique,\r\n dq.discharge_date_missing as discharge_date_missing,\r\n dq.admission_date_after_discharge_date\r\n as admission_date_after_discharge_date,\r\n dq.admit_type_code_not_unique\r\n as admit_type_code_not_unique,\r\n dq.admit_type_code_missing\r\n as admit_type_code_missing,\r\n dq.admit_source_code_not_unique\r\n as admit_source_code_not_unique,\r\n dq.admit_source_code_missing\r\n as admit_source_code_missing,\r\n dq.discharge_disposition_code_not_unique\r\n as discharge_disposition_code_not_unique,\r\n dq.discharge_disposition_code_missing\r\n as discharge_disposition_code_missing,\r\n dq.facility_npi_not_unique as facility_npi_not_unique,\r\n dq.facility_npi_missing as facility_npi_missing,\r\n dq.claim_type_not_unique as claim_type_not_unique,\r\n dq.claim_type_missing as claim_type_missing,\r\n dq.claim_type_not_institutional as claim_type_not_institutional,\r\n h.data_source,\r\n '{{ var('tuva_last_run')}}' as tuva_last_run\r\n\r\nfrom header_level_values h\r\nleft join data_quality_flags dq\r\n on h.claim_id = dq.claim_id", "language": "sql", "refs": [["medical_claim"], ["service_category__service_category_grouper"]], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.input_layer.medical_claim", "model.the_tuva_project.service_category__service_category_grouper"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\emergency_department\\intermediate\\emergency_department__int_institutional_claims.sql", "compiled": true, "compiled_code": "\n\n\nwith emergency_department_claim_lines as (\nselect\n mc.patient_id,\n mc.claim_id,\n mc.claim_line_number,\n mc.claim_start_date,\n mc.claim_end_date,\n mc.admission_date,\n mc.discharge_date,\n mc.admit_source_code,\n mc.admit_type_code,\n mc.discharge_disposition_code,\n mc.facility_npi,\n mc.claim_type,\n mc.data_source\nfrom tuva.input_layer.medical_claim mc\ninner join devforrest.claims_preprocessing.service_category_grouper sc\n on mc.claim_id = sc.claim_id\nwhere mc.claim_type = 'institutional'\n and sc.service_category_2 = 'Emergency Department'\n),\n\ndata_quality_flags as (\nselect\n claim_id,\n-- patient_id_not_unique:\n case\n when count(distinct patient_id) > 1 then 1\n else 0\n end as patient_id_not_unique,\n-- patient_id_missing: \n case\n when max(patient_id) is null then 1\n else 0\n end as patient_id_missing, \n-- claim_start_date_not_unique:\n case\n when count(distinct claim_start_date) > 1 then 1\n else 0\n end as claim_start_date_not_unique,\n-- claim_start_date_missing: \n case\n when max(claim_start_date) is null then 1\n else 0\n end as claim_start_date_missing,\n-- claim_end_date_not_unique:\n case\n when count(distinct claim_end_date) > 1 then 1\n else 0\n end as claim_end_date_not_unique,\n-- claim_end_date_missing: \n case\n when max(claim_end_date) is null then 1\n else 0\n end as claim_end_date_missing,\n-- claim_start_date_after_claim_end_date:\n case\n when min(claim_start_date) > max(claim_end_date) then 1\n else 0\n end as claim_start_date_after_claim_end_date,\n-- admission_date_not_unique:\n case\n when count(distinct admission_date) > 1 then 1\n else 0\n end as admission_date_not_unique,\n-- admission_date_missing: \n case\n when max(admission_date) is null then 1\n else 0\n end as admission_date_missing,\n-- discharge_date_not_unique:\n case\n when count(distinct discharge_date) > 1 then 1\n else 0\n end as discharge_date_not_unique,\n-- discharge_date_missing: \n case\n when max(discharge_date) is null then 1\n else 0\n end as discharge_date_missing,\n-- admission_date_after_discharge_date:\n case\n when min(admission_date) > max(discharge_date) then 1\n else 0\n end as admission_date_after_discharge_date,\n-- admit_type_code_not_unique:\n case\n when count(distinct admit_type_code) > 1 then 1\n else 0\n end as admit_type_code_not_unique,\n-- admit_type_code_missing: \n case\n when max(admit_type_code) is null then 1\n else 0\n end as admit_type_code_missing, \n-- admit_source_code_not_unique:\n case\n when count(distinct admit_source_code) > 1 then 1\n else 0\n end as admit_source_code_not_unique,\n-- admit_source_code_missing: \n case\n when max(admit_source_code) is null then 1\n else 0\n end as admit_source_code_missing, \n-- discharge_disposition_code_not_unique:\n case\n when count(distinct discharge_disposition_code) > 1 then 1\n else 0\n end as discharge_disposition_code_not_unique,\n-- discharge_disposition_code_missing: \n case\n when max(discharge_disposition_code) is null then 1\n else 0\n end as discharge_disposition_code_missing,\n-- facility_npi_not_unique:\n case\n when count(distinct facility_npi) > 1 then 1\n else 0\n end as facility_npi_not_unique,\n-- facility_npi_missing: \n case\n when max(facility_npi) is null then 1\n else 0\n end as facility_npi_missing,\n-- claim_type_not_unique:\n case\n when count(distinct claim_type) > 1 then 1\n else 0\n end as claim_type_not_unique,\n-- claim_type_missing: \n case\n when max(claim_type) is null then 1\n else 0\n end as claim_type_missing,\n-- claim_type_not_institutional:\n case\n when max(claim_type) <> 'institutional'\n and min(claim_type) <> 'institutional' then 1\n else 0\n end as claim_type_not_institutional\nfrom emergency_department_claim_lines\ngroup by claim_id\n),\n\n\nheader_level_values as (\nselect\n claim_id,\n max(patient_id) as patient_id,\n min(claim_start_date) as claim_start_date,\n max(claim_end_date) as claim_end_date,\n min(admission_date) as admission_date,\n max(discharge_date) as discharge_date,\n max(admit_source_code) as admit_source_code,\n max(admit_type_code) as admit_type_code,\n max(discharge_disposition_code) as discharge_disposition_code,\n max(facility_npi) as facility_npi,\n max(claim_type) as claim_type,\n coalesce(min(admission_date),\n min(claim_start_date)) as start_date,\n coalesce(max(discharge_date),\n max(claim_end_date)) as end_date,\n case\n when min(admission_date) is not null then 'admission_date'\n when min(claim_start_date) is not null then 'claim_start_date'\n else null\n end as date_used_as_start_date,\n case\n when max(discharge_date) is not null then 'discharge_date'\n when max(claim_end_date) is not null then 'claim_end_date'\n else null\n end as date_used_as_end_date,\n data_source\nfrom emergency_department_claim_lines\ngroup by claim_id, data_source\n)\n\nselect\n h.patient_id as patient_id,\n h.claim_id as claim_id, \n h.claim_start_date as claim_start_date,\n h.claim_end_date as claim_end_date,\n h.admission_date as admission_date,\n h.discharge_date as discharge_date,\n h.admit_source_code as admit_source_code,\n h.admit_type_code as admit_type_code,\n h.discharge_disposition_code as discharge_disposition_code,\n h.facility_npi as facility_npi,\n h.claim_type as claim_type,\n h.start_date as start_date,\n h.end_date as end_date,\n h.date_used_as_start_date,\n h.date_used_as_end_date, \n\n case\n when\n ( (dq.patient_id_not_unique = 1) or\n (dq.patient_id_missing = 1) or\n (dq.discharge_disposition_code_not_unique = 1) or\n (dq.discharge_disposition_code_missing = 1) or\n (dq.facility_npi_not_unique = 1) or\n (dq.facility_npi_missing = 1) or\n (h.date_used_as_start_date is null) or\n\t(h.date_used_as_end_date is null) or\n\t(h.start_date > h.end_date) ) then 1\n else 0\n end as dq_problem,\n\n case\n when\n ( (dq.claim_start_date_not_unique = 1) or\n\t(dq.claim_start_date_missing = 1) or\n (dq.claim_end_date_not_unique = 1) or\n (dq.claim_end_date_missing = 1) or\n (dq.claim_start_date_after_claim_end_date = 1) or\n (dq.admission_date_not_unique = 1) or\n (dq.admission_date_missing = 1) or\n (dq.discharge_date_not_unique = 1) or\n (dq.discharge_date_missing = 1) or\n (dq.admission_date_after_discharge_date = 1) or\n (dq.admit_type_code_not_unique = 1) or\n (dq.admit_type_code_missing = 1) or\n (dq.admit_source_code_not_unique = 1) or\n (dq.admit_source_code_missing = 1) or\t\n (dq.claim_type_not_unique = 1) or\n (dq.claim_type_missing = 1) or\n (dq.claim_type_not_institutional = 1) ) then 1\n else 0\n end as dq_insight,\n\n case\n when (h.date_used_as_start_date is null) then 1\n else 0\n end as start_date_not_determined,\n \n case\n when (h.date_used_as_end_date is null) then 1\n else 0\n end as end_date_not_determined,\n\n case\n when (h.start_date > h.end_date) then 1\n else 0\n end as start_date_after_end_date,\n \n dq.patient_id_not_unique as patient_id_not_unique,\n dq.patient_id_missing as patient_id_missing,\n dq.claim_start_date_not_unique as claim_start_date_not_unique,\n dq.claim_start_date_missing as claim_start_date_missing,\n dq.claim_end_date_not_unique as claim_end_date_not_unique,\n dq.claim_end_date_missing as claim_end_date_missing,\n dq.claim_start_date_after_claim_end_date\n as claim_start_date_after_claim_end_date,\n dq.admission_date_not_unique as admission_date_not_unique,\n dq.admission_date_missing as admission_date_missing,\n dq.discharge_date_not_unique as discharge_date_not_unique,\n dq.discharge_date_missing as discharge_date_missing,\n dq.admission_date_after_discharge_date\n as admission_date_after_discharge_date,\n dq.admit_type_code_not_unique\n as admit_type_code_not_unique,\n dq.admit_type_code_missing\n as admit_type_code_missing,\n dq.admit_source_code_not_unique\n as admit_source_code_not_unique,\n dq.admit_source_code_missing\n as admit_source_code_missing,\n dq.discharge_disposition_code_not_unique\n as discharge_disposition_code_not_unique,\n dq.discharge_disposition_code_missing\n as discharge_disposition_code_missing,\n dq.facility_npi_not_unique as facility_npi_not_unique,\n dq.facility_npi_missing as facility_npi_missing,\n dq.claim_type_not_unique as claim_type_not_unique,\n dq.claim_type_missing as claim_type_missing,\n dq.claim_type_not_institutional as claim_type_not_institutional,\n h.data_source,\n '2023-12-13 23:31:59.089856+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": []}, "model.the_tuva_project.emergency_department__int_institutional_encounter_id": {"database": "devforrest", "schema": "claims_preprocessing", "name": "emergency_department__int_institutional_encounter_id", "resource_type": "model", "package_name": "the_tuva_project", "path": "claims_preprocessing\\emergency_department\\intermediate\\emergency_department__int_institutional_encounter_id.sql", "original_file_path": "models\\claims_preprocessing\\emergency_department\\intermediate\\emergency_department__int_institutional_encounter_id.sql", "unique_id": "model.the_tuva_project.emergency_department__int_institutional_encounter_id", "fqn": ["the_tuva_project", "claims_preprocessing", "emergency_department", "intermediate", "emergency_department__int_institutional_encounter_id"], "alias": "_int_emergency_department_institutional_encounter_id", "checksum": {"name": "sha256", "checksum": "47389ee5e825ebe802761f9ee313c78f1464b0b094d2b6043c037947c1a8eafd"}, "config": {"enabled": true, "alias": "_int_emergency_department_institutional_encounter_id", "schema": "claims_preprocessing", "database": null, "tags": ["emergency_department", "claims_preprocessing"], "meta": {}, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["emergency_department", "claims_preprocessing"], "description": "Assigns encounter_id to every emergency_department institutional claim", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_emergency_department_institutional_encounter_id", "tags": ["emergency_department", "claims_preprocessing"], "enabled": true, "bind": false}, "created_at": 1702481696.5039878, "relation_name": "devforrest.claims_preprocessing._int_emergency_department_institutional_encounter_id", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r\n )\r\n}}\r\n\r\n\r\nwith add_row_num as (\r\nselect\r\n patient_id,\r\n claim_id,\r\n start_date,\r\n end_date,\r\n discharge_disposition_code,\r\n facility_npi,\r\n row_number() over (partition by patient_id order by end_date, start_date, claim_id) as row_num\r\nfrom {{ ref('emergency_department__int_institutional_claims') }}\r\n),\r\n\r\ncheck_for_merges_with_larger_row_num as (\r\nselect\r\n aa.patient_id,\r\n aa.claim_id as claim_id_a,\r\n bb.claim_id as claim_id_b,\r\n aa.row_num as row_num_a,\r\n bb.row_num as row_num_b,\r\n case\r\n -- Claims with same end_date and same facility_npi should be merged:\r\n when (aa.end_date = bb.end_date\r\n and aa.facility_npi = bb.facility_npi) then 1\r\n -- Claims with different end_date \r\n -- should be merged if they overlap:\r\n when ( (aa.end_date <> bb.end_date) and \r\n (aa.end_date >= bb.start_date) and --overlap requirement\r\n (aa.facility_npi = bb.facility_npi)\r\n\t )then 1\r\n else 0\r\n end as merge_flag\r\nfrom add_row_num aa\r\n inner join add_row_num bb\r\n on aa.patient_id = bb.patient_id\r\n and aa.row_num < bb.row_num\r\n),\r\n\r\nmerges_with_larger_row_num as (\r\nselect\r\n patient_id,\r\n claim_id_a,\r\n claim_id_b,\r\n row_num_a,\r\n row_num_b,\r\n merge_flag\r\nfrom check_for_merges_with_larger_row_num\r\nwhere merge_flag = 1\r\n),\r\n\r\n\r\nclaim_ids_that_merge_with_larger_row_num as (\r\nselect distinct claim_id_a as claim_id\r\nfrom merges_with_larger_row_num\r\n),\r\n\r\n\r\nclaim_ids_having_a_smaller_row_num_merging_with_a_larger_row_num as (\r\nselect distinct aa.claim_id as claim_id\r\nfrom add_row_num aa\r\n inner join\r\n merges_with_larger_row_num bb\r\n on aa.patient_id = bb.patient_id\r\n and bb.row_num_a < aa.row_num\r\n and bb.row_num_b > aa.row_num\r\n),\r\n\r\n\r\nclose_flags as (\r\nselect\r\n aa.patient_id,\r\n aa.claim_id,\r\n aa.start_date,\r\n aa.end_date,\r\n aa.discharge_disposition_code,\r\n aa.facility_npi,\r\n aa.row_num,\r\n case when (bb.claim_id is null and cc.claim_id is null) then 1\r\n else 0\r\n end as close_flag\r\n\r\nfrom add_row_num aa\r\n\r\nleft join claim_ids_that_merge_with_larger_row_num bb\r\non aa.claim_id = bb.claim_id\r\n\r\nleft join claim_ids_having_a_smaller_row_num_merging_with_a_larger_row_num cc\r\non aa.claim_id = cc.claim_id\r\n),\r\n\r\n\r\njoin_every_row_to_later_closes as (\r\nselect\r\n aa.patient_id as patient_id,\r\n aa.claim_id as claim_id,\r\n aa.row_num as row_num,\r\n bb.row_num as row_num_b\r\nfrom close_flags aa inner join close_flags bb\r\n on aa.patient_id = bb.patient_id\r\n and aa.row_num <= bb.row_num\r\nwhere bb.close_flag = 1\r\n),\r\n\r\n\r\nfind_min_closing_row_num_for_every_claim as (\r\nselect\r\n patient_id,\r\n claim_id,\r\n min(row_num_b) as min_closing_row\r\nfrom join_every_row_to_later_closes\r\ngroup by patient_id, claim_id\r\n),\r\n\r\n\r\nadd_min_closing_row_to_every_claim as (\r\nselect\r\n aa.patient_id as patient_id,\r\n aa.claim_id as claim_id,\r\n aa.start_date as start_date,\r\n aa.end_date as end_date,\r\n aa.discharge_disposition_code as discharge_disposition_code,\r\n aa.facility_npi as facility_npi,\r\n aa.row_num as row_num,\r\n aa.close_flag as close_flag,\r\n bb.min_closing_row as min_closing_row\r\nfrom close_flags aa\r\n left join find_min_closing_row_num_for_every_claim bb\r\n on aa.patient_id = bb.patient_id\r\n and aa.claim_id = bb.claim_id\r\n),\r\n\r\n\r\nadd_encounter_id as (\r\nselect\r\n aa.patient_id as patient_id,\r\n aa.claim_id as claim_id,\r\n aa.start_date as start_date,\r\n aa.end_date as end_date,\r\n aa.discharge_disposition_code as discharge_disposition_code,\r\n aa.facility_npi as facility_npi,\r\n aa.row_num as row_num,\r\n aa.close_flag as close_flag,\r\n aa.min_closing_row as min_closing_row,\r\n bb.claim_id as encounter_id\r\nfrom add_min_closing_row_to_every_claim aa\r\n left join add_min_closing_row_to_every_claim bb\r\n on aa.patient_id = bb.patient_id\r\n and aa.min_closing_row = bb.row_num\r\n)\r\n\r\nselect *, '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom add_encounter_id", "language": "sql", "refs": [["emergency_department__int_institutional_claims"]], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.emergency_department__int_institutional_claims"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\emergency_department\\intermediate\\emergency_department__int_institutional_encounter_id.sql", "compiled": true, "compiled_code": "\n\n\nwith add_row_num as (\nselect\n patient_id,\n claim_id,\n start_date,\n end_date,\n discharge_disposition_code,\n facility_npi,\n row_number() over (partition by patient_id order by end_date, start_date, claim_id) as row_num\nfrom devforrest.claims_preprocessing._int_emergency_department_institutional_claims\n),\n\ncheck_for_merges_with_larger_row_num as (\nselect\n aa.patient_id,\n aa.claim_id as claim_id_a,\n bb.claim_id as claim_id_b,\n aa.row_num as row_num_a,\n bb.row_num as row_num_b,\n case\n -- Claims with same end_date and same facility_npi should be merged:\n when (aa.end_date = bb.end_date\n and aa.facility_npi = bb.facility_npi) then 1\n -- Claims with different end_date \n -- should be merged if they overlap:\n when ( (aa.end_date <> bb.end_date) and \n (aa.end_date >= bb.start_date) and --overlap requirement\n (aa.facility_npi = bb.facility_npi)\n\t )then 1\n else 0\n end as merge_flag\nfrom add_row_num aa\n inner join add_row_num bb\n on aa.patient_id = bb.patient_id\n and aa.row_num < bb.row_num\n),\n\nmerges_with_larger_row_num as (\nselect\n patient_id,\n claim_id_a,\n claim_id_b,\n row_num_a,\n row_num_b,\n merge_flag\nfrom check_for_merges_with_larger_row_num\nwhere merge_flag = 1\n),\n\n\nclaim_ids_that_merge_with_larger_row_num as (\nselect distinct claim_id_a as claim_id\nfrom merges_with_larger_row_num\n),\n\n\nclaim_ids_having_a_smaller_row_num_merging_with_a_larger_row_num as (\nselect distinct aa.claim_id as claim_id\nfrom add_row_num aa\n inner join\n merges_with_larger_row_num bb\n on aa.patient_id = bb.patient_id\n and bb.row_num_a < aa.row_num\n and bb.row_num_b > aa.row_num\n),\n\n\nclose_flags as (\nselect\n aa.patient_id,\n aa.claim_id,\n aa.start_date,\n aa.end_date,\n aa.discharge_disposition_code,\n aa.facility_npi,\n aa.row_num,\n case when (bb.claim_id is null and cc.claim_id is null) then 1\n else 0\n end as close_flag\n\nfrom add_row_num aa\n\nleft join claim_ids_that_merge_with_larger_row_num bb\non aa.claim_id = bb.claim_id\n\nleft join claim_ids_having_a_smaller_row_num_merging_with_a_larger_row_num cc\non aa.claim_id = cc.claim_id\n),\n\n\njoin_every_row_to_later_closes as (\nselect\n aa.patient_id as patient_id,\n aa.claim_id as claim_id,\n aa.row_num as row_num,\n bb.row_num as row_num_b\nfrom close_flags aa inner join close_flags bb\n on aa.patient_id = bb.patient_id\n and aa.row_num <= bb.row_num\nwhere bb.close_flag = 1\n),\n\n\nfind_min_closing_row_num_for_every_claim as (\nselect\n patient_id,\n claim_id,\n min(row_num_b) as min_closing_row\nfrom join_every_row_to_later_closes\ngroup by patient_id, claim_id\n),\n\n\nadd_min_closing_row_to_every_claim as (\nselect\n aa.patient_id as patient_id,\n aa.claim_id as claim_id,\n aa.start_date as start_date,\n aa.end_date as end_date,\n aa.discharge_disposition_code as discharge_disposition_code,\n aa.facility_npi as facility_npi,\n aa.row_num as row_num,\n aa.close_flag as close_flag,\n bb.min_closing_row as min_closing_row\nfrom close_flags aa\n left join find_min_closing_row_num_for_every_claim bb\n on aa.patient_id = bb.patient_id\n and aa.claim_id = bb.claim_id\n),\n\n\nadd_encounter_id as (\nselect\n aa.patient_id as patient_id,\n aa.claim_id as claim_id,\n aa.start_date as start_date,\n aa.end_date as end_date,\n aa.discharge_disposition_code as discharge_disposition_code,\n aa.facility_npi as facility_npi,\n aa.row_num as row_num,\n aa.close_flag as close_flag,\n aa.min_closing_row as min_closing_row,\n bb.claim_id as encounter_id\nfrom add_min_closing_row_to_every_claim aa\n left join add_min_closing_row_to_every_claim bb\n on aa.patient_id = bb.patient_id\n and aa.min_closing_row = bb.row_num\n)\n\nselect *, '2023-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom add_encounter_id", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.emergency_department__int_last_claim_values": {"database": "devforrest", "schema": "claims_preprocessing", "name": "emergency_department__int_last_claim_values", "resource_type": "model", "package_name": "the_tuva_project", "path": "claims_preprocessing\\emergency_department\\intermediate\\emergency_department__int_last_claim_values.sql", "original_file_path": "models\\claims_preprocessing\\emergency_department\\intermediate\\emergency_department__int_last_claim_values.sql", "unique_id": "model.the_tuva_project.emergency_department__int_last_claim_values", "fqn": ["the_tuva_project", "claims_preprocessing", "emergency_department", "intermediate", "emergency_department__int_last_claim_values"], "alias": "_int_emergency_department_last_claim_values", "checksum": {"name": "sha256", "checksum": "f2a15c429ab8316ffcdb4973b832970f4f39d644e2d3f1caf8be187d9299bac5"}, "config": {"enabled": true, "alias": "_int_emergency_department_last_claim_values", "schema": "claims_preprocessing", "database": null, "tags": ["emergency_department", "claims_preprocessing"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["emergency_department", "claims_preprocessing"], "description": "Orders claims to pull out encounter details (discharge disposition, etc)", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_emergency_department_last_claim_values", "tags": ["emergency_department", "claims_preprocessing"], "materialized": "table", "enabled": true, "bind": false}, "created_at": 1702481696.5112753, "relation_name": "devforrest.claims_preprocessing._int_emergency_department_last_claim_values", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r\n )\r\n}}\r\n\r\nwith first_claim_values as(\r\n select distinct\r\n e.encounter_id\r\n , coalesce(claim_start_date, admission_date) as claim_start\r\n , discharge_disposition_code\r\n from {{ ref('emergency_department__int_encounter_id')}} e\r\n inner join {{ ref('medical_claim') }} m\r\n on e.claim_id = m.claim_id\r\n where claim_type = 'institutional'\r\n)\r\n\r\nselect\r\n encounter_id\r\n , claim_start\r\n , discharge_disposition_code\r\n , row_number() over (partition by encounter_id order by claim_start desc) as claim_row\r\nfrom first_claim_values", "language": "sql", "refs": [["emergency_department__int_encounter_id"], ["medical_claim"]], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.emergency_department__int_encounter_id", "model.input_layer.medical_claim"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\emergency_department\\intermediate\\emergency_department__int_last_claim_values.sql", "compiled": true, "compiled_code": "\n\nwith first_claim_values as(\n select distinct\n e.encounter_id\n , coalesce(claim_start_date, admission_date) as claim_start\n , discharge_disposition_code\n from devforrest.claims_preprocessing._int_emergency_department_encounter_id e\n inner join tuva.input_layer.medical_claim m\n on e.claim_id = m.claim_id\n where claim_type = 'institutional'\n)\n\nselect\n encounter_id\n , claim_start\n , discharge_disposition_code\n , row_number() over (partition by encounter_id order by claim_start desc) as claim_row\nfrom first_claim_values", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.emergency_department__int_professional_encounter_id": {"database": "devforrest", "schema": "claims_preprocessing", "name": "emergency_department__int_professional_encounter_id", "resource_type": "model", "package_name": "the_tuva_project", "path": "claims_preprocessing\\emergency_department\\intermediate\\emergency_department__int_professional_encounter_id.sql", "original_file_path": "models\\claims_preprocessing\\emergency_department\\intermediate\\emergency_department__int_professional_encounter_id.sql", "unique_id": "model.the_tuva_project.emergency_department__int_professional_encounter_id", "fqn": ["the_tuva_project", "claims_preprocessing", "emergency_department", "intermediate", "emergency_department__int_professional_encounter_id"], "alias": "_int_emergency_department_professional_encounter_id", "checksum": {"name": "sha256", "checksum": "dd4b55e8de1f3e257c9f64039c0404a57eaee1a9fd7493a5fcdf6d8a4feb82e6"}, "config": {"enabled": true, "alias": "_int_emergency_department_professional_encounter_id", "schema": "claims_preprocessing", "database": null, "tags": ["emergency_department", "claims_preprocessing"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["emergency_department", "claims_preprocessing"], "description": "Assigns encounter_id to every emergency_department professional claim", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_emergency_department_professional_encounter_id", "tags": ["emergency_department", "claims_preprocessing"], "materialized": "table", "enabled": true, "bind": false}, "created_at": 1702481696.5079849, "relation_name": "devforrest.claims_preprocessing._int_emergency_department_professional_encounter_id", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r\n )\r\n}}\r\n\r\n\r\nwith emergency_department_professional_claim_ids as (\r\nselect \r\n claim_id\r\n , claim_line_number\r\nfrom {{ ref('service_category__service_category_grouper') }} \r\nwhere claim_type = 'professional'\r\n and service_category_2 = 'Emergency Department'\r\n),\r\n\r\nemergency_department_professional_claim_lines as (\r\nselect\r\n mc.claim_id\r\n , mc.claim_line_number\r\n , mc.patient_id\r\n , mc.claim_start_date as start_date\r\n , mc.claim_end_date as end_date\t \r\nfrom {{ ref('medical_claim') }} mc\r\ninner join emergency_department_professional_claim_ids prof\r\n on mc.claim_id = prof.claim_id\r\n and mc.claim_line_number = prof.claim_line_number\r\n),\r\n\r\n\r\nemergency_department_professional_claim_dates as (\r\nselect\r\n claim_id\r\n , claim_line_number\r\n , patient_id\r\n , min(start_date) as start_date\r\n , max(end_date) as end_date\r\nfrom emergency_department_professional_claim_lines\r\ngroup by \r\n claim_id\r\n , claim_line_number\r\n , patient_id\r\n),\r\n\r\n\r\nroll_up_professional_claims_to_institutional_claims as (\r\n select\r\n aa.patient_id\r\n , aa.claim_id\r\n , aa.claim_line_number\r\n , aa.start_date\r\n , aa.end_date\r\n , bb.encounter_id\r\n , case\r\n when bb.encounter_id is null then 1\r\n else 0\r\n end as orphan_claim_flag\r\n from emergency_department_professional_claim_dates aa\r\n left join {{ ref('emergency_department__int_encounter_start_and_end_dates') }} bb\r\n on aa.patient_id = bb.patient_id\r\n and (coalesce(aa.start_date, aa.end_date) between coalesce(bb.encounter_start_date, bb.determined_encounter_start_date) and coalesce(bb.encounter_end_date, bb.determined_encounter_end_date))\r\n and (coalesce(aa.end_date, aa.start_date) between coalesce(bb.encounter_start_date, bb.determined_encounter_start_date) and coalesce(bb.encounter_end_date, bb.determined_encounter_end_date))\r\n),\r\n\r\nprofessional_claims_in_more_than_one_encounter as (\r\nselect\r\n patient_id\r\n , claim_id\r\n , claim_line_number\r\n , min(start_date) as start_date\r\n , max(end_date) as end_date\r\n , count(distinct encounter_id) as encounter_count\r\nfrom roll_up_professional_claims_to_institutional_claims\r\ngroup by patient_id, claim_id, claim_line_number\r\nhaving count(distinct encounter_id) > 1\r\n),\r\n\r\n\r\nprofessional_claims_not_in_more_than_one_encounter as (\r\nselect\r\n aa.patient_id,\r\n aa.claim_id,\r\n aa.claim_line_number,\r\n aa.start_date,\r\n aa.end_date,\r\n aa.encounter_id,\r\n aa.orphan_claim_flag,\r\n case\r\n when (aa.orphan_claim_flag = 1) then 0\r\n else 1\r\n end as encounter_count\r\nfrom roll_up_professional_claims_to_institutional_claims aa\r\nleft join professional_claims_in_more_than_one_encounter bb\r\non aa.claim_id = bb.claim_id\r\nand aa.claim_line_number = bb.claim_line_number\r\nand aa.patient_id = bb.patient_id\r\nwhere (bb.patient_id is null) and (bb.claim_id is null)\r\n),\r\n\r\n\r\nall_emergency_department_professional_claims as (\r\nselect\r\n patient_id,\r\n claim_id,\r\n claim_line_number,\r\n start_date,\r\n end_date,\r\n encounter_id,\r\n orphan_claim_flag,\r\n encounter_count\r\nfrom professional_claims_not_in_more_than_one_encounter\r\n\r\nunion all\r\n\r\nselect\r\n patient_id,\r\n claim_id,\r\n claim_line_number,\r\n start_date,\r\n end_date,\r\n null as encounter_id,\r\n 0 as orphan_claim_count,\r\n encounter_count\r\nfrom professional_claims_in_more_than_one_encounter\r\n)\r\n\r\n\r\n\r\nselect *, '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom all_emergency_department_professional_claims", "language": "sql", "refs": [["service_category__service_category_grouper"], ["medical_claim"], ["emergency_department__int_encounter_start_and_end_dates"]], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.service_category__service_category_grouper", "model.input_layer.medical_claim", "model.the_tuva_project.emergency_department__int_encounter_start_and_end_dates"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\emergency_department\\intermediate\\emergency_department__int_professional_encounter_id.sql", "compiled": true, "compiled_code": "\n\n\nwith emergency_department_professional_claim_ids as (\nselect \n claim_id\n , claim_line_number\nfrom devforrest.claims_preprocessing.service_category_grouper \nwhere claim_type = 'professional'\n and service_category_2 = 'Emergency Department'\n),\n\nemergency_department_professional_claim_lines as (\nselect\n mc.claim_id\n , mc.claim_line_number\n , mc.patient_id\n , mc.claim_start_date as start_date\n , mc.claim_end_date as end_date\t \nfrom tuva.input_layer.medical_claim mc\ninner join emergency_department_professional_claim_ids prof\n on mc.claim_id = prof.claim_id\n and mc.claim_line_number = prof.claim_line_number\n),\n\n\nemergency_department_professional_claim_dates as (\nselect\n claim_id\n , claim_line_number\n , patient_id\n , min(start_date) as start_date\n , max(end_date) as end_date\nfrom emergency_department_professional_claim_lines\ngroup by \n claim_id\n , claim_line_number\n , patient_id\n),\n\n\nroll_up_professional_claims_to_institutional_claims as (\n select\n aa.patient_id\n , aa.claim_id\n , aa.claim_line_number\n , aa.start_date\n , aa.end_date\n , bb.encounter_id\n , case\n when bb.encounter_id is null then 1\n else 0\n end as orphan_claim_flag\n from emergency_department_professional_claim_dates aa\n left join devforrest.claims_preprocessing._int_emergency_department_encounter_start_and_end_dates bb\n on aa.patient_id = bb.patient_id\n and (coalesce(aa.start_date, aa.end_date) between coalesce(bb.encounter_start_date, bb.determined_encounter_start_date) and coalesce(bb.encounter_end_date, bb.determined_encounter_end_date))\n and (coalesce(aa.end_date, aa.start_date) between coalesce(bb.encounter_start_date, bb.determined_encounter_start_date) and coalesce(bb.encounter_end_date, bb.determined_encounter_end_date))\n),\n\nprofessional_claims_in_more_than_one_encounter as (\nselect\n patient_id\n , claim_id\n , claim_line_number\n , min(start_date) as start_date\n , max(end_date) as end_date\n , count(distinct encounter_id) as encounter_count\nfrom roll_up_professional_claims_to_institutional_claims\ngroup by patient_id, claim_id, claim_line_number\nhaving count(distinct encounter_id) > 1\n),\n\n\nprofessional_claims_not_in_more_than_one_encounter as (\nselect\n aa.patient_id,\n aa.claim_id,\n aa.claim_line_number,\n aa.start_date,\n aa.end_date,\n aa.encounter_id,\n aa.orphan_claim_flag,\n case\n when (aa.orphan_claim_flag = 1) then 0\n else 1\n end as encounter_count\nfrom roll_up_professional_claims_to_institutional_claims aa\nleft join professional_claims_in_more_than_one_encounter bb\non aa.claim_id = bb.claim_id\nand aa.claim_line_number = bb.claim_line_number\nand aa.patient_id = bb.patient_id\nwhere (bb.patient_id is null) and (bb.claim_id is null)\n),\n\n\nall_emergency_department_professional_claims as (\nselect\n patient_id,\n claim_id,\n claim_line_number,\n start_date,\n end_date,\n encounter_id,\n orphan_claim_flag,\n encounter_count\nfrom professional_claims_not_in_more_than_one_encounter\n\nunion all\n\nselect\n patient_id,\n claim_id,\n claim_line_number,\n start_date,\n end_date,\n null as encounter_id,\n 0 as orphan_claim_count,\n encounter_count\nfrom professional_claims_in_more_than_one_encounter\n)\n\n\n\nselect *, '2023-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom all_emergency_department_professional_claims", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.service_category__dq_input_layer_results": {"database": "devforrest", "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", "claims_preprocessing"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["service_category_grouper", "claims_preprocessing"], "description": "N/A", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_dq_input_layer_results", "materialized": "table", "tags": ["service_category_grouper", "claims_preprocessing"], "enabled": true, "bind": false}, "created_at": 1702481696.6179585, "relation_name": "devforrest.claims_preprocessing._dq_input_layer_results", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r\n )\r\n}}\r\n\r\nselect\r\n dq_problem\r\n, count(distinct claim_id) as distinct_claims\r\n, '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('service_category__dq_input_layer_tests') }}\r\ngroup by 1", "language": "sql", "refs": [["service_category__dq_input_layer_tests"]], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.service_category__dq_input_layer_tests"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\service_category\\data_quality\\service_category__dq_input_layer_results.sql", "compiled": true, "compiled_code": "\n\nselect\n dq_problem\n, count(distinct claim_id) as distinct_claims\n, '2023-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom devforrest.claims_preprocessing._dq_input_layer_tests\ngroup by 1", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.service_category__dq_input_layer_tests": {"database": "devforrest", "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", "claims_preprocessing"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["service_category_grouper", "claims_preprocessing"], "description": "N/A", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_dq_input_layer_tests", "materialized": "table", "tags": ["service_category_grouper", "claims_preprocessing"], "enabled": true, "bind": false}, "created_at": 1702481696.6206684, "relation_name": "devforrest.claims_preprocessing._dq_input_layer_tests", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r\n )\r\n}}\r\n\r\nselect distinct \r\n claim_id\r\n, 'Multiple claim_type' as dq_problem\r\n, '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('service_category__stg_medical_claim') }}\r\ngroup by 1\r\nhaving count(distinct claim_type) > 1\r\n\r\nunion all\r\n\r\nselect distinct \r\n claim_id\r\n, 'Multiple bill_type_code' as dq_problem\r\n, '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('service_category__stg_medical_claim') }}\r\ngroup by 1\r\nhaving count(distinct bill_type_code) > 1\r\n\r\nunion all\r\n\r\nselect distinct \r\n claim_id\r\n, 'Missing claim_type' as dq_problem\r\n, '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('service_category__stg_medical_claim') }}\r\nwhere claim_type is null\r\n\r\nunion all\r\n\r\nselect distinct \r\n claim_id\r\n, 'Missing place_of_service_code' as dq_problem\r\n, '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('service_category__stg_medical_claim') }}\r\nwhere claim_type = 'professional'\r\n and place_of_service_code is null\r\n\r\nunion all\r\n\r\nselect distinct \r\n claim_id\r\n, 'Missing bill_type_code' as dq_problem\r\n, '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('service_category__stg_medical_claim') }}\r\nwhere claim_type = 'institutional'\r\n and bill_type_code is null\r\n\r\nunion all\r\n\r\nselect distinct \r\n claim_id\r\n, 'Missing revenue_center_code' as dq_problem\r\n, '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('service_category__stg_medical_claim') }}\r\nwhere claim_type = 'institutional'\r\n and revenue_center_code is null\r\n\r\nunion all\r\n\r\nselect distinct \r\n claim_id\r\n, 'Missing hcpcs_code' as dq_problem\r\n, '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('service_category__stg_medical_claim') }}\r\nwhere claim_type = 'professional'\r\n and hcpcs_code is null\r\n\r\nunion all\r\n\r\nselect distinct \r\n claim_id\r\n, 'Invalid claim_type' as dq_problem\r\n, '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('service_category__stg_medical_claim') }} a\r\ninner join {{ ref('terminology__claim_type') }} b\r\n on a.claim_type = b.claim_type\r\nwhere b.claim_type is null\r\n\r\nunion all\r\n\r\nselect distinct \r\n claim_id\r\n, 'Invalid place_of_service_code' as dq_problem\r\n, '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('service_category__stg_medical_claim') }} a\r\ninner join {{ ref('terminology__place_of_service') }} b\r\n on a.place_of_service_code = b.place_of_service_code\r\nwhere a.claim_type = 'professional'\r\n and b.place_of_service_code is null\r\n\r\nunion all\r\n\r\nselect distinct \r\n claim_id\r\n, 'Invalid bill_type_code' as dq_problem\r\n, '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('service_category__stg_medical_claim') }} a\r\ninner join {{ ref('terminology__bill_type') }} b\r\n on a.bill_type_code = b.bill_type_code\r\nwhere a.claim_type = 'institutional'\r\n and b.bill_type_code is null\r\n\r\nunion all\r\n\r\nselect distinct \r\n claim_id\r\n, 'Invalid revenue_center_code' as dq_problem\r\n, '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('service_category__stg_medical_claim') }} a\r\ninner join {{ ref('terminology__revenue_center') }} b\r\n on a.revenue_center_code = b.revenue_center_code\r\nwhere a.claim_type = 'institutional'\r\n and b.revenue_center_code is null\r\n\r\nunion all\r\n\r\nselect distinct \r\n claim_id\r\n, 'Invalid hcpcs_code' as dq_problem\r\n, '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('service_category__stg_medical_claim') }} a\r\ninner join {{ ref('terminology__hcpcs_level_2') }} b\r\n on a.hcpcs_code = b.hcpcs\r\nwhere a.claim_type = 'professional'\r\n and b.hcpcs is null\r\n\r\nunion all\r\n\r\nselect distinct \r\n claim_id\r\n, 'Invalid ms_drg_code' as dq_problem\r\n, '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('service_category__stg_medical_claim') }} a\r\ninner join {{ ref('terminology__ms_drg') }} b\r\n on a.ms_drg_code = b.ms_drg_code\r\nwhere a.claim_type = 'institutional'\r\n and b.ms_drg_code is null\r\n\r\nunion all\r\n\r\nselect distinct \r\n claim_id\r\n, 'Invalid apr_drg_code' as dq_problem\r\n, '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('service_category__stg_medical_claim') }} a\r\ninner join {{ ref('terminology__apr_drg') }} b\r\n on a.apr_drg_code = b.apr_drg_code\r\nwhere a.claim_type = 'institutional'\r\n and b.apr_drg_code is null", "language": "sql", "refs": [["service_category__stg_medical_claim"], ["service_category__stg_medical_claim"], ["service_category__stg_medical_claim"], ["service_category__stg_medical_claim"], ["service_category__stg_medical_claim"], ["service_category__stg_medical_claim"], ["service_category__stg_medical_claim"], ["service_category__stg_medical_claim"], ["terminology__claim_type"], ["service_category__stg_medical_claim"], ["terminology__place_of_service"], ["service_category__stg_medical_claim"], ["terminology__bill_type"], ["service_category__stg_medical_claim"], ["terminology__revenue_center"], ["service_category__stg_medical_claim"], ["terminology__hcpcs_level_2"], ["service_category__stg_medical_claim"], ["terminology__ms_drg"], ["service_category__stg_medical_claim"], ["terminology__apr_drg"]], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.service_category__stg_medical_claim", "model.the_tuva_project.service_category__stg_medical_claim", "model.the_tuva_project.service_category__stg_medical_claim", "model.the_tuva_project.service_category__stg_medical_claim", "model.the_tuva_project.service_category__stg_medical_claim", "model.the_tuva_project.service_category__stg_medical_claim", "model.the_tuva_project.service_category__stg_medical_claim", "model.the_tuva_project.service_category__stg_medical_claim", "seed.the_tuva_project.terminology__claim_type", "model.the_tuva_project.service_category__stg_medical_claim", "seed.the_tuva_project.terminology__place_of_service", "model.the_tuva_project.service_category__stg_medical_claim", "seed.the_tuva_project.terminology__bill_type", "model.the_tuva_project.service_category__stg_medical_claim", "seed.the_tuva_project.terminology__revenue_center", "model.the_tuva_project.service_category__stg_medical_claim", "seed.the_tuva_project.terminology__hcpcs_level_2", "model.the_tuva_project.service_category__stg_medical_claim", "seed.the_tuva_project.terminology__ms_drg", "model.the_tuva_project.service_category__stg_medical_claim", "seed.the_tuva_project.terminology__apr_drg"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\service_category\\data_quality\\service_category__dq_input_layer_tests.sql", "compiled": true, "compiled_code": "\n\nwith __dbt__cte__service_category__stg_medical_claim as (\n\n\nselect\nAPR_DRG_CODE,\nBILL_TYPE_CODE,\nCLAIM_ID,\nCLAIM_LINE_NUMBER,\nCLAIM_TYPE,\nHCPCS_CODE,\nMS_DRG_CODE,\nPLACE_OF_SERVICE_CODE,\nREVENUE_CENTER_CODE,\n'2023-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom tuva.input_layer.medical_claim\n)select distinct \n claim_id\n, 'Multiple claim_type' as dq_problem\n, '2023-12-13 23:31:59.089856+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-12-13 23:31:59.089856+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-12-13 23:31:59.089856+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-12-13 23:31:59.089856+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-12-13 23:31:59.089856+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-12-13 23:31:59.089856+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-12-13 23:31:59.089856+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-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom __dbt__cte__service_category__stg_medical_claim a\ninner join devforrest.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-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom __dbt__cte__service_category__stg_medical_claim a\ninner join devforrest.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-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom __dbt__cte__service_category__stg_medical_claim a\ninner join devforrest.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-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom __dbt__cte__service_category__stg_medical_claim a\ninner join devforrest.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-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom __dbt__cte__service_category__stg_medical_claim a\ninner join devforrest.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-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom __dbt__cte__service_category__stg_medical_claim a\ninner join devforrest.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-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom __dbt__cte__service_category__stg_medical_claim a\ninner join devforrest.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-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom tuva.input_layer.medical_claim\n)"}]}, "model.the_tuva_project.service_category__dq_multiple_service_categories_institutional": {"database": "devforrest", "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", "claims_preprocessing"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["service_category_grouper", "claims_preprocessing"], "description": "N/A", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_dq_multiple_service_categories_institutional", "materialized": "table", "tags": ["service_category_grouper", "claims_preprocessing"], "enabled": true, "bind": false}, "created_at": 1702481696.6206684, "relation_name": "devforrest.claims_preprocessing._dq_multiple_service_categories_institutional", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r\n )\r\n}}\r\n\r\nselect\r\n claim_id\r\n, count(distinct service_category_2) as distinct_service_category_count\r\n, '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('service_category__combined_institutional') }}\r\ngroup by 1\r\nhaving count(distinct service_category_2) > 1", "language": "sql", "refs": [["service_category__combined_institutional"]], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.service_category__combined_institutional"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\service_category\\data_quality\\service_category__dq_multiple_service_categories_institutional.sql", "compiled": true, "compiled_code": "\n\nselect\n claim_id\n, count(distinct service_category_2) as distinct_service_category_count\n, '2023-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom devforrest.claims_preprocessing._int_combined_institutional\ngroup by 1\nhaving count(distinct service_category_2) > 1", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.service_category__dq_multiple_service_categories_professional": {"database": "devforrest", "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", "claims_preprocessing"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["service_category_grouper", "claims_preprocessing"], "description": "N/A", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_dq_multiple_service_categories_professional", "materialized": "table", "tags": ["service_category_grouper", "claims_preprocessing"], "enabled": true, "bind": false}, "created_at": 1702481696.6206684, "relation_name": "devforrest.claims_preprocessing._dq_multiple_service_categories_professional", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r\n )\r\n}}\r\n\r\nselect\r\n claim_id\r\n, claim_line_number\r\n, count(distinct service_category_2) as distinct_service_category_count\r\n, '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('service_category__combined_professional') }}\r\ngroup by 1,2\r\nhaving count(distinct service_category_2) > 1", "language": "sql", "refs": [["service_category__combined_professional"]], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.service_category__combined_professional"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\service_category\\data_quality\\service_category__dq_multiple_service_categories_professional.sql", "compiled": true, "compiled_code": "\n\nselect\n claim_id\n, claim_line_number\n, count(distinct service_category_2) as distinct_service_category_count\n, '2023-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom devforrest.claims_preprocessing._int_combined_professional\ngroup by 1,2\nhaving count(distinct service_category_2) > 1", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.service_category__service_category_grouper": {"database": "devforrest", "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": "34cb25c1ae0a5392a484d24bf2146f99afacc5b4afcaff7de25416e74936b914"}, "config": {"enabled": true, "alias": "service_category_grouper", "schema": "claims_preprocessing", "database": null, "tags": ["service_category_grouper", "claims_preprocessing"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["service_category_grouper", "claims_preprocessing"], "description": "Assigns every claim line into a unique service category.", "columns": {"claim_id": {"name": "claim_id", "description": "Unique identifier for each claim.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "claim_line_number": {"name": "claim_line_number", "description": "Indicates the line number for the particular line of the claim.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "claim_type": {"name": "claim_type", "description": "Indicated the type of claims", "meta": {}, "data_type": null, "quote": null, "tags": []}, "service_category_1": {"name": "service_category_1", "description": "The first service category of the claim line", "meta": {}, "data_type": null, "quote": null, "tags": []}, "service_category_2": {"name": "service_category_2", "description": "The second, more specific service category of the claim line", "meta": {}, "data_type": null, "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The time at with the model was materialized. Generated by `dbt_utils.pretty_time` as the local time of the `dbt run` environment. Timezone is configurable via the `tuva_last_run` var.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "service_category_grouper", "materialized": "table", "tags": ["service_category_grouper", "claims_preprocessing"], "enabled": true, "bind": false}, "created_at": 1702481696.5162754, "relation_name": "devforrest.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 service_category_1_mapping\r\n)\r\n\r\nselect\r\n claim_id\r\n , claim_line_number\r\n , claim_type\r\n , service_category_1\r\n , service_category_2\r\nfrom service_category_2_deduplication\r\nwhere duplicate_row_number = 1", "language": "sql", "refs": [["service_category__stg_medical_claim"], ["service_category__combined_professional"], ["service_category__stg_medical_claim"], ["service_category__combined_institutional"]], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.service_category__stg_medical_claim", "model.the_tuva_project.service_category__combined_professional", "model.the_tuva_project.service_category__stg_medical_claim", "model.the_tuva_project.service_category__combined_institutional"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\service_category\\final\\service_category__service_category_grouper.sql", "compiled": true, "compiled_code": "\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-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom tuva.input_layer.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-12-13 23:31:59.089856+00:00' as tuva_last_run\n from __dbt__cte__service_category__stg_medical_claim a\n left join devforrest.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-12-13 23:31:59.089856+00:00' as tuva_last_run\n from __dbt__cte__service_category__stg_medical_claim a\n left join devforrest.claims_preprocessing._int_combined_institutional b\n on a.claim_id = b.claim_id\n where a.claim_type = 'institutional'\n)\n, service_category_2_deduplication as(\n select \n claim_id\n , claim_line_number\n , claim_type\n , service_category_1\n , service_category_2\n , row_number() over (partition by claim_id, claim_line_number order by \n case\n when service_category_2 = 'Acute Inpatient' then 3\n when service_category_2 = 'Ambulance' then 7\n when service_category_2 = 'Ambulatory Surgery' then 8\n when service_category_2 = 'Dialysis' then 17\n when service_category_2 = 'Durable Medical Equipment' then 1\n when service_category_2 = 'Emergency Department' then 5\n when service_category_2 = 'Home Health' then 9\n when service_category_2 = 'Hospice' then 10\n when service_category_2 = 'Inpatient Psychiatric' then 11\n when service_category_2 = 'Inpatient Rehabilitation' then 12\n when service_category_2 = 'Lab' then 13\n when service_category_2 = 'Office Visit' then 4\n when service_category_2 = 'Outpatient Hospital or Clinic' then 14\n when service_category_2 = 'Outpatient Psychiatric' then 15\n when service_category_2 = 'Outpatient Rehabilitation' then 16\n when service_category_2 = 'Skilled Nursing' then 6\n when service_category_2 = 'Urgent Care' then 2\n when service_category_2 is null then 18\n else 99 end) as duplicate_row_number\n from service_category_1_mapping\n)\n\nselect\n claim_id\n , claim_line_number\n , claim_type\n , service_category_1\n , service_category_2\nfrom service_category_2_deduplication\nwhere duplicate_row_number = 1", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.the_tuva_project.service_category__stg_medical_claim", "sql": " __dbt__cte__service_category__stg_medical_claim as (\n\n\nselect\nAPR_DRG_CODE,\nBILL_TYPE_CODE,\nCLAIM_ID,\nCLAIM_LINE_NUMBER,\nCLAIM_TYPE,\nHCPCS_CODE,\nMS_DRG_CODE,\nPLACE_OF_SERVICE_CODE,\nREVENUE_CENTER_CODE,\n'2023-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom tuva.input_layer.medical_claim\n)"}]}, "model.the_tuva_project.service_category__acute_inpatient_institutional": {"database": "devforrest", "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", "claims_preprocessing"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["service_category_grouper", "claims_preprocessing"], "description": "N/A", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_acute_inpatient_institutional", "materialized": "table", "tags": ["service_category_grouper", "claims_preprocessing"], "enabled": true, "bind": false}, "created_at": 1702481696.5262532, "relation_name": "devforrest.claims_preprocessing._int_acute_inpatient_institutional", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r\n )\r\n}}\r\n\r\nwith room_and_board_requirement as (\r\nselect distinct \r\n claim_id\r\nfrom {{ ref('service_category__stg_medical_claim') }}\r\nwhere claim_type = 'institutional'\r\n and revenue_center_code in\r\n ('0100','0101',\r\n '0110','0111','0112','0113','0114','0116','0117','0118','0119',\r\n '0120','0121','0122','0123','0124','0126','0127','0128','0129',\r\n '0130','0131','0132','0133','0134','0136','0137','0138','0139',\r\n '0140','0141','0142','0143','0144','0146','0147','0148','0149',\r\n '0150','0151','0152','0153','0154','0156','0157','0158','0159',\r\n '0160','0164','0167','0169',\r\n '0170','0171','0172','0173','0174','0179',\r\n '0190','0191','0192','0193','0194','0199',\r\n '0200','0201','0202','0203','0204','0206','0207','0208','0209',\r\n '0210','0211','0212','0213','0214','0219',\r\n '1000','1001','1002')\r\n)\r\n\r\n, drg_requirement as (\r\nselect distinct \r\n mc.claim_id\r\nfrom {{ ref('service_category__stg_medical_claim') }} mc\r\nleft join {{ ref('terminology__ms_drg')}} msdrg\r\n on mc.ms_drg_code = msdrg.ms_drg_code\r\nleft join {{ ref('terminology__apr_drg')}} aprdrg\r\n on mc.apr_drg_code = aprdrg.apr_drg_code\r\nwhere claim_type = 'institutional'\r\n and (msdrg.ms_drg_code is not null or aprdrg.apr_drg_code is not null)\r\n)\r\n\r\n, bill_type_requirement as (\r\nselect distinct \r\n claim_id\r\nfrom {{ ref('service_category__stg_medical_claim') }}\r\nwhere claim_type = 'institutional'\r\n and left(bill_type_code,2) in ('11','12') \r\n)\r\n\r\nselect distinct \r\n a.claim_id\r\n, 'Acute Inpatient' as service_category_2\r\n, '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('service_category__stg_medical_claim') }} a\r\ninner join room_and_board_requirement b\r\n on a.claim_id = b.claim_id\r\ninner join drg_requirement c\r\n on a.claim_id = c.claim_id\r\ninner join bill_type_requirement d\r\n on a.claim_id = d.claim_id", "language": "sql", "refs": [["service_category__stg_medical_claim"], ["service_category__stg_medical_claim"], ["terminology__ms_drg"], ["terminology__apr_drg"], ["service_category__stg_medical_claim"], ["service_category__stg_medical_claim"]], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.service_category__stg_medical_claim", "model.the_tuva_project.service_category__stg_medical_claim", "seed.the_tuva_project.terminology__ms_drg", "seed.the_tuva_project.terminology__apr_drg", "model.the_tuva_project.service_category__stg_medical_claim", "model.the_tuva_project.service_category__stg_medical_claim"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\service_category\\intermediate\\service_category__acute_inpatient_institutional.sql", "compiled": true, "compiled_code": "\n\nwith __dbt__cte__service_category__stg_medical_claim as (\n\n\nselect\nAPR_DRG_CODE,\nBILL_TYPE_CODE,\nCLAIM_ID,\nCLAIM_LINE_NUMBER,\nCLAIM_TYPE,\nHCPCS_CODE,\nMS_DRG_CODE,\nPLACE_OF_SERVICE_CODE,\nREVENUE_CENTER_CODE,\n'2023-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom tuva.input_layer.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 devforrest.terminology.ms_drg msdrg\n on mc.ms_drg_code = msdrg.ms_drg_code\nleft join devforrest.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-12-13 23:31:59.089856+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-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom tuva.input_layer.medical_claim\n)"}]}, "model.the_tuva_project.service_category__acute_inpatient_professional": {"database": "devforrest", "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", "claims_preprocessing"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["service_category_grouper", "claims_preprocessing"], "description": "N/A", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_acute_inpatient_professional", "materialized": "table", "tags": ["service_category_grouper", "claims_preprocessing"], "enabled": true, "bind": false}, "created_at": 1702481696.5292554, "relation_name": "devforrest.claims_preprocessing._int_acute_inpatient_professional", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r\n )\r\n}}\r\n\r\nselect distinct\r\n claim_id\r\n, claim_line_number\r\n, 'Acute Inpatient' as service_category_2\r\n, '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('service_category__stg_medical_claim') }}\r\nwhere claim_type = 'professional'\r\n and place_of_service_code = '21'", "language": "sql", "refs": [["service_category__stg_medical_claim"]], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.service_category__stg_medical_claim"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\service_category\\intermediate\\service_category__acute_inpatient_professional.sql", "compiled": true, "compiled_code": "\n\nwith __dbt__cte__service_category__stg_medical_claim as (\n\n\nselect\nAPR_DRG_CODE,\nBILL_TYPE_CODE,\nCLAIM_ID,\nCLAIM_LINE_NUMBER,\nCLAIM_TYPE,\nHCPCS_CODE,\nMS_DRG_CODE,\nPLACE_OF_SERVICE_CODE,\nREVENUE_CENTER_CODE,\n'2023-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom tuva.input_layer.medical_claim\n)select distinct\n claim_id\n, claim_line_number\n, 'Acute Inpatient' as service_category_2\n, '2023-12-13 23:31:59.089856+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-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom tuva.input_layer.medical_claim\n)"}]}, "model.the_tuva_project.service_category__ambulance_professional": {"database": "devforrest", "schema": "claims_preprocessing", "name": "service_category__ambulance_professional", "resource_type": "model", "package_name": "the_tuva_project", "path": "claims_preprocessing\\service_category\\intermediate\\service_category__ambulance_professional.sql", "original_file_path": "models\\claims_preprocessing\\service_category\\intermediate\\service_category__ambulance_professional.sql", "unique_id": "model.the_tuva_project.service_category__ambulance_professional", "fqn": ["the_tuva_project", "claims_preprocessing", "service_category", "intermediate", "service_category__ambulance_professional"], "alias": "_int_ambulance_professional", "checksum": {"name": "sha256", "checksum": "44f209883bcf412c4870a26c12a607c1b3e4090a24206ab65809c5913967531a"}, "config": {"enabled": true, "alias": "_int_ambulance_professional", "schema": "claims_preprocessing", "database": null, "tags": ["service_category_grouper", "claims_preprocessing"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["service_category_grouper", "claims_preprocessing"], "description": "N/A", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_ambulance_professional", "materialized": "table", "tags": ["service_category_grouper", "claims_preprocessing"], "enabled": true, "bind": false}, "created_at": 1702481696.5322566, "relation_name": "devforrest.claims_preprocessing._int_ambulance_professional", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r\n )\r\n}}\r\n\r\nselect distinct \r\n claim_id\r\n, claim_line_number\r\n, 'Ambulance' as service_category_2\r\n, '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('service_category__stg_medical_claim') }}\r\nwhere claim_type = 'professional'\r\n and (hcpcs_code between 'A0425' and 'A0436' or place_of_service_code in ('41','42'))", "language": "sql", "refs": [["service_category__stg_medical_claim"]], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.service_category__stg_medical_claim"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\service_category\\intermediate\\service_category__ambulance_professional.sql", "compiled": true, "compiled_code": "\n\nwith __dbt__cte__service_category__stg_medical_claim as (\n\n\nselect\nAPR_DRG_CODE,\nBILL_TYPE_CODE,\nCLAIM_ID,\nCLAIM_LINE_NUMBER,\nCLAIM_TYPE,\nHCPCS_CODE,\nMS_DRG_CODE,\nPLACE_OF_SERVICE_CODE,\nREVENUE_CENTER_CODE,\n'2023-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom tuva.input_layer.medical_claim\n)select distinct \n claim_id\n, claim_line_number\n, 'Ambulance' as service_category_2\n, '2023-12-13 23:31:59.089856+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-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom tuva.input_layer.medical_claim\n)"}]}, "model.the_tuva_project.service_category__ambulatory_surgery_professional": {"database": "devforrest", "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", "claims_preprocessing"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["service_category_grouper", "claims_preprocessing"], "description": "N/A", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_ambulatory_surgery_professional", "materialized": "table", "tags": ["service_category_grouper", "claims_preprocessing"], "enabled": true, "bind": false}, "created_at": 1702481696.5353637, "relation_name": "devforrest.claims_preprocessing._int_ambulatory_surgery_professional", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r\n )\r\n}}\r\n\r\nselect distinct \r\n a.claim_id\r\n, a.claim_line_number\r\n, 'Ambulatory Surgery' as service_category_2\r\n, '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('service_category__stg_medical_claim') }} a\r\nleft join {{ ref('service_category__dme_professional') }} b\r\n on a.claim_id = b.claim_id\r\n and a.claim_line_number = b.claim_line_number\r\nwhere a.claim_type = 'professional'\r\n and a.place_of_service_code in ('24')\r\n and (b.claim_id is null and b.claim_line_number is null)", "language": "sql", "refs": [["service_category__stg_medical_claim"], ["service_category__dme_professional"]], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.service_category__stg_medical_claim", "model.the_tuva_project.service_category__dme_professional"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\service_category\\intermediate\\service_category__ambulatory_surgery_professional.sql", "compiled": true, "compiled_code": "\n\nwith __dbt__cte__service_category__stg_medical_claim as (\n\n\nselect\nAPR_DRG_CODE,\nBILL_TYPE_CODE,\nCLAIM_ID,\nCLAIM_LINE_NUMBER,\nCLAIM_TYPE,\nHCPCS_CODE,\nMS_DRG_CODE,\nPLACE_OF_SERVICE_CODE,\nREVENUE_CENTER_CODE,\n'2023-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom tuva.input_layer.medical_claim\n)select distinct \n a.claim_id\n, a.claim_line_number\n, 'Ambulatory Surgery' as service_category_2\n, '2023-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom __dbt__cte__service_category__stg_medical_claim a\nleft join devforrest.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-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom tuva.input_layer.medical_claim\n)"}]}, "model.the_tuva_project.service_category__combined_institutional": {"database": "devforrest", "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": "6b7f8e6d4e0d72b5e1b3206c84d43ed02b5ccf77dc3954d63a31f36f96cfe4ac"}, "config": {"enabled": true, "alias": "_int_combined_institutional", "schema": "claims_preprocessing", "database": null, "tags": ["service_category_grouper", "claims_preprocessing"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["service_category_grouper", "claims_preprocessing"], "description": "N/A", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_combined_institutional", "materialized": "table", "tags": ["service_category_grouper", "claims_preprocessing"], "enabled": true, "bind": false}, "created_at": 1702481696.5232797, "relation_name": "devforrest.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\nwith duplicate_bill_types as (\r\nselect distinct\r\n claim_id\r\n, 'Other' as service_category_2\r\nfrom {{ ref('service_category__duplicate_bill_types') }}\r\n)\r\n\r\n, combine as (\r\nselect *\r\nfrom {{ ref('service_category__acute_inpatient_institutional') }}\r\n\r\nunion all\r\n\r\nselect *\r\nfrom {{ ref('service_category__dialysis_institutional') }}\r\n\r\nunion all\r\n\r\nselect *\r\nfrom {{ ref('service_category__emergency_department_institutional') }}\r\n\r\nunion all\r\n\r\nselect *\r\nfrom {{ ref('service_category__home_health_institutional') }}\r\n\r\nunion all\r\n\r\nselect *\r\nfrom {{ ref('service_category__hospice_institutional') }}\r\n\r\nunion all\r\n\r\nselect *\r\nfrom {{ ref('service_category__lab_institutional') }}\r\n\r\nunion all\r\n\r\nselect *\r\nfrom {{ ref('service_category__outpatient_hospital_or_clinic_institutional') }}\r\n\r\nunion all\r\n\r\nselect *\r\nfrom {{ ref('service_category__outpatient_psychiatric_institutional') }}\r\n\r\nunion all\r\n\r\nselect *\r\nfrom {{ ref('service_category__skilled_nursing_institutional') }}\r\n\r\nunion all\r\n\r\nselect *\r\nfrom {{ ref('service_category__urgent_care_institutional') }}\r\n)\r\n\r\nselect\r\n claim_id\r\n, service_category_2\r\nfrom duplicate_bill_types\r\n\r\nunion all\r\n\r\nselect\r\n a.claim_id\r\n, a.service_category_2\r\nfrom combine a\r\nleft join duplicate_bill_types b\r\n on a.claim_id = b.claim_id\r\nwhere b.claim_id is null", "language": "sql", "refs": [["service_category__duplicate_bill_types"], ["service_category__acute_inpatient_institutional"], ["service_category__dialysis_institutional"], ["service_category__emergency_department_institutional"], ["service_category__home_health_institutional"], ["service_category__hospice_institutional"], ["service_category__lab_institutional"], ["service_category__outpatient_hospital_or_clinic_institutional"], ["service_category__outpatient_psychiatric_institutional"], ["service_category__skilled_nursing_institutional"], ["service_category__urgent_care_institutional"]], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.service_category__duplicate_bill_types", "model.the_tuva_project.service_category__acute_inpatient_institutional", "model.the_tuva_project.service_category__dialysis_institutional", "model.the_tuva_project.service_category__emergency_department_institutional", "model.the_tuva_project.service_category__home_health_institutional", "model.the_tuva_project.service_category__hospice_institutional", "model.the_tuva_project.service_category__lab_institutional", "model.the_tuva_project.service_category__outpatient_hospital_or_clinic_institutional", "model.the_tuva_project.service_category__outpatient_psychiatric_institutional", "model.the_tuva_project.service_category__skilled_nursing_institutional", "model.the_tuva_project.service_category__urgent_care_institutional"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\service_category\\intermediate\\service_category__combined_institutional.sql", "compiled": true, "compiled_code": "\n\nwith duplicate_bill_types as (\nselect distinct\n claim_id\n, 'Other' as service_category_2\nfrom devforrest.claims_preprocessing._int_duplicate_bill_types\n)\n\n, combine as (\nselect *\nfrom devforrest.claims_preprocessing._int_acute_inpatient_institutional\n\nunion all\n\nselect *\nfrom devforrest.claims_preprocessing._int_dialysis_institutional\n\nunion all\n\nselect *\nfrom devforrest.claims_preprocessing._int_emergency_department_institutional\n\nunion all\n\nselect *\nfrom devforrest.claims_preprocessing._int_home_health_institutional\n\nunion all\n\nselect *\nfrom devforrest.claims_preprocessing._int_hospice_institutional\n\nunion all\n\nselect *\nfrom devforrest.claims_preprocessing._int_lab_institutional\n\nunion all\n\nselect *\nfrom devforrest.claims_preprocessing._int_outpatient_hospital_or_clinic_institutional\n\nunion all\n\nselect *\nfrom devforrest.claims_preprocessing._int_outpatient_psychiatric_institutional\n\nunion all\n\nselect *\nfrom devforrest.claims_preprocessing._int_skilled_nursing_institutional\n\nunion all\n\nselect *\nfrom devforrest.claims_preprocessing._int_urgent_care_institutional\n)\n\nselect\n claim_id\n, service_category_2\nfrom duplicate_bill_types\n\nunion all\n\nselect\n a.claim_id\n, a.service_category_2\nfrom combine a\nleft join duplicate_bill_types b\n on a.claim_id = b.claim_id\nwhere b.claim_id is null", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.service_category__combined_professional": {"database": "devforrest", "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": "65f1b8b7c06cee302804d5e569add3935bbe253749baf89803238a96ad947e7c"}, "config": {"enabled": true, "alias": "_int_combined_professional", "schema": "claims_preprocessing", "database": null, "tags": ["service_category_grouper", "claims_preprocessing"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["service_category_grouper", "claims_preprocessing"], "description": "N/A", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_combined_professional", "materialized": "table", "tags": ["service_category_grouper", "claims_preprocessing"], "enabled": true, "bind": false}, "created_at": 1702481696.5191774, "relation_name": "devforrest.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\nwith combined as (\r\nselect *\r\nfrom {{ ref('service_category__acute_inpatient_professional') }}\r\n\r\nunion all\r\n\r\nselect *\r\nfrom {{ ref('service_category__ambulatory_surgery_professional') }}\r\n\r\nunion all\r\n\r\nselect *\r\nfrom {{ ref('service_category__dialysis_professional') }}\r\n\r\nunion all\r\n\r\nselect *\r\nfrom {{ ref('service_category__emergency_department_professional') }}\r\n\r\nunion all\r\n\r\nselect *\r\nfrom {{ ref('service_category__home_health_professional') }}\r\n\r\nunion all\r\n\r\nselect *\r\nfrom {{ ref('service_category__hospice_professional') }}\r\n\r\nunion all\r\n\r\nselect *\r\nfrom {{ ref('service_category__inpatient_psychiatric_professional') }}\r\n\r\nunion all\r\n\r\nselect *\r\nfrom {{ ref('service_category__inpatient_rehab_professional') }}\r\n\r\nunion all\r\n\r\nselect *\r\nfrom {{ ref('service_category__lab_professional') }}\r\n\r\nunion all\r\n\r\nselect *\r\nfrom {{ ref('service_category__office_visit_professional') }}\r\n\r\nunion all\r\n\r\nselect *\r\nfrom {{ ref('service_category__outpatient_hospital_or_clinic_professional') }}\r\n\r\nunion all\r\n\r\nselect *\r\nfrom {{ ref('service_category__outpatient_psychiatric_professional') }}\r\n\r\nunion all\r\n\r\nselect *\r\nfrom {{ ref('service_category__outpatient_rehab_professional') }}\r\n\r\nunion all\r\n\r\nselect *\r\nfrom {{ ref('service_category__skilled_nursing_professional') }}\r\n\r\nunion all\r\n\r\nselect *\r\nfrom {{ ref('service_category__urgent_care_professional') }}\r\n)\r\n\r\nselect \r\n claim_id\r\n, claim_line_number\r\n, service_category_2\r\n, tuva_last_run\r\nfrom {{ ref('service_category__dme_professional') }}\r\n\r\nunion all\r\n\r\nselect \r\n a.claim_id\r\n, a.claim_line_number\r\n, a.service_category_2\r\n, a.tuva_last_run\r\nfrom {{ ref('service_category__ambulance_professional') }} a\r\nleft join {{ ref('service_category__dme_professional') }} b\r\n on a.claim_id = b.claim_id\r\n and a.claim_line_number = b.claim_line_number\r\nwhere (b.claim_id is null and b.claim_line_number is null)\r\n\r\nunion all\r\n\r\nselect \r\n a.claim_id\r\n, a.claim_line_number\r\n, a.service_category_2\r\n, a.tuva_last_run\r\nfrom combined a\r\nleft join {{ ref('service_category__dme_professional') }} b\r\n on a.claim_id = b.claim_id\r\n and a.claim_line_number = b.claim_line_number\r\nleft join {{ ref('service_category__ambulance_professional') }} c\r\n on a.claim_id = c.claim_id\r\n and a.claim_line_number = c.claim_line_number\r\nwhere (b.claim_id is null and b.claim_line_number is null)\r\n and (c.claim_id is null and c.claim_line_number is null)", "language": "sql", "refs": [["service_category__acute_inpatient_professional"], ["service_category__ambulatory_surgery_professional"], ["service_category__dialysis_professional"], ["service_category__emergency_department_professional"], ["service_category__home_health_professional"], ["service_category__hospice_professional"], ["service_category__inpatient_psychiatric_professional"], ["service_category__inpatient_rehab_professional"], ["service_category__lab_professional"], ["service_category__office_visit_professional"], ["service_category__outpatient_hospital_or_clinic_professional"], ["service_category__outpatient_psychiatric_professional"], ["service_category__outpatient_rehab_professional"], ["service_category__skilled_nursing_professional"], ["service_category__urgent_care_professional"], ["service_category__dme_professional"], ["service_category__ambulance_professional"], ["service_category__dme_professional"], ["service_category__dme_professional"], ["service_category__ambulance_professional"]], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.service_category__acute_inpatient_professional", "model.the_tuva_project.service_category__ambulatory_surgery_professional", "model.the_tuva_project.service_category__dialysis_professional", "model.the_tuva_project.service_category__emergency_department_professional", "model.the_tuva_project.service_category__home_health_professional", "model.the_tuva_project.service_category__hospice_professional", "model.the_tuva_project.service_category__inpatient_psychiatric_professional", "model.the_tuva_project.service_category__inpatient_rehab_professional", "model.the_tuva_project.service_category__lab_professional", "model.the_tuva_project.service_category__office_visit_professional", "model.the_tuva_project.service_category__outpatient_hospital_or_clinic_professional", "model.the_tuva_project.service_category__outpatient_psychiatric_professional", "model.the_tuva_project.service_category__outpatient_rehab_professional", "model.the_tuva_project.service_category__skilled_nursing_professional", "model.the_tuva_project.service_category__urgent_care_professional", "model.the_tuva_project.service_category__dme_professional", "model.the_tuva_project.service_category__ambulance_professional", "model.the_tuva_project.service_category__dme_professional", "model.the_tuva_project.service_category__dme_professional", "model.the_tuva_project.service_category__ambulance_professional"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\service_category\\intermediate\\service_category__combined_professional.sql", "compiled": true, "compiled_code": "\n\nwith combined as (\nselect *\nfrom devforrest.claims_preprocessing._int_acute_inpatient_professional\n\nunion all\n\nselect *\nfrom devforrest.claims_preprocessing._int_ambulatory_surgery_professional\n\nunion all\n\nselect *\nfrom devforrest.claims_preprocessing._int_dialysis_professional\n\nunion all\n\nselect *\nfrom devforrest.claims_preprocessing._int_emergency_department_professional\n\nunion all\n\nselect *\nfrom devforrest.claims_preprocessing._int_home_health_professional\n\nunion all\n\nselect *\nfrom devforrest.claims_preprocessing._int_hospice_professional\n\nunion all\n\nselect *\nfrom devforrest.claims_preprocessing._int_inpatient_psychiatric_professional\n\nunion all\n\nselect *\nfrom devforrest.claims_preprocessing._int_inpatient_rehab_professional\n\nunion all\n\nselect *\nfrom devforrest.claims_preprocessing._int_lab_professional\n\nunion all\n\nselect *\nfrom devforrest.claims_preprocessing._int_office_visit_professional\n\nunion all\n\nselect *\nfrom devforrest.claims_preprocessing._int_outpatient_hospital_or_clinic_professional\n\nunion all\n\nselect *\nfrom devforrest.claims_preprocessing._int_outpatient_psychiatric_professional\n\nunion all\n\nselect *\nfrom devforrest.claims_preprocessing._int_outpatient_rehab_professional\n\nunion all\n\nselect *\nfrom devforrest.claims_preprocessing._int_skilled_nursing_professional\n\nunion all\n\nselect *\nfrom devforrest.claims_preprocessing._int_urgent_care_professional\n)\n\nselect \n claim_id\n, claim_line_number\n, service_category_2\n, tuva_last_run\nfrom devforrest.claims_preprocessing._int_dme_professional\n\nunion all\n\nselect \n a.claim_id\n, a.claim_line_number\n, a.service_category_2\n, a.tuva_last_run\nfrom devforrest.claims_preprocessing._int_ambulance_professional a\nleft join devforrest.claims_preprocessing._int_dme_professional b\n on a.claim_id = b.claim_id\n and a.claim_line_number = b.claim_line_number\nwhere (b.claim_id is null and b.claim_line_number is null)\n\nunion all\n\nselect \n a.claim_id\n, a.claim_line_number\n, a.service_category_2\n, a.tuva_last_run\nfrom combined a\nleft join devforrest.claims_preprocessing._int_dme_professional b\n on a.claim_id = b.claim_id\n and a.claim_line_number = b.claim_line_number\nleft join devforrest.claims_preprocessing._int_ambulance_professional c\n on a.claim_id = c.claim_id\n and a.claim_line_number = c.claim_line_number\nwhere (b.claim_id is null and b.claim_line_number is null)\n and (c.claim_id is null and c.claim_line_number is null)", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.service_category__dialysis_institutional": {"database": "devforrest", "schema": "claims_preprocessing", "name": "service_category__dialysis_institutional", "resource_type": "model", "package_name": "the_tuva_project", "path": "claims_preprocessing\\service_category\\intermediate\\service_category__dialysis_institutional.sql", "original_file_path": "models\\claims_preprocessing\\service_category\\intermediate\\service_category__dialysis_institutional.sql", "unique_id": "model.the_tuva_project.service_category__dialysis_institutional", "fqn": ["the_tuva_project", "claims_preprocessing", "service_category", "intermediate", "service_category__dialysis_institutional"], "alias": "_int_dialysis_institutional", "checksum": {"name": "sha256", "checksum": "20e78d709c0ed0460182d80c44a6e17e89af5baa64f42d3630b8ffd609f605cd"}, "config": {"enabled": true, "alias": "_int_dialysis_institutional", "schema": "claims_preprocessing", "database": null, "tags": ["service_category_grouper", "claims_preprocessing"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["service_category_grouper", "claims_preprocessing"], "description": "N/A", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_dialysis_institutional", "materialized": "table", "tags": ["service_category_grouper", "claims_preprocessing"], "enabled": true, "bind": false}, "created_at": 1702481696.5393653, "relation_name": "devforrest.claims_preprocessing._int_dialysis_institutional", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r\n )\r\n}}\r\n\r\nselect distinct \r\n claim_id\r\n, 'Dialysis' as service_category_2\r\n, '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('service_category__stg_medical_claim') }}\r\nwhere claim_type = 'institutional'\r\n and left(bill_type_code,2) in ('72')", "language": "sql", "refs": [["service_category__stg_medical_claim"]], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.service_category__stg_medical_claim"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\service_category\\intermediate\\service_category__dialysis_institutional.sql", "compiled": true, "compiled_code": "\n\nwith __dbt__cte__service_category__stg_medical_claim as (\n\n\nselect\nAPR_DRG_CODE,\nBILL_TYPE_CODE,\nCLAIM_ID,\nCLAIM_LINE_NUMBER,\nCLAIM_TYPE,\nHCPCS_CODE,\nMS_DRG_CODE,\nPLACE_OF_SERVICE_CODE,\nREVENUE_CENTER_CODE,\n'2023-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom tuva.input_layer.medical_claim\n)select distinct \n claim_id\n, 'Dialysis' as service_category_2\n, '2023-12-13 23:31:59.089856+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-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom tuva.input_layer.medical_claim\n)"}]}, "model.the_tuva_project.service_category__dialysis_professional": {"database": "devforrest", "schema": "claims_preprocessing", "name": "service_category__dialysis_professional", "resource_type": "model", "package_name": "the_tuva_project", "path": "claims_preprocessing\\service_category\\intermediate\\service_category__dialysis_professional.sql", "original_file_path": "models\\claims_preprocessing\\service_category\\intermediate\\service_category__dialysis_professional.sql", "unique_id": "model.the_tuva_project.service_category__dialysis_professional", "fqn": ["the_tuva_project", "claims_preprocessing", "service_category", "intermediate", "service_category__dialysis_professional"], "alias": "_int_dialysis_professional", "checksum": {"name": "sha256", "checksum": "d44b35e28d2318bd5ad888394e5967f4d8641d11299f63ab21ab68393c97d1a7"}, "config": {"enabled": true, "alias": "_int_dialysis_professional", "schema": "claims_preprocessing", "database": null, "tags": ["service_category_grouper", "claims_preprocessing"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["service_category_grouper", "claims_preprocessing"], "description": "N/A", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_dialysis_professional", "materialized": "table", "tags": ["service_category_grouper", "claims_preprocessing"], "enabled": true, "bind": false}, "created_at": 1702481696.5423498, "relation_name": "devforrest.claims_preprocessing._int_dialysis_professional", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r\n )\r\n}}\r\n\r\nselect distinct \r\n claim_id\r\n, claim_line_number\r\n, 'Dialysis' as service_category_2\r\n, '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('service_category__stg_medical_claim') }}\r\nwhere claim_type = 'professional'\r\n and place_of_service_code in ('65')", "language": "sql", "refs": [["service_category__stg_medical_claim"]], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.service_category__stg_medical_claim"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\service_category\\intermediate\\service_category__dialysis_professional.sql", "compiled": true, "compiled_code": "\n\nwith __dbt__cte__service_category__stg_medical_claim as (\n\n\nselect\nAPR_DRG_CODE,\nBILL_TYPE_CODE,\nCLAIM_ID,\nCLAIM_LINE_NUMBER,\nCLAIM_TYPE,\nHCPCS_CODE,\nMS_DRG_CODE,\nPLACE_OF_SERVICE_CODE,\nREVENUE_CENTER_CODE,\n'2023-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom tuva.input_layer.medical_claim\n)select distinct \n claim_id\n, claim_line_number\n, 'Dialysis' as service_category_2\n, '2023-12-13 23:31:59.089856+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-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom tuva.input_layer.medical_claim\n)"}]}, "model.the_tuva_project.service_category__dme_professional": {"database": "devforrest", "schema": "claims_preprocessing", "name": "service_category__dme_professional", "resource_type": "model", "package_name": "the_tuva_project", "path": "claims_preprocessing\\service_category\\intermediate\\service_category__dme_professional.sql", "original_file_path": "models\\claims_preprocessing\\service_category\\intermediate\\service_category__dme_professional.sql", "unique_id": "model.the_tuva_project.service_category__dme_professional", "fqn": ["the_tuva_project", "claims_preprocessing", "service_category", "intermediate", "service_category__dme_professional"], "alias": "_int_dme_professional", "checksum": {"name": "sha256", "checksum": "e7afd6e430fa8cdd893ac98646228f7bd33ccc6f64a1c565674ec361dd95a9ef"}, "config": {"enabled": true, "alias": "_int_dme_professional", "schema": "claims_preprocessing", "database": null, "tags": ["service_category_grouper", "claims_preprocessing"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["service_category_grouper", "claims_preprocessing"], "description": "N/A", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_dme_professional", "materialized": "table", "tags": ["service_category_grouper", "claims_preprocessing"], "enabled": true, "bind": false}, "created_at": 1702481696.545379, "relation_name": "devforrest.claims_preprocessing._int_dme_professional", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r\n )\r\n}}\r\n\r\nselect distinct \r\n claim_id\r\n, claim_line_number\r\n, 'Durable Medical Equipment' as service_category_2\r\n, '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('service_category__stg_medical_claim') }}\r\nwhere claim_type = 'professional'\r\n and hcpcs_code between 'E0100' and 'E8002'", "language": "sql", "refs": [["service_category__stg_medical_claim"]], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.service_category__stg_medical_claim"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\service_category\\intermediate\\service_category__dme_professional.sql", "compiled": true, "compiled_code": "\n\nwith __dbt__cte__service_category__stg_medical_claim as (\n\n\nselect\nAPR_DRG_CODE,\nBILL_TYPE_CODE,\nCLAIM_ID,\nCLAIM_LINE_NUMBER,\nCLAIM_TYPE,\nHCPCS_CODE,\nMS_DRG_CODE,\nPLACE_OF_SERVICE_CODE,\nREVENUE_CENTER_CODE,\n'2023-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom tuva.input_layer.medical_claim\n)select distinct \n claim_id\n, claim_line_number\n, 'Durable Medical Equipment' as service_category_2\n, '2023-12-13 23:31:59.089856+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-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom tuva.input_layer.medical_claim\n)"}]}, "model.the_tuva_project.service_category__duplicate_bill_types": {"database": "devforrest", "schema": "claims_preprocessing", "name": "service_category__duplicate_bill_types", "resource_type": "model", "package_name": "the_tuva_project", "path": "claims_preprocessing\\service_category\\intermediate\\service_category__duplicate_bill_types.sql", "original_file_path": "models\\claims_preprocessing\\service_category\\intermediate\\service_category__duplicate_bill_types.sql", "unique_id": "model.the_tuva_project.service_category__duplicate_bill_types", "fqn": ["the_tuva_project", "claims_preprocessing", "service_category", "intermediate", "service_category__duplicate_bill_types"], "alias": "_int_duplicate_bill_types", "checksum": {"name": "sha256", "checksum": "dfe4714a7591abdf93cdd1a3233d4f3801a68554a44442f4247afae2c52ecb78"}, "config": {"enabled": true, "alias": "_int_duplicate_bill_types", "schema": "claims_preprocessing", "database": null, "tags": ["service_category_grouper", "claims_preprocessing"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["service_category_grouper", "claims_preprocessing"], "description": "N/A", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_duplicate_bill_types", "materialized": "table", "tags": ["service_category_grouper", "claims_preprocessing"], "enabled": true, "bind": false}, "created_at": 1702481696.6129484, "relation_name": "devforrest.claims_preprocessing._int_duplicate_bill_types", "raw_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, count(distinct bill_type_code) as cnt\r\nfrom {{ ref('service_category__stg_medical_claim') }}\r\ngroup by 1\r\nhaving count(distinct bill_type_code) > 1", "language": "sql", "refs": [["service_category__stg_medical_claim"]], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.service_category__stg_medical_claim"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\service_category\\intermediate\\service_category__duplicate_bill_types.sql", "compiled": true, "compiled_code": "\n\nwith __dbt__cte__service_category__stg_medical_claim as (\n\n\nselect\nAPR_DRG_CODE,\nBILL_TYPE_CODE,\nCLAIM_ID,\nCLAIM_LINE_NUMBER,\nCLAIM_TYPE,\nHCPCS_CODE,\nMS_DRG_CODE,\nPLACE_OF_SERVICE_CODE,\nREVENUE_CENTER_CODE,\n'2023-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom tuva.input_layer.medical_claim\n)select distinct\n claim_id\n, count(distinct bill_type_code) as cnt\nfrom __dbt__cte__service_category__stg_medical_claim\ngroup by 1\nhaving count(distinct bill_type_code) > 1", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.the_tuva_project.service_category__stg_medical_claim", "sql": " __dbt__cte__service_category__stg_medical_claim as (\n\n\nselect\nAPR_DRG_CODE,\nBILL_TYPE_CODE,\nCLAIM_ID,\nCLAIM_LINE_NUMBER,\nCLAIM_TYPE,\nHCPCS_CODE,\nMS_DRG_CODE,\nPLACE_OF_SERVICE_CODE,\nREVENUE_CENTER_CODE,\n'2023-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom tuva.input_layer.medical_claim\n)"}]}, "model.the_tuva_project.service_category__emergency_department_institutional": {"database": "devforrest", "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": "4f34d9425c67b300c5a474260473564d73acc94e8828b03ad0f487a2545445f3"}, "config": {"enabled": true, "alias": "_int_emergency_department_institutional", "schema": "claims_preprocessing", "database": null, "tags": ["service_category_grouper", "claims_preprocessing"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["service_category_grouper", "claims_preprocessing"], "description": "N/A", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_emergency_department_institutional", "materialized": "table", "tags": ["service_category_grouper", "claims_preprocessing"], "enabled": true, "bind": false}, "created_at": 1702481696.5483787, "relation_name": "devforrest.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 med.claim_id\r\n , 'Emergency Department' as service_category_2\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('service_category__stg_medical_claim') }} med\r\nleft join {{ ref('service_category__acute_inpatient_institutional') }} inpatient\r\n on med.claim_id = inpatient.claim_id\r\nwhere claim_type = 'institutional'\r\nand revenue_center_code in ('0450','0451','0452','0459','0981')\r\nand inpatient.claim_id is null\r\n-- 0456, urgent care, is included in most published definitions\r\n-- that also include a requirement of a bill type code for\r\n-- inpatient or outpatient hospital.", "language": "sql", "refs": [["service_category__stg_medical_claim"], ["service_category__acute_inpatient_institutional"]], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.service_category__stg_medical_claim", "model.the_tuva_project.service_category__acute_inpatient_institutional"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\service_category\\intermediate\\service_category__emergency_department_institutional.sql", "compiled": true, "compiled_code": "\n\nwith __dbt__cte__service_category__stg_medical_claim as (\n\n\nselect\nAPR_DRG_CODE,\nBILL_TYPE_CODE,\nCLAIM_ID,\nCLAIM_LINE_NUMBER,\nCLAIM_TYPE,\nHCPCS_CODE,\nMS_DRG_CODE,\nPLACE_OF_SERVICE_CODE,\nREVENUE_CENTER_CODE,\n'2023-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom tuva.input_layer.medical_claim\n)select distinct \n med.claim_id\n , 'Emergency Department' as service_category_2\n , '2023-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom __dbt__cte__service_category__stg_medical_claim med\nleft join devforrest.claims_preprocessing._int_acute_inpatient_institutional inpatient\n on med.claim_id = inpatient.claim_id\nwhere claim_type = 'institutional'\nand revenue_center_code in ('0450','0451','0452','0459','0981')\nand inpatient.claim_id is null\n-- 0456, urgent care, is included in most published definitions\n-- that also include a requirement of a bill type code for\n-- inpatient or outpatient hospital.", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.the_tuva_project.service_category__stg_medical_claim", "sql": " __dbt__cte__service_category__stg_medical_claim as (\n\n\nselect\nAPR_DRG_CODE,\nBILL_TYPE_CODE,\nCLAIM_ID,\nCLAIM_LINE_NUMBER,\nCLAIM_TYPE,\nHCPCS_CODE,\nMS_DRG_CODE,\nPLACE_OF_SERVICE_CODE,\nREVENUE_CENTER_CODE,\n'2023-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom tuva.input_layer.medical_claim\n)"}]}, "model.the_tuva_project.service_category__emergency_department_professional": {"database": "devforrest", "schema": "claims_preprocessing", "name": "service_category__emergency_department_professional", "resource_type": "model", "package_name": "the_tuva_project", "path": "claims_preprocessing\\service_category\\intermediate\\service_category__emergency_department_professional.sql", "original_file_path": "models\\claims_preprocessing\\service_category\\intermediate\\service_category__emergency_department_professional.sql", "unique_id": "model.the_tuva_project.service_category__emergency_department_professional", "fqn": ["the_tuva_project", "claims_preprocessing", "service_category", "intermediate", "service_category__emergency_department_professional"], "alias": "_int_emergency_department_professional", "checksum": {"name": "sha256", "checksum": "6dd74ae07d39e1bc9cd076cc3db91c05beb1efc03921bf7a929eeeae16cfeb6a"}, "config": {"enabled": true, "alias": "_int_emergency_department_professional", "schema": "claims_preprocessing", "database": null, "tags": ["service_category_grouper", "claims_preprocessing"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["service_category_grouper", "claims_preprocessing"], "description": "N/A", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_emergency_department_professional", "materialized": "table", "tags": ["service_category_grouper", "claims_preprocessing"], "enabled": true, "bind": false}, "created_at": 1702481696.5520675, "relation_name": "devforrest.claims_preprocessing._int_emergency_department_professional", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r\n )\r\n}}\r\n\r\nselect distinct \r\n claim_id\r\n, claim_line_number\r\n, 'Emergency Department' as service_category_2\r\n, '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('service_category__stg_medical_claim') }}\r\nwhere claim_type = 'professional'\r\n and place_of_service_code = '23'", "language": "sql", "refs": [["service_category__stg_medical_claim"]], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.service_category__stg_medical_claim"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\service_category\\intermediate\\service_category__emergency_department_professional.sql", "compiled": true, "compiled_code": "\n\nwith __dbt__cte__service_category__stg_medical_claim as (\n\n\nselect\nAPR_DRG_CODE,\nBILL_TYPE_CODE,\nCLAIM_ID,\nCLAIM_LINE_NUMBER,\nCLAIM_TYPE,\nHCPCS_CODE,\nMS_DRG_CODE,\nPLACE_OF_SERVICE_CODE,\nREVENUE_CENTER_CODE,\n'2023-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom tuva.input_layer.medical_claim\n)select distinct \n claim_id\n, claim_line_number\n, 'Emergency Department' as service_category_2\n, '2023-12-13 23:31:59.089856+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-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom tuva.input_layer.medical_claim\n)"}]}, "model.the_tuva_project.service_category__home_health_institutional": {"database": "devforrest", "schema": "claims_preprocessing", "name": "service_category__home_health_institutional", "resource_type": "model", "package_name": "the_tuva_project", "path": "claims_preprocessing\\service_category\\intermediate\\service_category__home_health_institutional.sql", "original_file_path": "models\\claims_preprocessing\\service_category\\intermediate\\service_category__home_health_institutional.sql", "unique_id": "model.the_tuva_project.service_category__home_health_institutional", "fqn": ["the_tuva_project", "claims_preprocessing", "service_category", "intermediate", "service_category__home_health_institutional"], "alias": "_int_home_health_institutional", "checksum": {"name": "sha256", "checksum": "efb90e774ffe4cb653057354fd144a139dad955f7cab60601388b4d763137ace"}, "config": {"enabled": true, "alias": "_int_home_health_institutional", "schema": "claims_preprocessing", "database": null, "tags": ["service_category_grouper", "claims_preprocessing"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["service_category_grouper", "claims_preprocessing"], "description": "N/A", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_home_health_institutional", "materialized": "table", "tags": ["service_category_grouper", "claims_preprocessing"], "enabled": true, "bind": false}, "created_at": 1702481696.5532482, "relation_name": "devforrest.claims_preprocessing._int_home_health_institutional", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r\n )\r\n}}\r\n\r\nselect distinct \r\n claim_id\r\n, 'Home Health' as service_category_2\r\n, '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('service_category__stg_medical_claim') }}\r\nwhere claim_type = 'institutional'\r\n and left(bill_type_code,2) in ('31','32','33')", "language": "sql", "refs": [["service_category__stg_medical_claim"]], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.service_category__stg_medical_claim"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\service_category\\intermediate\\service_category__home_health_institutional.sql", "compiled": true, "compiled_code": "\n\nwith __dbt__cte__service_category__stg_medical_claim as (\n\n\nselect\nAPR_DRG_CODE,\nBILL_TYPE_CODE,\nCLAIM_ID,\nCLAIM_LINE_NUMBER,\nCLAIM_TYPE,\nHCPCS_CODE,\nMS_DRG_CODE,\nPLACE_OF_SERVICE_CODE,\nREVENUE_CENTER_CODE,\n'2023-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom tuva.input_layer.medical_claim\n)select distinct \n claim_id\n, 'Home Health' as service_category_2\n, '2023-12-13 23:31:59.089856+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-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom tuva.input_layer.medical_claim\n)"}]}, "model.the_tuva_project.service_category__home_health_professional": {"database": "devforrest", "schema": "claims_preprocessing", "name": "service_category__home_health_professional", "resource_type": "model", "package_name": "the_tuva_project", "path": "claims_preprocessing\\service_category\\intermediate\\service_category__home_health_professional.sql", "original_file_path": "models\\claims_preprocessing\\service_category\\intermediate\\service_category__home_health_professional.sql", "unique_id": "model.the_tuva_project.service_category__home_health_professional", "fqn": ["the_tuva_project", "claims_preprocessing", "service_category", "intermediate", "service_category__home_health_professional"], "alias": "_int_home_health_professional", "checksum": {"name": "sha256", "checksum": "db35d1592f7e4f81e6f32a949c491323163e8bd032a1bbb763545b7e6ca5e2c3"}, "config": {"enabled": true, "alias": "_int_home_health_professional", "schema": "claims_preprocessing", "database": null, "tags": ["service_category_grouper", "claims_preprocessing"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["service_category_grouper", "claims_preprocessing"], "description": "N/A", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_home_health_professional", "materialized": "table", "tags": ["service_category_grouper", "claims_preprocessing"], "enabled": true, "bind": false}, "created_at": 1702481696.5532482, "relation_name": "devforrest.claims_preprocessing._int_home_health_professional", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r\n )\r\n}}\r\n\r\nselect distinct \r\n a.claim_id\r\n, a.claim_line_number\r\n, 'Home Health' as service_category_2\r\n, '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('service_category__stg_medical_claim') }} a\r\nleft join {{ ref('service_category__dme_professional') }} b\r\n on a.claim_id = b.claim_id\r\n and a.claim_line_number = b.claim_line_number\r\nwhere a.claim_type = 'professional'\r\n and a.place_of_service_code in ('12')\r\n and (b.claim_id is null and b.claim_line_number is null)", "language": "sql", "refs": [["service_category__stg_medical_claim"], ["service_category__dme_professional"]], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.service_category__stg_medical_claim", "model.the_tuva_project.service_category__dme_professional"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\service_category\\intermediate\\service_category__home_health_professional.sql", "compiled": true, "compiled_code": "\n\nwith __dbt__cte__service_category__stg_medical_claim as (\n\n\nselect\nAPR_DRG_CODE,\nBILL_TYPE_CODE,\nCLAIM_ID,\nCLAIM_LINE_NUMBER,\nCLAIM_TYPE,\nHCPCS_CODE,\nMS_DRG_CODE,\nPLACE_OF_SERVICE_CODE,\nREVENUE_CENTER_CODE,\n'2023-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom tuva.input_layer.medical_claim\n)select distinct \n a.claim_id\n, a.claim_line_number\n, 'Home Health' as service_category_2\n, '2023-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom __dbt__cte__service_category__stg_medical_claim a\nleft join devforrest.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-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom tuva.input_layer.medical_claim\n)"}]}, "model.the_tuva_project.service_category__hospice_institutional": {"database": "devforrest", "schema": "claims_preprocessing", "name": "service_category__hospice_institutional", "resource_type": "model", "package_name": "the_tuva_project", "path": "claims_preprocessing\\service_category\\intermediate\\service_category__hospice_institutional.sql", "original_file_path": "models\\claims_preprocessing\\service_category\\intermediate\\service_category__hospice_institutional.sql", "unique_id": "model.the_tuva_project.service_category__hospice_institutional", "fqn": ["the_tuva_project", "claims_preprocessing", "service_category", "intermediate", "service_category__hospice_institutional"], "alias": "_int_hospice_institutional", "checksum": {"name": "sha256", "checksum": "3bc8831be11a812e16eae225c7830a2740d9b81d9f50ccec81649b4daa7d828d"}, "config": {"enabled": true, "alias": "_int_hospice_institutional", "schema": "claims_preprocessing", "database": null, "tags": ["service_category_grouper", "claims_preprocessing"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["service_category_grouper", "claims_preprocessing"], "description": "N/A", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_hospice_institutional", "materialized": "table", "tags": ["service_category_grouper", "claims_preprocessing"], "enabled": true, "bind": false}, "created_at": 1702481696.5532482, "relation_name": "devforrest.claims_preprocessing._int_hospice_institutional", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r\n )\r\n}}\r\n\r\nselect distinct \r\n claim_id\r\n, 'Hospice' as service_category_2\r\n, '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('service_category__stg_medical_claim') }}\r\nwhere claim_type = 'institutional'\r\n and left(bill_type_code,2) in ('81','82')", "language": "sql", "refs": [["service_category__stg_medical_claim"]], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.service_category__stg_medical_claim"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\service_category\\intermediate\\service_category__hospice_institutional.sql", "compiled": true, "compiled_code": "\n\nwith __dbt__cte__service_category__stg_medical_claim as (\n\n\nselect\nAPR_DRG_CODE,\nBILL_TYPE_CODE,\nCLAIM_ID,\nCLAIM_LINE_NUMBER,\nCLAIM_TYPE,\nHCPCS_CODE,\nMS_DRG_CODE,\nPLACE_OF_SERVICE_CODE,\nREVENUE_CENTER_CODE,\n'2023-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom tuva.input_layer.medical_claim\n)select distinct \n claim_id\n, 'Hospice' as service_category_2\n, '2023-12-13 23:31:59.089856+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-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom tuva.input_layer.medical_claim\n)"}]}, "model.the_tuva_project.service_category__hospice_professional": {"database": "devforrest", "schema": "claims_preprocessing", "name": "service_category__hospice_professional", "resource_type": "model", "package_name": "the_tuva_project", "path": "claims_preprocessing\\service_category\\intermediate\\service_category__hospice_professional.sql", "original_file_path": "models\\claims_preprocessing\\service_category\\intermediate\\service_category__hospice_professional.sql", "unique_id": "model.the_tuva_project.service_category__hospice_professional", "fqn": ["the_tuva_project", "claims_preprocessing", "service_category", "intermediate", "service_category__hospice_professional"], "alias": "_int_hospice_professional", "checksum": {"name": "sha256", "checksum": "9a5689f5227edac24e3411d7474e9650b4976702dd244f9e161d806016b8b556"}, "config": {"enabled": true, "alias": "_int_hospice_professional", "schema": "claims_preprocessing", "database": null, "tags": ["service_category_grouper", "claims_preprocessing"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["service_category_grouper", "claims_preprocessing"], "description": "N/A", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_hospice_professional", "materialized": "table", "tags": ["service_category_grouper", "claims_preprocessing"], "enabled": true, "bind": false}, "created_at": 1702481696.5532482, "relation_name": "devforrest.claims_preprocessing._int_hospice_professional", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r\n )\r\n}}\r\n\r\nselect distinct \r\n claim_id\r\n, claim_line_number\r\n, 'Hospice' as service_category_2\r\n, '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('service_category__stg_medical_claim') }}\r\nwhere claim_type = 'professional'\r\n and place_of_service_code in ('34')", "language": "sql", "refs": [["service_category__stg_medical_claim"]], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.service_category__stg_medical_claim"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\service_category\\intermediate\\service_category__hospice_professional.sql", "compiled": true, "compiled_code": "\n\nwith __dbt__cte__service_category__stg_medical_claim as (\n\n\nselect\nAPR_DRG_CODE,\nBILL_TYPE_CODE,\nCLAIM_ID,\nCLAIM_LINE_NUMBER,\nCLAIM_TYPE,\nHCPCS_CODE,\nMS_DRG_CODE,\nPLACE_OF_SERVICE_CODE,\nREVENUE_CENTER_CODE,\n'2023-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom tuva.input_layer.medical_claim\n)select distinct \n claim_id\n, claim_line_number\n, 'Hospice' as service_category_2\n, '2023-12-13 23:31:59.089856+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-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom tuva.input_layer.medical_claim\n)"}]}, "model.the_tuva_project.service_category__inpatient_psychiatric_professional": {"database": "devforrest", "schema": "claims_preprocessing", "name": "service_category__inpatient_psychiatric_professional", "resource_type": "model", "package_name": "the_tuva_project", "path": "claims_preprocessing\\service_category\\intermediate\\service_category__inpatient_psychiatric_professional.sql", "original_file_path": "models\\claims_preprocessing\\service_category\\intermediate\\service_category__inpatient_psychiatric_professional.sql", "unique_id": "model.the_tuva_project.service_category__inpatient_psychiatric_professional", "fqn": ["the_tuva_project", "claims_preprocessing", "service_category", "intermediate", "service_category__inpatient_psychiatric_professional"], "alias": "_int_inpatient_psychiatric_professional", "checksum": {"name": "sha256", "checksum": "b3b9c8cc407ad449f552a3c4253f23c8c3be51564ecb5fc14206799fabf4ad9d"}, "config": {"enabled": true, "alias": "_int_inpatient_psychiatric_professional", "schema": "claims_preprocessing", "database": null, "tags": ["service_category_grouper", "claims_preprocessing"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["service_category_grouper", "claims_preprocessing"], "description": "N/A", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_inpatient_psychiatric_professional", "materialized": "table", "tags": ["service_category_grouper", "claims_preprocessing"], "enabled": true, "bind": false}, "created_at": 1702481696.5532482, "relation_name": "devforrest.claims_preprocessing._int_inpatient_psychiatric_professional", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r\n )\r\n}}\r\n\r\nselect distinct \r\n claim_id\r\n, claim_line_number\r\n, 'Inpatient Psychiatric' as service_category_2\r\n, '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('service_category__stg_medical_claim') }}\r\nwhere claim_type = 'professional'\r\n and place_of_service_code in ('51','55','56')", "language": "sql", "refs": [["service_category__stg_medical_claim"]], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.service_category__stg_medical_claim"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\service_category\\intermediate\\service_category__inpatient_psychiatric_professional.sql", "compiled": true, "compiled_code": "\n\nwith __dbt__cte__service_category__stg_medical_claim as (\n\n\nselect\nAPR_DRG_CODE,\nBILL_TYPE_CODE,\nCLAIM_ID,\nCLAIM_LINE_NUMBER,\nCLAIM_TYPE,\nHCPCS_CODE,\nMS_DRG_CODE,\nPLACE_OF_SERVICE_CODE,\nREVENUE_CENTER_CODE,\n'2023-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom tuva.input_layer.medical_claim\n)select distinct \n claim_id\n, claim_line_number\n, 'Inpatient Psychiatric' as service_category_2\n, '2023-12-13 23:31:59.089856+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-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom tuva.input_layer.medical_claim\n)"}]}, "model.the_tuva_project.service_category__inpatient_rehab_professional": {"database": "devforrest", "schema": "claims_preprocessing", "name": "service_category__inpatient_rehab_professional", "resource_type": "model", "package_name": "the_tuva_project", "path": "claims_preprocessing\\service_category\\intermediate\\service_category__inpatient_rehab_professional.sql", "original_file_path": "models\\claims_preprocessing\\service_category\\intermediate\\service_category__inpatient_rehab_professional.sql", "unique_id": "model.the_tuva_project.service_category__inpatient_rehab_professional", "fqn": ["the_tuva_project", "claims_preprocessing", "service_category", "intermediate", "service_category__inpatient_rehab_professional"], "alias": "_int_inpatient_rehab_professional", "checksum": {"name": "sha256", "checksum": "202e394bb6ed3de077f9961f8b7eac1a0019b4cbd89cbe8549e82236c927ed3f"}, "config": {"enabled": true, "alias": "_int_inpatient_rehab_professional", "schema": "claims_preprocessing", "database": null, "tags": ["service_category_grouper", "claims_preprocessing"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["service_category_grouper", "claims_preprocessing"], "description": "N/A", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_inpatient_rehab_professional", "materialized": "table", "tags": ["service_category_grouper", "claims_preprocessing"], "enabled": true, "bind": false}, "created_at": 1702481696.5708456, "relation_name": "devforrest.claims_preprocessing._int_inpatient_rehab_professional", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r\n )\r\n}}\r\n\r\nselect distinct \r\n claim_id\r\n, claim_line_number\r\n, 'Inpatient Rehabilitation' as service_category_2\r\n, '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('service_category__stg_medical_claim') }}\r\nwhere claim_type = 'professional'\r\n and place_of_service_code in ('61')", "language": "sql", "refs": [["service_category__stg_medical_claim"]], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.service_category__stg_medical_claim"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\service_category\\intermediate\\service_category__inpatient_rehab_professional.sql", "compiled": true, "compiled_code": "\n\nwith __dbt__cte__service_category__stg_medical_claim as (\n\n\nselect\nAPR_DRG_CODE,\nBILL_TYPE_CODE,\nCLAIM_ID,\nCLAIM_LINE_NUMBER,\nCLAIM_TYPE,\nHCPCS_CODE,\nMS_DRG_CODE,\nPLACE_OF_SERVICE_CODE,\nREVENUE_CENTER_CODE,\n'2023-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom tuva.input_layer.medical_claim\n)select distinct \n claim_id\n, claim_line_number\n, 'Inpatient Rehabilitation' as service_category_2\n, '2023-12-13 23:31:59.089856+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-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom tuva.input_layer.medical_claim\n)"}]}, "model.the_tuva_project.service_category__lab_institutional": {"database": "devforrest", "schema": "claims_preprocessing", "name": "service_category__lab_institutional", "resource_type": "model", "package_name": "the_tuva_project", "path": "claims_preprocessing\\service_category\\intermediate\\service_category__lab_institutional.sql", "original_file_path": "models\\claims_preprocessing\\service_category\\intermediate\\service_category__lab_institutional.sql", "unique_id": "model.the_tuva_project.service_category__lab_institutional", "fqn": ["the_tuva_project", "claims_preprocessing", "service_category", "intermediate", "service_category__lab_institutional"], "alias": "_int_lab_institutional", "checksum": {"name": "sha256", "checksum": "ccc73a53515e6e1353b99078dd083379f868eaaea51ae614401b6151c6f4d7e0"}, "config": {"enabled": true, "alias": "_int_lab_institutional", "schema": "claims_preprocessing", "database": null, "tags": ["service_category_grouper", "claims_preprocessing"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["service_category_grouper", "claims_preprocessing"], "description": "N/A", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_lab_institutional", "materialized": "table", "tags": ["service_category_grouper", "claims_preprocessing"], "enabled": true, "bind": false}, "created_at": 1702481696.5738988, "relation_name": "devforrest.claims_preprocessing._int_lab_institutional", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r\n )\r\n}}\r\n\r\nselect distinct \r\n claim_id\r\n, 'Lab' as service_category_2\r\n, '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('service_category__stg_medical_claim') }}\r\nwhere claim_type = 'institutional'\r\n and left(bill_type_code,2) in ('14')", "language": "sql", "refs": [["service_category__stg_medical_claim"]], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.service_category__stg_medical_claim"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\service_category\\intermediate\\service_category__lab_institutional.sql", "compiled": true, "compiled_code": "\n\nwith __dbt__cte__service_category__stg_medical_claim as (\n\n\nselect\nAPR_DRG_CODE,\nBILL_TYPE_CODE,\nCLAIM_ID,\nCLAIM_LINE_NUMBER,\nCLAIM_TYPE,\nHCPCS_CODE,\nMS_DRG_CODE,\nPLACE_OF_SERVICE_CODE,\nREVENUE_CENTER_CODE,\n'2023-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom tuva.input_layer.medical_claim\n)select distinct \n claim_id\n, 'Lab' as service_category_2\n, '2023-12-13 23:31:59.089856+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-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom tuva.input_layer.medical_claim\n)"}]}, "model.the_tuva_project.service_category__lab_professional": {"database": "devforrest", "schema": "claims_preprocessing", "name": "service_category__lab_professional", "resource_type": "model", "package_name": "the_tuva_project", "path": "claims_preprocessing\\service_category\\intermediate\\service_category__lab_professional.sql", "original_file_path": "models\\claims_preprocessing\\service_category\\intermediate\\service_category__lab_professional.sql", "unique_id": "model.the_tuva_project.service_category__lab_professional", "fqn": ["the_tuva_project", "claims_preprocessing", "service_category", "intermediate", "service_category__lab_professional"], "alias": "_int_lab_professional", "checksum": {"name": "sha256", "checksum": "c0cb05661eb5c335447327f638b0317dad985f25b2485e01275746138b448fbf"}, "config": {"enabled": true, "alias": "_int_lab_professional", "schema": "claims_preprocessing", "database": null, "tags": ["service_category_grouper", "claims_preprocessing"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["service_category_grouper", "claims_preprocessing"], "description": "N/A", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_lab_professional", "materialized": "table", "tags": ["service_category_grouper", "claims_preprocessing"], "enabled": true, "bind": false}, "created_at": 1702481696.5738988, "relation_name": "devforrest.claims_preprocessing._int_lab_professional", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r\n )\r\n}}\r\n\r\nselect distinct \r\n claim_id\r\n, claim_line_number\r\n, 'Lab' as service_category_2\r\n, '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('service_category__stg_medical_claim') }}\r\nwhere claim_type = 'professional'\r\n and place_of_service_code = '81'", "language": "sql", "refs": [["service_category__stg_medical_claim"]], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.service_category__stg_medical_claim"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\service_category\\intermediate\\service_category__lab_professional.sql", "compiled": true, "compiled_code": "\n\nwith __dbt__cte__service_category__stg_medical_claim as (\n\n\nselect\nAPR_DRG_CODE,\nBILL_TYPE_CODE,\nCLAIM_ID,\nCLAIM_LINE_NUMBER,\nCLAIM_TYPE,\nHCPCS_CODE,\nMS_DRG_CODE,\nPLACE_OF_SERVICE_CODE,\nREVENUE_CENTER_CODE,\n'2023-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom tuva.input_layer.medical_claim\n)select distinct \n claim_id\n, claim_line_number\n, 'Lab' as service_category_2\n, '2023-12-13 23:31:59.089856+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-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom tuva.input_layer.medical_claim\n)"}]}, "model.the_tuva_project.service_category__office_visit_professional": {"database": "devforrest", "schema": "claims_preprocessing", "name": "service_category__office_visit_professional", "resource_type": "model", "package_name": "the_tuva_project", "path": "claims_preprocessing\\service_category\\intermediate\\service_category__office_visit_professional.sql", "original_file_path": "models\\claims_preprocessing\\service_category\\intermediate\\service_category__office_visit_professional.sql", "unique_id": "model.the_tuva_project.service_category__office_visit_professional", "fqn": ["the_tuva_project", "claims_preprocessing", "service_category", "intermediate", "service_category__office_visit_professional"], "alias": "_int_office_visit_professional", "checksum": {"name": "sha256", "checksum": "44ababd289d8045ee2c9140015196a46dfc087cd6173deb0ce511fd30a04b59c"}, "config": {"enabled": true, "alias": "_int_office_visit_professional", "schema": "claims_preprocessing", "database": null, "tags": ["service_category_grouper", "claims_preprocessing"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["service_category_grouper", "claims_preprocessing"], "description": "N/A", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_office_visit_professional", "materialized": "table", "tags": ["service_category_grouper", "claims_preprocessing"], "enabled": true, "bind": false}, "created_at": 1702481696.5738988, "relation_name": "devforrest.claims_preprocessing._int_office_visit_professional", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r\n )\r\n}}\r\n\r\nselect distinct \r\n claim_id\r\n, claim_line_number\r\n, 'Office Visit' as service_category_2\r\n, '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('service_category__stg_medical_claim') }}\r\nwhere claim_type = 'professional'\r\n and place_of_service_code in ('11','02')", "language": "sql", "refs": [["service_category__stg_medical_claim"]], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.service_category__stg_medical_claim"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\service_category\\intermediate\\service_category__office_visit_professional.sql", "compiled": true, "compiled_code": "\n\nwith __dbt__cte__service_category__stg_medical_claim as (\n\n\nselect\nAPR_DRG_CODE,\nBILL_TYPE_CODE,\nCLAIM_ID,\nCLAIM_LINE_NUMBER,\nCLAIM_TYPE,\nHCPCS_CODE,\nMS_DRG_CODE,\nPLACE_OF_SERVICE_CODE,\nREVENUE_CENTER_CODE,\n'2023-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom tuva.input_layer.medical_claim\n)select distinct \n claim_id\n, claim_line_number\n, 'Office Visit' as service_category_2\n, '2023-12-13 23:31:59.089856+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-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom tuva.input_layer.medical_claim\n)"}]}, "model.the_tuva_project.service_category__outpatient_hospital_or_clinic_institutional": {"database": "devforrest", "schema": "claims_preprocessing", "name": "service_category__outpatient_hospital_or_clinic_institutional", "resource_type": "model", "package_name": "the_tuva_project", "path": "claims_preprocessing\\service_category\\intermediate\\service_category__outpatient_hospital_or_clinic_institutional.sql", "original_file_path": "models\\claims_preprocessing\\service_category\\intermediate\\service_category__outpatient_hospital_or_clinic_institutional.sql", "unique_id": "model.the_tuva_project.service_category__outpatient_hospital_or_clinic_institutional", "fqn": ["the_tuva_project", "claims_preprocessing", "service_category", "intermediate", "service_category__outpatient_hospital_or_clinic_institutional"], "alias": "_int_outpatient_hospital_or_clinic_institutional", "checksum": {"name": "sha256", "checksum": "32ff91af7dcb9e139efd403486bed63509b968fc152a588184a1482bdf2b2321"}, "config": {"enabled": true, "alias": "_int_outpatient_hospital_or_clinic_institutional", "schema": "claims_preprocessing", "database": null, "tags": ["service_category_grouper", "claims_preprocessing"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["service_category_grouper", "claims_preprocessing"], "description": "N/A", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_outpatient_hospital_or_clinic_institutional", "materialized": "table", "tags": ["service_category_grouper", "claims_preprocessing"], "enabled": true, "bind": false}, "created_at": 1702481696.5738988, "relation_name": "devforrest.claims_preprocessing._int_outpatient_hospital_or_clinic_institutional", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r\n )\r\n}}\r\n\r\nselect distinct \r\n a.claim_id\r\n, 'Outpatient Hospital or Clinic' as service_category_2\r\n, '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('service_category__stg_medical_claim') }} a\r\nleft join {{ ref('service_category__emergency_department_institutional') }} b\r\n on a.claim_id = b.claim_id\r\nleft join {{ ref('service_category__urgent_care_institutional') }} c\r\n on a.claim_id = c.claim_id\r\nwhere a.claim_type = 'institutional'\r\n and left(a.bill_type_code,2) in ('13','71','73')\r\n and b.claim_id is null\r\n and c.claim_id is null", "language": "sql", "refs": [["service_category__stg_medical_claim"], ["service_category__emergency_department_institutional"], ["service_category__urgent_care_institutional"]], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.service_category__stg_medical_claim", "model.the_tuva_project.service_category__emergency_department_institutional", "model.the_tuva_project.service_category__urgent_care_institutional"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\service_category\\intermediate\\service_category__outpatient_hospital_or_clinic_institutional.sql", "compiled": true, "compiled_code": "\n\nwith __dbt__cte__service_category__stg_medical_claim as (\n\n\nselect\nAPR_DRG_CODE,\nBILL_TYPE_CODE,\nCLAIM_ID,\nCLAIM_LINE_NUMBER,\nCLAIM_TYPE,\nHCPCS_CODE,\nMS_DRG_CODE,\nPLACE_OF_SERVICE_CODE,\nREVENUE_CENTER_CODE,\n'2023-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom tuva.input_layer.medical_claim\n)select distinct \n a.claim_id\n, 'Outpatient Hospital or Clinic' as service_category_2\n, '2023-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom __dbt__cte__service_category__stg_medical_claim a\nleft join devforrest.claims_preprocessing._int_emergency_department_institutional b\n on a.claim_id = b.claim_id\nleft join devforrest.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-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom tuva.input_layer.medical_claim\n)"}]}, "model.the_tuva_project.service_category__outpatient_hospital_or_clinic_professional": {"database": "devforrest", "schema": "claims_preprocessing", "name": "service_category__outpatient_hospital_or_clinic_professional", "resource_type": "model", "package_name": "the_tuva_project", "path": "claims_preprocessing\\service_category\\intermediate\\service_category__outpatient_hospital_or_clinic_professional.sql", "original_file_path": "models\\claims_preprocessing\\service_category\\intermediate\\service_category__outpatient_hospital_or_clinic_professional.sql", "unique_id": "model.the_tuva_project.service_category__outpatient_hospital_or_clinic_professional", "fqn": ["the_tuva_project", "claims_preprocessing", "service_category", "intermediate", "service_category__outpatient_hospital_or_clinic_professional"], "alias": "_int_outpatient_hospital_or_clinic_professional", "checksum": {"name": "sha256", "checksum": "1c399c15ab5818875a0316a7f093aa2cc445f4cd8dca48bbdedd8387779ef127"}, "config": {"enabled": true, "alias": "_int_outpatient_hospital_or_clinic_professional", "schema": "claims_preprocessing", "database": null, "tags": ["service_category_grouper", "claims_preprocessing"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["service_category_grouper", "claims_preprocessing"], "description": "N/A", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_outpatient_hospital_or_clinic_professional", "materialized": "table", "tags": ["service_category_grouper", "claims_preprocessing"], "enabled": true, "bind": false}, "created_at": 1702481696.5738988, "relation_name": "devforrest.claims_preprocessing._int_outpatient_hospital_or_clinic_professional", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r\n )\r\n}}\r\n\r\nselect distinct \r\n claim_id\r\n, claim_line_number\r\n, 'Outpatient Hospital or Clinic' as service_category_2\r\n, '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('service_category__stg_medical_claim') }}\r\nwhere claim_type = 'professional'\r\n and place_of_service_code in ('15','17','19','22','49','50','60','71','72')", "language": "sql", "refs": [["service_category__stg_medical_claim"]], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.service_category__stg_medical_claim"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\service_category\\intermediate\\service_category__outpatient_hospital_or_clinic_professional.sql", "compiled": true, "compiled_code": "\n\nwith __dbt__cte__service_category__stg_medical_claim as (\n\n\nselect\nAPR_DRG_CODE,\nBILL_TYPE_CODE,\nCLAIM_ID,\nCLAIM_LINE_NUMBER,\nCLAIM_TYPE,\nHCPCS_CODE,\nMS_DRG_CODE,\nPLACE_OF_SERVICE_CODE,\nREVENUE_CENTER_CODE,\n'2023-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom tuva.input_layer.medical_claim\n)select distinct \n claim_id\n, claim_line_number\n, 'Outpatient Hospital or Clinic' as service_category_2\n, '2023-12-13 23:31:59.089856+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-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom tuva.input_layer.medical_claim\n)"}]}, "model.the_tuva_project.service_category__outpatient_psychiatric_institutional": {"database": "devforrest", "schema": "claims_preprocessing", "name": "service_category__outpatient_psychiatric_institutional", "resource_type": "model", "package_name": "the_tuva_project", "path": "claims_preprocessing\\service_category\\intermediate\\service_category__outpatient_psychiatric_institutional.sql", "original_file_path": "models\\claims_preprocessing\\service_category\\intermediate\\service_category__outpatient_psychiatric_institutional.sql", "unique_id": "model.the_tuva_project.service_category__outpatient_psychiatric_institutional", "fqn": ["the_tuva_project", "claims_preprocessing", "service_category", "intermediate", "service_category__outpatient_psychiatric_institutional"], "alias": "_int_outpatient_psychiatric_institutional", "checksum": {"name": "sha256", "checksum": "cc4578150352a181c4b5118b91993beb634abe3b8bb5631bdba9e8cb0f03361f"}, "config": {"enabled": true, "alias": "_int_outpatient_psychiatric_institutional", "schema": "claims_preprocessing", "database": null, "tags": ["service_category_grouper", "claims_preprocessing"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["service_category_grouper", "claims_preprocessing"], "description": "N/A", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_outpatient_psychiatric_institutional", "materialized": "table", "tags": ["service_category_grouper", "claims_preprocessing"], "enabled": true, "bind": false}, "created_at": 1702481696.5898526, "relation_name": "devforrest.claims_preprocessing._int_outpatient_psychiatric_institutional", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r\n )\r\n}}\r\n\r\nselect distinct \r\n claim_id\r\n, 'Outpatient Psychiatric' as service_category_2\r\n, '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('service_category__stg_medical_claim') }}\r\nwhere claim_type = 'institutional'\r\n and left(bill_type_code,2) in ('52')", "language": "sql", "refs": [["service_category__stg_medical_claim"]], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.service_category__stg_medical_claim"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\service_category\\intermediate\\service_category__outpatient_psychiatric_institutional.sql", "compiled": true, "compiled_code": "\n\nwith __dbt__cte__service_category__stg_medical_claim as (\n\n\nselect\nAPR_DRG_CODE,\nBILL_TYPE_CODE,\nCLAIM_ID,\nCLAIM_LINE_NUMBER,\nCLAIM_TYPE,\nHCPCS_CODE,\nMS_DRG_CODE,\nPLACE_OF_SERVICE_CODE,\nREVENUE_CENTER_CODE,\n'2023-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom tuva.input_layer.medical_claim\n)select distinct \n claim_id\n, 'Outpatient Psychiatric' as service_category_2\n, '2023-12-13 23:31:59.089856+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-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom tuva.input_layer.medical_claim\n)"}]}, "model.the_tuva_project.service_category__outpatient_psychiatric_professional": {"database": "devforrest", "schema": "claims_preprocessing", "name": "service_category__outpatient_psychiatric_professional", "resource_type": "model", "package_name": "the_tuva_project", "path": "claims_preprocessing\\service_category\\intermediate\\service_category__outpatient_psychiatric_professional.sql", "original_file_path": "models\\claims_preprocessing\\service_category\\intermediate\\service_category__outpatient_psychiatric_professional.sql", "unique_id": "model.the_tuva_project.service_category__outpatient_psychiatric_professional", "fqn": ["the_tuva_project", "claims_preprocessing", "service_category", "intermediate", "service_category__outpatient_psychiatric_professional"], "alias": "_int_outpatient_psychiatric_professional", "checksum": {"name": "sha256", "checksum": "e1fa4188a9df6040ced7494410a4e588b9e2d6f4c54d56564324624cdc66f375"}, "config": {"enabled": true, "alias": "_int_outpatient_psychiatric_professional", "schema": "claims_preprocessing", "database": null, "tags": ["service_category_grouper", "claims_preprocessing"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["service_category_grouper", "claims_preprocessing"], "description": "N/A", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_outpatient_psychiatric_professional", "materialized": "table", "tags": ["service_category_grouper", "claims_preprocessing"], "enabled": true, "bind": false}, "created_at": 1702481696.5939422, "relation_name": "devforrest.claims_preprocessing._int_outpatient_psychiatric_professional", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r\n )\r\n}}\r\n\r\nselect distinct \r\n claim_id\r\n, claim_line_number\r\n, 'Outpatient Psychiatric' as service_category_2\r\n, '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('service_category__stg_medical_claim') }}\r\nwhere claim_type = 'professional'\r\n and place_of_service_code in ('52','53','57','58')", "language": "sql", "refs": [["service_category__stg_medical_claim"]], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.service_category__stg_medical_claim"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\service_category\\intermediate\\service_category__outpatient_psychiatric_professional.sql", "compiled": true, "compiled_code": "\n\nwith __dbt__cte__service_category__stg_medical_claim as (\n\n\nselect\nAPR_DRG_CODE,\nBILL_TYPE_CODE,\nCLAIM_ID,\nCLAIM_LINE_NUMBER,\nCLAIM_TYPE,\nHCPCS_CODE,\nMS_DRG_CODE,\nPLACE_OF_SERVICE_CODE,\nREVENUE_CENTER_CODE,\n'2023-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom tuva.input_layer.medical_claim\n)select distinct \n claim_id\n, claim_line_number\n, 'Outpatient Psychiatric' as service_category_2\n, '2023-12-13 23:31:59.089856+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-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom tuva.input_layer.medical_claim\n)"}]}, "model.the_tuva_project.service_category__outpatient_rehab_professional": {"database": "devforrest", "schema": "claims_preprocessing", "name": "service_category__outpatient_rehab_professional", "resource_type": "model", "package_name": "the_tuva_project", "path": "claims_preprocessing\\service_category\\intermediate\\service_category__outpatient_rehab_professional.sql", "original_file_path": "models\\claims_preprocessing\\service_category\\intermediate\\service_category__outpatient_rehab_professional.sql", "unique_id": "model.the_tuva_project.service_category__outpatient_rehab_professional", "fqn": ["the_tuva_project", "claims_preprocessing", "service_category", "intermediate", "service_category__outpatient_rehab_professional"], "alias": "_int_outpatient_rehab_professional", "checksum": {"name": "sha256", "checksum": "a82703bf4e7373d72097ea876af395212a4547433e54a6b86a754ea79907ac0a"}, "config": {"enabled": true, "alias": "_int_outpatient_rehab_professional", "schema": "claims_preprocessing", "database": null, "tags": ["service_category_grouper", "claims_preprocessing"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["service_category_grouper", "claims_preprocessing"], "description": "N/A", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_outpatient_rehab_professional", "materialized": "table", "tags": ["service_category_grouper", "claims_preprocessing"], "enabled": true, "bind": false}, "created_at": 1702481696.5969446, "relation_name": "devforrest.claims_preprocessing._int_outpatient_rehab_professional", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r\n )\r\n}}\r\n\r\nselect distinct \r\n claim_id\r\n, claim_line_number\r\n, 'Outpatient Rehabilitation' as service_category_2\r\n, '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('service_category__stg_medical_claim') }}\r\nwhere claim_type = 'professional'\r\n and place_of_service_code in ('62')", "language": "sql", "refs": [["service_category__stg_medical_claim"]], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.service_category__stg_medical_claim"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\service_category\\intermediate\\service_category__outpatient_rehab_professional.sql", "compiled": true, "compiled_code": "\n\nwith __dbt__cte__service_category__stg_medical_claim as (\n\n\nselect\nAPR_DRG_CODE,\nBILL_TYPE_CODE,\nCLAIM_ID,\nCLAIM_LINE_NUMBER,\nCLAIM_TYPE,\nHCPCS_CODE,\nMS_DRG_CODE,\nPLACE_OF_SERVICE_CODE,\nREVENUE_CENTER_CODE,\n'2023-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom tuva.input_layer.medical_claim\n)select distinct \n claim_id\n, claim_line_number\n, 'Outpatient Rehabilitation' as service_category_2\n, '2023-12-13 23:31:59.089856+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-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom tuva.input_layer.medical_claim\n)"}]}, "model.the_tuva_project.service_category__skilled_nursing_institutional": {"database": "devforrest", "schema": "claims_preprocessing", "name": "service_category__skilled_nursing_institutional", "resource_type": "model", "package_name": "the_tuva_project", "path": "claims_preprocessing\\service_category\\intermediate\\service_category__skilled_nursing_institutional.sql", "original_file_path": "models\\claims_preprocessing\\service_category\\intermediate\\service_category__skilled_nursing_institutional.sql", "unique_id": "model.the_tuva_project.service_category__skilled_nursing_institutional", "fqn": ["the_tuva_project", "claims_preprocessing", "service_category", "intermediate", "service_category__skilled_nursing_institutional"], "alias": "_int_skilled_nursing_institutional", "checksum": {"name": "sha256", "checksum": "95189065009a39d41e95fd40c6cf9fbbd50087c6ce48819c993ba85cf7660a62"}, "config": {"enabled": true, "alias": "_int_skilled_nursing_institutional", "schema": "claims_preprocessing", "database": null, "tags": ["service_category_grouper", "claims_preprocessing"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["service_category_grouper", "claims_preprocessing"], "description": "N/A", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_skilled_nursing_institutional", "materialized": "table", "tags": ["service_category_grouper", "claims_preprocessing"], "enabled": true, "bind": false}, "created_at": 1702481696.5999439, "relation_name": "devforrest.claims_preprocessing._int_skilled_nursing_institutional", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r\n )\r\n}}\r\n\r\nselect distinct \r\n claim_id\r\n, 'Skilled Nursing' as service_category_2\r\n, '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('service_category__stg_medical_claim') }}\r\nwhere claim_type = 'institutional'\r\n and left(bill_type_code,2) in ('21','22')", "language": "sql", "refs": [["service_category__stg_medical_claim"]], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.service_category__stg_medical_claim"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\service_category\\intermediate\\service_category__skilled_nursing_institutional.sql", "compiled": true, "compiled_code": "\n\nwith __dbt__cte__service_category__stg_medical_claim as (\n\n\nselect\nAPR_DRG_CODE,\nBILL_TYPE_CODE,\nCLAIM_ID,\nCLAIM_LINE_NUMBER,\nCLAIM_TYPE,\nHCPCS_CODE,\nMS_DRG_CODE,\nPLACE_OF_SERVICE_CODE,\nREVENUE_CENTER_CODE,\n'2023-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom tuva.input_layer.medical_claim\n)select distinct \n claim_id\n, 'Skilled Nursing' as service_category_2\n, '2023-12-13 23:31:59.089856+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-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom tuva.input_layer.medical_claim\n)"}]}, "model.the_tuva_project.service_category__skilled_nursing_professional": {"database": "devforrest", "schema": "claims_preprocessing", "name": "service_category__skilled_nursing_professional", "resource_type": "model", "package_name": "the_tuva_project", "path": "claims_preprocessing\\service_category\\intermediate\\service_category__skilled_nursing_professional.sql", "original_file_path": "models\\claims_preprocessing\\service_category\\intermediate\\service_category__skilled_nursing_professional.sql", "unique_id": "model.the_tuva_project.service_category__skilled_nursing_professional", "fqn": ["the_tuva_project", "claims_preprocessing", "service_category", "intermediate", "service_category__skilled_nursing_professional"], "alias": "_int_skilled_nursing_professional", "checksum": {"name": "sha256", "checksum": "c43c5519de8e58ff36fdad21e76aeceef9c48140e4b55c464db4369defb269cd"}, "config": {"enabled": true, "alias": "_int_skilled_nursing_professional", "schema": "claims_preprocessing", "database": null, "tags": ["service_category_grouper", "claims_preprocessing"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["service_category_grouper", "claims_preprocessing"], "description": "N/A", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_skilled_nursing_professional", "materialized": "table", "tags": ["service_category_grouper", "claims_preprocessing"], "enabled": true, "bind": false}, "created_at": 1702481696.6029646, "relation_name": "devforrest.claims_preprocessing._int_skilled_nursing_professional", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r\n )\r\n}}\r\n\r\nselect distinct \r\n a.claim_id\r\n, a.claim_line_number\r\n, 'Skilled Nursing' as service_category_2\r\n, '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('service_category__stg_medical_claim') }} a\r\nleft join {{ ref('service_category__dme_professional') }} b\r\n on a.claim_id = b.claim_id\r\n and a.claim_line_number = b.claim_line_number\r\nwhere claim_type = 'professional'\r\n and place_of_service_code in ('31','32')\r\n and (b.claim_id is null and b.claim_line_number is null)", "language": "sql", "refs": [["service_category__stg_medical_claim"], ["service_category__dme_professional"]], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.service_category__stg_medical_claim", "model.the_tuva_project.service_category__dme_professional"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\service_category\\intermediate\\service_category__skilled_nursing_professional.sql", "compiled": true, "compiled_code": "\n\nwith __dbt__cte__service_category__stg_medical_claim as (\n\n\nselect\nAPR_DRG_CODE,\nBILL_TYPE_CODE,\nCLAIM_ID,\nCLAIM_LINE_NUMBER,\nCLAIM_TYPE,\nHCPCS_CODE,\nMS_DRG_CODE,\nPLACE_OF_SERVICE_CODE,\nREVENUE_CENTER_CODE,\n'2023-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom tuva.input_layer.medical_claim\n)select distinct \n a.claim_id\n, a.claim_line_number\n, 'Skilled Nursing' as service_category_2\n, '2023-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom __dbt__cte__service_category__stg_medical_claim a\nleft join devforrest.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-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom tuva.input_layer.medical_claim\n)"}]}, "model.the_tuva_project.service_category__urgent_care_institutional": {"database": "devforrest", "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": "7a992e3f3c4d3828fab8d34340e7ad1b71c8cedbf7c38ee54f0f155e826cbb3e"}, "config": {"enabled": true, "alias": "_int_urgent_care_institutional", "schema": "claims_preprocessing", "database": null, "tags": ["service_category_grouper", "claims_preprocessing"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["service_category_grouper", "claims_preprocessing"], "description": "N/A", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_urgent_care_institutional", "materialized": "table", "tags": ["service_category_grouper", "claims_preprocessing"], "enabled": true, "bind": false}, "created_at": 1702481696.6059468, "relation_name": "devforrest.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 a.claim_id\r\n, 'Urgent Care' as service_category_2\r\n, '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('service_category__stg_medical_claim') }} a\r\nleft join {{ ref('service_category__emergency_department_institutional') }} b\r\n on a.claim_id = b.claim_id\r\nwhere claim_type = 'institutional'\r\n and revenue_center_code = '0456'\r\n and left(bill_type_code,2) in ('13','71','73')\r\n and b.claim_id is null", "language": "sql", "refs": [["service_category__stg_medical_claim"], ["service_category__emergency_department_institutional"]], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.service_category__stg_medical_claim", "model.the_tuva_project.service_category__emergency_department_institutional"]}, "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-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom tuva.input_layer.medical_claim\n)select distinct \n a.claim_id\n, 'Urgent Care' as service_category_2\n, '2023-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom __dbt__cte__service_category__stg_medical_claim a\nleft join devforrest.claims_preprocessing._int_emergency_department_institutional b\n on a.claim_id = b.claim_id\nwhere claim_type = 'institutional'\n and revenue_center_code = '0456'\n and left(bill_type_code,2) in ('13','71','73')\n and b.claim_id is null", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.the_tuva_project.service_category__stg_medical_claim", "sql": " __dbt__cte__service_category__stg_medical_claim as (\n\n\nselect\nAPR_DRG_CODE,\nBILL_TYPE_CODE,\nCLAIM_ID,\nCLAIM_LINE_NUMBER,\nCLAIM_TYPE,\nHCPCS_CODE,\nMS_DRG_CODE,\nPLACE_OF_SERVICE_CODE,\nREVENUE_CENTER_CODE,\n'2023-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom tuva.input_layer.medical_claim\n)"}]}, "model.the_tuva_project.service_category__urgent_care_professional": {"database": "devforrest", "schema": "claims_preprocessing", "name": "service_category__urgent_care_professional", "resource_type": "model", "package_name": "the_tuva_project", "path": "claims_preprocessing\\service_category\\intermediate\\service_category__urgent_care_professional.sql", "original_file_path": "models\\claims_preprocessing\\service_category\\intermediate\\service_category__urgent_care_professional.sql", "unique_id": "model.the_tuva_project.service_category__urgent_care_professional", "fqn": ["the_tuva_project", "claims_preprocessing", "service_category", "intermediate", "service_category__urgent_care_professional"], "alias": "_int_urgent_care_professional", "checksum": {"name": "sha256", "checksum": "997ffe7833fd3ceb34e168fb79278b6b99eb8e0526588cf1aa7d2c8fc212ff0b"}, "config": {"enabled": true, "alias": "_int_urgent_care_professional", "schema": "claims_preprocessing", "database": null, "tags": ["service_category_grouper", "claims_preprocessing"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["service_category_grouper", "claims_preprocessing"], "description": "N/A", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_int_urgent_care_professional", "materialized": "table", "tags": ["service_category_grouper", "claims_preprocessing"], "enabled": true, "bind": false}, "created_at": 1702481696.6089537, "relation_name": "devforrest.claims_preprocessing._int_urgent_care_professional", "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r\n )\r\n}}\r\n\r\nselect distinct \r\n claim_id\r\n, claim_line_number\r\n, 'Urgent Care' as service_category_2\r\n, '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('service_category__stg_medical_claim') }}\r\nwhere claim_type = 'professional'\r\n and place_of_service_code in ('20')", "language": "sql", "refs": [["service_category__stg_medical_claim"]], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.service_category__stg_medical_claim"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\service_category\\intermediate\\service_category__urgent_care_professional.sql", "compiled": true, "compiled_code": "\n\nwith __dbt__cte__service_category__stg_medical_claim as (\n\n\nselect\nAPR_DRG_CODE,\nBILL_TYPE_CODE,\nCLAIM_ID,\nCLAIM_LINE_NUMBER,\nCLAIM_TYPE,\nHCPCS_CODE,\nMS_DRG_CODE,\nPLACE_OF_SERVICE_CODE,\nREVENUE_CENTER_CODE,\n'2023-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom tuva.input_layer.medical_claim\n)select distinct \n claim_id\n, claim_line_number\n, 'Urgent Care' as service_category_2\n, '2023-12-13 23:31:59.089856+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-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom tuva.input_layer.medical_claim\n)"}]}, "model.the_tuva_project.service_category__stg_medical_claim": {"database": "devforrest", "schema": "dbt_forrest", "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", "claims_preprocessing"], "meta": {}, "materialized": "ephemeral", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["service_category_grouper", "claims_preprocessing"], "description": "Staging med claims for sc grouper", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "ephemeral", "tags": ["service_category_grouper", "claims_preprocessing"], "enabled": true, "bind": false}, "created_at": 1702481696.6149483, "relation_name": null, "raw_code": "{{ config(\r\n enabled = var('claims_preprocessing_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r\n )\r\n}}\r\n\r\nselect\r\nAPR_DRG_CODE,\r\nBILL_TYPE_CODE,\r\nCLAIM_ID,\r\nCLAIM_LINE_NUMBER,\r\nCLAIM_TYPE,\r\nHCPCS_CODE,\r\nMS_DRG_CODE,\r\nPLACE_OF_SERVICE_CODE,\r\nREVENUE_CENTER_CODE,\r\n'{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('medical_claim') }}", "language": "sql", "refs": [["medical_claim"]], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.input_layer.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-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom tuva.input_layer.medical_claim", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.cms_hcc__patient_risk_factors": {"database": "devforrest", "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": "49de99ede6f21002738d05a0ca5686ad62389e595e59d7e679f36eeb1e679411"}, "config": {"enabled": true, "alias": "patient_risk_factors", "schema": "cms_hcc", "database": null, "tags": ["cms_hcc"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["cms_hcc"], "description": "This final model displays the contributing demographic and disease risk factors, interactions, and HCCs for each enrollee in the payment year.\n", "columns": {"patient_id": {"name": "patient_id", "description": "Unique ID for the patient.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "enrollment_status_default": {"name": "enrollment_status_default", "description": "Indicates the input data was missing and a default status was used.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "medicaid_dual_status_default": {"name": "medicaid_dual_status_default", "description": "Indicates the input data was missing and a default status was used.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "orec_default": {"name": "orec_default", "description": "Indicates the input data was missing and a default status was used.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "institutional_status_default": {"name": "institutional_status_default", "description": "Indicates the input data was missing and a default status was used.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "risk_factor_description": {"name": "risk_factor_description", "description": "Description of the risk factor.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "coefficient": {"name": "coefficient", "description": "Relative factor value that correspond to the CMS HCC model's risk indicators.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "factor_type": {"name": "factor_type", "description": "Type of risk factor, e.g. Demographic, Disease, etc.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "model_version": {"name": "model_version", "description": "CMS HCC model version.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "payment_year": {"name": "payment_year", "description": "The payment year the HCC and risk scores are being calculated for.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The date the model was run.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://models\\cms_hcc\\cms_hcc_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "cms_hcc", "alias": "patient_risk_factors", "tags": "cms_hcc", "materialized": "table", "enabled": true, "bind": false}, "created_at": 1702481696.6432571, "relation_name": "devforrest.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 , gender\r\n || ', '\r\n || age_group\r\n || ' Years'\r\n || ', '\r\n || enrollment_status\r\n || ' Enrollee'\r\n || ', '\r\n || case\r\n when medicaid_status = 'Yes' then 'Medicaid'\r\n else 'Non-Medicaid'\r\n end\r\n || ', '\r\n || dual_status\r\n || ' Dual'\r\n || ', '\r\n || orec\r\n || ', '\r\n || case\r\n when institutional_status = 'Yes' then 'Institutional'\r\n else 'Non-Institutional'\r\n end\r\n as description\r\n , coefficient\r\n , factor_type\r\n , model_version\r\n , payment_year\r\n from {{ ref('cms_hcc__int_demographic_factors') }}\r\n\r\n)\r\n\r\n, demographic_defaults as (\r\n\r\n select\r\n patient_id\r\n , enrollment_status_default\r\n , medicaid_dual_status_default\r\n , orec_default\r\n , institutional_status_default\r\n from {{ ref('cms_hcc__int_demographic_factors') }}\r\n\r\n)\r\n\r\n, disease_factors as (\r\n\r\n select\r\n patient_id\r\n , hcc_description || ' (HCC ' || hcc_code || ')' as description\r\n , coefficient\r\n , factor_type\r\n , model_version\r\n , payment_year\r\n from {{ ref('cms_hcc__int_disease_factors') }}\r\n\r\n)\r\n\r\n, enrollment_interactions as (\r\n\r\n select\r\n patient_id\r\n , description\r\n , coefficient\r\n , factor_type\r\n , model_version\r\n , payment_year\r\n from {{ ref('cms_hcc__int_enrollment_interaction_factors') }}\r\n\r\n)\r\n\r\n, disabled_interactions as (\r\n\r\n select\r\n patient_id\r\n , description\r\n , coefficient\r\n , factor_type\r\n , model_version\r\n , payment_year\r\n from {{ ref('cms_hcc__int_disabled_interaction_factors') }}\r\n\r\n)\r\n\r\n, disease_interactions as (\r\n\r\n select\r\n patient_id\r\n , description\r\n , coefficient\r\n , factor_type\r\n , model_version\r\n , payment_year\r\n from {{ ref('cms_hcc__int_disease_interaction_factors') }}\r\n\r\n)\r\n\r\n, hcc_counts as (\r\n\r\n select\r\n patient_id\r\n , description\r\n , coefficient\r\n , factor_type\r\n , model_version\r\n , payment_year\r\n from {{ ref('cms_hcc__int_hcc_count_factors') }}\r\n\r\n)\r\n\r\n, unioned as (\r\n\r\n select * from demographic_factors\r\n union all\r\n select * from disease_factors\r\n union all\r\n select * from enrollment_interactions\r\n union all\r\n select * from disabled_interactions\r\n union all\r\n select * from disease_interactions\r\n union all\r\n select * from hcc_counts\r\n\r\n)\r\n\r\n, add_defaults as (\r\n\r\n select\r\n unioned.patient_id\r\n , demographic_defaults.enrollment_status_default\r\n , demographic_defaults.medicaid_dual_status_default\r\n , demographic_defaults.orec_default\r\n , demographic_defaults.institutional_status_default\r\n , unioned.description as risk_factor_description\r\n , unioned.coefficient\r\n , unioned.factor_type\r\n , unioned.model_version\r\n , unioned.payment_year\r\n from unioned\r\n left join demographic_defaults\r\n on unioned.patient_id = demographic_defaults.patient_id\r\n\r\n)\r\n\r\n, add_data_types as (\r\n\r\n select\r\n cast(patient_id as {{ dbt.type_string() }}) as patient_id\r\n , cast(enrollment_status_default as boolean) as enrollment_status_default\r\n , cast(medicaid_dual_status_default as boolean) as medicaid_dual_status_default\r\n , cast(orec_default as boolean) as orec_default\r\n , cast(institutional_status_default as boolean) as institutional_status_default\r\n , cast(factor_type as {{ dbt.type_string() }}) as factor_type\r\n , cast(risk_factor_description as {{ dbt.type_string() }}) as risk_factor_description\r\n , round(cast(coefficient as {{ dbt.type_numeric() }}),3) as coefficient\r\n , cast(model_version as {{ dbt.type_string() }}) as model_version\r\n , cast(payment_year as integer) as payment_year\r\n from add_defaults\r\n\r\n)\r\n\r\nselect\r\n patient_id\r\n , enrollment_status_default\r\n , medicaid_dual_status_default\r\n , orec_default\r\n , institutional_status_default\r\n , factor_type\r\n , risk_factor_description\r\n , coefficient\r\n , model_version\r\n , payment_year\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom add_data_types", "language": "sql", "refs": [["cms_hcc__int_demographic_factors"], ["cms_hcc__int_demographic_factors"], ["cms_hcc__int_disease_factors"], ["cms_hcc__int_enrollment_interaction_factors"], ["cms_hcc__int_disabled_interaction_factors"], ["cms_hcc__int_disease_interaction_factors"], ["cms_hcc__int_hcc_count_factors"]], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.type_string", "macro.dbt.type_numeric"], "nodes": ["model.the_tuva_project.cms_hcc__int_demographic_factors", "model.the_tuva_project.cms_hcc__int_demographic_factors", "model.the_tuva_project.cms_hcc__int_disease_factors", "model.the_tuva_project.cms_hcc__int_enrollment_interaction_factors", "model.the_tuva_project.cms_hcc__int_disabled_interaction_factors", "model.the_tuva_project.cms_hcc__int_disease_interaction_factors", "model.the_tuva_project.cms_hcc__int_hcc_count_factors"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\cms_hcc\\final\\cms_hcc__patient_risk_factors.sql", "compiled": true, "compiled_code": "\nwith demographic_factors as (\n\n select\n patient_id\n /* concatenate demographic risk factors */\n , gender\n || ', '\n || age_group\n || ' Years'\n || ', '\n || enrollment_status\n || ' Enrollee'\n || ', '\n || case\n when medicaid_status = 'Yes' then 'Medicaid'\n else 'Non-Medicaid'\n end\n || ', '\n || dual_status\n || ' Dual'\n || ', '\n || orec\n || ', '\n || case\n when institutional_status = 'Yes' then 'Institutional'\n else 'Non-Institutional'\n end\n as description\n , coefficient\n , factor_type\n , model_version\n , payment_year\n from devforrest.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 , orec_default\n , institutional_status_default\n from devforrest.cms_hcc._int_demographic_factors\n\n)\n\n, disease_factors as (\n\n select\n patient_id\n , hcc_description || ' (HCC ' || hcc_code || ')' as description\n , coefficient\n , factor_type\n , model_version\n , payment_year\n from devforrest.cms_hcc._int_disease_factors\n\n)\n\n, enrollment_interactions as (\n\n select\n patient_id\n , description\n , coefficient\n , factor_type\n , model_version\n , payment_year\n from devforrest.cms_hcc._int_enrollment_interaction_factors\n\n)\n\n, disabled_interactions as (\n\n select\n patient_id\n , description\n , coefficient\n , factor_type\n , model_version\n , payment_year\n from devforrest.cms_hcc._int_disabled_interaction_factors\n\n)\n\n, disease_interactions as (\n\n select\n patient_id\n , description\n , coefficient\n , factor_type\n , model_version\n , payment_year\n from devforrest.cms_hcc._int_disease_interaction_factors\n\n)\n\n, hcc_counts as (\n\n select\n patient_id\n , description\n , coefficient\n , factor_type\n , model_version\n , payment_year\n from devforrest.cms_hcc._int_hcc_count_factors\n\n)\n\n, unioned as (\n\n select * from demographic_factors\n union all\n select * from disease_factors\n union all\n select * from enrollment_interactions\n union all\n select * from disabled_interactions\n union all\n select * from disease_interactions\n union all\n select * from hcc_counts\n\n)\n\n, add_defaults as (\n\n select\n unioned.patient_id\n , demographic_defaults.enrollment_status_default\n , demographic_defaults.medicaid_dual_status_default\n , demographic_defaults.orec_default\n , demographic_defaults.institutional_status_default\n , unioned.description as risk_factor_description\n , unioned.coefficient\n , unioned.factor_type\n , unioned.model_version\n , unioned.payment_year\n from unioned\n left join demographic_defaults\n on unioned.patient_id = demographic_defaults.patient_id\n\n)\n\n, add_data_types as (\n\n select\n cast(patient_id as TEXT) as patient_id\n , cast(enrollment_status_default as boolean) as enrollment_status_default\n , cast(medicaid_dual_status_default as boolean) as medicaid_dual_status_default\n , cast(orec_default as boolean) as orec_default\n , cast(institutional_status_default as boolean) as institutional_status_default\n , cast(factor_type as TEXT) as factor_type\n , cast(risk_factor_description as TEXT) as risk_factor_description\n , round(cast(coefficient as numeric(28,6)),3) as coefficient\n , cast(model_version as TEXT) as model_version\n , cast(payment_year as integer) as payment_year\n from add_defaults\n\n)\n\nselect\n patient_id\n , enrollment_status_default\n , medicaid_dual_status_default\n , orec_default\n , institutional_status_default\n , factor_type\n , risk_factor_description\n , coefficient\n , model_version\n , payment_year\n , '2023-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom add_data_types", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.cms_hcc__patient_risk_scores": {"database": "devforrest", "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": "8a947241c32b1da8be54a9afe0a8be3fa2a2b0686a1f8a761bce69bfe9a08dfd"}, "config": {"enabled": true, "alias": "patient_risk_scores", "schema": "cms_hcc", "database": null, "tags": ["cms_hcc"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["cms_hcc"], "description": "This final model calculates the CMS HCC raw risk score, normalized risk score, and payment risk score for each enrollee in the payment year.\n", "columns": {"patient_id": {"name": "patient_id", "description": "Unique ID for the patient.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "raw_risk_score": {"name": "raw_risk_score", "description": "The sum of all patient risk factors.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "normalized_risk_score": {"name": "normalized_risk_score", "description": "The raw risk score divided by the normalization adjustment factor for the corresponding HCC model version and payment year's rate announcement from CMS.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "payment_risk_score": {"name": "payment_risk_score", "description": "The normalized risk score multiplied by the MA coding pattern adjustment factor for the corresponding HCC model version and payment years rate announcement from CMS.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "model_version": {"name": "model_version", "description": "CMS HCC model version.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "payment_year": {"name": "payment_year", "description": "The payment year the HCC and risk scores are being calculated for.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The date the model was run.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://models\\cms_hcc\\cms_hcc_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "cms_hcc", "alias": "patient_risk_scores", "tags": "cms_hcc", "materialized": "table", "enabled": true, "bind": false}, "created_at": 1702481696.6472552, "relation_name": "devforrest.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 from payment\r\n\r\n)\r\n\r\nselect\r\n patient_id\r\n , raw_risk_score\r\n , normalized_risk_score\r\n , payment_risk_score\r\n , model_version\r\n , payment_year\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom add_data_types", "language": "sql", "refs": [["cms_hcc__adjustment_rates"], ["cms_hcc__patient_risk_factors"]], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.type_numeric", "macro.dbt.type_string"], "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 devforrest.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 devforrest.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 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-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom add_data_types", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.cms_hcc__int_all_conditions": {"database": "devforrest", "schema": "cms_hcc", "name": "cms_hcc__int_all_conditions", "resource_type": "model", "package_name": "the_tuva_project", "path": "cms_hcc\\intermediate\\cms_hcc__int_all_conditions.sql", "original_file_path": "models\\cms_hcc\\intermediate\\cms_hcc__int_all_conditions.sql", "unique_id": "model.the_tuva_project.cms_hcc__int_all_conditions", "fqn": ["the_tuva_project", "cms_hcc", "intermediate", "cms_hcc__int_all_conditions"], "alias": "_int_all_conditions", "checksum": {"name": "sha256", "checksum": "5b5a4f8948cfd62b05efcbe80732b09345df4d9c65c3fb0f0c8de712a8a5ea77"}, "config": {"enabled": true, "alias": "_int_all_conditions", "schema": "cms_hcc", "database": null, "tags": ["cms_hcc"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["cms_hcc"], "description": "All historical conditions mapped to HCCs.", "columns": {"patient_id": {"name": "patient_id", "description": "Unique ID for the patient.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "recorded_date": {"name": "recorded_date", "description": "Date in which the condition was recorded.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "condition_type": {"name": "condition_type", "description": "The type of condition.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "icd_10_cm_code": {"name": "icd_10_cm_code", "description": "The ICD-10-CM condition code.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "hcc_code": {"name": "hcc_code", "description": "HCC code from the latest CMS HCC model available in the mart.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "hcc_description": {"name": "hcc_description", "description": "HCC description from the latest CMS HCC model available in the mart.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "model_version": {"name": "model_version", "description": "CMS HCC model version.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "payment_year": {"name": "payment_year", "description": "The payment year the HCC and risk scores are being calculated for.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The date the model was run.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://models\\cms_hcc\\cms_hcc_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "cms_hcc", "alias": "_int_all_conditions", "tags": "cms_hcc", "materialized": "table", "enabled": true, "bind": false}, "created_at": 1702481696.6528816, "relation_name": "devforrest.cms_hcc._int_all_conditions", "raw_code": "{{ config(\r\n enabled = var('cms_hcc_enabled',var('claims_enabled',var('clinical_enabled',var('tuva_marts_enabled',False))))\r\n )\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 , recorded_date\r\n , condition_type\r\n , code_type\r\n , code\r\n from {{ ref('cms_hcc__stg_core__condition') }}\r\n\r\n)\r\n\r\n, seed_hcc_mapping as (\r\n\r\n select\r\n diagnosis_code\r\n , cms_hcc_v24\r\n from {{ ref('cms_hcc__icd_10_cm_mappings') }}\r\n where payment_year = (select max(payment_year) from {{ ref('cms_hcc__icd_10_cm_mappings') }})\r\n and cms_hcc_v24_flag = 'Yes'\r\n\r\n)\r\n\r\n, seed_hcc_descriptions as (\r\n\r\n select distinct\r\n hcc_code\r\n , description\r\n from {{ ref('cms_hcc__disease_factors') }}\r\n where model_version = '{{ model_version_compiled }}'\r\n\r\n)\r\n\r\n, joined as (\r\n\r\n select\r\n conditions.patient_id\r\n , conditions.recorded_date\r\n , conditions.condition_type\r\n , conditions.code\r\n , seed_hcc_mapping.cms_hcc_v24 as hcc_code\r\n , seed_hcc_descriptions.description as hcc_description\r\n from conditions\r\n left join seed_hcc_mapping\r\n on conditions.code = seed_hcc_mapping.diagnosis_code\r\n left join seed_hcc_descriptions\r\n on seed_hcc_mapping.cms_hcc_v24 = seed_hcc_descriptions.hcc_code\r\n where conditions.code_type = 'icd-10-cm'\r\n\r\n)\r\n\r\n, add_data_types as (\r\n\r\n select\r\n cast(patient_id as {{ dbt.type_string() }}) as patient_id\r\n , cast(recorded_date as date) as recorded_date\r\n , cast(condition_type as {{ dbt.type_string() }}) as condition_type\r\n , cast(code as {{ dbt.type_string() }}) as icd_10_cm_code\r\n , cast(hcc_code as {{ dbt.type_string() }}) as hcc_code\r\n , cast(hcc_description as {{ dbt.type_string() }}) as hcc_description\r\n , cast('{{ model_version_compiled }}' as {{ dbt.type_string() }}) as model_version\r\n , cast({{ payment_year_compiled }} as integer) as payment_year\r\n from joined\r\n\r\n)\r\n\r\nselect\r\n patient_id\r\n , recorded_date\r\n , condition_type\r\n , icd_10_cm_code\r\n , hcc_code\r\n , hcc_description\r\n , model_version\r\n , payment_year\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom add_data_types", "language": "sql", "refs": [["cms_hcc__stg_core__condition"], ["cms_hcc__icd_10_cm_mappings"], ["cms_hcc__icd_10_cm_mappings"], ["cms_hcc__disease_factors"]], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.type_string"], "nodes": ["model.the_tuva_project.cms_hcc__stg_core__condition", "seed.the_tuva_project.cms_hcc__icd_10_cm_mappings", "seed.the_tuva_project.cms_hcc__icd_10_cm_mappings", "seed.the_tuva_project.cms_hcc__disease_factors"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\cms_hcc\\intermediate\\cms_hcc__int_all_conditions.sql", "compiled": true, "compiled_code": "\n\nwith __dbt__cte__cms_hcc__stg_core__condition as (\n\nselect\n claim_id\n , patient_id\n , recorded_date\n , condition_type\n , normalized_code_type as code_type\n , normalized_code as code\n , '2023-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom devforrest.core.condition\n),conditions as (\n\n select\n patient_id\n , recorded_date\n , condition_type\n , code_type\n , code\n from __dbt__cte__cms_hcc__stg_core__condition\n\n)\n\n, seed_hcc_mapping as (\n\n select\n diagnosis_code\n , cms_hcc_v24\n from devforrest.cms_hcc._value_set_icd_10_cm_mappings\n where payment_year = (select max(payment_year) from devforrest.cms_hcc._value_set_icd_10_cm_mappings)\n and cms_hcc_v24_flag = 'Yes'\n\n)\n\n, seed_hcc_descriptions as (\n\n select distinct\n hcc_code\n , description\n from devforrest.cms_hcc._value_set_disease_factors\n where model_version = 'CMS-HCC-V24'\n\n)\n\n, joined as (\n\n select\n conditions.patient_id\n , conditions.recorded_date\n , conditions.condition_type\n , conditions.code\n , seed_hcc_mapping.cms_hcc_v24 as hcc_code\n , seed_hcc_descriptions.description as hcc_description\n from conditions\n left join seed_hcc_mapping\n on conditions.code = seed_hcc_mapping.diagnosis_code\n left join seed_hcc_descriptions\n on seed_hcc_mapping.cms_hcc_v24 = seed_hcc_descriptions.hcc_code\n where conditions.code_type = 'icd-10-cm'\n\n)\n\n, add_data_types as (\n\n select\n cast(patient_id as TEXT) as patient_id\n , cast(recorded_date as date) as recorded_date\n , cast(condition_type as TEXT) as condition_type\n , cast(code as TEXT) as icd_10_cm_code\n , cast(hcc_code as TEXT) as hcc_code\n , cast(hcc_description as TEXT) as hcc_description\n , cast('CMS-HCC-V24' as TEXT) as model_version\n , cast(2023 as integer) as payment_year\n from joined\n\n)\n\nselect\n patient_id\n , recorded_date\n , condition_type\n , icd_10_cm_code\n , hcc_code\n , hcc_description\n , model_version\n , payment_year\n , '2023-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom add_data_types", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.the_tuva_project.cms_hcc__stg_core__condition", "sql": " __dbt__cte__cms_hcc__stg_core__condition as (\n\nselect\n claim_id\n , patient_id\n , recorded_date\n , condition_type\n , normalized_code_type as code_type\n , normalized_code as code\n , '2023-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom devforrest.core.condition\n)"}]}, "model.the_tuva_project.cms_hcc__int_demographic_factors": {"database": "devforrest", "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": "be165fa4aa8ef94e2ad6002ac26b21414aa73f9466402f7a1b596bdfafac100e"}, "config": {"enabled": true, "alias": "_int_demographic_factors", "schema": "cms_hcc", "database": null, "tags": ["cms_hcc"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["cms_hcc"], "description": "Demographic and enrollment risk relative factor values for the corresponding HCC model version and payment year.\n", "columns": {"patient_id": {"name": "patient_id", "description": "Unique ID for the patient.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "enrollment_status": {"name": "enrollment_status", "description": "Indicates whether the patient is a \"Continuing\" or \"New\" enrollee.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "gender": {"name": "gender", "description": "Indicates whether the patient is \"Female\" or \"Male\".", "meta": {}, "data_type": null, "quote": null, "tags": []}, "age_group": {"name": "age_group", "description": "Indicates what age group the patient is in. (e.g. \"60-64\"). CMS guidance: Age is calculated as of Feb 1 of the payment year.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "medicaid_status": {"name": "medicaid_status", "description": "Indicates whether the patient is enrolled in Medicaid.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "dual_status": {"name": "dual_status", "description": "Indicates whether the patient has \"Full\", \"Partial\", or \"Non\" dual status.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "orec": {"name": "orec", "description": "Indicates the Original Reason for Entitlement Code (OREC) \"Aged\", \"Disabled\", or \"ESRD\".\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "institutional_status": {"name": "institutional_status", "description": "Indicates whether the patient resided in an institution for at least 90 days.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "enrollment_status_default": {"name": "enrollment_status_default", "description": "Indicates the input data was missing and a default status was used.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "medicaid_dual_status_default": {"name": "medicaid_dual_status_default", "description": "Indicates the input data was missing and a default status was used.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "orec_default": {"name": "orec_default", "description": "Indicates the input data was missing and a default status was used.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "institutional_status_default": {"name": "institutional_status_default", "description": "Indicates the input data was missing and a default status was used.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "coefficient": {"name": "coefficient", "description": "Relative factor value that correspond to the CMS HCC model's risk indicators.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "factor_type": {"name": "factor_type", "description": "Type of risk factor, e.g. Demographic, Disease, etc.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "model_version": {"name": "model_version", "description": "CMS HCC model version.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "payment_year": {"name": "payment_year", "description": "The payment year the HCC and risk scores are being calculated for.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The date the model was run.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://models\\cms_hcc\\cms_hcc_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "cms_hcc", "alias": "_int_demographic_factors", "tags": "cms_hcc", "materialized": "table", "enabled": true, "bind": false}, "created_at": 1702481696.6611552, "relation_name": "devforrest.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 , orec_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.orec_default\r\n , members.institutional_status_default\r\n , members.model_version\r\n , members.payment_year\r\n , seed_demographic_factors.factor_type\r\n , seed_demographic_factors.coefficient\r\n from members\r\n inner join seed_demographic_factors\r\n on members.enrollment_status = seed_demographic_factors.enrollment_status\r\n and members.gender = seed_demographic_factors.gender\r\n and members.age_group = seed_demographic_factors.age_group\r\n and members.medicaid_status = seed_demographic_factors.medicaid_status\r\n and members.orec = seed_demographic_factors.orec\r\n where members.enrollment_status = 'New'\r\n\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.orec_default\r\n , members.institutional_status_default\r\n , members.model_version\r\n , members.payment_year\r\n , seed_demographic_factors.factor_type\r\n , seed_demographic_factors.coefficient\r\n from members\r\n inner join seed_demographic_factors\r\n on members.enrollment_status = seed_demographic_factors.enrollment_status\r\n and members.gender = seed_demographic_factors.gender\r\n and members.age_group = seed_demographic_factors.age_group\r\n and members.medicaid_status = seed_demographic_factors.medicaid_status\r\n and members.dual_status = seed_demographic_factors.dual_status\r\n and members.orec = seed_demographic_factors.orec\r\n and members.institutional_status = seed_demographic_factors.institutional_status\r\n where members.enrollment_status = 'Continuing'\r\n\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\r\n)\r\n\r\n, add_data_types as (\r\n\r\n select\r\n cast(patient_id as {{ dbt.type_string() }}) as patient_id\r\n , cast(enrollment_status as {{ dbt.type_string() }}) as enrollment_status\r\n , cast(gender as {{ dbt.type_string() }}) as gender\r\n , cast(age_group as {{ dbt.type_string() }}) as age_group\r\n , cast(medicaid_status as {{ dbt.type_string() }}) as medicaid_status\r\n , cast(dual_status as {{ dbt.type_string() }}) as dual_status\r\n , cast(orec as {{ dbt.type_string() }}) as orec\r\n , cast(institutional_status as {{ dbt.type_string() }}) as institutional_status\r\n , cast(enrollment_status_default as boolean) as enrollment_status_default\r\n , cast(medicaid_dual_status_default as boolean) as medicaid_dual_status_default\r\n , cast(orec_default as boolean) as orec_default\r\n , cast(institutional_status_default as boolean) as institutional_status_default\r\n , round(cast(coefficient as {{ dbt.type_numeric() }}),3) as coefficient\r\n , cast(factor_type as {{ dbt.type_string() }}) as factor_type\r\n , cast(model_version as {{ dbt.type_string() }}) as model_version\r\n , cast(payment_year as integer) as payment_year\r\n from unioned\r\n\r\n)\r\n\r\nselect\r\n patient_id\r\n , enrollment_status\r\n , gender\r\n , age_group\r\n , medicaid_status\r\n , dual_status\r\n , orec\r\n , institutional_status\r\n , enrollment_status_default\r\n , medicaid_dual_status_default\r\n , orec_default\r\n , institutional_status_default\r\n , coefficient\r\n , factor_type\r\n , model_version\r\n , payment_year\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom add_data_types", "language": "sql", "refs": [["cms_hcc__int_members"], ["cms_hcc__demographic_factors"]], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.type_string", "macro.dbt.type_numeric"], "nodes": ["model.the_tuva_project.cms_hcc__int_members", "seed.the_tuva_project.cms_hcc__demographic_factors"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\cms_hcc\\intermediate\\cms_hcc__int_demographic_factors.sql", "compiled": true, "compiled_code": "\n/*\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 , orec_default\n , institutional_status_default\n , model_version\n , payment_year\n from devforrest.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 devforrest.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.orec_default\n , members.institutional_status_default\n , members.model_version\n , members.payment_year\n , seed_demographic_factors.factor_type\n , seed_demographic_factors.coefficient\n from members\n inner join seed_demographic_factors\n on members.enrollment_status = seed_demographic_factors.enrollment_status\n and members.gender = seed_demographic_factors.gender\n and members.age_group = seed_demographic_factors.age_group\n and members.medicaid_status = seed_demographic_factors.medicaid_status\n and members.orec = seed_demographic_factors.orec\n where members.enrollment_status = 'New'\n\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.orec_default\n , members.institutional_status_default\n , members.model_version\n , members.payment_year\n , seed_demographic_factors.factor_type\n , seed_demographic_factors.coefficient\n from members\n inner join seed_demographic_factors\n on members.enrollment_status = seed_demographic_factors.enrollment_status\n and members.gender = seed_demographic_factors.gender\n and members.age_group = seed_demographic_factors.age_group\n and members.medicaid_status = seed_demographic_factors.medicaid_status\n and members.dual_status = seed_demographic_factors.dual_status\n and members.orec = seed_demographic_factors.orec\n and members.institutional_status = seed_demographic_factors.institutional_status\n where members.enrollment_status = 'Continuing'\n\n)\n\n, unioned as (\n\n select * from new_enrollees\n union all\n select * from continuining_enrollees\n\n)\n\n, add_data_types as (\n\n select\n cast(patient_id as TEXT) as patient_id\n , cast(enrollment_status as TEXT) as enrollment_status\n , cast(gender as TEXT) as gender\n , cast(age_group as TEXT) as age_group\n , cast(medicaid_status as TEXT) as medicaid_status\n , cast(dual_status as TEXT) as dual_status\n , cast(orec as TEXT) as orec\n , cast(institutional_status as TEXT) as institutional_status\n , cast(enrollment_status_default as boolean) as enrollment_status_default\n , cast(medicaid_dual_status_default as boolean) as medicaid_dual_status_default\n , cast(orec_default as boolean) as orec_default\n , cast(institutional_status_default as boolean) as institutional_status_default\n , round(cast(coefficient as numeric(28,6)),3) as coefficient\n , cast(factor_type as TEXT) as factor_type\n , cast(model_version as TEXT) as model_version\n , cast(payment_year as integer) as payment_year\n from unioned\n\n)\n\nselect\n patient_id\n , enrollment_status\n , gender\n , age_group\n , medicaid_status\n , dual_status\n , orec\n , institutional_status\n , enrollment_status_default\n , medicaid_dual_status_default\n , orec_default\n , institutional_status_default\n , coefficient\n , factor_type\n , model_version\n , payment_year\n , '2023-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom add_data_types", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.cms_hcc__int_disabled_interaction_factors": {"database": "devforrest", "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": "ba8a7b02c1b097e57a657bf6b4e784a26d2e73431ff41c780b949628ccb24510"}, "config": {"enabled": true, "alias": "_int_disabled_interaction_factors", "schema": "cms_hcc", "database": null, "tags": ["cms_hcc"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["cms_hcc"], "description": "Disabled and disease interaction factor values for the corresponding HCC model version and payment year.\n", "columns": {"patient_id": {"name": "patient_id", "description": "Unique ID for the patient.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "description": {"name": "description", "description": "Description of the disabled and disease interaction.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "coefficient": {"name": "coefficient", "description": "Relative factor value that correspond to the CMS HCC model's risk indicators.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "factor_type": {"name": "factor_type", "description": "Type of risk factor, e.g. Demographic, Disease, etc.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "model_version": {"name": "model_version", "description": "CMS HCC model version.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "payment_year": {"name": "payment_year", "description": "The payment year the HCC and risk scores are being calculated for.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The date the model was run.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://models\\cms_hcc\\cms_hcc_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "cms_hcc", "alias": "_int_disabled_interaction_factors", "tags": "cms_hcc", "materialized": "table", "enabled": true, "bind": false}, "created_at": 1702481696.6661658, "relation_name": "devforrest.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 , factor_type\r\n , enrollment_status\r\n , institutional_status\r\n , short_name\r\n , description\r\n , hcc_code\r\n , coefficient\r\n from {{ ref('cms_hcc__disabled_interaction_factors') }}\r\n 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.factor_type\r\n , seed_interaction_factors.description\r\n , seed_interaction_factors.coefficient\r\n from demographics_with_hccs\r\n inner join seed_interaction_factors\r\n on demographics_with_hccs.enrollment_status = seed_interaction_factors.enrollment_status\r\n and demographics_with_hccs.institutional_status = seed_interaction_factors.institutional_status\r\n and demographics_with_hccs.hcc_code = seed_interaction_factors.hcc_code\r\n\r\n)\r\n\r\n, add_data_types as (\r\n\r\nselect\r\n cast(patient_id as {{ dbt.type_string() }}) as patient_id\r\n , cast(description as {{ dbt.type_string() }}) as description\r\n , round(cast(coefficient as {{ dbt.type_numeric() }}),3) as coefficient\r\n , cast(factor_type as {{ dbt.type_string() }}) as factor_type\r\n , cast(model_version as {{ dbt.type_string() }}) as model_version\r\n , cast(payment_year as integer) as payment_year\r\nfrom interactions\r\n\r\n)\r\n\r\nselect\r\n patient_id\r\n , description\r\n , coefficient\r\n , factor_type\r\n , model_version\r\n , payment_year\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom add_data_types", "language": "sql", "refs": [["cms_hcc__int_demographic_factors"], ["cms_hcc__int_hcc_hierarchy"], ["cms_hcc__disabled_interaction_factors"]], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.type_string", "macro.dbt.type_numeric"], "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 devforrest.cms_hcc._int_demographic_factors\n\n)\n\n, hcc_hierarchy as (\n\n select\n patient_id\n , hcc_code\n from devforrest.cms_hcc._int_hcc_hierarchy\n\n)\n\n, seed_interaction_factors as (\n\n select\n model_version\n , factor_type\n , enrollment_status\n , institutional_status\n , short_name\n , description\n , hcc_code\n , coefficient\n from devforrest.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.factor_type\n , seed_interaction_factors.description\n , seed_interaction_factors.coefficient\n from demographics_with_hccs\n inner join seed_interaction_factors\n on demographics_with_hccs.enrollment_status = seed_interaction_factors.enrollment_status\n and demographics_with_hccs.institutional_status = seed_interaction_factors.institutional_status\n and demographics_with_hccs.hcc_code = seed_interaction_factors.hcc_code\n\n)\n\n, add_data_types as (\n\nselect\n cast(patient_id as TEXT) as patient_id\n , cast(description as TEXT) as description\n , round(cast(coefficient as numeric(28,6)),3) as coefficient\n , cast(factor_type as TEXT) as factor_type\n , cast(model_version as TEXT) as model_version\n , cast(payment_year as integer) as payment_year\nfrom interactions\n\n)\n\nselect\n patient_id\n , description\n , coefficient\n , factor_type\n , model_version\n , payment_year\n , '2023-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom add_data_types", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.cms_hcc__int_disease_factors": {"database": "devforrest", "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": "2595b94a248fd59a5a93f2af4c04d99b1326a824493eb61301c2d5f910af59d4"}, "config": {"enabled": true, "alias": "_int_disease_factors", "schema": "cms_hcc", "database": null, "tags": ["cms_hcc"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["cms_hcc"], "description": "Disease factor values for every enrollee's final payment-eligible HCC after the hierarchy has been applied and necessary HCCs dropped for the corresponding HCC model version and payment year.\n", "columns": {"patient_id": {"name": "patient_id", "description": "Unique ID for the patient.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "hcc_code": {"name": "hcc_code", "description": "HCC code.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "hcc_description": {"name": "hcc_description", "description": "HCC description.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "coefficient": {"name": "coefficient", "description": "Relative factor value that correspond to the CMS HCC model's risk indicators.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "factor_type": {"name": "factor_type", "description": "Type of risk factor, e.g. Demographic, Disease, etc.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "model_version": {"name": "model_version", "description": "CMS HCC model version.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "payment_year": {"name": "payment_year", "description": "The payment year the HCC and risk scores are being calculated for.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The date the model was run.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://models\\cms_hcc\\cms_hcc_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "cms_hcc", "alias": "_int_disease_factors", "tags": "cms_hcc", "materialized": "table", "enabled": true, "bind": false}, "created_at": 1702481696.6711707, "relation_name": "devforrest.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 , 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 , factor_type\r\n , enrollment_status\r\n , medicaid_status\r\n , dual_status\r\n , orec\r\n , institutional_status\r\n , hcc_code\r\n , description\r\n , coefficient\r\n from {{ ref('cms_hcc__disease_factors') }}\r\n 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.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.factor_type\r\n , seed_disease_factors.description\r\n , seed_disease_factors.coefficient\r\n from demographics_with_hccs\r\n inner join seed_disease_factors\r\n on demographics_with_hccs.enrollment_status = seed_disease_factors.enrollment_status\r\n and demographics_with_hccs.medicaid_status = seed_disease_factors.medicaid_status\r\n and demographics_with_hccs.dual_status = seed_disease_factors.dual_status\r\n and demographics_with_hccs.orec = seed_disease_factors.orec\r\n and demographics_with_hccs.institutional_status = seed_disease_factors.institutional_status\r\n and demographics_with_hccs.hcc_code = seed_disease_factors.hcc_code\r\n\r\n)\r\n\r\n, add_data_types as (\r\n\r\n select\r\n cast(patient_id as {{ dbt.type_string() }}) as patient_id\r\n , cast(hcc_code as {{ dbt.type_string() }}) as hcc_code\r\n , cast(description as {{ dbt.type_string() }}) as hcc_description\r\n , round(cast(coefficient as {{ dbt.type_numeric() }}),3) as coefficient\r\n , cast(factor_type as {{ dbt.type_string() }}) as factor_type\r\n , cast(model_version as {{ dbt.type_string() }}) as model_version\r\n , cast(payment_year as integer) as payment_year\r\n from disease_factors\r\n\r\n)\r\n\r\nselect\r\n patient_id\r\n , hcc_code\r\n , hcc_description\r\n , coefficient\r\n , factor_type\r\n , model_version\r\n , payment_year\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom add_data_types", "language": "sql", "refs": [["cms_hcc__int_demographic_factors"], ["cms_hcc__int_hcc_hierarchy"], ["cms_hcc__disease_factors"]], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.type_string", "macro.dbt.type_numeric"], "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 , model_version\n , payment_year\n from devforrest.cms_hcc._int_demographic_factors\n\n)\n\n, hcc_hierarchy as (\n\n select\n patient_id\n , hcc_code\n from devforrest.cms_hcc._int_hcc_hierarchy\n\n)\n\n, seed_disease_factors as (\n\n select\n model_version\n , factor_type\n , enrollment_status\n , medicaid_status\n , dual_status\n , orec\n , institutional_status\n , hcc_code\n , description\n , coefficient\n from devforrest.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.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.factor_type\n , seed_disease_factors.description\n , seed_disease_factors.coefficient\n from demographics_with_hccs\n inner join seed_disease_factors\n on demographics_with_hccs.enrollment_status = seed_disease_factors.enrollment_status\n and demographics_with_hccs.medicaid_status = seed_disease_factors.medicaid_status\n and demographics_with_hccs.dual_status = seed_disease_factors.dual_status\n and demographics_with_hccs.orec = seed_disease_factors.orec\n and demographics_with_hccs.institutional_status = seed_disease_factors.institutional_status\n and demographics_with_hccs.hcc_code = seed_disease_factors.hcc_code\n\n)\n\n, add_data_types as (\n\n select\n cast(patient_id as TEXT) as patient_id\n , cast(hcc_code as TEXT) as hcc_code\n , cast(description as TEXT) as hcc_description\n , round(cast(coefficient as numeric(28,6)),3) as coefficient\n , cast(factor_type as TEXT) as factor_type\n , cast(model_version as TEXT) as model_version\n , cast(payment_year as integer) as payment_year\n from disease_factors\n\n)\n\nselect\n patient_id\n , hcc_code\n , hcc_description\n , coefficient\n , factor_type\n , model_version\n , payment_year\n , '2023-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom add_data_types", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.cms_hcc__int_disease_interaction_factors": {"database": "devforrest", "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": "c2f964371ec1ed60682407ccbdc12648a85fe952877c80b4a3c68d5c53240e4f"}, "config": {"enabled": true, "alias": "_int_disease_interaction_factors", "schema": "cms_hcc", "database": null, "tags": ["cms_hcc"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["cms_hcc"], "description": "Disease interaction factor values for final payment-eligible HCC after the hierarchy has been applied and necessary HCCs dropped for the corresponding HCC model version and payment year.\n", "columns": {"patient_id": {"name": "patient_id", "description": "Unique ID for the patient.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "hcc_code_1": {"name": "hcc_code_1", "description": "HCC code 1 of the interaction.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "hcc_code_2": {"name": "hcc_code_2", "description": "HCC code 2 of the interaction.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "description": {"name": "description", "description": "Description of the disease interaction.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "coefficient": {"name": "coefficient", "description": "Relative factor value that correspond to the CMS HCC model's risk indicators.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "factor_type": {"name": "factor_type", "description": "Type of risk factor, e.g. Demographic, Disease, etc.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "model_version": {"name": "model_version", "description": "CMS HCC model version.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "payment_year": {"name": "payment_year", "description": "The payment year the HCC and risk scores are being calculated for.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The date the model was run.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://models\\cms_hcc\\cms_hcc_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "cms_hcc", "alias": "_int_disease_interaction_factors", "tags": "cms_hcc", "materialized": "table", "enabled": true, "bind": false}, "created_at": 1702481696.6767237, "relation_name": "devforrest.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 , 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 , factor_type\r\n , enrollment_status\r\n , medicaid_status\r\n , dual_status\r\n , orec\r\n , institutional_status\r\n , short_name\r\n , description\r\n , hcc_code_1\r\n , hcc_code_2\r\n , coefficient\r\n from {{ ref('cms_hcc__disease_interaction_factors') }}\r\n 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.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.factor_type\r\n , interactions_code_1.description\r\n , interactions_code_1.hcc_code_1\r\n , interactions_code_1.hcc_code_2\r\n , interactions_code_1.coefficient\r\n from demographics_with_hccs\r\n inner join seed_interaction_factors as interactions_code_1\r\n on demographics_with_hccs.enrollment_status = interactions_code_1.enrollment_status\r\n and demographics_with_hccs.medicaid_status = interactions_code_1.medicaid_status\r\n and demographics_with_hccs.dual_status = interactions_code_1.dual_status\r\n and demographics_with_hccs.orec = interactions_code_1.orec\r\n and demographics_with_hccs.institutional_status = interactions_code_1.institutional_status\r\n and demographics_with_hccs.hcc_code = interactions_code_1.hcc_code_1\r\n\r\n)\r\n\r\n, disease_interactions as (\r\n\r\n select\r\n demographics_with_interactions.patient_id\r\n , demographics_with_interactions.factor_type\r\n , demographics_with_interactions.hcc_code_1\r\n , demographics_with_interactions.hcc_code_2\r\n , demographics_with_interactions.description\r\n , demographics_with_interactions.coefficient\r\n , demographics_with_interactions.model_version\r\n , demographics_with_interactions.payment_year\r\n from demographics_with_interactions\r\n inner join demographics_with_hccs as interactions_code_2\r\n on demographics_with_interactions.patient_id = interactions_code_2.patient_id\r\n and demographics_with_interactions.hcc_code_2 = interactions_code_2.hcc_code\r\n)\r\n\r\n, add_data_types as (\r\n\r\n select\r\n cast(patient_id as {{ dbt.type_string() }}) as patient_id\r\n , cast(hcc_code_1 as {{ dbt.type_string() }}) as hcc_code_1\r\n , cast(hcc_code_2 as {{ dbt.type_string() }}) as hcc_code_2\r\n , cast(description as {{ dbt.type_string() }}) as description\r\n , round(cast(coefficient as {{ dbt.type_numeric() }}),3) as coefficient\r\n , cast(factor_type as {{ dbt.type_string() }}) as factor_type\r\n , cast(model_version as {{ dbt.type_string() }}) as model_version\r\n , cast(payment_year as integer) as payment_year\r\n from disease_interactions\r\n\r\n)\r\n\r\nselect\r\n patient_id\r\n , hcc_code_1\r\n , hcc_code_2\r\n , description\r\n , coefficient\r\n , factor_type\r\n , model_version\r\n , payment_year\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom add_data_types", "language": "sql", "refs": [["cms_hcc__int_demographic_factors"], ["cms_hcc__int_hcc_hierarchy"], ["cms_hcc__disease_interaction_factors"]], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.type_string", "macro.dbt.type_numeric"], "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 , model_version\n , payment_year\n from devforrest.cms_hcc._int_demographic_factors\n\n)\n\n, hcc_hierarchy as (\n\n select\n patient_id\n , hcc_code\n from devforrest.cms_hcc._int_hcc_hierarchy\n\n)\n\n, seed_interaction_factors as (\n\n select\n model_version\n , factor_type\n , enrollment_status\n , medicaid_status\n , dual_status\n , orec\n , institutional_status\n , short_name\n , description\n , hcc_code_1\n , hcc_code_2\n , coefficient\n from devforrest.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.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.factor_type\n , interactions_code_1.description\n , interactions_code_1.hcc_code_1\n , interactions_code_1.hcc_code_2\n , interactions_code_1.coefficient\n from demographics_with_hccs\n inner join seed_interaction_factors as interactions_code_1\n on demographics_with_hccs.enrollment_status = interactions_code_1.enrollment_status\n and demographics_with_hccs.medicaid_status = interactions_code_1.medicaid_status\n and demographics_with_hccs.dual_status = interactions_code_1.dual_status\n and demographics_with_hccs.orec = interactions_code_1.orec\n and demographics_with_hccs.institutional_status = interactions_code_1.institutional_status\n and demographics_with_hccs.hcc_code = interactions_code_1.hcc_code_1\n\n)\n\n, disease_interactions as (\n\n select\n demographics_with_interactions.patient_id\n , demographics_with_interactions.factor_type\n , demographics_with_interactions.hcc_code_1\n , demographics_with_interactions.hcc_code_2\n , demographics_with_interactions.description\n , demographics_with_interactions.coefficient\n , demographics_with_interactions.model_version\n , demographics_with_interactions.payment_year\n from demographics_with_interactions\n inner join demographics_with_hccs as interactions_code_2\n on demographics_with_interactions.patient_id = interactions_code_2.patient_id\n and demographics_with_interactions.hcc_code_2 = interactions_code_2.hcc_code\n)\n\n, add_data_types as (\n\n select\n cast(patient_id as TEXT) as patient_id\n , cast(hcc_code_1 as TEXT) as hcc_code_1\n , cast(hcc_code_2 as TEXT) as hcc_code_2\n , cast(description as TEXT) as description\n , round(cast(coefficient as numeric(28,6)),3) as coefficient\n , cast(factor_type as TEXT) as factor_type\n , cast(model_version as TEXT) as model_version\n , cast(payment_year as integer) as payment_year\n from disease_interactions\n\n)\n\nselect\n patient_id\n , hcc_code_1\n , hcc_code_2\n , description\n , coefficient\n , factor_type\n , model_version\n , payment_year\n , '2023-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom add_data_types", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.cms_hcc__int_eligible_conditions": {"database": "devforrest", "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": "ca22e899c79a9c7847da4e7935e71ea3b1bd3ead5b2d44029b924bd482e83627"}, "config": {"enabled": true, "alias": "_int_eligible_conditions", "schema": "cms_hcc", "database": null, "tags": ["cms_hcc"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["cms_hcc"], "description": "Conditions from eligible risk-adjustable claims per claim type for the collection year.\n", "columns": {"patient_id": {"name": "patient_id", "description": "Unique ID for the patient.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "condition_code": {"name": "condition_code", "description": "The condition code.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "model_version": {"name": "model_version", "description": "CMS HCC model version.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "payment_year": {"name": "payment_year", "description": "The payment year the HCC and risk scores are being calculated for.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The date the model was run.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://models\\cms_hcc\\cms_hcc_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "cms_hcc", "alias": "_int_eligible_conditions", "tags": "cms_hcc", "materialized": "table", "enabled": true, "bind": false}, "created_at": 1702481696.6806974, "relation_name": "devforrest.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_core__medical_claim') }}\r\n\r\n)\r\n\r\n, conditions as (\r\n\r\n select\r\n claim_id\r\n , patient_id\r\n , code\r\n from {{ ref('cms_hcc__stg_core__condition') }}\r\n where code_type = 'icd-10-cm'\r\n\r\n)\r\n\r\n, cpt_hcpcs_list as (\r\n\r\n select\r\n payment_year\r\n , hcpcs_cpt_code\r\n from {{ ref('cms_hcc__cpt_hcpcs') }}\r\n\r\n)\r\n\r\n, professional_claims as (\r\n\r\n select\r\n medical_claims.claim_id\r\n , medical_claims.claim_line_number\r\n , medical_claims.claim_type\r\n , medical_claims.patient_id\r\n , medical_claims.claim_start_date\r\n , medical_claims.claim_end_date\r\n , medical_claims.bill_type_code\r\n , medical_claims.hcpcs_code\r\n from medical_claims\r\n inner join cpt_hcpcs_list\r\n on medical_claims.hcpcs_code = cpt_hcpcs_list.hcpcs_cpt_code\r\n where claim_type = 'professional'\r\n and extract(year from claim_end_date) = {{ collection_year }}\r\n and cpt_hcpcs_list.payment_year = {{ payment_year_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 from eligible_conditions\r\n\r\n)\r\n\r\nselect\r\n patient_id\r\n , condition_code\r\n , model_version\r\n , payment_year\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom add_data_types", "language": "sql", "refs": [["cms_hcc__stg_core__medical_claim"], ["cms_hcc__stg_core__condition"], ["cms_hcc__cpt_hcpcs"]], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.type_string"], "nodes": ["model.the_tuva_project.cms_hcc__stg_core__medical_claim", "model.the_tuva_project.cms_hcc__stg_core__condition", "seed.the_tuva_project.cms_hcc__cpt_hcpcs"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\cms_hcc\\intermediate\\cms_hcc__int_eligible_conditions.sql", "compiled": true, "compiled_code": "\n/*\nSteps for staging condition data:\n 1) Filter to risk-adjustable claims per claim type for the collection year.\n 2) Gather diagnosis codes from condition for the eligible claims.\n 3) Map and filter diagnosis codes to HCCs\n\nClaims filtering logic:\n - Professional:\n - CPT/HCPCS in CPT/HCPCS seed file from CMS\n - Inpatient:\n - Bill type code in (11X, 41X)\n - Outpatient:\n - Bill type code in (12X, 13X, 43X, 71X, 73X, 76X, 77X, 85X)\n - CPT/HCPCS in CPT/HCPCS seed file from CMS\n\nJinja is used to set payment 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_core__medical_claim as (\n\nselect\n claim_id\n , claim_line_number\n , claim_type\n , patient_id\n , claim_start_date\n , claim_end_date\n , bill_type_code\n , hcpcs_code\n , '2023-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom devforrest.core.medical_claim\n), __dbt__cte__cms_hcc__stg_core__condition as (\n\nselect\n claim_id\n , patient_id\n , recorded_date\n , condition_type\n , normalized_code_type as code_type\n , normalized_code as code\n , '2023-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom devforrest.core.condition\n),medical_claims as (\n\n select\n claim_id\n , claim_line_number\n , claim_type\n , patient_id\n , claim_start_date\n , claim_end_date\n , bill_type_code\n , hcpcs_code\n from __dbt__cte__cms_hcc__stg_core__medical_claim\n\n)\n\n, conditions as (\n\n select\n claim_id\n , patient_id\n , code\n from __dbt__cte__cms_hcc__stg_core__condition\n where code_type = 'icd-10-cm'\n\n)\n\n, cpt_hcpcs_list as (\n\n select\n payment_year\n , hcpcs_cpt_code\n from devforrest.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 from eligible_conditions\n\n)\n\nselect\n patient_id\n , condition_code\n , model_version\n , payment_year\n , '2023-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom add_data_types", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.the_tuva_project.cms_hcc__stg_core__medical_claim", "sql": " __dbt__cte__cms_hcc__stg_core__medical_claim as (\n\nselect\n claim_id\n , claim_line_number\n , claim_type\n , patient_id\n , claim_start_date\n , claim_end_date\n , bill_type_code\n , hcpcs_code\n , '2023-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom devforrest.core.medical_claim\n)"}, {"id": "model.the_tuva_project.cms_hcc__stg_core__condition", "sql": " __dbt__cte__cms_hcc__stg_core__condition as (\n\nselect\n claim_id\n , patient_id\n , recorded_date\n , condition_type\n , normalized_code_type as code_type\n , normalized_code as code\n , '2023-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom devforrest.core.condition\n)"}]}, "model.the_tuva_project.cms_hcc__int_enrollment_interaction_factors": {"database": "devforrest", "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": "11d2696a210063b2ff33a4f37c9bf36ec5240332cc63bcbb6253d99f09c76518"}, "config": {"enabled": true, "alias": "_int_enrollment_interaction_factors", "schema": "cms_hcc", "database": null, "tags": ["cms_hcc"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["cms_hcc"], "description": "Enrollment interaction factor values for the corresponding HCC model version and payment year.\n", "columns": {"patient_id": {"name": "patient_id", "description": "Unique ID for the patient.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "description": {"name": "description", "description": "Description of the enrollment interaction.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "coefficient": {"name": "coefficient", "description": "Relative factor value that correspond to the CMS HCC model's risk indicators.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "factor_type": {"name": "factor_type", "description": "Type of risk factor, e.g. Demographic, Disease, etc.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "model_version": {"name": "model_version", "description": "CMS HCC model version.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "payment_year": {"name": "payment_year", "description": "The payment year the HCC and risk scores are being calculated for.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The date the model was run.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://models\\cms_hcc\\cms_hcc_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "cms_hcc", "alias": "_int_enrollment_interaction_factors", "tags": "cms_hcc", "materialized": "table", "enabled": true, "bind": false}, "created_at": 1702481696.6847005, "relation_name": "devforrest.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 , model_version\r\n , payment_year\r\n from {{ ref('cms_hcc__int_demographic_factors') }}\r\n\r\n)\r\n\r\n, seed_interaction_factors as (\r\n\r\n select\r\n model_version\r\n , factor_type\r\n , gender\r\n , enrollment_status\r\n , medicaid_status\r\n , dual_status\r\n , institutional_status\r\n , description\r\n , coefficient\r\n from {{ ref('cms_hcc__enrollment_interaction_factors') }}\r\n 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.factor_type\r\n , seed_interaction_factors.description\r\n , seed_interaction_factors.coefficient\r\n from demographics\r\n inner join seed_interaction_factors\r\n on demographics.gender = seed_interaction_factors.gender\r\n and demographics.enrollment_status = seed_interaction_factors.enrollment_status\r\n and demographics.medicaid_status = seed_interaction_factors.medicaid_status\r\n and demographics.dual_status = seed_interaction_factors.dual_status\r\n and demographics.institutional_status = seed_interaction_factors.institutional_status\r\n where demographics.institutional_status = 'No'\r\n and demographics.orec = 'Disabled'\r\n and demographics.age_group in (\r\n '65-69'\r\n , '70-74'\r\n , '75-79'\r\n , '80-84'\r\n , '85-89'\r\n , '90-94'\r\n , '>=95'\r\n )\r\n\r\n)\r\n\r\n/*\r\n Medicaid interactions for institutional members\r\n*/\r\n, institutional_interactions as (\r\n\r\n select\r\n demographics.patient_id\r\n , demographics.model_version\r\n , demographics.payment_year\r\n , seed_interaction_factors.factor_type\r\n , seed_interaction_factors.description\r\n , seed_interaction_factors.coefficient\r\n from demographics\r\n inner join seed_interaction_factors\r\n on demographics.enrollment_status = seed_interaction_factors.enrollment_status\r\n and demographics.institutional_status = seed_interaction_factors.institutional_status\r\n where demographics.institutional_status = 'Yes'\r\n and demographics.medicaid_status = 'Yes'\r\n\r\n)\r\n\r\n, unioned as (\r\n\r\n select * from non_institutional_interactions\r\n union all\r\n select * from institutional_interactions\r\n\r\n)\r\n\r\n, add_data_types as (\r\n\r\n select\r\n cast(patient_id as {{ dbt.type_string() }}) as patient_id\r\n , cast(description as {{ dbt.type_string() }}) as description\r\n , round(cast(coefficient as {{ dbt.type_numeric() }}),3) as coefficient\r\n , cast(factor_type as {{ dbt.type_string() }}) as factor_type\r\n , cast(model_version as {{ dbt.type_string() }}) as model_version\r\n , cast(payment_year as integer) as payment_year\r\n from unioned\r\n\r\n)\r\n\r\nselect\r\n patient_id\r\n , description\r\n , coefficient\r\n , factor_type\r\n , model_version\r\n , payment_year\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom add_data_types", "language": "sql", "refs": [["cms_hcc__int_demographic_factors"], ["cms_hcc__enrollment_interaction_factors"]], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.type_string", "macro.dbt.type_numeric"], "nodes": ["model.the_tuva_project.cms_hcc__int_demographic_factors", "seed.the_tuva_project.cms_hcc__enrollment_interaction_factors"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\cms_hcc\\intermediate\\cms_hcc__int_enrollment_interaction_factors.sql", "compiled": true, "compiled_code": "\n/*\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 , model_version\n , payment_year\n from devforrest.cms_hcc._int_demographic_factors\n\n)\n\n, seed_interaction_factors as (\n\n select\n model_version\n , factor_type\n , gender\n , enrollment_status\n , medicaid_status\n , dual_status\n , institutional_status\n , description\n , coefficient\n from devforrest.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.factor_type\n , seed_interaction_factors.description\n , seed_interaction_factors.coefficient\n from demographics\n inner join seed_interaction_factors\n on demographics.gender = seed_interaction_factors.gender\n and demographics.enrollment_status = seed_interaction_factors.enrollment_status\n and demographics.medicaid_status = seed_interaction_factors.medicaid_status\n and demographics.dual_status = seed_interaction_factors.dual_status\n and demographics.institutional_status = seed_interaction_factors.institutional_status\n where demographics.institutional_status = 'No'\n and demographics.orec = 'Disabled'\n and demographics.age_group in (\n '65-69'\n , '70-74'\n , '75-79'\n , '80-84'\n , '85-89'\n , '90-94'\n , '>=95'\n )\n\n)\n\n/*\n Medicaid interactions for institutional members\n*/\n, institutional_interactions as (\n\n select\n demographics.patient_id\n , demographics.model_version\n , demographics.payment_year\n , seed_interaction_factors.factor_type\n , seed_interaction_factors.description\n , seed_interaction_factors.coefficient\n from demographics\n inner join seed_interaction_factors\n on demographics.enrollment_status = seed_interaction_factors.enrollment_status\n and demographics.institutional_status = seed_interaction_factors.institutional_status\n where demographics.institutional_status = 'Yes'\n and demographics.medicaid_status = 'Yes'\n\n)\n\n, unioned as (\n\n select * from non_institutional_interactions\n union all\n select * from institutional_interactions\n\n)\n\n, add_data_types as (\n\n select\n cast(patient_id as TEXT) as patient_id\n , cast(description as TEXT) as description\n , round(cast(coefficient as numeric(28,6)),3) as coefficient\n , cast(factor_type as TEXT) as factor_type\n , cast(model_version as TEXT) as model_version\n , cast(payment_year as integer) as payment_year\n from unioned\n\n)\n\nselect\n patient_id\n , description\n , coefficient\n , factor_type\n , model_version\n , payment_year\n , '2023-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom add_data_types", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.cms_hcc__int_hcc_count_factors": {"database": "devforrest", "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": "a090b5674bff2b8191eae90c62560826dabf96cb2663d2406a8e1d486e4d27d6"}, "config": {"enabled": true, "alias": "_int_hcc_count_factors", "schema": "cms_hcc", "database": null, "tags": ["cms_hcc"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["cms_hcc"], "description": "Final payment-eligible HCC count factor values for the corresponding HCC model version and payment year.\n", "columns": {"patient_id": {"name": "patient_id", "description": "Unique ID for the patient.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "description": {"name": "description", "description": "HCC counts.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "coefficient": {"name": "coefficient", "description": "Relative factor value that correspond to the CMS HCC model's risk indicators.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "factor_type": {"name": "factor_type", "description": "Type of risk factor, e.g. Demographic, Disease, etc.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "model_version": {"name": "model_version", "description": "CMS HCC model version.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "payment_year": {"name": "payment_year", "description": "The payment year the HCC and risk scores are being calculated for.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The date the model was run.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://models\\cms_hcc\\cms_hcc_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "cms_hcc", "alias": "_int_hcc_count_factors", "tags": "cms_hcc", "materialized": "table", "enabled": true, "bind": false}, "created_at": 1702481696.6903849, "relation_name": "devforrest.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 , factor_type\r\n , enrollment_status\r\n , medicaid_status\r\n , dual_status\r\n , orec\r\n , institutional_status\r\n , payment_hcc_count\r\n , description\r\n , coefficient\r\n from {{ ref('cms_hcc__payment_hcc_count_factors') }}\r\n 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.factor_type\r\n , seed_payment_hcc_count_factors.description\r\n , seed_payment_hcc_count_factors.coefficient\r\n from hcc_counts_normalized\r\n inner join seed_payment_hcc_count_factors\r\n on hcc_counts_normalized.enrollment_status = seed_payment_hcc_count_factors.enrollment_status\r\n and hcc_counts_normalized.medicaid_status = seed_payment_hcc_count_factors.medicaid_status\r\n and hcc_counts_normalized.dual_status = seed_payment_hcc_count_factors.dual_status\r\n and hcc_counts_normalized.orec = seed_payment_hcc_count_factors.orec\r\n and hcc_counts_normalized.institutional_status = seed_payment_hcc_count_factors.institutional_status\r\n and hcc_counts_normalized.hcc_count_string = seed_payment_hcc_count_factors.payment_hcc_count\r\n\r\n)\r\n\r\n, add_data_types as (\r\n\r\n select\r\n cast(patient_id as {{ dbt.type_string() }}) as patient_id\r\n , cast(description as {{ dbt.type_string() }}) as description\r\n , round(cast(coefficient as {{ dbt.type_numeric() }}),3) as coefficient\r\n , cast(factor_type as {{ dbt.type_string() }}) as factor_type\r\n , cast(model_version as {{ dbt.type_string() }}) as model_version\r\n , cast(payment_year as integer) as payment_year\r\n from hcc_counts\r\n\r\n)\r\n\r\nselect\r\n patient_id\r\n , description\r\n , coefficient\r\n , factor_type\r\n , model_version\r\n , payment_year\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom add_data_types", "language": "sql", "refs": [["cms_hcc__int_demographic_factors"], ["cms_hcc__payment_hcc_count_factors"], ["cms_hcc__int_hcc_hierarchy"]], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.type_string", "macro.dbt.type_numeric"], "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 devforrest.cms_hcc._int_demographic_factors\n\n)\n\n, seed_payment_hcc_count_factors as (\n\n select\n model_version\n , factor_type\n , enrollment_status\n , medicaid_status\n , dual_status\n , orec\n , institutional_status\n , payment_hcc_count\n , description\n , coefficient\n from devforrest.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 devforrest.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.factor_type\n , seed_payment_hcc_count_factors.description\n , seed_payment_hcc_count_factors.coefficient\n from hcc_counts_normalized\n inner join seed_payment_hcc_count_factors\n on hcc_counts_normalized.enrollment_status = seed_payment_hcc_count_factors.enrollment_status\n and hcc_counts_normalized.medicaid_status = seed_payment_hcc_count_factors.medicaid_status\n and hcc_counts_normalized.dual_status = seed_payment_hcc_count_factors.dual_status\n and hcc_counts_normalized.orec = seed_payment_hcc_count_factors.orec\n and hcc_counts_normalized.institutional_status = seed_payment_hcc_count_factors.institutional_status\n and hcc_counts_normalized.hcc_count_string = seed_payment_hcc_count_factors.payment_hcc_count\n\n)\n\n, add_data_types as (\n\n select\n cast(patient_id as TEXT) as patient_id\n , cast(description as TEXT) as description\n , round(cast(coefficient as numeric(28,6)),3) as coefficient\n , cast(factor_type as TEXT) as factor_type\n , cast(model_version as TEXT) as model_version\n , cast(payment_year as integer) as payment_year\n from hcc_counts\n\n)\n\nselect\n patient_id\n , description\n , coefficient\n , factor_type\n , model_version\n , payment_year\n , '2023-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom add_data_types", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.cms_hcc__int_hcc_hierarchy": {"database": "devforrest", "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": "f2a9bd998686e95feedca9fa85fbc7e524bda7c20c455cc978bd5d105ca2aa4d"}, "config": {"enabled": true, "alias": "_int_hcc_hierarchy", "schema": "cms_hcc", "database": null, "tags": ["cms_hcc"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["cms_hcc"], "description": "HCC hierarchy for the corresponding HCC model version and payment year applied to the mapped payment-eligible HCCs.\n", "columns": {"patient_id": {"name": "patient_id", "description": "Unique ID for the patient.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "model_version": {"name": "model_version", "description": "CMS HCC model version.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "payment_year": {"name": "payment_year", "description": "The payment year the HCC and risk scores are being calculated for.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "hcc_code": {"name": "hcc_code", "description": "HCC code.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The date the model was run.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://models\\cms_hcc\\cms_hcc_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "cms_hcc", "alias": "_int_hcc_hierarchy", "tags": "cms_hcc", "materialized": "table", "enabled": true, "bind": false}, "created_at": 1702481696.694428, "relation_name": "devforrest.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 from unioned\r\n\r\n)\r\n\r\nselect\r\n patient_id\r\n , model_version\r\n , payment_year\r\n , hcc_code\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom add_data_types", "language": "sql", "refs": [["cms_hcc__int_hcc_mapping"], ["cms_hcc__disease_hierarchy"]], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.type_string"], "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 devforrest.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 devforrest.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 from unioned\n\n)\n\nselect\n patient_id\n , model_version\n , payment_year\n , hcc_code\n , '2023-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom add_data_types", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.cms_hcc__int_hcc_mapping": {"database": "devforrest", "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": "71da06fd16d283b817c0fff48eb9928d0c8fa7ea0c132a220b6d02e222c45b35"}, "config": {"enabled": true, "alias": "_int_hcc_mapping", "schema": "cms_hcc", "database": null, "tags": ["cms_hcc"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["cms_hcc"], "description": "Eligible conditions mapped to HCC codes for the corresponding HCC model version and payment year\n", "columns": {"patient_id": {"name": "patient_id", "description": "Unique ID for the patient.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "condition_code": {"name": "condition_code", "description": "Condition code.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "hcc_code": {"name": "hcc_code", "description": "HCC code.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "model_version": {"name": "model_version", "description": "CMS HCC model version.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "payment_year": {"name": "payment_year", "description": "The payment year the HCC and risk scores are being calculated for.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The date the model was run.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://models\\cms_hcc\\cms_hcc_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "cms_hcc", "alias": "_int_hcc_mapping", "tags": "cms_hcc", "materialized": "table", "enabled": true, "bind": false}, "created_at": 1702481696.6983886, "relation_name": "devforrest.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 from mapped\r\n\r\n)\r\n\r\nselect\r\n patient_id\r\n , condition_code\r\n , hcc_code\r\n , model_version\r\n , payment_year\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom add_data_types", "language": "sql", "refs": [["cms_hcc__int_eligible_conditions"], ["cms_hcc__icd_10_cm_mappings"]], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.type_string"], "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 devforrest.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 devforrest.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 from mapped\n\n)\n\nselect\n patient_id\n , condition_code\n , hcc_code\n , model_version\n , payment_year\n , '2023-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom add_data_types", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.cms_hcc__int_members": {"database": "devforrest", "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": "528dcfd09ab522fffd21f1e206ed83607731958cb34b2fb8f1e7f8719142df3b"}, "config": {"enabled": true, "alias": "_int_members", "schema": "cms_hcc", "database": null, "tags": ["cms_hcc"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["cms_hcc"], "description": "Transformed eligibility data into the demographic risk segments required for the CMS HCC and risk calculations.\n", "columns": {"patient_id": {"name": "patient_id", "description": "Unique ID for the patient.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "enrollment_status": {"name": "enrollment_status", "description": "Indicates whether the patient is a \"Continuing\" or \"New\" enrollee.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "gender": {"name": "gender", "description": "Indicates whether the patient is \"Female\" or \"Male\".", "meta": {}, "data_type": null, "quote": null, "tags": []}, "age_group": {"name": "age_group", "description": "Indicates what age group the patient is in. (e.g. \"60-64\"). CMS guidance: Age is calculated as of Feb 1 of the payment year.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "medicaid_status": {"name": "medicaid_status", "description": "Indicates whether the patient is enrolled in Medicaid.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "dual_status": {"name": "dual_status", "description": "Indicates whether the patient has \"Full\", \"Partial\", or \"Non\" dual status.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "orec": {"name": "orec", "description": "Indicates the Original Reason for Entitlement Code (OREC) \"Aged\", \"Disabled\", or \"ESRD\". If available, current Medicare Status is used when OREC is missing.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "institutional_status": {"name": "institutional_status", "description": "Indicates whether the patient resided in an institution for at least 90 days.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "enrollment_status_default": {"name": "enrollment_status_default", "description": "Indicates the input data was missing and a default status was used.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "medicaid_dual_status_default": {"name": "medicaid_dual_status_default", "description": "Indicates the input data was missing and a default status was used.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "orec_default": {"name": "orec_default", "description": "Indicates the input data was missing and a default status was used.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "institutional_status_default": {"name": "institutional_status_default", "description": "Indicates the input data was missing and a default status was used.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "model_version": {"name": "model_version", "description": "CMS HCC model version.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "payment_year": {"name": "payment_year", "description": "The payment year the HCC and risk scores are being calculated for.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The date the model was run.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://models\\cms_hcc\\cms_hcc_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "cms_hcc", "alias": "_int_members", "tags": "cms_hcc", "materialized": "table", "enabled": true, "bind": false}, "created_at": 1702481696.7053995, "relation_name": "devforrest.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 = var('cms_hcc_model_version') -%}\r\n{% set payment_year = var('cms_hcc_payment_year') -%}\r\n{% set payment_year_age_date = payment_year ~ '-02-01' -%}\r\n{% set collection_year = payment_year - 1 -%}\r\n{% set collection_year_start = collection_year ~ '-01-01' -%}\r\n{% set collection_year_end = collection_year ~ '-12-31' -%}\r\n\r\nwith stg_eligibility as (\r\n\r\n select\r\n patient_id\r\n , enrollment_start_date\r\n , enrollment_end_date\r\n , original_reason_entitlement_code\r\n , dual_status_code\r\n , medicare_status_code\r\n , row_number() over(\r\n partition by patient_id\r\n order by enrollment_end_date desc\r\n ) as row_num /* used to dedupe eligibility */\r\n from {{ ref('cms_hcc__stg_core__eligibility') }}\r\n where\r\n /* filter to members with eligibility in collection or payment year */\r\n (extract(year from enrollment_start_date) >= {{ collection_year }}\r\n or extract(year from enrollment_end_date) <= {{ payment_year }})\r\n\r\n)\r\n\r\n, stg_patient as (\r\n\r\n select\r\n patient_id\r\n , sex\r\n , birth_date\r\n , floor({{ datediff('birth_date', \"'\"~payment_year_age_date~\"'\", 'hour') }} / 8766.0) as payment_year_age\r\n , death_date\r\n from {{ ref('cms_hcc__stg_core__patient') }}\r\n\r\n)\r\n\r\n, cap_collection_start_end_dates as (\r\n\r\n select\r\n patient_id\r\n , enrollment_start_date\r\n , enrollment_end_date\r\n , case\r\n when enrollment_start_date < '{{ collection_year_start }}'\r\n then '{{ collection_year_start }}'\r\n else enrollment_start_date\r\n end as proxy_enrollment_start_date\r\n , case\r\n when enrollment_end_date > '{{ collection_year_end }}'\r\n then '{{ collection_year_end }}'\r\n else enrollment_end_date\r\n end as proxy_enrollment_end_date\r\n from stg_eligibility\r\n where\r\n /* filter to members with eligibility in collection year */\r\n (extract(year from enrollment_start_date) = {{ collection_year }}\r\n or extract(year from enrollment_end_date) = {{ collection_year }})\r\n\r\n)\r\n\r\n, calculate_prior_coverage as (\r\n\r\n select patient_id\r\n , sum({{ datediff('proxy_enrollment_start_date', 'proxy_enrollment_end_date', 'month') }} + 1) as coverage_months /* include starting month */\r\n from cap_collection_start_end_dates\r\n group by patient_id\r\n\r\n)\r\n\r\n/*\r\n CMS guidance: A \u201cNew Enrollee\u201d status is when a beneficiary has less than\r\n 12 months of coverage prior to the payment year.\r\n*/\r\n, add_enrollment as (\r\n\r\n select\r\n patient_id\r\n , case\r\n when coverage_months < 12 then 'New'\r\n else 'Continuing'\r\n end as enrollment_status\r\n from calculate_prior_coverage\r\n\r\n)\r\n\r\n, latest_eligibility as (\r\n\r\n select\r\n stg_eligibility.patient_id\r\n , stg_patient.sex as gender\r\n , stg_patient.payment_year_age\r\n , stg_eligibility.original_reason_entitlement_code\r\n , stg_eligibility.dual_status_code\r\n , stg_eligibility.medicare_status_code\r\n /*\r\n Defaulting to \"New\" enrollment status when missing.\r\n */\r\n , case\r\n when add_enrollment.enrollment_status is null then 'New'\r\n else add_enrollment.enrollment_status\r\n end as enrollment_status\r\n , case\r\n when add_enrollment.enrollment_status is null then TRUE\r\n else FALSE\r\n end as enrollment_status_default\r\n from stg_eligibility\r\n left join add_enrollment\r\n on stg_eligibility.patient_id = add_enrollment.patient_id\r\n left join stg_patient\r\n on stg_eligibility.patient_id = stg_patient.patient_id\r\n where stg_eligibility.row_num = 1\r\n /* filter to members with eligibility in payment year */\r\n and extract(year from stg_eligibility.enrollment_start_date) <= {{ payment_year }}\r\n and extract(year from stg_eligibility.enrollment_end_date) >= {{ payment_year }}\r\n\r\n)\r\n\r\n, add_age_group as (\r\n\r\n select\r\n patient_id\r\n , gender\r\n , payment_year_age\r\n , original_reason_entitlement_code\r\n , dual_status_code\r\n , medicare_status_code\r\n , enrollment_status\r\n , enrollment_status_default\r\n , case\r\n when enrollment_status = 'Continuing' and payment_year_age between 0 and 34 then '0-34'\r\n when enrollment_status = 'Continuing' and payment_year_age between 35 and 44 then '35-44'\r\n when enrollment_status = 'Continuing' and payment_year_age between 45 and 54 then '45-54'\r\n when enrollment_status = 'Continuing' and payment_year_age between 55 and 59 then '55-59'\r\n when enrollment_status = 'Continuing' and payment_year_age between 60 and 64 then '60-64'\r\n when enrollment_status = 'Continuing' and payment_year_age between 65 and 69 then '65-69'\r\n when enrollment_status = 'Continuing' and payment_year_age between 70 and 74 then '70-74'\r\n when enrollment_status = 'Continuing' and payment_year_age between 75 and 79 then '75-79'\r\n when enrollment_status = 'Continuing' and payment_year_age between 80 and 84 then '80-84'\r\n when enrollment_status = 'Continuing' and payment_year_age between 85 and 89 then '85-89'\r\n when enrollment_status = 'Continuing' and payment_year_age between 90 and 94 then '90-94'\r\n when enrollment_status = 'Continuing' and payment_year_age >= 95 then '>=95'\r\n when enrollment_status = 'New' and payment_year_age between 0 and 34 then '0-34'\r\n when enrollment_status = 'New' and payment_year_age between 35 and 44 then '35-44'\r\n when enrollment_status = 'New' and payment_year_age between 45 and 54 then '45-54'\r\n when enrollment_status = 'New' and payment_year_age between 55 and 59 then '55-59'\r\n when enrollment_status = 'New' and payment_year_age between 60 and 64 then '60-64'\r\n when enrollment_status = 'New' and payment_year_age = 65 then '65'\r\n when enrollment_status = 'New' and payment_year_age = 66 then '66'\r\n when enrollment_status = 'New' and payment_year_age = 67 then '67'\r\n when enrollment_status = 'New' and payment_year_age = 68 then '68'\r\n when enrollment_status = 'New' and payment_year_age = 69 then '69'\r\n when enrollment_status = 'New' and payment_year_age between 70 and 74 then '70-74'\r\n when enrollment_status = 'New' and payment_year_age between 75 and 79 then '75-79'\r\n when enrollment_status = 'New' and payment_year_age between 80 and 84 then '80-84'\r\n when enrollment_status = 'New' and payment_year_age between 85 and 89 then '85-89'\r\n when enrollment_status = 'New' and payment_year_age between 90 and 94 then '90-94'\r\n when enrollment_status = 'New' and payment_year_age >= 95 then '>=95'\r\n end as age_group\r\n from latest_eligibility\r\n\r\n)\r\n\r\n, add_status_logic as (\r\n\r\n select\r\n patient_id\r\n , enrollment_status\r\n , case\r\n when gender = 'female' then 'Female'\r\n when gender = 'male' then 'Male'\r\n else null\r\n end as gender\r\n , age_group\r\n , case\r\n when dual_status_code in ('01','02','03','04','05','06','08') then 'Yes'\r\n else 'No'\r\n end as medicaid_status\r\n , case\r\n when dual_status_code in ('02','04','08') then 'Full'\r\n when dual_status_code in ('01','03','05','06') then 'Partial'\r\n else 'Non'\r\n end as dual_status\r\n /*\r\n The CMS-HCC model does not have factors for ESRD for these edge-cases,\r\n we default to 'Aged'. When OREC is missing, latest Medicare status is\r\n used, if available.\r\n */\r\n , case\r\n when original_reason_entitlement_code in ('0','2') then 'Aged'\r\n when original_reason_entitlement_code in ('1','3') then 'Disabled'\r\n when original_reason_entitlement_code is null and medicare_status_code in ('10','11','31') then 'Aged'\r\n when original_reason_entitlement_code is null and medicare_status_code in ('20','21') then 'Disabled'\r\n when coalesce(original_reason_entitlement_code,medicare_status_code) is null then 'Aged'\r\n end as orec\r\n /*\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 , enrollment_status_default\r\n , case\r\n when dual_status_code is null then TRUE\r\n else FALSE\r\n end as medicaid_dual_status_default\r\n /*\r\n Setting default true when OREC or Medicare Status is ESRD, or null.\r\n */\r\n , case\r\n when original_reason_entitlement_code in ('2') then TRUE\r\n when original_reason_entitlement_code is null and medicare_status_code in ('31') then TRUE\r\n when coalesce(original_reason_entitlement_code,medicare_status_code) is null then TRUE\r\n else FALSE\r\n end as orec_default\r\n /*\r\n Setting default true until institutional logic is added\r\n */\r\n , TRUE as institutional_status_default\r\n from add_age_group\r\n\r\n)\r\n\r\n, add_data_types as (\r\n\r\n select\r\n cast(patient_id as {{ dbt.type_string() }}) as patient_id\r\n , cast(enrollment_status as {{ dbt.type_string() }}) as enrollment_status\r\n , cast(gender as {{ dbt.type_string() }}) as gender\r\n , cast(age_group as {{ dbt.type_string() }}) as age_group\r\n , cast(medicaid_status as {{ dbt.type_string() }}) as medicaid_status\r\n , cast(dual_status as {{ dbt.type_string() }}) as dual_status\r\n , cast(orec as {{ dbt.type_string() }}) as orec\r\n , cast(institutional_status as {{ dbt.type_string() }}) as institutional_status\r\n , cast(enrollment_status_default as boolean) as enrollment_status_default\r\n , cast(medicaid_dual_status_default as boolean) as medicaid_dual_status_default\r\n , cast(orec_default as boolean) as orec_default\r\n , cast(institutional_status_default as boolean) as institutional_status_default\r\n , cast('{{ model_version }}' as {{ dbt.type_string() }}) as model_version\r\n , cast('{{ payment_year }}' as integer) as payment_year\r\n from add_status_logic\r\n\r\n)\r\n\r\nselect\r\n patient_id\r\n , enrollment_status\r\n , gender\r\n , age_group\r\n , medicaid_status\r\n , dual_status\r\n , orec\r\n , institutional_status\r\n , enrollment_status_default\r\n , medicaid_dual_status_default\r\n , orec_default\r\n , institutional_status_default\r\n , model_version\r\n , payment_year\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom add_data_types", "language": "sql", "refs": [["cms_hcc__stg_core__eligibility"], ["cms_hcc__stg_core__patient"]], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.datediff", "macro.dbt.type_string"], "nodes": ["model.the_tuva_project.cms_hcc__stg_core__eligibility", "model.the_tuva_project.cms_hcc__stg_core__patient"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\cms_hcc\\intermediate\\cms_hcc__int_members.sql", "compiled": true, "compiled_code": "\n/*\nSteps for transforming eligibility data into member demographics:\n 1) Determine enrollment status using eligibility from the collection year.\n 2) Roll up to latest eligibility record.\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_core__eligibility as (\n\nselect\n patient_id\n , enrollment_start_date\n , enrollment_end_date\n , original_reason_entitlement_code\n , dual_status_code\n , medicare_status_code\n , '2023-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom devforrest.core.eligibility\n), __dbt__cte__cms_hcc__stg_core__patient as (\n\nselect\n patient_id\n , sex\n , birth_date\n , death_date\n , '2023-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom devforrest.core.patient\n),stg_eligibility as (\n\n select\n patient_id\n , enrollment_start_date\n , enrollment_end_date\n , original_reason_entitlement_code\n , dual_status_code\n , medicare_status_code\n , row_number() over(\n partition by patient_id\n order by enrollment_end_date desc\n ) as row_num /* used to dedupe eligibility */\n from __dbt__cte__cms_hcc__stg_core__eligibility\n where\n /* filter to members with eligibility in collection or payment year */\n (extract(year from enrollment_start_date) >= 2022\n or extract(year from enrollment_end_date) <= 2023)\n\n)\n\n, stg_patient as (\n\n select\n patient_id\n , sex\n , birth_date\n , floor(datediff(\n hour,\n birth_date,\n '2023-02-01'\n ) / 8766.0) as payment_year_age\n , death_date\n from __dbt__cte__cms_hcc__stg_core__patient\n\n)\n\n, cap_collection_start_end_dates as (\n\n select\n patient_id\n , enrollment_start_date\n , enrollment_end_date\n , case\n when enrollment_start_date < '2022-01-01'\n then '2022-01-01'\n else enrollment_start_date\n end as proxy_enrollment_start_date\n , case\n when enrollment_end_date > '2022-12-31'\n then '2022-12-31'\n else enrollment_end_date\n end as proxy_enrollment_end_date\n from stg_eligibility\n where\n /* filter to members with eligibility in collection year */\n (extract(year from enrollment_start_date) = 2022\n or extract(year from enrollment_end_date) = 2022)\n\n)\n\n, calculate_prior_coverage as (\n\n select patient_id\n , sum(datediff(\n month,\n proxy_enrollment_start_date,\n proxy_enrollment_end_date\n ) + 1) as coverage_months /* include starting month */\n from cap_collection_start_end_dates\n group by patient_id\n\n)\n\n/*\n CMS guidance: A \u201cNew Enrollee\u201d status is when a beneficiary has less than\n 12 months of coverage prior to the payment year.\n*/\n, add_enrollment as (\n\n select\n patient_id\n , case\n when coverage_months < 12 then 'New'\n else 'Continuing'\n end as enrollment_status\n from calculate_prior_coverage\n\n)\n\n, latest_eligibility as (\n\n select\n stg_eligibility.patient_id\n , stg_patient.sex as gender\n , stg_patient.payment_year_age\n , stg_eligibility.original_reason_entitlement_code\n , stg_eligibility.dual_status_code\n , stg_eligibility.medicare_status_code\n /*\n Defaulting to \"New\" enrollment status when missing.\n */\n , case\n when add_enrollment.enrollment_status is null then 'New'\n else add_enrollment.enrollment_status\n end as enrollment_status\n , case\n when add_enrollment.enrollment_status is null then TRUE\n else FALSE\n end as enrollment_status_default\n from stg_eligibility\n left join add_enrollment\n on stg_eligibility.patient_id = add_enrollment.patient_id\n left join stg_patient\n on stg_eligibility.patient_id = stg_patient.patient_id\n where stg_eligibility.row_num = 1\n /* filter to members with eligibility in payment year */\n and extract(year from stg_eligibility.enrollment_start_date) <= 2023\n and extract(year from stg_eligibility.enrollment_end_date) >= 2023\n\n)\n\n, add_age_group as (\n\n select\n patient_id\n , gender\n , payment_year_age\n , original_reason_entitlement_code\n , dual_status_code\n , medicare_status_code\n , enrollment_status\n , enrollment_status_default\n , case\n when enrollment_status = 'Continuing' and payment_year_age between 0 and 34 then '0-34'\n when enrollment_status = 'Continuing' and payment_year_age between 35 and 44 then '35-44'\n when enrollment_status = 'Continuing' and payment_year_age between 45 and 54 then '45-54'\n when enrollment_status = 'Continuing' and payment_year_age between 55 and 59 then '55-59'\n when enrollment_status = 'Continuing' and payment_year_age between 60 and 64 then '60-64'\n when enrollment_status = 'Continuing' and payment_year_age between 65 and 69 then '65-69'\n when enrollment_status = 'Continuing' and payment_year_age between 70 and 74 then '70-74'\n when enrollment_status = 'Continuing' and payment_year_age between 75 and 79 then '75-79'\n when enrollment_status = 'Continuing' and payment_year_age between 80 and 84 then '80-84'\n when enrollment_status = 'Continuing' and payment_year_age between 85 and 89 then '85-89'\n when enrollment_status = 'Continuing' and payment_year_age between 90 and 94 then '90-94'\n when enrollment_status = 'Continuing' and payment_year_age >= 95 then '>=95'\n when enrollment_status = 'New' and payment_year_age between 0 and 34 then '0-34'\n when enrollment_status = 'New' and payment_year_age between 35 and 44 then '35-44'\n when enrollment_status = 'New' and payment_year_age between 45 and 54 then '45-54'\n when enrollment_status = 'New' and payment_year_age between 55 and 59 then '55-59'\n when enrollment_status = 'New' and payment_year_age between 60 and 64 then '60-64'\n when enrollment_status = 'New' and payment_year_age = 65 then '65'\n when enrollment_status = 'New' and payment_year_age = 66 then '66'\n when enrollment_status = 'New' and payment_year_age = 67 then '67'\n when enrollment_status = 'New' and payment_year_age = 68 then '68'\n when enrollment_status = 'New' and payment_year_age = 69 then '69'\n when enrollment_status = 'New' and payment_year_age between 70 and 74 then '70-74'\n when enrollment_status = 'New' and payment_year_age between 75 and 79 then '75-79'\n when enrollment_status = 'New' and payment_year_age between 80 and 84 then '80-84'\n when enrollment_status = 'New' and payment_year_age between 85 and 89 then '85-89'\n when enrollment_status = 'New' and payment_year_age between 90 and 94 then '90-94'\n when enrollment_status = 'New' and payment_year_age >= 95 then '>=95'\n end as age_group\n from latest_eligibility\n\n)\n\n, add_status_logic as (\n\n select\n patient_id\n , enrollment_status\n , case\n when gender = 'female' then 'Female'\n when gender = 'male' then 'Male'\n else null\n end as gender\n , age_group\n , case\n when dual_status_code in ('01','02','03','04','05','06','08') then 'Yes'\n else 'No'\n end as medicaid_status\n , case\n when dual_status_code in ('02','04','08') then 'Full'\n when dual_status_code in ('01','03','05','06') then 'Partial'\n else 'Non'\n end as dual_status\n /*\n The CMS-HCC model does not have factors for ESRD for these edge-cases,\n we default to 'Aged'. When OREC is missing, latest Medicare status is\n used, if available.\n */\n , case\n when original_reason_entitlement_code in ('0','2') then 'Aged'\n when original_reason_entitlement_code in ('1','3') then 'Disabled'\n when original_reason_entitlement_code is null and medicare_status_code in ('10','11','31') then 'Aged'\n when original_reason_entitlement_code is null and medicare_status_code in ('20','21') then 'Disabled'\n when coalesce(original_reason_entitlement_code,medicare_status_code) is null then 'Aged'\n end as orec\n /*\n Defaulting everyone to non-institutional until logic is added\n */\n , cast('No' as TEXT) as institutional_status\n , enrollment_status_default\n , case\n when dual_status_code is null then TRUE\n else FALSE\n end as medicaid_dual_status_default\n /*\n Setting default true when OREC or Medicare Status is ESRD, or null.\n */\n , case\n when original_reason_entitlement_code in ('2') then TRUE\n when original_reason_entitlement_code is null and medicare_status_code in ('31') then TRUE\n when coalesce(original_reason_entitlement_code,medicare_status_code) is null then TRUE\n else FALSE\n end as orec_default\n /*\n Setting default true until institutional logic is added\n */\n , TRUE as institutional_status_default\n from add_age_group\n\n)\n\n, add_data_types as (\n\n select\n cast(patient_id as TEXT) as patient_id\n , cast(enrollment_status as TEXT) as enrollment_status\n , cast(gender as TEXT) as gender\n , cast(age_group as TEXT) as age_group\n , cast(medicaid_status as TEXT) as medicaid_status\n , cast(dual_status as TEXT) as dual_status\n , cast(orec as TEXT) as orec\n , cast(institutional_status as TEXT) as institutional_status\n , cast(enrollment_status_default as boolean) as enrollment_status_default\n , cast(medicaid_dual_status_default as boolean) as medicaid_dual_status_default\n , cast(orec_default as boolean) as orec_default\n , cast(institutional_status_default as boolean) as institutional_status_default\n , cast('CMS-HCC-V24' as TEXT) as model_version\n , cast('2023' as integer) as payment_year\n from add_status_logic\n\n)\n\nselect\n patient_id\n , enrollment_status\n , gender\n , age_group\n , medicaid_status\n , dual_status\n , orec\n , institutional_status\n , enrollment_status_default\n , medicaid_dual_status_default\n , orec_default\n , institutional_status_default\n , model_version\n , payment_year\n , '2023-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom add_data_types", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.the_tuva_project.cms_hcc__stg_core__eligibility", "sql": " __dbt__cte__cms_hcc__stg_core__eligibility as (\n\nselect\n patient_id\n , enrollment_start_date\n , enrollment_end_date\n , original_reason_entitlement_code\n , dual_status_code\n , medicare_status_code\n , '2023-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom devforrest.core.eligibility\n)"}, {"id": "model.the_tuva_project.cms_hcc__stg_core__patient", "sql": " __dbt__cte__cms_hcc__stg_core__patient as (\n\nselect\n patient_id\n , sex\n , birth_date\n , death_date\n , '2023-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom devforrest.core.patient\n)"}]}, "model.the_tuva_project.cms_hcc__stg_core__condition": {"database": "devforrest", "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": "696a2fa4a30aacbec7c9287b130149fb620aed0c8df02bd6d3b9673bc964ad09"}, "config": {"enabled": true, "alias": "_stg_condition", "schema": "cms_hcc", "database": null, "tags": ["cms_hcc"], "meta": {}, "materialized": "ephemeral", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["cms_hcc"], "description": "Staging conditions from core.", "columns": {"claim_id": {"name": "claim_id", "description": "Unique claim_id for each claim.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "patient_id": {"name": "patient_id", "description": "Unique patient_id for each person.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "recorded_date": {"name": "recorded_date", "description": "Date in which the condition was recorded.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "condition_type": {"name": "condition_type", "description": "The type of condition.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "code_type": {"name": "code_type", "description": "The type of condition code.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "code": {"name": "code", "description": "The condition code.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://models\\cms_hcc\\cms_hcc_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "cms_hcc", "alias": "_stg_condition", "tags": "cms_hcc", "materialized": "ephemeral", "enabled": true, "bind": false}, "created_at": 1702481696.7065437, "relation_name": null, "raw_code": "{{ config(\r\n enabled = var('cms_hcc_enabled',var('claims_enabled',var('clinical_enabled',var('tuva_marts_enabled',False))))\r\n )\r\n}}\r\nselect\r\n claim_id\r\n , patient_id\r\n , recorded_date\r\n , condition_type\r\n , normalized_code_type as code_type\r\n , normalized_code as code\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('core__condition') }}", "language": "sql", "refs": [["core__condition"]], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.core__condition"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\cms_hcc\\staging\\cms_hcc__stg_core__condition.sql", "compiled": true, "compiled_code": "\nselect\n claim_id\n , patient_id\n , recorded_date\n , condition_type\n , normalized_code_type as code_type\n , normalized_code as code\n , '2023-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom devforrest.core.condition", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.cms_hcc__stg_core__eligibility": {"database": "devforrest", "schema": "cms_hcc", "name": "cms_hcc__stg_core__eligibility", "resource_type": "model", "package_name": "the_tuva_project", "path": "cms_hcc\\staging\\cms_hcc__stg_core__eligibility.sql", "original_file_path": "models\\cms_hcc\\staging\\cms_hcc__stg_core__eligibility.sql", "unique_id": "model.the_tuva_project.cms_hcc__stg_core__eligibility", "fqn": ["the_tuva_project", "cms_hcc", "staging", "cms_hcc__stg_core__eligibility"], "alias": "_stg_eligibility", "checksum": {"name": "sha256", "checksum": "2b9eb56202c157877d30191033c1e616f5b27ae7cb8981bf7c0004e6777b4013"}, "config": {"enabled": true, "alias": "_stg_eligibility", "schema": "cms_hcc", "database": null, "tags": ["cms_hcc"], "meta": {}, "materialized": "ephemeral", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["cms_hcc"], "description": "Staging eligibility from core.", "columns": {"patient_id": {"name": "patient_id", "description": "Unique identifier for each patient in the dataset.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "enrollment_start_date": {"name": "enrollment_start_date", "description": "Date the patient's insurance eligibility began.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "enrollment_end_date": {"name": "enrollment_end_date", "description": "Date the patient's insurance eligibility ended.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "dual_status_code": {"name": "dual_status_code", "description": "Indicates whether the patient is dually eligible for Medicare and Medicaid.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "medicare_status_code": {"name": "medicare_status_code", "description": "Indicates how the patient became eligible for Medicare.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://models\\cms_hcc\\cms_hcc_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "cms_hcc", "alias": "_stg_eligibility", "tags": "cms_hcc", "materialized": "ephemeral", "enabled": true, "bind": false}, "created_at": 1702481696.7065437, "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 , enrollment_start_date\r\n , enrollment_end_date\r\n , original_reason_entitlement_code\r\n , dual_status_code\r\n , medicare_status_code\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('core__eligibility') }}", "language": "sql", "refs": [["core__eligibility"]], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.core__eligibility"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\cms_hcc\\staging\\cms_hcc__stg_core__eligibility.sql", "compiled": true, "compiled_code": "\nselect\n patient_id\n , enrollment_start_date\n , enrollment_end_date\n , original_reason_entitlement_code\n , dual_status_code\n , medicare_status_code\n , '2023-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom devforrest.core.eligibility", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.cms_hcc__stg_core__medical_claim": {"database": "devforrest", "schema": "cms_hcc", "name": "cms_hcc__stg_core__medical_claim", "resource_type": "model", "package_name": "the_tuva_project", "path": "cms_hcc\\staging\\cms_hcc__stg_core__medical_claim.sql", "original_file_path": "models\\cms_hcc\\staging\\cms_hcc__stg_core__medical_claim.sql", "unique_id": "model.the_tuva_project.cms_hcc__stg_core__medical_claim", "fqn": ["the_tuva_project", "cms_hcc", "staging", "cms_hcc__stg_core__medical_claim"], "alias": "_stg_medical_claim", "checksum": {"name": "sha256", "checksum": "db47a8d924c9a7315a8a9bd211d70eae771766f763211d0b58ff8bb2968b02f4"}, "config": {"enabled": true, "alias": "_stg_medical_claim", "schema": "cms_hcc", "database": null, "tags": ["cms_hcc"], "meta": {}, "materialized": "ephemeral", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["cms_hcc"], "description": "Staging medical claims from core.", "columns": {"claim_id": {"name": "claim_id", "description": "Unique identifier for each claim.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "claim_line_number": {"name": "claim_line_number", "description": "Indicates the line number for the particular line of the claim.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "claim_type": {"name": "claim_type", "description": "Indicates whether the claim is professional (CMS-1500), institutional (UB-04), dental, or vision.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "patient_id": {"name": "patient_id", "description": "Unique identifier for each patient in the dataset.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "claim_start_date": {"name": "claim_start_date", "description": "Start date for the claim.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "claim_end_date": {"name": "claim_end_date", "description": "End date for the claim.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "bill_type_code": {"name": "bill_type_code", "description": "Bill type code for the claim (institutional claims only).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "hcpcs_code": {"name": "hcpcs_code", "description": "HCPCS level 1 or level 2 code for the claim line.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://models\\cms_hcc\\cms_hcc_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "cms_hcc", "alias": "_stg_medical_claim", "tags": "cms_hcc", "materialized": "ephemeral", "enabled": true, "bind": false}, "created_at": 1702481696.7065437, "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('core__medical_claim') }}", "language": "sql", "refs": [["core__medical_claim"]], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.core__medical_claim"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\cms_hcc\\staging\\cms_hcc__stg_core__medical_claim.sql", "compiled": true, "compiled_code": "\nselect\n claim_id\n , claim_line_number\n , claim_type\n , patient_id\n , claim_start_date\n , claim_end_date\n , bill_type_code\n , hcpcs_code\n , '2023-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom devforrest.core.medical_claim", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.cms_hcc__stg_core__patient": {"database": "devforrest", "schema": "cms_hcc", "name": "cms_hcc__stg_core__patient", "resource_type": "model", "package_name": "the_tuva_project", "path": "cms_hcc\\staging\\cms_hcc__stg_core__patient.sql", "original_file_path": "models\\cms_hcc\\staging\\cms_hcc__stg_core__patient.sql", "unique_id": "model.the_tuva_project.cms_hcc__stg_core__patient", "fqn": ["the_tuva_project", "cms_hcc", "staging", "cms_hcc__stg_core__patient"], "alias": "_stg_patient", "checksum": {"name": "sha256", "checksum": "f77751e42b97506bef15f5cb906c08ad6b87665d13dcc0c1ccd3c2b78f26bada"}, "config": {"enabled": true, "alias": "_stg_patient", "schema": "cms_hcc", "database": null, "tags": ["cms_hcc"], "meta": {}, "materialized": "ephemeral", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["cms_hcc"], "description": "Staging patient from core.", "columns": {"patient_id": {"name": "patient_id", "description": "Unique identifier for each patient in the dataset.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "sex": {"name": "sex", "description": "Biological sex of the patient.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "birth_date": {"name": "birth_date", "description": "Date the patient was born.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "death_date": {"name": "death_date", "description": "The death date of the patient if there is one.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://models\\cms_hcc\\cms_hcc_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "cms_hcc", "alias": "_stg_patient", "tags": "cms_hcc", "materialized": "ephemeral", "enabled": true, "bind": false}, "created_at": 1702481696.7222478, "relation_name": null, "raw_code": "{{ config(\r\n enabled = var('cms_hcc_enabled',var('claims_enabled',var('clinical_enabled',var('tuva_marts_enabled',False))))\r\n )\r\n}}\r\nselect\r\n patient_id\r\n , sex\r\n , birth_date\r\n , death_date\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('core__patient') }}", "language": "sql", "refs": [["core__patient"]], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.core__patient"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\cms_hcc\\staging\\cms_hcc__stg_core__patient.sql", "compiled": true, "compiled_code": "\nselect\n patient_id\n , sex\n , birth_date\n , death_date\n , '2023-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom devforrest.core.patient", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.core__eligibility": {"database": "devforrest", "schema": "core", "name": "core__eligibility", "resource_type": "model", "package_name": "the_tuva_project", "path": "core\\final\\core__eligibility.sql", "original_file_path": "models\\core\\final\\core__eligibility.sql", "unique_id": "model.the_tuva_project.core__eligibility", "fqn": ["the_tuva_project", "core", "final", "core__eligibility"], "alias": "eligibility", "checksum": {"name": "sha256", "checksum": "6c4444c95ace83c2f6bc4f2e9dfc69bef360c3b0a01bea5e67b3da4761485111"}, "config": {"enabled": true, "alias": "eligibility", "schema": "core", "database": null, "tags": ["core"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#0f3d0b"}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["core"], "description": "The eligibility table contains information on patient health plan and supplemental insurance eligibility.\n", "columns": {"patient_id": {"name": "patient_id", "description": "Unique identifier for each patient in the dataset.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "member_id": {"name": "member_id", "description": "Identifier that links a patient to a particular insurance product or health plan. A patient can have more than one member_id because they can have more than one insurance product/plan.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "birth_date": {"name": "birth_date", "description": "Date the patient was born.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "death_date": {"name": "death_date", "description": "Date the patient died.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "enrollment_start_date": {"name": "enrollment_start_date", "description": "Date the patient's insurance eligibility began.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "enrollment_end_date": {"name": "enrollment_end_date", "description": "Date the patient's insurance eligibility ended.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "payer": {"name": "payer", "description": "Name of the payer (i.e. health insurer) providing coverage.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "payer_type": {"name": "payer_type", "description": "Type of payer (e.g. commercial, medicare, medicaid, etc.).", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__payer_type.csv"}, "data_type": null, "quote": null, "tags": []}, "plan": {"name": "plan", "description": "Name of the plan (i.e. sub contract) providing coverage.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "original_reason_entitlement_code": {"name": "original_reason_entitlement_code", "description": "Original reason for Medicare entitlement code.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__medicare_orec.csv"}, "data_type": null, "quote": null, "tags": []}, "dual_status_code": {"name": "dual_status_code", "description": "Indicates whether the patient is dually eligible for Medicare and Medicaid.\n", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__medicare_dual_eligibility.csv"}, "data_type": null, "quote": null, "tags": []}, "medicare_status_code": {"name": "medicare_status_code", "description": "Indicates how the patient became eligible for Medicare.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__medicare_status.csv"}, "data_type": null, "quote": null, "tags": []}, "data_source": {"name": "data_source", "description": "User-configured field that indicates the data source (e.g. typically named after the payer and state \"BCBS Tennessee\").\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The last time the data was refreshed. Generated by `dbt_utils.pretty_time` as the local time of the `dbt run` environment. Timezone is configurable via the `tuva_last_run` var.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": "#0f3d0b"}, "patch_path": "the_tuva_project://models\\core\\core_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "core", "alias": "eligibility", "tags": "core", "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#0f3d0b"}}, "created_at": 1702481696.7473302, "relation_name": "devforrest.core.eligibility", "raw_code": "{{ config(\r\n enabled = var('claims_enabled',var('tuva_marts_enabled',False))\r\n )\r\n}}\r\n\r\n\r\nselect * from {{ ref('core__stg_claims_eligibility')}}", "language": "sql", "refs": [["core__stg_claims_eligibility"]], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.core__stg_claims_eligibility"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\core\\final\\core__eligibility.sql", "compiled": true, "compiled_code": "\n\n\nselect * from devforrest.core._stg_claims_eligibility", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.core__stg_claims_condition": {"database": "devforrest", "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": "a46333247ed56f4ecebcfcf028592931656cff7dcd503969b43610180c6e15d1"}, "config": {"enabled": true, "alias": "_stg_claims_condition", "schema": "core", "database": null, "tags": ["core_stage_claims"], "meta": {}, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#0f3d0b"}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["core_stage_claims"], "description": "Staging core claims conditions", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#0f3d0b"}, "patch_path": "the_tuva_project://models\\core\\core_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "core", "alias": "_stg_claims_condition", "tags": "core_stage_claims", "materialized": "view", "enabled": true, "bind": false, "docs": {"node_color": "#0f3d0b"}}, "created_at": 1702481696.854664, "relation_name": "devforrest.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(coalesce(ap.encounter_id, ed.encounter_id) as {{ dbt.type_string() }} ) as encounter_id,\r\n cast(unpivot_cte.claim_id as {{ dbt.type_string() }} ) as claim_id,\r\n {{ try_to_cast_date('unpivot_cte.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_id')}} as ap\r\n on unpivot_cte.claim_id = ap.claim_id\r\nleft join {{ ref('emergency_department__int_encounter_id')}} as ed\r\n on unpivot_cte.claim_id = ed.claim_id\r\nleft join {{ ref('terminology__icd_10_cm') }} icd\r\n on unpivot_cte.source_code = icd.icd_10_cm\r\nleft join {{ ref('terminology__present_on_admission') }} as poa\r\n on unpivot_cte.present_on_admit_code = poa.present_on_admit_code", "language": "sql", "refs": [["medical_claim"], ["medical_claim"], ["medical_claim"], ["medical_claim"], ["medical_claim"], ["medical_claim"], ["medical_claim"], ["medical_claim"], ["medical_claim"], ["medical_claim"], ["medical_claim"], ["medical_claim"], ["medical_claim"], ["medical_claim"], ["medical_claim"], ["medical_claim"], ["medical_claim"], ["medical_claim"], ["medical_claim"], ["medical_claim"], ["medical_claim"], ["medical_claim"], ["medical_claim"], ["medical_claim"], ["medical_claim"], ["acute_inpatient__encounter_id"], ["emergency_department__int_encounter_id"], ["terminology__icd_10_cm"], ["terminology__present_on_admission"]], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.type_string", "macro.the_tuva_project.try_to_cast_date", "macro.dbt.type_int", "macro.dbt.type_timestamp"], "nodes": ["model.input_layer.medical_claim", "model.input_layer.medical_claim", "model.input_layer.medical_claim", "model.input_layer.medical_claim", "model.input_layer.medical_claim", "model.input_layer.medical_claim", "model.input_layer.medical_claim", "model.input_layer.medical_claim", "model.input_layer.medical_claim", "model.input_layer.medical_claim", "model.input_layer.medical_claim", "model.input_layer.medical_claim", "model.input_layer.medical_claim", "model.input_layer.medical_claim", "model.input_layer.medical_claim", "model.input_layer.medical_claim", "model.input_layer.medical_claim", "model.input_layer.medical_claim", "model.input_layer.medical_claim", "model.input_layer.medical_claim", "model.input_layer.medical_claim", "model.input_layer.medical_claim", "model.input_layer.medical_claim", "model.input_layer.medical_claim", "model.input_layer.medical_claim", "model.the_tuva_project.acute_inpatient__encounter_id", "model.the_tuva_project.emergency_department__int_encounter_id", "seed.the_tuva_project.terminology__icd_10_cm", "seed.the_tuva_project.terminology__present_on_admission"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\core\\staging\\core__stg_claims_condition.sql", "compiled": true, "compiled_code": "\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.input_layer.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.input_layer.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.input_layer.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.input_layer.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.input_layer.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.input_layer.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.input_layer.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.input_layer.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.input_layer.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.input_layer.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.input_layer.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.input_layer.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.input_layer.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.input_layer.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.input_layer.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.input_layer.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.input_layer.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.input_layer.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.input_layer.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.input_layer.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.input_layer.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.input_layer.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.input_layer.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.input_layer.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.input_layer.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(coalesce(ap.encounter_id, ed.encounter_id) as TEXT ) as encounter_id,\n cast(unpivot_cte.claim_id as TEXT ) as claim_id,\n try_cast( unpivot_cte.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-12-13 23:31:59.089856+00:00' as TIMESTAMP ) as tuva_last_run\nfrom unpivot_cte\nleft join devforrest.claims_preprocessing._int_acute_inpatient_encounter_id as ap\n on unpivot_cte.claim_id = ap.claim_id\nleft join devforrest.claims_preprocessing._int_emergency_department_encounter_id as ed\n on unpivot_cte.claim_id = ed.claim_id\nleft join devforrest.terminology.icd_10_cm icd\n on unpivot_cte.source_code = icd.icd_10_cm\nleft join devforrest.terminology.present_on_admission as poa\n on unpivot_cte.present_on_admit_code = poa.present_on_admit_code", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.core__stg_claims_eligibility": {"database": "devforrest", "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": "f11058de6b31b800f0b48d05bd8b6efd361e21784ba5403e46733b659873a8e3"}, "config": {"enabled": true, "alias": "_stg_claims_eligibility", "schema": "core", "database": null, "tags": ["core_stage_claims"], "meta": {}, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#0f3d0b"}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["core_stage_claims"], "description": "Staging core eligibility", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#0f3d0b"}, "patch_path": "the_tuva_project://models\\core\\core_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "core", "alias": "_stg_claims_eligibility", "tags": "core_stage_claims", "materialized": "view", "enabled": true, "bind": false, "docs": {"node_color": "#0f3d0b"}}, "created_at": 1702481696.8703895, "relation_name": "devforrest.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(birth_date as date) as birth_date\r\n , cast(death_date as date) as death_date\r\n , cast(enrollment_start_date as date ) as enrollment_start_date\r\n , cast(enrollment_end_date as date ) as enrollment_end_date\r\n , cast(payer as {{ dbt.type_string() }} ) as payer\r\n , cast(payer_type as {{ dbt.type_string() }} ) as payer_type\r\n , cast(plan as {{ dbt.type_string() }} ) as plan\r\n , cast(original_reason_entitlement_code as {{ dbt.type_string() }} ) as original_reason_entitlement_code\r\n , cast(dual_status_code as {{ dbt.type_string() }} ) as dual_status_code\r\n , cast(medicare_status_code as {{ dbt.type_string() }} ) as medicare_status_code\r\n , cast(data_source as {{ dbt.type_string() }} ) as data_source\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('eligibility') }}", "language": "sql", "refs": [["eligibility"]], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.type_string"], "nodes": ["model.input_layer.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(birth_date as date) as birth_date\n , cast(death_date as date) as death_date\n , cast(enrollment_start_date as date ) as enrollment_start_date\n , cast(enrollment_end_date as date ) as enrollment_end_date\n , cast(payer as TEXT ) as payer\n , cast(payer_type as TEXT ) as payer_type\n , cast(plan as TEXT ) as plan\n , cast(original_reason_entitlement_code as TEXT ) as original_reason_entitlement_code\n , cast(dual_status_code as TEXT ) as dual_status_code\n , cast(medicare_status_code as TEXT ) as medicare_status_code\n , cast(data_source as TEXT ) as data_source\n , '2023-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom tuva.input_layer.eligibility", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.core__stg_claims_encounter": {"database": "devforrest", "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": "dd440a1808e8b318c40c9b49da58e081bc075528be61b65d88ebbc7bb4b7c116"}, "config": {"enabled": true, "alias": "_stg_claims_encounter", "schema": "core", "database": null, "tags": ["core_stage_claims"], "meta": {}, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#0f3d0b"}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["core_stage_claims"], "description": "Staging core claims encounters", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#0f3d0b"}, "patch_path": "the_tuva_project://models\\core\\core_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "core", "alias": "_stg_claims_encounter", "tags": "core_stage_claims", "materialized": "view", "enabled": true, "bind": false, "docs": {"node_color": "#0f3d0b"}}, "created_at": 1702481696.8505657, "relation_name": "devforrest.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(primary_diagnosis_code_type as {{ dbt.type_string() }} ) as primary_diagnosis_code_type\r\n , cast(primary_diagnosis_code as {{ dbt.type_string() }} ) as primary_diagnosis_code\r\n , cast(primary_diagnosis_description as {{ dbt.type_string() }} ) as primary_diagnosis_description\r\n , cast(ms_drg_code as {{ dbt.type_string() }} ) as ms_drg_code\r\n , cast(ms_drg_description as {{ dbt.type_string() }} ) as ms_drg_description\r\n , cast(apr_drg_code as {{ dbt.type_string() }} ) as apr_drg_code\r\n , cast(apr_drg_description as {{ dbt.type_string() }} ) as apr_drg_description\r\n , cast(total_paid_amount as {{ dbt.type_numeric() }} ) as paid_amount\r\n , cast(total_allowed_amount as {{ dbt.type_numeric() }} ) as allowed_amount\r\n , cast(total_charge_amount as {{ dbt.type_numeric() }} ) as charge_amount\r\n , cast(data_source as {{ dbt.type_string() }} ) as data_source\r\n , cast('{{ var('tuva_last_run')}}' as {{ dbt.type_timestamp() }} ) as tuva_last_run\r\nfrom {{ ref('acute_inpatient__summary') }} \r\n\r\nunion all \r\n\r\nselect\r\n cast(encounter_id as {{ dbt.type_string() }} ) as encounter_id\r\n , cast(patient_id as {{ dbt.type_string() }} ) as patient_id\r\n , cast('emergency department' as {{ dbt.type_string() }} ) as encounter_type\r\n , {{ try_to_cast_date('encounter_start_date', 'YYYY-MM-DD') }} as encounter_start_date\r\n , {{ try_to_cast_date('encounter_end_date', 'YYYY-MM-DD') }} as encounter_end_date\r\n , cast(length_of_stay as {{ dbt.type_int() }} ) as length_of_stay\r\n , cast(admit_source_code as {{ dbt.type_string() }} ) as admit_source_code\r\n , cast(admit_source_description as {{ dbt.type_string() }} ) as admit_source_description\r\n , cast(admit_type_code as {{ dbt.type_string() }} ) as admit_type_code\r\n , cast(admit_type_description as {{ dbt.type_string() }} ) as admit_type_description\r\n , cast(discharge_disposition_code as {{ dbt.type_string() }} ) as discharge_disposition_code\r\n , cast(discharge_disposition_description as {{ dbt.type_string() }} ) as discharge_disposition_description\r\n , cast(null as {{ dbt.type_string() }} ) as attending_provider_id\r\n , cast(facility_npi as {{ dbt.type_string() }} ) as facility_npi\r\n , cast(primary_diagnosis_code_type as {{ dbt.type_string() }} ) as primary_diagnosis_code_type\r\n , cast(primary_diagnosis_code as {{ dbt.type_string() }} ) as primary_diagnosis_code\r\n , cast(primary_diagnosis_description as {{ dbt.type_string() }} ) as primary_diagnosis_description\r\n , cast(ms_drg_code as {{ dbt.type_string() }} ) as ms_drg_code\r\n , cast(ms_drg_description as {{ dbt.type_string() }} ) as ms_drg_description\r\n , cast(apr_drg_code as {{ dbt.type_string() }} ) as apr_drg_code\r\n , cast(apr_drg_description as {{ dbt.type_string() }} ) as apr_drg_description\r\n , cast(total_paid_amount as {{ dbt.type_numeric() }} ) as paid_amount\r\n , cast(total_allowed_amount as {{ dbt.type_numeric() }} ) as allowed_amount\r\n , cast(total_charge_amount as {{ dbt.type_numeric() }} ) as charge_amount\r\n , cast(data_source as {{ dbt.type_string() }} ) as data_source\r\n , cast('{{ var('tuva_last_run')}}' as {{ dbt.type_timestamp() }} ) as tuva_last_run\r\nfrom {{ ref('emergency_department__summary') }}", "language": "sql", "refs": [["acute_inpatient__summary"], ["emergency_department__summary"]], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.type_string", "macro.the_tuva_project.try_to_cast_date", "macro.dbt.type_int", "macro.dbt.type_numeric", "macro.dbt.type_timestamp"], "nodes": ["model.the_tuva_project.acute_inpatient__summary", "model.the_tuva_project.emergency_department__summary"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\core\\staging\\core__stg_claims_encounter.sql", "compiled": true, "compiled_code": "\n\n-- *************************************************\n-- This dbt model creates the encounter table in core.\n-- *************************************************\n\nselect\n cast(encounter_id as TEXT ) as encounter_id\n , cast(patient_id as TEXT ) as patient_id\n , cast('acute inpatient' as TEXT ) as encounter_type\n , try_cast( encounter_start_date as date ) as encounter_start_date\n , try_cast( encounter_end_date as date ) as encounter_end_date\n , cast(length_of_stay as INT ) as length_of_stay\n , cast(admit_source_code as TEXT ) as admit_source_code\n , cast(admit_source_description as TEXT ) as admit_source_description\n , cast(admit_type_code as TEXT ) as admit_type_code\n , cast(admit_type_description as TEXT ) as admit_type_description\n , cast(discharge_disposition_code as TEXT ) as discharge_disposition_code\n , cast(discharge_disposition_description as TEXT ) as discharge_disposition_description\n , cast(null as TEXT ) as attending_provider_id\n , cast(facility_npi as TEXT ) as facility_npi\n , cast(primary_diagnosis_code_type as TEXT ) as primary_diagnosis_code_type\n , cast(primary_diagnosis_code as TEXT ) as primary_diagnosis_code\n , cast(primary_diagnosis_description as TEXT ) as primary_diagnosis_description\n , cast(ms_drg_code as TEXT ) as ms_drg_code\n , cast(ms_drg_description as TEXT ) as ms_drg_description\n , cast(apr_drg_code as TEXT ) as apr_drg_code\n , cast(apr_drg_description as TEXT ) as apr_drg_description\n , cast(total_paid_amount as numeric(28,6) ) as paid_amount\n , cast(total_allowed_amount as numeric(28,6) ) as allowed_amount\n , cast(total_charge_amount as numeric(28,6) ) as charge_amount\n , cast(data_source as TEXT ) as data_source\n , cast('2023-12-13 23:31:59.089856+00:00' as TIMESTAMP ) as tuva_last_run\nfrom devforrest.claims_preprocessing.acute_inpatient_summary \n\nunion all \n\nselect\n cast(encounter_id as TEXT ) as encounter_id\n , cast(patient_id as TEXT ) as patient_id\n , cast('emergency department' as TEXT ) as encounter_type\n , try_cast( encounter_start_date as date ) as encounter_start_date\n , try_cast( encounter_end_date as date ) as encounter_end_date\n , cast(length_of_stay as INT ) as length_of_stay\n , cast(admit_source_code as TEXT ) as admit_source_code\n , cast(admit_source_description as TEXT ) as admit_source_description\n , cast(admit_type_code as TEXT ) as admit_type_code\n , cast(admit_type_description as TEXT ) as admit_type_description\n , cast(discharge_disposition_code as TEXT ) as discharge_disposition_code\n , cast(discharge_disposition_description as TEXT ) as discharge_disposition_description\n , cast(null as TEXT ) as attending_provider_id\n , cast(facility_npi as TEXT ) as facility_npi\n , cast(primary_diagnosis_code_type as TEXT ) as primary_diagnosis_code_type\n , cast(primary_diagnosis_code as TEXT ) as primary_diagnosis_code\n , cast(primary_diagnosis_description as TEXT ) as primary_diagnosis_description\n , cast(ms_drg_code as TEXT ) as ms_drg_code\n , cast(ms_drg_description as TEXT ) as ms_drg_description\n , cast(apr_drg_code as TEXT ) as apr_drg_code\n , cast(apr_drg_description as TEXT ) as apr_drg_description\n , cast(total_paid_amount as numeric(28,6) ) as paid_amount\n , cast(total_allowed_amount as numeric(28,6) ) as allowed_amount\n , cast(total_charge_amount as numeric(28,6) ) as charge_amount\n , cast(data_source as TEXT ) as data_source\n , cast('2023-12-13 23:31:59.089856+00:00' as TIMESTAMP ) as tuva_last_run\nfrom devforrest.claims_preprocessing.emergency_department_summary", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.core__stg_claims_location": {"database": "devforrest", "schema": "core", "name": "core__stg_claims_location", "resource_type": "model", "package_name": "the_tuva_project", "path": "core\\staging\\core__stg_claims_location.sql", "original_file_path": "models\\core\\staging\\core__stg_claims_location.sql", "unique_id": "model.the_tuva_project.core__stg_claims_location", "fqn": ["the_tuva_project", "core", "staging", "core__stg_claims_location"], "alias": "_stg_claims_location", "checksum": {"name": "sha256", "checksum": "2b02d9e557b871867f284fc790abb1ab1881d1427309d84c3a34c2753e13be57"}, "config": {"enabled": true, "alias": "_stg_claims_location", "schema": "core", "database": null, "tags": ["core_stage_claims"], "meta": {}, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#0f3d0b"}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["core_stage_claims"], "description": "Staging core claims locations", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#0f3d0b"}, "patch_path": "the_tuva_project://models\\core\\core_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "core", "alias": "_stg_claims_location", "tags": "core_stage_claims", "materialized": "view", "enabled": true, "bind": false, "docs": {"node_color": "#0f3d0b"}}, "created_at": 1702481696.854664, "relation_name": "devforrest.core._stg_claims_location", "raw_code": "{{ config(\r\n enabled = var('claims_enabled',var('tuva_marts_enabled',False))\r\n )\r\n}}\r\n\r\nwith all_providers_in_claims_dataset as (\r\nselect distinct facility_npi as npi, data_source\r\nfrom {{ ref('core__stg_claims_medical_claim') }}\r\n\r\nunion all\r\n\r\nselect distinct rendering_npi as npi, data_source\r\nfrom {{ ref('core__stg_claims_medical_claim') }}\r\n\r\nunion all\r\n\r\nselect distinct billing_npi as npi, data_source\r\nfrom {{ ref('core__stg_claims_medical_claim') }}\r\n),\r\n\r\n\r\nprovider as (\r\nselect aa.*, bb.data_source\r\nfrom {{ ref('terminology__provider') }} aa\r\ninner join all_providers_in_claims_dataset bb\r\non aa.npi = bb.npi\r\nwhere lower(aa.entity_type_description) = 'organization'\r\n)\r\n\r\n\r\n\r\nselect \r\n cast(npi as {{ dbt.type_string() }} ) as location_id\r\n , cast(npi as {{ dbt.type_string() }} ) as npi\r\n , cast(provider_organization_name as {{ dbt.type_string() }} ) as name\r\n , cast(null as {{ dbt.type_string() }} ) as facility_type\r\n , cast(parent_organization_name as {{ dbt.type_string() }} ) as parent_organization\r\n , cast(practice_address_line_1 as {{ dbt.type_string() }} ) as address\r\n , cast(practice_city as {{ dbt.type_string() }} ) as city\r\n , cast(practice_state as {{ dbt.type_string() }} ) as state\r\n , cast(practice_zip_code as {{ dbt.type_string() }} ) as zip_code\r\n , cast(null as {{ dbt.type_float() }} ) as latitude\r\n , cast(null as {{ dbt.type_float() }} ) as longitude\r\n , cast(data_source as {{ dbt.type_string() }} ) as data_source\r\n , cast( '{{ var('tuva_last_run')}}' as {{ dbt.type_timestamp() }} ) as tuva_last_run\r\nfrom provider", "language": "sql", "refs": [["core__stg_claims_medical_claim"], ["core__stg_claims_medical_claim"], ["core__stg_claims_medical_claim"], ["terminology__provider"]], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.type_string", "macro.dbt.type_float", "macro.dbt.type_timestamp"], "nodes": ["model.the_tuva_project.core__stg_claims_medical_claim", "model.the_tuva_project.core__stg_claims_medical_claim", "model.the_tuva_project.core__stg_claims_medical_claim", "seed.the_tuva_project.terminology__provider"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\core\\staging\\core__stg_claims_location.sql", "compiled": true, "compiled_code": "\n\nwith all_providers_in_claims_dataset as (\nselect distinct facility_npi as npi, data_source\nfrom devforrest.core._stg_claims_medical_claim\n\nunion all\n\nselect distinct rendering_npi as npi, data_source\nfrom devforrest.core._stg_claims_medical_claim\n\nunion all\n\nselect distinct billing_npi as npi, data_source\nfrom devforrest.core._stg_claims_medical_claim\n),\n\n\nprovider as (\nselect aa.*, bb.data_source\nfrom devforrest.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-12-13 23:31:59.089856+00:00' as TIMESTAMP ) as tuva_last_run\nfrom provider", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.core__stg_claims_medical_claim": {"database": "devforrest", "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": "969ba2e7ae79502aa8ff7784222e0b06ac2751a23db22acecf185c05ec2cb5ce"}, "config": {"enabled": true, "alias": "_stg_claims_medical_claim", "schema": "core", "database": null, "tags": ["core_stage_claims"], "meta": {}, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#0f3d0b"}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["core_stage_claims"], "description": "Staging core medical claims", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#0f3d0b"}, "patch_path": "the_tuva_project://models\\core\\core_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "core", "alias": "_stg_claims_medical_claim", "tags": "core_stage_claims", "materialized": "view", "enabled": true, "bind": false, "docs": {"node_color": "#0f3d0b"}}, "created_at": 1702481696.838463, "relation_name": "devforrest.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(coalesce(ap.encounter_id,ed.encounter_id) as {{ dbt.type_string() }} ) as encounter_id \r\n , cast(med.claim_type as {{ dbt.type_string() }} ) as claim_type\r\n , cast(med.patient_id as {{ dbt.type_string() }} ) as patient_id\r\n , cast(med.member_id as {{ dbt.type_string() }} ) as member_id\r\n , cast(med.payer as {{ dbt.type_string() }} ) as payer\r\n , cast(med.plan as {{ dbt.type_string() }} ) as plan\r\n , {{ try_to_cast_date('med.claim_start_date', 'YYYY-MM-DD') }} as claim_start_date\r\n , {{ try_to_cast_date('med.claim_end_date', 'YYYY-MM-DD') }} as claim_end_date\r\n , {{ try_to_cast_date('med.claim_line_start_date', 'YYYY-MM-DD') }} as claim_line_start_date\r\n , {{ try_to_cast_date('med.claim_line_end_date', 'YYYY-MM-DD') }} as claim_line_end_date\r\n , {{ try_to_cast_date('med.admission_date', 'YYYY-MM-DD') }} as admission_date\r\n , {{ try_to_cast_date('med.discharge_date', 'YYYY-MM-DD') }} as discharge_date\r\n , cast(srv_group.service_category_1 as {{ dbt.type_string() }} ) as service_category_1\r\n , cast(srv_group.service_category_2 as {{ dbt.type_string() }} ) as service_category_2\r\n , cast(med.admit_source_code as {{ dbt.type_string() }} ) as admit_source_code\r\n , cast(med.admit_type_code as {{ dbt.type_string() }} ) as admit_type_code\r\n , cast(med.discharge_disposition_code as {{ dbt.type_string() }} ) as discharge_disposition_code\r\n , cast(med.place_of_service_code as {{ dbt.type_string() }} ) as place_of_service_code\r\n , cast(med.bill_type_code as {{ dbt.type_string() }} ) as bill_type_code\r\n , cast(med.ms_drg_code as {{ dbt.type_string() }} ) as ms_drg_code\r\n , cast(med.apr_drg_code as {{ dbt.type_string() }} ) as apr_drg_code\r\n , cast(med.revenue_center_code as {{ dbt.type_string() }} ) as revenue_center_code\r\n , cast(med.service_unit_quantity as {{ dbt.type_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.coinsurance_amount as {{ dbt.type_numeric() }} ) as coinsurance_amount\r\n , cast(med.copayment_amount as {{ dbt.type_numeric() }} ) as copayment_amount\r\n , cast(med.deductible_amount as {{ dbt.type_numeric() }} ) as deductible_amount\r\n , cast(med.total_cost_amount as {{ dbt.type_numeric() }} ) as total_cost_amount\r\n , cast(med.data_source as {{ dbt.type_string() }} ) as data_source\r\n , cast('{{ var('tuva_last_run')}}' as {{ dbt.type_timestamp() }} ) as tuva_last_run\r\nfrom {{ ref('medical_claim') }} med\r\nleft join {{ ref('service_category__service_category_grouper') }} srv_group\r\n on med.claim_id = srv_group.claim_id\r\n and med.claim_line_number = srv_group.claim_line_number\r\nleft join {{ ref('acute_inpatient__encounter_id') }} ap\r\n on med.claim_id = ap.claim_id\r\n and med.claim_line_number = ap.claim_line_number\r\nleft join {{ ref('emergency_department__int_encounter_id') }} ed\r\n on med.claim_id = ed.claim_id\r\n and med.claim_line_number = ed.claim_line_number", "language": "sql", "refs": [["medical_claim"], ["service_category__service_category_grouper"], ["acute_inpatient__encounter_id"], ["emergency_department__int_encounter_id"]], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.type_string", "macro.dbt.type_int", "macro.the_tuva_project.try_to_cast_date", "macro.dbt.type_numeric", "macro.dbt.type_timestamp"], "nodes": ["model.input_layer.medical_claim", "model.the_tuva_project.service_category__service_category_grouper", "model.the_tuva_project.acute_inpatient__encounter_id", "model.the_tuva_project.emergency_department__int_encounter_id"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\core\\staging\\core__stg_claims_medical_claim.sql", "compiled": true, "compiled_code": "\n\n-- *************************************************\n-- This dbt model creates the medical_claim table\n-- in core. It adds these 4 fields to the input layer\n-- medical claim table:\n-- encounter_id\n-- service_category_1\n-- service_category_2\n-- *************************************************\n\n\nselect\n cast(med.claim_id as TEXT ) as claim_id\n , cast(med.claim_line_number as INT ) as claim_line_number\n , cast(coalesce(ap.encounter_id,ed.encounter_id) as TEXT ) as encounter_id \n , cast(med.claim_type as TEXT ) as claim_type\n , cast(med.patient_id as TEXT ) as patient_id\n , cast(med.member_id as TEXT ) as member_id\n , cast(med.payer as TEXT ) as payer\n , cast(med.plan as TEXT ) as plan\n , try_cast( med.claim_start_date as date ) as claim_start_date\n , try_cast( med.claim_end_date as date ) as claim_end_date\n , try_cast( med.claim_line_start_date as date ) as claim_line_start_date\n , try_cast( med.claim_line_end_date as date ) as claim_line_end_date\n , try_cast( med.admission_date as date ) as admission_date\n , try_cast( med.discharge_date as date ) as discharge_date\n , cast(srv_group.service_category_1 as TEXT ) as service_category_1\n , cast(srv_group.service_category_2 as TEXT ) as service_category_2\n , cast(med.admit_source_code as TEXT ) as admit_source_code\n , cast(med.admit_type_code as TEXT ) as admit_type_code\n , cast(med.discharge_disposition_code as TEXT ) as discharge_disposition_code\n , cast(med.place_of_service_code as TEXT ) as place_of_service_code\n , cast(med.bill_type_code as TEXT ) as bill_type_code\n , cast(med.ms_drg_code as TEXT ) as ms_drg_code\n , cast(med.apr_drg_code as TEXT ) as apr_drg_code\n , cast(med.revenue_center_code as TEXT ) as revenue_center_code\n , cast(med.service_unit_quantity as 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.coinsurance_amount as numeric(28,6) ) as coinsurance_amount\n , cast(med.copayment_amount as numeric(28,6) ) as copayment_amount\n , cast(med.deductible_amount as numeric(28,6) ) as deductible_amount\n , cast(med.total_cost_amount as numeric(28,6) ) as total_cost_amount\n , cast(med.data_source as TEXT ) as data_source\n , cast('2023-12-13 23:31:59.089856+00:00' as TIMESTAMP ) as tuva_last_run\nfrom tuva.input_layer.medical_claim med\nleft join devforrest.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 devforrest.claims_preprocessing._int_acute_inpatient_encounter_id ap\n on med.claim_id = ap.claim_id\n and med.claim_line_number = ap.claim_line_number\nleft join devforrest.claims_preprocessing._int_emergency_department_encounter_id ed\n on med.claim_id = ed.claim_id\n and med.claim_line_number = ed.claim_line_number", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.core__stg_claims_patient": {"database": "devforrest", "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": "c09c7b85cd101c46884263bd98cce73cfe0d067a1437ac1df82b249c29ec5b4e"}, "config": {"enabled": true, "alias": "_stg_claims_patient", "schema": "core", "database": null, "tags": ["core_stage_claims"], "meta": {}, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#0f3d0b"}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["core_stage_claims"], "description": "Staging core claims patients", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#0f3d0b"}, "patch_path": "the_tuva_project://models\\core\\core_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "core", "alias": "_stg_claims_patient", "tags": "core_stage_claims", "materialized": "view", "enabled": true, "bind": false, "docs": {"node_color": "#0f3d0b"}}, "created_at": 1702481696.854664, "relation_name": "devforrest.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 longitude\r\n , cast(data_source as {{ dbt.type_string() }}) as data_source\r\n , cast('{{ var('tuva_last_run')}}' as {{ dbt.type_timestamp() }}) as tuva_last_run\r\nfrom patient_stage\r\nwhere row_sequence = 1", "language": "sql", "refs": [["eligibility"]], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.type_string", "macro.dbt.type_float", "macro.dbt.type_timestamp"], "nodes": ["model.input_layer.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.input_layer.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 longitude\n , cast(data_source as TEXT) as data_source\n , cast('2023-12-13 23:31:59.089856+00:00' as TIMESTAMP) as tuva_last_run\nfrom patient_stage\nwhere row_sequence = 1", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.core__stg_claims_pharmacy_claim": {"database": "devforrest", "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": "2f59442d2cd5d78485d9aec3250d3425522a7f2f8406f1ce7f99b83e1dbb5726"}, "config": {"enabled": true, "alias": "_stg_claims_pharmacy_claim", "schema": "core", "database": null, "tags": ["core_stage_claims"], "meta": {}, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#0f3d0b"}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["core_stage_claims"], "description": "Staging core pharmacy claims", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#0f3d0b"}, "patch_path": "the_tuva_project://models\\core\\core_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "core", "alias": "_stg_claims_pharmacy_claim", "tags": "core_stage_claims", "materialized": "view", "enabled": true, "bind": false, "docs": {"node_color": "#0f3d0b"}}, "created_at": 1702481696.854664, "relation_name": "devforrest.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(payer as {{ dbt.type_string() }} ) as payer\r\n , cast(plan as {{ dbt.type_string() }} ) as plan\r\n , cast(prescribing_provider_npi as {{ dbt.type_string() }} ) as prescribing_provider_npi\r\n , cast(dispensing_provider_npi as {{ dbt.type_string() }} ) as dispensing_provider_npi\r\n , cast(dispensing_date as date ) as dispensing_date\r\n , cast(ndc_code as {{ dbt.type_string() }} ) as ndc_code\r\n , cast(quantity as integer ) as quantity\r\n , cast(days_supply as integer ) as days_supply\r\n , cast(refills as integer ) as refills\r\n , cast(paid_date as date ) as paid_date\r\n , cast(paid_amount as {{ dbt.type_numeric() }}) as paid_amount\r\n , cast(allowed_amount as {{ dbt.type_numeric() }} ) as allowed_amount\r\n , cast(coinsurance_amount as {{ dbt.type_numeric() }} ) as coinsurance_amount\r\n , cast(copayment_amount as {{ dbt.type_numeric() }} ) as copayment_amount\r\n , cast(deductible_amount as {{ dbt.type_numeric() }} ) as deductible_amount\r\n , cast(data_source as {{ dbt.type_string() }} ) as data_source\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('pharmacy_claim') }}", "language": "sql", "refs": [["pharmacy_claim"]], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.type_string", "macro.dbt.type_numeric"], "nodes": ["model.input_layer.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(payer as TEXT ) as payer\n , cast(plan as TEXT ) as plan\n , cast(prescribing_provider_npi as TEXT ) as prescribing_provider_npi\n , cast(dispensing_provider_npi as TEXT ) as dispensing_provider_npi\n , cast(dispensing_date as date ) as dispensing_date\n , cast(ndc_code as TEXT ) as ndc_code\n , cast(quantity as integer ) as quantity\n , cast(days_supply as integer ) as days_supply\n , cast(refills as integer ) as refills\n , cast(paid_date as date ) as paid_date\n , cast(paid_amount as numeric(28,6)) as paid_amount\n , cast(allowed_amount as numeric(28,6) ) as allowed_amount\n , cast(coinsurance_amount as numeric(28,6) ) as coinsurance_amount\n , cast(copayment_amount as numeric(28,6) ) as copayment_amount\n , cast(deductible_amount as numeric(28,6) ) as deductible_amount\n , cast(data_source as TEXT ) as data_source\n , '2023-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom tuva.input_layer.pharmacy_claim", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.core__stg_claims_practitioner": {"database": "devforrest", "schema": "core", "name": "core__stg_claims_practitioner", "resource_type": "model", "package_name": "the_tuva_project", "path": "core\\staging\\core__stg_claims_practitioner.sql", "original_file_path": "models\\core\\staging\\core__stg_claims_practitioner.sql", "unique_id": "model.the_tuva_project.core__stg_claims_practitioner", "fqn": ["the_tuva_project", "core", "staging", "core__stg_claims_practitioner"], "alias": "_stg_claims_practitioner", "checksum": {"name": "sha256", "checksum": "e9484f724915ae7eb934a92f6dc139b1c0d4b5f876ff9b608238363c81566e44"}, "config": {"enabled": true, "alias": "_stg_claims_practitioner", "schema": "core", "database": null, "tags": ["core_stage_claims"], "meta": {}, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#0f3d0b"}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["core_stage_claims"], "description": "Staging core providers in the claims dataset", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#0f3d0b"}, "patch_path": "the_tuva_project://models\\core\\core_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "core", "alias": "_stg_claims_practitioner", "tags": "core_stage_claims", "materialized": "view", "enabled": true, "bind": false, "docs": {"node_color": "#0f3d0b"}}, "created_at": 1702481696.875338, "relation_name": "devforrest.core._stg_claims_practitioner", "raw_code": "{{ config(\r\n enabled = var('claims_enabled',var('tuva_marts_enabled',False))\r\n )\r\n}}\r\n\r\n-- *************************************************\r\n-- This dbt model creates the provider table \r\n-- in core. It includes data about all providers\r\n-- present in the raw claims dataset.\r\n-- *************************************************\r\n\r\n\r\nwith all_providers_in_claims_dataset as (\r\nselect distinct facility_npi as npi, data_source\r\nfrom {{ ref('core__stg_claims_medical_claim') }}\r\n\r\nunion all\r\n\r\nselect distinct rendering_npi as npi, data_source\r\nfrom {{ ref('core__stg_claims_medical_claim') }}\r\n\r\nunion all\r\n\r\nselect distinct billing_npi as npi, data_source\r\nfrom {{ ref('core__stg_claims_medical_claim') }}\r\n),\r\n\r\n\r\nprovider as (\r\nselect aa.*, bb.data_source\r\nfrom {{ ref('terminology__provider') }} aa\r\ninner join all_providers_in_claims_dataset bb\r\non aa.npi = bb.npi\r\nwhere lower(aa.entity_type_description) = 'individual'\r\n)\r\n\r\n\r\n\r\nselect \r\n cast(npi as {{ dbt.type_string() }} ) as practitioner_id\r\n , cast(npi as {{ dbt.type_string() }} ) as npi\r\n , cast(provider_first_name as {{ dbt.type_string() }} ) as provider_first_name\r\n , cast(provider_last_name as {{ dbt.type_string() }} ) as provider_last_name\r\n , cast(parent_organization_name as {{ dbt.type_string() }} ) as practice_affiliation\r\n , cast(primary_specialty_description as {{ dbt.type_string() }} ) as specialty\r\n , cast(null as {{ dbt.type_string() }} ) as sub_specialty\r\n , cast(data_source as {{ dbt.type_string() }} ) as data_source\r\n , cast('{{ var('tuva_last_run')}}' as {{ dbt.type_timestamp() }} ) as tuva_last_run\r\nfrom provider", "language": "sql", "refs": [["core__stg_claims_medical_claim"], ["core__stg_claims_medical_claim"], ["core__stg_claims_medical_claim"], ["terminology__provider"]], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.type_string", "macro.dbt.type_timestamp"], "nodes": ["model.the_tuva_project.core__stg_claims_medical_claim", "model.the_tuva_project.core__stg_claims_medical_claim", "model.the_tuva_project.core__stg_claims_medical_claim", "seed.the_tuva_project.terminology__provider"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\core\\staging\\core__stg_claims_practitioner.sql", "compiled": true, "compiled_code": "\n\n-- *************************************************\n-- This dbt model creates the provider table \n-- in core. It includes data about all providers\n-- present in the raw claims dataset.\n-- *************************************************\n\n\nwith all_providers_in_claims_dataset as (\nselect distinct facility_npi as npi, data_source\nfrom devforrest.core._stg_claims_medical_claim\n\nunion all\n\nselect distinct rendering_npi as npi, data_source\nfrom devforrest.core._stg_claims_medical_claim\n\nunion all\n\nselect distinct billing_npi as npi, data_source\nfrom devforrest.core._stg_claims_medical_claim\n),\n\n\nprovider as (\nselect aa.*, bb.data_source\nfrom devforrest.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-12-13 23:31:59.089856+00:00' as TIMESTAMP ) as tuva_last_run\nfrom provider", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.core__stg_claims_procedure": {"database": "devforrest", "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": "06367e77d788e84d7a1fafdad710b9e01e13c66947f824e0924f0a2a4bbe9c87"}, "config": {"enabled": true, "alias": "_stg_claims_procedure", "schema": "core", "database": null, "tags": ["core_stage_claims"], "meta": {}, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#0f3d0b"}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["core_stage_claims"], "description": "Staging core claims procedures", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#0f3d0b"}, "patch_path": "the_tuva_project://models\\core\\core_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "core", "alias": "_stg_claims_procedure", "tags": "core_stage_claims", "materialized": "view", "enabled": true, "bind": false, "docs": {"node_color": "#0f3d0b"}}, "created_at": 1702481696.854664, "relation_name": "devforrest.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(coalesce(ap.encounter_id, ed.encounter_id) as {{ dbt.type_string() }} ) as encounter_id\r\n , cast(unpivot_cte.claim_id as {{ dbt.type_string() }} ) as claim_id\r\n , {{ try_to_cast_date('unpivot_cte.procedure_date', 'YYYY-MM-DD') }} as procedure_date\r\n , cast(unpivot_cte.source_code_type as {{ dbt.type_string() }} ) as source_code_type\r\n , cast(unpivot_cte.source_code as {{ dbt.type_string() }} ) as source_code\r\n , cast(null as {{ dbt.type_string() }} ) as source_description\r\n , cast(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\nleft join {{ ref('acute_inpatient__encounter_id')}} as ap\r\n on unpivot_cte.claim_id = ap.claim_id\r\nleft join {{ ref('emergency_department__int_encounter_id')}} as ed\r\n on unpivot_cte.claim_id = ed.claim_id", "language": "sql", "refs": [["medical_claim"], ["medical_claim"], ["medical_claim"], ["medical_claim"], ["medical_claim"], ["medical_claim"], ["medical_claim"], ["medical_claim"], ["medical_claim"], ["medical_claim"], ["medical_claim"], ["medical_claim"], ["medical_claim"], ["medical_claim"], ["medical_claim"], ["medical_claim"], ["medical_claim"], ["medical_claim"], ["medical_claim"], ["medical_claim"], ["medical_claim"], ["medical_claim"], ["medical_claim"], ["medical_claim"], ["medical_claim"], ["terminology__icd_10_pcs"], ["acute_inpatient__encounter_id"], ["emergency_department__int_encounter_id"]], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.type_string", "macro.the_tuva_project.try_to_cast_date", "macro.dbt.type_timestamp"], "nodes": ["model.input_layer.medical_claim", "model.input_layer.medical_claim", "model.input_layer.medical_claim", "model.input_layer.medical_claim", "model.input_layer.medical_claim", "model.input_layer.medical_claim", "model.input_layer.medical_claim", "model.input_layer.medical_claim", "model.input_layer.medical_claim", "model.input_layer.medical_claim", "model.input_layer.medical_claim", "model.input_layer.medical_claim", "model.input_layer.medical_claim", "model.input_layer.medical_claim", "model.input_layer.medical_claim", "model.input_layer.medical_claim", "model.input_layer.medical_claim", "model.input_layer.medical_claim", "model.input_layer.medical_claim", "model.input_layer.medical_claim", "model.input_layer.medical_claim", "model.input_layer.medical_claim", "model.input_layer.medical_claim", "model.input_layer.medical_claim", "model.input_layer.medical_claim", "seed.the_tuva_project.terminology__icd_10_pcs", "model.the_tuva_project.acute_inpatient__encounter_id", "model.the_tuva_project.emergency_department__int_encounter_id"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\core\\staging\\core__stg_claims_procedure.sql", "compiled": true, "compiled_code": "\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.input_layer.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.input_layer.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.input_layer.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.input_layer.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.input_layer.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.input_layer.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.input_layer.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.input_layer.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.input_layer.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.input_layer.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.input_layer.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.input_layer.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.input_layer.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.input_layer.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.input_layer.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.input_layer.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.input_layer.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.input_layer.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.input_layer.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.input_layer.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.input_layer.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.input_layer.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.input_layer.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.input_layer.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.input_layer.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(coalesce(ap.encounter_id, ed.encounter_id) as TEXT ) as encounter_id\n , cast(unpivot_cte.claim_id as TEXT ) as claim_id\n , try_cast( unpivot_cte.procedure_date as date ) as procedure_date\n , cast(unpivot_cte.source_code_type as TEXT ) as source_code_type\n , cast(unpivot_cte.source_code as TEXT ) as source_code\n , cast(null as TEXT ) as source_description\n , cast(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-12-13 23:31:59.089856+00:00' as TIMESTAMP ) as tuva_last_run\nfrom unpivot_cte\n left join devforrest.terminology.icd_10_pcs as icd\n on unpivot_cte.source_code = icd.icd_10_pcs\nleft join devforrest.claims_preprocessing._int_acute_inpatient_encounter_id as ap\n on unpivot_cte.claim_id = ap.claim_id\nleft join devforrest.claims_preprocessing._int_emergency_department_encounter_id as ed\n on unpivot_cte.claim_id = ed.claim_id", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.core__stg_clinical_condition": {"database": "devforrest", "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": "25e87bd48f2e2316cb3b8971379ca0d534d28fd365abbd884fad95e736cfadb9"}, "config": {"enabled": true, "alias": "_stg_clinical_condition", "schema": "core", "database": null, "tags": ["core_stage_clinical"], "meta": {}, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#0f3d0b"}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["core_stage_clinical"], "description": "Staging core clinical conditions", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#0f3d0b"}, "patch_path": "the_tuva_project://models\\core\\core_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "core", "alias": "_stg_clinical_condition", "tags": "core_stage_clinical", "materialized": "view", "enabled": true, "bind": false, "docs": {"node_color": "#0f3d0b"}}, "created_at": 1702481696.8775516, "relation_name": "devforrest.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('{{ var('tuva_last_run')}}' as {{ dbt.type_timestamp() }} ) as tuva_last_run\r\nfrom {{ ref('condition') }}", "language": "sql", "refs": [["condition"]], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.type_string", "macro.the_tuva_project.try_to_cast_date", "macro.dbt.type_int", "macro.dbt.type_timestamp"], "nodes": ["model.input_layer.condition"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\core\\staging\\core__stg_clinical_condition.sql", "compiled": true, "compiled_code": "\n\nselect\n cast(condition_id as TEXT ) as condition_id\n , cast(patient_id as TEXT ) as patient_id\n , cast(encounter_id as TEXT ) as encounter_id\n , cast(claim_id as TEXT ) as claim_id\n , try_cast( recorded_date as date ) as recorded_date\n , try_cast( onset_date as date ) as onset_date\n , try_cast( resolved_date as date ) as resolved_date\n , cast(status as TEXT ) as status\n , cast(condition_type as TEXT ) as condition_type\n , cast(source_code_type as TEXT ) as source_code_type\n , cast(source_code as TEXT ) as source_code\n , cast(source_description as TEXT ) as source_description\n , cast(normalized_code_type as TEXT ) as normalized_code_type\n , cast(normalized_code as TEXT ) as normalized_code\n , cast(normalized_description as TEXT ) as normalized_description\n , cast(condition_rank as INT ) as condition_rank\n , cast(present_on_admit_code as TEXT ) as present_on_admit_code\n , cast(present_on_admit_description as TEXT ) as present_on_admit_description\n , cast(data_source as TEXT ) as data_source\n , cast('2023-12-13 23:31:59.089856+00:00' as TIMESTAMP ) as tuva_last_run\nfrom tuva.input_layer.condition", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.core__stg_clinical_encounter": {"database": "devforrest", "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": "c47cfd1dc07ea59eb5444d6ae23c65b52fc9a2f27eb9670fbd36329fdd610106"}, "config": {"enabled": true, "alias": "_stg_clinical_encounter", "schema": "core", "database": null, "tags": ["core_stage_clinical"], "meta": {}, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#0f3d0b"}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["core_stage_clinical"], "description": "Staging core clinical encounters", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#0f3d0b"}, "patch_path": "the_tuva_project://models\\core\\core_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "core", "alias": "_stg_clinical_encounter", "tags": "core_stage_clinical", "materialized": "view", "enabled": true, "bind": false, "docs": {"node_color": "#0f3d0b"}}, "created_at": 1702481696.8775516, "relation_name": "devforrest.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_type\r\n , cast(primary_diagnosis_code as {{ dbt.type_string() }} ) as primary_diagnosis_code\r\n , cast(primary_diagnosis_description as {{ dbt.type_string() }} ) as primary_diagnosis_description\r\n , cast(ms_drg_code as {{ dbt.type_string() }} ) as ms_drg_code\r\n , cast(ms_drg_description as {{ dbt.type_string() }} ) as ms_drg_description \r\n , cast(apr_drg_code as {{ dbt.type_string() }} ) as apr_drg_code\r\n , cast(apr_drg_description as {{ dbt.type_string() }} ) as apr_drg_description\r\n , cast(paid_amount as {{ dbt.type_numeric() }} ) as paid_amount\r\n , cast(allowed_amount as {{ dbt.type_numeric() }} ) as allowed_amount\r\n , cast(charge_amount as {{ dbt.type_numeric() }} ) as charge_amount\r\n , cast(data_source as {{ dbt.type_string() }} ) as data_source\r\n , cast('{{ var('tuva_last_run')}}' as {{ dbt.type_timestamp() }} ) as tuva_last_run\r\nfrom {{ ref('encounter') }}", "language": "sql", "refs": [["encounter"]], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.type_string", "macro.the_tuva_project.try_to_cast_date", "macro.dbt.type_int", "macro.dbt.type_numeric", "macro.dbt.type_timestamp"], "nodes": ["model.input_layer.encounter"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\core\\staging\\core__stg_clinical_encounter.sql", "compiled": true, "compiled_code": "\n\nselect \n cast(encounter_id as TEXT ) as encounter_id\n , cast(patient_id as TEXT ) as patient_id\n , cast(encounter_type as TEXT ) as encounter_type\n , try_cast( encounter_start_date as date ) as encounter_start_date\n , try_cast( encounter_end_date as date ) as encounter_end_date\n , cast(length_of_stay as INT ) as length_of_stay\n , cast(admit_source_code as TEXT ) as admit_source_code\n , cast(admit_source_description as TEXT ) as admit_source_description\n , cast(admit_type_code as TEXT ) as admit_type_code\n , cast(admit_type_description as TEXT ) as admit_type_description\n , cast(discharge_disposition_code as TEXT ) as discharge_disposition_code\n , cast(discharge_disposition_description as TEXT ) as discharge_disposition_description\n , cast(attending_provider_id as TEXT ) as attending_provider_id\n , cast(facility_npi as TEXT ) as facility_npi\n , cast(primary_diagnosis_code as TEXT ) as primary_diagnosis_code_type\n , cast(primary_diagnosis_code as TEXT ) as primary_diagnosis_code\n , cast(primary_diagnosis_description as TEXT ) as primary_diagnosis_description\n , cast(ms_drg_code as TEXT ) as ms_drg_code\n , cast(ms_drg_description as TEXT ) as ms_drg_description \n , cast(apr_drg_code as TEXT ) as apr_drg_code\n , cast(apr_drg_description as TEXT ) as apr_drg_description\n , cast(paid_amount as numeric(28,6) ) as paid_amount\n , cast(allowed_amount as numeric(28,6) ) as allowed_amount\n , cast(charge_amount as numeric(28,6) ) as charge_amount\n , cast(data_source as TEXT ) as data_source\n , cast('2023-12-13 23:31:59.089856+00:00' as TIMESTAMP ) as tuva_last_run\nfrom tuva.input_layer.encounter", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.core__stg_clinical_lab_result": {"database": "devforrest", "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": "259a823fa611bbc77ac43362e79145c088d2a606b85dc52a473acf5c49aa6e39"}, "config": {"enabled": true, "alias": "_stg_clinical_lab_result", "schema": "core", "database": null, "tags": ["core_stage_clinical"], "meta": {}, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#0f3d0b"}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["core_stage_clinical"], "description": "Staging core clinical lab results", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#0f3d0b"}, "patch_path": "the_tuva_project://models\\core\\core_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "core", "alias": "_stg_clinical_lab_result", "tags": "core_stage_clinical", "materialized": "view", "enabled": true, "bind": false, "docs": {"node_color": "#0f3d0b"}}, "created_at": 1702481696.8775516, "relation_name": "devforrest.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('{{ var('tuva_last_run')}}' as {{ dbt.type_timestamp() }} ) as tuva_last_run\r\nfrom {{ ref('lab_result') }}", "language": "sql", "refs": [["lab_result"]], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.type_string", "macro.the_tuva_project.try_to_cast_date", "macro.dbt.type_int", "macro.dbt.type_timestamp"], "nodes": ["model.input_layer.lab_result"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\core\\staging\\core__stg_clinical_lab_result.sql", "compiled": true, "compiled_code": "\n\nselect\n cast(lab_result_id as TEXT ) as lab_result_id\n , cast(patient_id as TEXT ) as patient_id\n , cast(encounter_id as TEXT ) as encounter_id\n , cast(accession_number as TEXT ) as accession_number\n , cast(source_code_type as TEXT ) as source_code_type\n , cast(source_code as TEXT ) as source_code\n , cast(source_description as TEXT ) as source_description\n , cast(source_component as TEXT ) as source_component\n , cast(normalized_code_type as TEXT ) as normalized_code_type\n , cast(normalized_code as TEXT ) as normalized_code\n , cast(normalized_description as TEXT ) as normalized_description\n , cast(normalized_component as TEXT ) as normalized_component\n , cast(status as TEXT ) as status\n , cast(result as TEXT ) as result\n , try_cast( result_date as date ) as result_date\n , try_cast( collection_date as date ) as collection_date\n , cast(source_units as TEXT ) as source_units\n , cast(normalized_units as TEXT ) as normalized_units\n , cast(source_reference_range_low as TEXT ) as source_reference_range_low\n , cast(source_reference_range_high as TEXT ) as source_reference_range_high\n , cast(normalized_reference_range_low as TEXT ) as normalized_reference_range_low\n , cast(normalized_reference_range_high as TEXT ) as normalized_reference_range_high\n , cast(source_abnormal_flag as 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('2023-12-13 23:31:59.089856+00:00' as TIMESTAMP ) as tuva_last_run\nfrom tuva.input_layer.lab_result", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.core__stg_clinical_location": {"database": "devforrest", "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": "d174a7c1a6034db5bd81239712dd36ba2a7d8ddebeda83eca4c9d86f00c169b8"}, "config": {"enabled": true, "alias": "_stg_clinical_location", "schema": "core", "database": null, "tags": ["core_stage_clinical"], "meta": {}, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#0f3d0b"}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["core_stage_clinical"], "description": "Staging core clinical locations", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#0f3d0b"}, "patch_path": "the_tuva_project://models\\core\\core_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "core", "alias": "_stg_clinical_location", "tags": "core_stage_clinical", "materialized": "view", "enabled": true, "bind": false, "docs": {"node_color": "#0f3d0b"}}, "created_at": 1702481696.8861513, "relation_name": "devforrest.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('{{ var('tuva_last_run')}}' as {{ dbt.type_timestamp() }} ) as tuva_last_run\r\nfrom {{ ref('location') }}", "language": "sql", "refs": [["location"]], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.type_string", "macro.dbt.type_float", "macro.dbt.type_timestamp"], "nodes": ["model.input_layer.location"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\core\\staging\\core__stg_clinical_location.sql", "compiled": true, "compiled_code": "\n\nselect\n cast(location_id as TEXT ) as location_id\n , cast(npi as TEXT ) as npi\n , cast(name as TEXT ) as name\n , cast(facility_type as TEXT ) as facility_type\n , cast(parent_organization as TEXT ) as parent_organization\n , cast(address as TEXT ) as address\n , cast(city as TEXT ) as city\n , cast(state as TEXT ) as state\n , cast(zip_code as TEXT ) as zip_code\n , cast(latitude as FLOAT ) as latitude\n , cast(longitude as FLOAT ) as longitude\n , cast(data_source as TEXT ) as data_source\n , cast('2023-12-13 23:31:59.089856+00:00' as TIMESTAMP ) as tuva_last_run\nfrom tuva.input_layer.location", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.core__stg_clinical_medication": {"database": "devforrest", "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": "eed4c28eebf0da1fdd2ee2e9eba1815652c374282a610d9400f1e6435b7d7830"}, "config": {"enabled": true, "alias": "_stg_clinical_medication", "schema": "core", "database": null, "tags": ["core_stage_clinical"], "meta": {}, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#0f3d0b"}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["core_stage_clinical"], "description": "Staging core clinical medications", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#0f3d0b"}, "patch_path": "the_tuva_project://models\\core\\core_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "core", "alias": "_stg_clinical_medication", "tags": "core_stage_clinical", "materialized": "view", "enabled": true, "bind": false, "docs": {"node_color": "#0f3d0b"}}, "created_at": 1702481696.8861513, "relation_name": "devforrest.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('{{ var('tuva_last_run')}}' as {{ dbt.type_timestamp() }} ) as tuva_last_run\r\nfrom {{ ref('medication') }}", "language": "sql", "refs": [["medication"]], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.type_string", "macro.the_tuva_project.try_to_cast_date", "macro.dbt.type_int", "macro.dbt.type_timestamp"], "nodes": ["model.input_layer.medication"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\core\\staging\\core__stg_clinical_medication.sql", "compiled": true, "compiled_code": "\n\nselect\n cast(medication_id as TEXT ) as medication_id\n , cast(patient_id as TEXT ) as patient_id\n , cast(encounter_id as TEXT ) as encounter_id\n , try_cast( dispensing_date as date ) as dispensing_date\n , try_cast( prescribing_date as date ) as prescribing_date\n , cast(source_code_type as TEXT ) as source_code_type\n , cast(source_code as TEXT ) as source_code\n , cast(source_description as TEXT ) as source_description\n , cast(ndc_code as TEXT ) as ndc_code\n , cast(ndc_description as TEXT ) as ndc_description\n , cast(rxnorm_code as TEXT ) as rxnorm_code\n , cast(rxnorm_description as TEXT ) as rxnorm_description \n , cast(atc_code as TEXT ) as atc_code\n , cast(atc_description as TEXT ) as atc_description\n , cast(route as TEXT ) as route\n , cast(strength as TEXT ) as strength\n , cast(quantity as INT ) as quantity\n , cast(quantity_unit as TEXT ) as quantity_unit\n , cast(days_supply as INT ) as days_supply\n , cast(practitioner_id as TEXT ) as practitioner_id\n , cast(data_source as TEXT ) as data_source\n , cast('2023-12-13 23:31:59.089856+00:00' as TIMESTAMP ) as tuva_last_run\nfrom tuva.input_layer.medication", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.core__stg_clinical_observation": {"database": "devforrest", "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": "ddaf6b74591f480bfb52671b7ba193e4d9d9ef913e0d12ef81e6a6c9867d49d0"}, "config": {"enabled": true, "alias": "_stg_clinical_observation", "schema": "core", "database": null, "tags": ["core_stage_clinical"], "meta": {}, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#0f3d0b"}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["core_stage_clinical"], "description": "Staging core clinical observations", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#0f3d0b"}, "patch_path": "the_tuva_project://models\\core\\core_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "core", "alias": "_stg_clinical_observation", "tags": "core_stage_clinical", "materialized": "view", "enabled": true, "bind": false, "docs": {"node_color": "#0f3d0b"}}, "created_at": 1702481696.8861513, "relation_name": "devforrest.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('{{ var('tuva_last_run')}}' as {{ dbt.type_timestamp() }} ) as tuva_last_run\r\nfrom {{ ref('observation') }}", "language": "sql", "refs": [["observation"]], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.type_string", "macro.the_tuva_project.try_to_cast_date", "macro.dbt.type_timestamp"], "nodes": ["model.input_layer.observation"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\core\\staging\\core__stg_clinical_observation.sql", "compiled": true, "compiled_code": "\n\n\nselect\n cast(observation_id as TEXT ) as observation_id\n , cast(patient_id as TEXT ) as patient_id\n , cast(encounter_id as TEXT ) as encounter_id\n , cast(panel_id as TEXT ) as panel_id\n , try_cast( observation_date as date ) as observation_date\n , cast(observation_type as TEXT ) as observation_type\n , cast(source_code_type as TEXT ) as source_code_type\n , cast(source_code as TEXT ) as source_code\n , cast(source_description as TEXT ) as source_description\n , cast(normalized_code_type as TEXT ) as normalized_code_type\n , cast(normalized_code as TEXT ) as normalized_code\n , cast(normalized_description as TEXT ) as normalized_description\n , cast(result as TEXT ) as result\n , cast(source_units as TEXT ) as source_units\n , cast(normalized_units as TEXT ) as normalized_units\n , cast(source_reference_range_low as TEXT ) as source_reference_range_low\n , cast(source_reference_range_high as TEXT ) as source_reference_range_high\n , cast(normalized_reference_range_low as TEXT ) as normalized_reference_range_low\n , cast(normalized_reference_range_high as TEXT ) as normalized_reference_range_high\n , cast(data_source as TEXT ) as data_source\n , cast('2023-12-13 23:31:59.089856+00:00' as TIMESTAMP ) as tuva_last_run\nfrom tuva.input_layer.observation", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.core__stg_clinical_patient": {"database": "devforrest", "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": "a8544d3c8810492f9cc0f30fea0e5869f8ec58373d72b741fceaf3d3d889a7da"}, "config": {"enabled": true, "alias": "_stg_clinical_patient", "schema": "core", "database": null, "tags": ["core_stage_clinical"], "meta": {}, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#0f3d0b"}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["core_stage_clinical"], "description": "Staging core clinical patients", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#0f3d0b"}, "patch_path": "the_tuva_project://models\\core\\core_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "core", "alias": "_stg_clinical_patient", "tags": "core_stage_clinical", "materialized": "view", "enabled": true, "bind": false, "docs": {"node_color": "#0f3d0b"}}, "created_at": 1702481696.8861513, "relation_name": "devforrest.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('{{ var('tuva_last_run')}}' as {{ dbt.type_timestamp() }} ) as tuva_last_run\r\n\r\nfrom {{ ref('patient') }}", "language": "sql", "refs": [["patient"]], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.type_string", "macro.the_tuva_project.try_to_cast_date", "macro.dbt.type_int", "macro.dbt.type_float", "macro.dbt.type_timestamp"], "nodes": ["model.input_layer.patient"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\core\\staging\\core__stg_clinical_patient.sql", "compiled": true, "compiled_code": "\n\nselect\n cast(patient_id as TEXT ) as patient_id\n , cast(first_name as TEXT ) as first_name\n , cast(last_name as TEXT ) as last_name\n , cast(sex as TEXT ) as sex\n , cast(race as TEXT ) as race\n , try_cast( birth_date as date ) as birth_date\n , try_cast( death_date as date ) as death_date\n , cast(death_flag as INT ) as death_flag\n , cast(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('2023-12-13 23:31:59.089856+00:00' as TIMESTAMP ) as tuva_last_run\n\nfrom tuva.input_layer.patient", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.core__stg_clinical_practitioner": {"database": "devforrest", "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": "e769f295355c15ace0383bef63b0a3912e7994f0c55eb6f54e868648cf14942e"}, "config": {"enabled": true, "alias": "_stg_clinical_practitioner", "schema": "core", "database": null, "tags": ["core_stage_clinical"], "meta": {}, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#0f3d0b"}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["core_stage_clinical"], "description": "Staging core clinical providers", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#0f3d0b"}, "patch_path": "the_tuva_project://models\\core\\core_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "core", "alias": "_stg_clinical_practitioner", "tags": "core_stage_clinical", "materialized": "view", "enabled": true, "bind": false, "docs": {"node_color": "#0f3d0b"}}, "created_at": 1702481696.8861513, "relation_name": "devforrest.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('{{ var('tuva_last_run')}}' as {{ dbt.type_timestamp() }} ) as tuva_last_run\r\nfrom {{ ref('practitioner') }}", "language": "sql", "refs": [["practitioner"]], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.type_string", "macro.dbt.type_timestamp"], "nodes": ["model.input_layer.practitioner"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\core\\staging\\core__stg_clinical_practitioner.sql", "compiled": true, "compiled_code": "\n\nselect\n cast(practitioner_id as TEXT ) as practitioner_id\n , cast(npi as TEXT ) as npi\n , cast(first_name as TEXT ) as first_name\n , cast(last_name as TEXT ) as last_name\n , cast(practice_affiliation as TEXT ) as practice_affiliation\n , cast(specialty as TEXT ) as specialty\n , cast(sub_specialty as TEXT ) as sub_specialty\n , cast(data_source as TEXT ) as data_source\n , cast('2023-12-13 23:31:59.089856+00:00' as TIMESTAMP ) as tuva_last_run\nfrom tuva.input_layer.practitioner", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.core__stg_clinical_procedure": {"database": "devforrest", "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": "7bc68a62ce6849e1cce50c536c97e9e78f7bad09aab6575497d22580b742c097"}, "config": {"enabled": true, "alias": "_stg_clinical_procedure", "schema": "core", "database": null, "tags": ["core_stage_clinical"], "meta": {}, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#0f3d0b"}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["core_stage_clinical"], "description": "Staging core clinical procedures", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#0f3d0b"}, "patch_path": "the_tuva_project://models\\core\\core_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "core", "alias": "_stg_clinical_procedure", "tags": "core_stage_clinical", "materialized": "view", "enabled": true, "bind": false, "docs": {"node_color": "#0f3d0b"}}, "created_at": 1702481696.9025087, "relation_name": "devforrest.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('{{ var('tuva_last_run')}}' as {{ dbt.type_timestamp() }} ) as tuva_last_run\r\nfrom {{ ref('procedure') }}", "language": "sql", "refs": [["procedure"]], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.type_string", "macro.the_tuva_project.try_to_cast_date", "macro.dbt.type_timestamp"], "nodes": ["model.input_layer.procedure"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\core\\staging\\core__stg_clinical_procedure.sql", "compiled": true, "compiled_code": "\n\nselect\n cast(procedure_id as TEXT ) as procedure_id \n , cast(patient_id as TEXT ) as patient_id\n , cast(encounter_id as TEXT ) as encounter_id\n , cast(claim_id as TEXT ) as claim_id\n , try_cast( procedure_date as date ) as procedure_date\n , cast(source_code_type as TEXT ) as source_code_type\n , cast(source_code as TEXT ) as source_code\n , cast(source_description as TEXT ) as source_description\n , cast(normalized_code_type as TEXT ) as normalized_code_type\n , cast(normalized_code as TEXT ) as normalized_code\n , cast(normalized_description as TEXT ) as normalized_description\n , cast(modifier_1 as TEXT ) as modifier_1\n , cast(modifier_2 as TEXT ) as modifier_2\n , cast(modifier_3 as TEXT ) as modifier_3\n , cast(modifier_4 as TEXT ) as modifier_4\n , cast(modifier_5 as TEXT ) as modifier_5\n , cast(practitioner_id as TEXT ) as practitioner_id\n , cast(data_source as TEXT ) as data_source\n , cast('2023-12-13 23:31:59.089856+00:00' as TIMESTAMP ) as tuva_last_run\nfrom tuva.input_layer.procedure", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.ed_classification__int_filter_encounter_with_classification": {"database": "devforrest", "schema": "ed_classification", "name": "ed_classification__int_filter_encounter_with_classification", "resource_type": "model", "package_name": "the_tuva_project", "path": "ed_classification\\intermediate\\ed_classification__int_filter_encounter_with_classification.sql", "original_file_path": "models\\ed_classification\\intermediate\\ed_classification__int_filter_encounter_with_classification.sql", "unique_id": "model.the_tuva_project.ed_classification__int_filter_encounter_with_classification", "fqn": ["the_tuva_project", "ed_classification", "intermediate", "ed_classification__int_filter_encounter_with_classification"], "alias": "_int_filter_encounter_with_classification", "checksum": {"name": "sha256", "checksum": "028a2038eb9aa43408f912eb2c0ddb8fce20b3a412533afd27d67ca2cc0a7825"}, "config": {"enabled": true, "alias": "_int_filter_encounter_with_classification", "schema": "ed_classification", "database": null, "tags": ["ed_classification"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["ed_classification"], "description": "Filter out ED visits that were not classified", "columns": {}, "meta": {}, "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_filter_encounter_with_classification", "tags": "ed_classification", "materialized": "table", "enabled": true, "bind": false}, "created_at": 1702481696.9184554, "relation_name": "devforrest.ed_classification._int_filter_encounter_with_classification", "raw_code": "/*\r\nFilter conditions to those that were classified and pick the classification\r\nwith the greatest probability (that's the greatest logic). This logic removes\r\nany rows that were not classified.\r\n*/\r\n{{ config(\r\n enabled = var('ed_classification_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r\n )\r\n}}\r\n\r\nselect\r\n a.*\r\n , case greatest(edcnnpa, edcnpa, epct, noner, injury, psych, alcohol, drug)\r\n when edcnnpa then 'edcnnpa'\r\n when edcnpa then 'edcnpa'\r\n when epct then 'epct'\r\n when noner then 'noner'\r\n when injury then 'injury'\r\n when psych then 'psych'\r\n when alcohol then 'alcohol'\r\n when drug then 'drug'\r\n else 'unclassified'\r\n end as classification\r\nfrom {{ ref('ed_classification__int_map_primary_dx') }} a\r\nwhere ed_classification_capture = 1", "language": "sql", "refs": [["ed_classification__int_map_primary_dx"]], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.ed_classification__int_map_primary_dx"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\ed_classification\\intermediate\\ed_classification__int_filter_encounter_with_classification.sql", "compiled": true, "compiled_code": "/*\nFilter conditions to those that were classified and pick the classification\nwith the greatest probability (that's the greatest logic). This logic removes\nany rows that were not classified.\n*/\n\n\nselect\n a.*\n , case greatest(edcnnpa, edcnpa, epct, noner, injury, psych, alcohol, drug)\n when edcnnpa then 'edcnnpa'\n when edcnpa then 'edcnpa'\n when epct then 'epct'\n when noner then 'noner'\n when injury then 'injury'\n when psych then 'psych'\n when alcohol then 'alcohol'\n when drug then 'drug'\n else 'unclassified'\n end as classification\nfrom devforrest.ed_classification._int_by_provider_parent_organization a\nwhere ed_classification_capture = 1", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.ed_classification__int_map_primary_dx": {"database": "devforrest", "schema": "ed_classification", "name": "ed_classification__int_map_primary_dx", "resource_type": "model", "package_name": "the_tuva_project", "path": "ed_classification\\intermediate\\ed_classification__int_map_primary_dx.sql", "original_file_path": "models\\ed_classification\\intermediate\\ed_classification__int_map_primary_dx.sql", "unique_id": "model.the_tuva_project.ed_classification__int_map_primary_dx", "fqn": ["the_tuva_project", "ed_classification", "intermediate", "ed_classification__int_map_primary_dx"], "alias": "_int_by_provider_parent_organization", "checksum": {"name": "sha256", "checksum": "9deb715f4a63d4bf20f7cdd4d07ff9a433b8f1d8f3f62b1ffd3f4f9bb9404f7c"}, "config": {"enabled": true, "alias": "_int_by_provider_parent_organization", "schema": "ed_classification", "database": null, "tags": ["ed_classification"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["ed_classification"], "description": "Map ED encounter primary dx to classification", "columns": {}, "meta": {}, "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": 1702481696.9214585, "relation_name": "devforrest.ed_classification._int_by_provider_parent_organization", "raw_code": "/*\r\nAll condition discharge diagnosis left join with probabilistic\r\nindicators of ED classification terminology\r\n*/\r\n\r\n{{ config(\r\n enabled = var('ed_classification_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r\n )\r\n}}\r\n{% set colnames = [\"edcnnpa\", \"edcnpa\", \"epct\", \"noner\", \"injury\", \"psych\", \"alcohol\", \"drug\"] %}\r\n\r\nwith condition as (\r\n select * \r\n from {{ ref('ed_classification__stg_encounter') }}\r\n where encounter_type = 'emergency department'\r\n)\r\n, icd9 as (\r\n select\r\n icd9 as code\r\n {% for colname in colnames %}\r\n , {{colname}}\r\n {% endfor %}\r\n , 1 as ed_classification_capture\r\n from {{ ref('ed_classification__johnston_icd9') }}\r\n)\r\n, icd10 as (\r\n select\r\n icd10 as code\r\n {% for colname in colnames %}\r\n , {{colname}}\r\n {% endfor %}\r\n , 1 as ed_classification_capture\r\n from {{ ref('ed_classification__johnston_icd10') }}\r\n)\r\n\r\nselect\r\n a.*\r\n {% for colname in colnames %}\r\n , icd10.{{colname}}\r\n {% endfor %}\r\n , coalesce(icd10.ed_classification_capture, 0) as ed_classification_capture\r\nfrom condition a\r\nleft join icd10\r\n on a.primary_diagnosis_code = icd10.code \r\n and a.primary_diagnosis_code_type = 'icd-10-cm'\r\n\r\nunion all\r\n\r\nselect\r\n a.*\r\n {% for colname in colnames %}\r\n , icd9.{{colname}}\r\n {% endfor %}\r\n , coalesce(icd9.ed_classification_capture, 0) ed_classification_capture\r\nfrom condition a\r\ninner join icd9\r\n on a.primary_diagnosis_code = icd9.code \r\n and a.primary_diagnosis_code_type = 'icd-9-cm'", "language": "sql", "refs": [["ed_classification__stg_encounter"], ["ed_classification__johnston_icd9"], ["ed_classification__johnston_icd10"]], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.ed_classification__stg_encounter", "seed.the_tuva_project.ed_classification__johnston_icd9", "seed.the_tuva_project.ed_classification__johnston_icd10"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\ed_classification\\intermediate\\ed_classification__int_map_primary_dx.sql", "compiled": true, "compiled_code": "/*\nAll condition discharge diagnosis left join with probabilistic\nindicators of ED classification terminology\n*/\n\n\n\n\nwith __dbt__cte__ed_classification__stg_encounter as (\n\n\nselect\n encounter_id\n , encounter_type\n , patient_id\n , encounter_end_date\n , facility_npi\n , primary_diagnosis_code_type\n , primary_diagnosis_code\n , primary_diagnosis_description\n , paid_amount\n , allowed_amount\n , charge_amount\nfrom devforrest.core.encounter\n),condition as (\n select * \n from __dbt__cte__ed_classification__stg_encounter\n where encounter_type = 'emergency department'\n)\n, icd9 as (\n select\n icd9 as code\n \n , edcnnpa\n \n , edcnpa\n \n , epct\n \n , noner\n \n , injury\n \n , psych\n \n , alcohol\n \n , drug\n \n , 1 as ed_classification_capture\n from devforrest.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 devforrest.ed_classification._value_set_johnston_icd10\n)\n\nselect\n a.*\n \n , icd10.edcnnpa\n \n , icd10.edcnpa\n \n , icd10.epct\n \n , icd10.noner\n \n , icd10.injury\n \n , icd10.psych\n \n , icd10.alcohol\n \n , icd10.drug\n \n , coalesce(icd10.ed_classification_capture, 0) as ed_classification_capture\nfrom condition a\nleft join icd10\n on a.primary_diagnosis_code = icd10.code \n and a.primary_diagnosis_code_type = 'icd-10-cm'\n\nunion all\n\nselect\n a.*\n \n , icd9.edcnnpa\n \n , icd9.edcnpa\n \n , icd9.epct\n \n , icd9.noner\n \n , icd9.injury\n \n , icd9.psych\n \n , icd9.alcohol\n \n , icd9.drug\n \n , coalesce(icd9.ed_classification_capture, 0) ed_classification_capture\nfrom condition a\ninner join icd9\n on a.primary_diagnosis_code = icd9.code \n and a.primary_diagnosis_code_type = 'icd-9-cm'", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.the_tuva_project.ed_classification__stg_encounter", "sql": " __dbt__cte__ed_classification__stg_encounter as (\n\n\nselect\n encounter_id\n , encounter_type\n , patient_id\n , encounter_end_date\n , facility_npi\n , primary_diagnosis_code_type\n , primary_diagnosis_code\n , primary_diagnosis_description\n , paid_amount\n , allowed_amount\n , charge_amount\nfrom devforrest.core.encounter\n)"}]}, "model.the_tuva_project.ed_classification__stg_encounter": {"database": "devforrest", "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": "1fe06aa48203595e38fc761b7637348e5538505e33cf0d53cd02badfbaffed19"}, "config": {"enabled": true, "alias": null, "schema": "ed_classification", "database": null, "tags": ["ed_classification"], "meta": {}, "materialized": "ephemeral", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["ed_classification"], "description": "", "columns": {}, "meta": {}, "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", "enabled": true, "bind": false}, "created_at": 1702481696.925371, "relation_name": null, "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 encounter_id\r\n , encounter_type\r\n , patient_id\r\n , encounter_end_date\r\n , facility_npi\r\n , primary_diagnosis_code_type\r\n , primary_diagnosis_code\r\n , primary_diagnosis_description\r\n , paid_amount\r\n , allowed_amount\r\n , charge_amount\r\nfrom {{ ref('core__encounter') }}", "language": "sql", "refs": [["core__encounter"]], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.core__encounter"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\ed_classification\\staging\\ed_classification__stg_encounter.sql", "compiled": true, "compiled_code": "\n\nselect\n encounter_id\n , encounter_type\n , patient_id\n , encounter_end_date\n , facility_npi\n , primary_diagnosis_code_type\n , primary_diagnosis_code\n , primary_diagnosis_description\n , paid_amount\n , allowed_amount\n , charge_amount\nfrom devforrest.core.encounter", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.ed_classification__stg_patient": {"database": "devforrest", "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": "30b001c3fe63f86b5238b8a4e5fce8c14208440e4b7c1946ac88cab63d6ecf34"}, "config": {"enabled": true, "alias": null, "schema": "ed_classification", "database": null, "tags": ["ed_classification"], "meta": {}, "materialized": "ephemeral", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["ed_classification"], "description": "", "columns": {}, "meta": {}, "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", "enabled": true, "bind": false}, "created_at": 1702481696.9284418, "relation_name": null, "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 patient_id\r\n , sex\r\n , birth_date\r\n , race\r\n , state\r\n , zip_code\r\n , latitude\r\n , longitude\r\nfrom {{ ref('core__patient') }}", "language": "sql", "refs": [["core__patient"]], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.core__patient"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\ed_classification\\staging\\ed_classification__stg_patient.sql", "compiled": true, "compiled_code": "\n\nselect\n patient_id\n , sex\n , birth_date\n , race\n , state\n , zip_code\n , latitude\n , longitude\nfrom devforrest.core.patient", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.financial_pmpm__member_months": {"database": "devforrest", "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": "70787204eeea52eb297066268c63eeff9159fcbe78aae47ebbe221d28d9b4742"}, "config": {"enabled": true, "alias": "member_months", "schema": "financial_pmpm", "database": null, "tags": ["financial_pmpm"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#abab26"}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["financial_pmpm"], "description": "Creates member months from eligibility data", "columns": {"patient_id": {"name": "patient_id", "description": "Unique identifier for each patient in the dataset.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "year_month": {"name": "year_month", "description": "Unique year-month of in the dataset computed from eligibility.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "payer": {"name": "payer", "description": "The payer covering the patient's eligibility", "meta": {}, "data_type": null, "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The time at with the model was materialized. Generated by `dbt_utils.pretty_time` as the local time of the `dbt run` environment. Timezone is configurable via the `tuva_last_run` var.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": "#abab26"}, "patch_path": "the_tuva_project://models\\financial_pmpm\\financial_pmpm_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "financial_pmpm", "alias": "member_months", "tags": ["financial_pmpm"], "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#abab26"}}, "created_at": 1702481696.9324653, "relation_name": "devforrest.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() }} ),lpad(cast(month as {{ dbt.type_string() }}),2,'0')) as year_month\r\n, min(full_date) as month_start_date\r\n, max(full_date) as month_end_date\r\nfrom {{ ref('terminology__calendar')}}\r\ngroup by 1\r\n)\r\n\r\nselect distinct\r\n a.patient_id\r\n, year_month\r\n, a.payer\r\n, a.plan\r\n, data_source\r\n, '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('financial_pmpm__stg_eligibility') }} a\r\ninner join month_start_and_end_dates b\r\n on a.enrollment_start_date <= b.month_end_date\r\n and a.enrollment_end_date >= b.month_start_date", "language": "sql", "refs": [["terminology__calendar"], ["financial_pmpm__stg_eligibility"]], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.type_string"], "nodes": ["seed.the_tuva_project.terminology__calendar", "model.the_tuva_project.financial_pmpm__stg_eligibility"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\financial_pmpm\\final\\financial_pmpm__member_months.sql", "compiled": true, "compiled_code": "\n\nwith __dbt__cte__financial_pmpm__stg_eligibility as (\n\n\nselect\n patient_id\n, enrollment_start_date\n, enrollment_end_date\n, payer\n, plan\n, data_source\n, '2023-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom devforrest.core.eligibility\n),month_start_and_end_dates as (\nselect \n concat(cast(year as TEXT ),lpad(cast(month as TEXT),2,'0')) as year_month\n, min(full_date) as month_start_date\n, max(full_date) as month_end_date\nfrom devforrest.terminology.calendar\ngroup by 1\n)\n\nselect distinct\n a.patient_id\n, year_month\n, a.payer\n, a.plan\n, data_source\n, '2023-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom __dbt__cte__financial_pmpm__stg_eligibility a\ninner join month_start_and_end_dates b\n on a.enrollment_start_date <= b.month_end_date\n and a.enrollment_end_date >= b.month_start_date", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.the_tuva_project.financial_pmpm__stg_eligibility", "sql": " __dbt__cte__financial_pmpm__stg_eligibility as (\n\n\nselect\n patient_id\n, enrollment_start_date\n, enrollment_end_date\n, payer\n, plan\n, data_source\n, '2023-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom devforrest.core.eligibility\n)"}]}, "model.the_tuva_project.financial_pmpm__pmpm": {"database": "devforrest", "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": "3a47acdaa59f84b6fa8c68933a4b3d0ff6c0c28a7a7939e3c15083649bd56f38"}, "config": {"enabled": true, "alias": "pmpm", "schema": "financial_pmpm", "database": null, "tags": ["financial_pmpm"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#abab26"}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["financial_pmpm"], "description": "Computes per member per month statistics for every service category by aggregating across patients from pmpm_prep.\n", "columns": {"year_month": {"name": "year_month", "description": "Unique year-month of in the dataset computed from eligibility.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "member_months": {"name": "member_months", "description": "The sum of member months.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "total_paid": {"name": "total_paid", "description": "Total paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "medical_paid": {"name": "medical_paid", "description": "Total medical paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "inpatient_paid": {"name": "inpatient_paid", "description": "Total inpatient paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "outpatient_paid": {"name": "outpatient_paid", "description": "Total outpatient paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "office_visit_paid": {"name": "office_visit_paid", "description": "Total office visit paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "ancillary_paid": {"name": "ancillary_paid", "description": "Total ancillary paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "pharmacy_paid": {"name": "pharmacy_paid", "description": "Total pharmacy paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "other_paid": {"name": "other_paid", "description": "Total other paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "acute_inpatient_paid": {"name": "acute_inpatient_paid", "description": "Total acute inpatient paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "ambulance_paid": {"name": "ambulance_paid", "description": "Total ambulance paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "ambulatory_surgery_paid": {"name": "ambulatory_surgery_paid", "description": "Total ambulatory surgery paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "dialysis_paid": {"name": "dialysis_paid", "description": "Total dialysis paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "durable_medical_equipment_paid": {"name": "durable_medical_equipment_paid", "description": "Total durable medical equipment paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "emergency_department_paid": {"name": "emergency_department_paid", "description": "Total emergency department paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "home_health_paid": {"name": "home_health_paid", "description": "Total home health paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "hospice_paid": {"name": "hospice_paid", "description": "Total hospice paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "inpatient_psychiatric_paid": {"name": "inpatient_psychiatric_paid", "description": "Total inpatient psychiatric paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "inpatient_rehabilitation_paid": {"name": "inpatient_rehabilitation_paid", "description": "Total inpatient rehabilitation paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "lab_paid": {"name": "lab_paid", "description": "Total lab paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "office_visit_paid_2": {"name": "office_visit_paid_2", "description": "Total office visit paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "outpatient_hospital_or_clinic_paid": {"name": "outpatient_hospital_or_clinic_paid", "description": "Total outpatient hospital or clinic paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "outpatient_psychiatric_paid": {"name": "outpatient_psychiatric_paid", "description": "Total outpatient psychiatric paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "outpatient_rehabilitation_paid": {"name": "outpatient_rehabilitation_paid", "description": "Total outpatient rehabilitation paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "skilled_nursing_paid": {"name": "skilled_nursing_paid", "description": "Total skilled nursing paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "urgent_care_paid": {"name": "urgent_care_paid", "description": "Total urgent care paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "total_allowed": {"name": "total_allowed", "description": "Total allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "medical_allowed": {"name": "medical_allowed", "description": "Total medical allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "inpatient_allowed": {"name": "inpatient_allowed", "description": "Total inpatient allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "outpatient_allowed": {"name": "outpatient_allowed", "description": "Total outpatient allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "office_visit_allowed": {"name": "office_visit_allowed", "description": "Total office visit allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "ancillary_allowed": {"name": "ancillary_allowed", "description": "Total ancillary allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "pharmacy_allowed": {"name": "pharmacy_allowed", "description": "Total pharmacy allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "other_allowed": {"name": "other_allowed", "description": "Total other allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "acute_inpatient_allowed": {"name": "acute_inpatient_allowed", "description": "Total acute inpatient allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "ambulance_allowed": {"name": "ambulance_allowed", "description": "Total ambulance allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "ambulatory_surgery_allowed": {"name": "ambulatory_surgery_allowed", "description": "Total ambulatory surgery allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "dialysis_allowed": {"name": "dialysis_allowed", "description": "Total dialysis allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "durable_medical_equipment_allowed": {"name": "durable_medical_equipment_allowed", "description": "Total durable medical equipment allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "emergency_department_allowed": {"name": "emergency_department_allowed", "description": "Total emergency department allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "home_health_allowed": {"name": "home_health_allowed", "description": "Total home health allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "hospice_allowed": {"name": "hospice_allowed", "description": "Total hospice allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "inpatient_psychiatric_allowed": {"name": "inpatient_psychiatric_allowed", "description": "Total inpatient psychiatric allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "inpatient_rehabilitation_allowed": {"name": "inpatient_rehabilitation_allowed", "description": "Total inpatient rehabilitation allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "lab_allowed": {"name": "lab_allowed", "description": "Total lab allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "office_visit_allowed_2": {"name": "office_visit_allowed_2", "description": "Total office visit allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "outpatient_hospital_or_clinic_allowed": {"name": "outpatient_hospital_or_clinic_allowed", "description": "Total outpatient hospital or clinic allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "outpatient_psychiatric_allowed": {"name": "outpatient_psychiatric_allowed", "description": "Total outpatient psychiatric allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "outpatient_rehabilitation_allowed": {"name": "outpatient_rehabilitation_allowed", "description": "Total outpatient rehabilitation allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "skilled_nursing_allowed": {"name": "skilled_nursing_allowed", "description": "Total skilled nursing allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "urgent_care_allowed": {"name": "urgent_care_allowed", "description": "Total urgent care allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The time at with the model was materialized. Generated by `dbt_utils.pretty_time` as the local time of the `dbt run` environment. Timezone is configurable via the `tuva_last_run` var.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": "#abab26"}, "patch_path": "the_tuva_project://models\\financial_pmpm\\financial_pmpm_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "financial_pmpm", "alias": "pmpm", "tags": ["financial_pmpm"], "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#abab26"}}, "created_at": 1702481696.9641562, "relation_name": "devforrest.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 payer,\r\n plan,\r\n data_source,\r\n count(1) as member_months,\r\n SUM(total_paid) / COUNT(1) AS total_paid,\r\n SUM(medical_paid) / COUNT(1) AS medical_paid,\r\n SUM(inpatient_paid) / COUNT(1) AS inpatient_paid,\r\n SUM(outpatient_paid) / COUNT(1) AS outpatient_paid,\r\n SUM(office_visit_paid) / COUNT(1) AS office_visit_paid,\r\n SUM(ancillary_paid) / COUNT(1) AS ancillary_paid,\r\n SUM(pharmacy_paid) / COUNT(1) AS pharmacy_paid,\r\n SUM(other_paid) / COUNT(1) AS other_paid,\r\n SUM(acute_inpatient_paid) / COUNT(1) AS acute_inpatient_paid,\r\n SUM(ambulance_paid) / COUNT(1) AS ambulance_paid,\r\n SUM(ambulatory_surgery_paid) / COUNT(1) AS ambulatory_surgery_paid,\r\n SUM(dialysis_paid) / COUNT(1) AS dialysis_paid,\r\n SUM(durable_medical_equipment_paid) / COUNT(1) AS durable_medical_equipment_paid,\r\n SUM(emergency_department_paid) / COUNT(1) AS emergency_department_paid,\r\n SUM(home_health_paid) / COUNT(1) AS home_health_paid,\r\n SUM(hospice_paid) / COUNT(1) AS hospice_paid,\r\n SUM(inpatient_psychiatric_paid) / COUNT(1) AS inpatient_psychiatric_paid,\r\n SUM(inpatient_rehabilitation_paid) / COUNT(1) AS inpatient_rehabilitation_paid,\r\n SUM(lab_paid) / COUNT(1) AS lab_paid,\r\n SUM(office_visit_paid_2) / COUNT(1) AS office_visit_paid_2,\r\n SUM(outpatient_hospital_or_clinic_paid) / COUNT(1) AS outpatient_hospital_or_clinic_paid,\r\n SUM(outpatient_psychiatric_paid) / COUNT(1) AS outpatient_psychiatric_paid,\r\n SUM(outpatient_rehabilitation_paid) / COUNT(1) AS outpatient_rehabilitation_paid,\r\n SUM(skilled_nursing_paid) / COUNT(1) AS skilled_nursing_paid,\r\n SUM(urgent_care_paid) / COUNT(1) AS urgent_care_paid,\r\n SUM(total_allowed) / COUNT(1) AS total_allowed,\r\n SUM(medical_allowed) / COUNT(1) AS medical_allowed,\r\n SUM(inpatient_allowed) / COUNT(1) AS inpatient_allowed,\r\n SUM(outpatient_allowed) / COUNT(1) AS outpatient_allowed,\r\n SUM(office_visit_allowed) / COUNT(1) AS office_visit_allowed,\r\n SUM(ancillary_allowed) / COUNT(1) AS ancillary_allowed,\r\n SUM(pharmacy_allowed) / COUNT(1) AS pharmacy_allowed,\r\n SUM(other_allowed) / COUNT(1) AS other_allowed,\r\n SUM(acute_inpatient_allowed) / COUNT(1) AS acute_inpatient_allowed,\r\n SUM(ambulance_allowed) / COUNT(1) AS ambulance_allowed,\r\n SUM(ambulatory_surgery_allowed) / COUNT(1) AS ambulatory_surgery_allowed,\r\n SUM(dialysis_allowed) / COUNT(1) AS dialysis_allowed,\r\n SUM(durable_medical_equipment_allowed) / COUNT(1) AS durable_medical_equipment_allowed,\r\n SUM(emergency_department_allowed) / COUNT(1) AS emergency_department_allowed,\r\n SUM(home_health_allowed) / COUNT(1) AS home_health_allowed,\r\n SUM(hospice_allowed) / COUNT(1) AS hospice_allowed,\r\n SUM(inpatient_psychiatric_allowed) / COUNT(1) AS inpatient_psychiatric_allowed,\r\n SUM(inpatient_rehabilitation_allowed) / COUNT(1) AS inpatient_rehabilitation_allowed,\r\n SUM(lab_allowed) / COUNT(1) AS lab_allowed,\r\n SUM(office_visit_allowed_2) / COUNT(1) AS office_visit_allowed_2,\r\n SUM(outpatient_hospital_or_clinic_allowed) / COUNT(1) AS outpatient_hospital_or_clinic_allowed,\r\n SUM(outpatient_psychiatric_allowed) / COUNT(1) AS outpatient_psychiatric_allowed,\r\n SUM(outpatient_rehabilitation_allowed) / COUNT(1) AS outpatient_rehabilitation_allowed,\r\n SUM(skilled_nursing_allowed) / COUNT(1) AS skilled_nursing_allowed,\r\n SUM(urgent_care_allowed) / COUNT(1) AS urgent_care_allowed,\r\n '{{ var('tuva_last_run')}}' as tuva_last_run\r\nFROM {{ ref('financial_pmpm__pmpm_prep') }} a\r\nGROUP BY 1,2,3,4", "language": "sql", "refs": [["financial_pmpm__pmpm_prep"]], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.financial_pmpm__pmpm_prep"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\financial_pmpm\\final\\financial_pmpm__pmpm.sql", "compiled": true, "compiled_code": "\n\nSELECT \n year_month,\n payer,\n plan,\n data_source,\n count(1) as member_months,\n SUM(total_paid) / COUNT(1) AS total_paid,\n SUM(medical_paid) / COUNT(1) AS medical_paid,\n SUM(inpatient_paid) / COUNT(1) AS inpatient_paid,\n SUM(outpatient_paid) / COUNT(1) AS outpatient_paid,\n SUM(office_visit_paid) / COUNT(1) AS office_visit_paid,\n SUM(ancillary_paid) / COUNT(1) AS ancillary_paid,\n SUM(pharmacy_paid) / COUNT(1) AS pharmacy_paid,\n SUM(other_paid) / COUNT(1) AS other_paid,\n SUM(acute_inpatient_paid) / COUNT(1) AS acute_inpatient_paid,\n SUM(ambulance_paid) / COUNT(1) AS ambulance_paid,\n SUM(ambulatory_surgery_paid) / COUNT(1) AS ambulatory_surgery_paid,\n SUM(dialysis_paid) / COUNT(1) AS dialysis_paid,\n SUM(durable_medical_equipment_paid) / COUNT(1) AS durable_medical_equipment_paid,\n SUM(emergency_department_paid) / COUNT(1) AS emergency_department_paid,\n SUM(home_health_paid) / COUNT(1) AS home_health_paid,\n SUM(hospice_paid) / COUNT(1) AS hospice_paid,\n SUM(inpatient_psychiatric_paid) / COUNT(1) AS inpatient_psychiatric_paid,\n SUM(inpatient_rehabilitation_paid) / COUNT(1) AS inpatient_rehabilitation_paid,\n SUM(lab_paid) / COUNT(1) AS lab_paid,\n SUM(office_visit_paid_2) / COUNT(1) AS office_visit_paid_2,\n SUM(outpatient_hospital_or_clinic_paid) / COUNT(1) AS outpatient_hospital_or_clinic_paid,\n SUM(outpatient_psychiatric_paid) / COUNT(1) AS outpatient_psychiatric_paid,\n SUM(outpatient_rehabilitation_paid) / COUNT(1) AS outpatient_rehabilitation_paid,\n SUM(skilled_nursing_paid) / COUNT(1) AS skilled_nursing_paid,\n SUM(urgent_care_paid) / COUNT(1) AS urgent_care_paid,\n SUM(total_allowed) / COUNT(1) AS total_allowed,\n SUM(medical_allowed) / COUNT(1) AS medical_allowed,\n SUM(inpatient_allowed) / COUNT(1) AS inpatient_allowed,\n SUM(outpatient_allowed) / COUNT(1) AS outpatient_allowed,\n SUM(office_visit_allowed) / COUNT(1) AS office_visit_allowed,\n SUM(ancillary_allowed) / COUNT(1) AS ancillary_allowed,\n SUM(pharmacy_allowed) / COUNT(1) AS pharmacy_allowed,\n SUM(other_allowed) / COUNT(1) AS other_allowed,\n SUM(acute_inpatient_allowed) / COUNT(1) AS acute_inpatient_allowed,\n SUM(ambulance_allowed) / COUNT(1) AS ambulance_allowed,\n SUM(ambulatory_surgery_allowed) / COUNT(1) AS ambulatory_surgery_allowed,\n SUM(dialysis_allowed) / COUNT(1) AS dialysis_allowed,\n SUM(durable_medical_equipment_allowed) / COUNT(1) AS durable_medical_equipment_allowed,\n SUM(emergency_department_allowed) / COUNT(1) AS emergency_department_allowed,\n SUM(home_health_allowed) / COUNT(1) AS home_health_allowed,\n SUM(hospice_allowed) / COUNT(1) AS hospice_allowed,\n SUM(inpatient_psychiatric_allowed) / COUNT(1) AS inpatient_psychiatric_allowed,\n SUM(inpatient_rehabilitation_allowed) / COUNT(1) AS inpatient_rehabilitation_allowed,\n SUM(lab_allowed) / COUNT(1) AS lab_allowed,\n SUM(office_visit_allowed_2) / COUNT(1) AS office_visit_allowed_2,\n SUM(outpatient_hospital_or_clinic_allowed) / COUNT(1) AS outpatient_hospital_or_clinic_allowed,\n SUM(outpatient_psychiatric_allowed) / COUNT(1) AS outpatient_psychiatric_allowed,\n SUM(outpatient_rehabilitation_allowed) / COUNT(1) AS outpatient_rehabilitation_allowed,\n SUM(skilled_nursing_allowed) / COUNT(1) AS skilled_nursing_allowed,\n SUM(urgent_care_allowed) / COUNT(1) AS urgent_care_allowed,\n '2023-12-13 23:31:59.089856+00:00' as tuva_last_run\nFROM devforrest.financial_pmpm.pmpm_prep a\nGROUP BY 1,2,3,4", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.financial_pmpm__pmpm_prep": {"database": "devforrest", "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": "09d01bc8ec05ab4fec05dc2634dd601c5933913df5a9faa6403e0ce1f3055448"}, "config": {"enabled": true, "alias": "pmpm_prep", "schema": "financial_pmpm", "database": null, "tags": ["financial_pmpm"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#abab26"}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["financial_pmpm"], "description": "Computes all the paid and allowed statistics for every patient_id and year_month combination. \n", "columns": {"patient_id": {"name": "patient_id", "description": "Unique identifier for each patient in the dataset.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "year_month": {"name": "year_month", "description": "Unique year-month of in the dataset computed from eligibility.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "member_months": {"name": "member_months", "description": "The sum of member months.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "total_paid": {"name": "total_paid", "description": "Total paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "medical_paid": {"name": "medical_paid", "description": "Total medical paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "inpatient_paid": {"name": "inpatient_paid", "description": "Total inpatient paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "outpatient_paid": {"name": "outpatient_paid", "description": "Total outpatient paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "office_visit_paid": {"name": "office_visit_paid", "description": "Total office visit paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "ancillary_paid": {"name": "ancillary_paid", "description": "Total ancillary paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "pharmacy_paid": {"name": "pharmacy_paid", "description": "Total pharmacy paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "other_paid": {"name": "other_paid", "description": "Total other paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "acute_inpatient_paid": {"name": "acute_inpatient_paid", "description": "Total acute inpatient paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "ambulance_paid": {"name": "ambulance_paid", "description": "Total ambulance paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "ambulatory_surgery_paid": {"name": "ambulatory_surgery_paid", "description": "Total ambulatory surgery paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "dialysis_paid": {"name": "dialysis_paid", "description": "Total dialysis paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "durable_medical_equipment_paid": {"name": "durable_medical_equipment_paid", "description": "Total durable medical equipment paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "emergency_department_paid": {"name": "emergency_department_paid", "description": "Total emergency department paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "home_health_paid": {"name": "home_health_paid", "description": "Total home health paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "hospice_paid": {"name": "hospice_paid", "description": "Total hospice paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "inpatient_psychiatric_paid": {"name": "inpatient_psychiatric_paid", "description": "Total inpatient psychiatric paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "inpatient_rehabilitation_paid": {"name": "inpatient_rehabilitation_paid", "description": "Total inpatient rehabilitation paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "lab_paid": {"name": "lab_paid", "description": "Total lab paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "office_visit_paid_2": {"name": "office_visit_paid_2", "description": "Total office visit paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "outpatient_hospital_or_clinic_paid": {"name": "outpatient_hospital_or_clinic_paid", "description": "Total outpatient hospital or clinic paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "outpatient_psychiatric_paid": {"name": "outpatient_psychiatric_paid", "description": "Total outpatient psychiatric paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "outpatient_rehabilitation_paid": {"name": "outpatient_rehabilitation_paid", "description": "Total outpatient rehabilitation paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "skilled_nursing_paid": {"name": "skilled_nursing_paid", "description": "Total skilled nursing paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "urgent_care_paid": {"name": "urgent_care_paid", "description": "Total urgent care paid amount per member per month (PMPM).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "total_allowed": {"name": "total_allowed", "description": "Total allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "medical_allowed": {"name": "medical_allowed", "description": "Total medical allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "inpatient_allowed": {"name": "inpatient_allowed", "description": "Total inpatient allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "outpatient_allowed": {"name": "outpatient_allowed", "description": "Total outpatient allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "office_visit_allowed": {"name": "office_visit_allowed", "description": "Total office visit allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "ancillary_allowed": {"name": "ancillary_allowed", "description": "Total ancillary allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "pharmacy_allowed": {"name": "pharmacy_allowed", "description": "Total pharmacy allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "other_allowed": {"name": "other_allowed", "description": "Total other allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "acute_inpatient_allowed": {"name": "acute_inpatient_allowed", "description": "Total acute inpatient allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "ambulance_allowed": {"name": "ambulance_allowed", "description": "Total ambulance allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "ambulatory_surgery_allowed": {"name": "ambulatory_surgery_allowed", "description": "Total ambulatory surgery allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "dialysis_allowed": {"name": "dialysis_allowed", "description": "Total dialysis allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "durable_medical_equipment_allowed": {"name": "durable_medical_equipment_allowed", "description": "Total durable medical equipment allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "emergency_department_allowed": {"name": "emergency_department_allowed", "description": "Total emergency department allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "home_health_allowed": {"name": "home_health_allowed", "description": "Total home health allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "hospice_allowed": {"name": "hospice_allowed", "description": "Total hospice allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "inpatient_psychiatric_allowed": {"name": "inpatient_psychiatric_allowed", "description": "Total inpatient psychiatric allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "inpatient_rehabilitation_allowed": {"name": "inpatient_rehabilitation_allowed", "description": "Total inpatient rehabilitation allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "lab_allowed": {"name": "lab_allowed", "description": "Total lab allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "office_visit_allowed_2": {"name": "office_visit_allowed_2", "description": "Total office visit allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "outpatient_hospital_or_clinic_allowed": {"name": "outpatient_hospital_or_clinic_allowed", "description": "Total outpatient hospital or clinic allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "outpatient_psychiatric_allowed": {"name": "outpatient_psychiatric_allowed", "description": "Total outpatient psychiatric allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "outpatient_rehabilitation_allowed": {"name": "outpatient_rehabilitation_allowed", "description": "Total outpatient rehabilitation allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "skilled_nursing_allowed": {"name": "skilled_nursing_allowed", "description": "Total skilled nursing allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "urgent_care_allowed": {"name": "urgent_care_allowed", "description": "Total urgent care allowed amount per member per month (PMPM).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The time at with the model was materialized. Generated by `dbt_utils.pretty_time` as the local time of the `dbt run` environment. Timezone is configurable via the `tuva_last_run` var.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": "#abab26"}, "patch_path": "the_tuva_project://models\\financial_pmpm\\financial_pmpm_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "financial_pmpm", "alias": "pmpm_prep", "tags": ["financial_pmpm"], "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#abab26"}}, "created_at": 1702481696.9490643, "relation_name": "devforrest.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 a.payer,\r\n a.plan, \r\n a.data_source,\r\n \r\n -- service cat 1 paid\r\n COALESCE(b.inpatient_paid, 0) AS inpatient_paid,\r\n COALESCE(b.outpatient_paid, 0) AS outpatient_paid,\r\n COALESCE(b.office_visit_paid, 0) AS office_visit_paid,\r\n COALESCE(b.ancillary_paid, 0) AS ancillary_paid,\r\n COALESCE(b.pharmacy_paid, 0) AS pharmacy_paid,\r\n COALESCE(b.other_paid, 0) AS other_paid,\r\n \r\n -- service cat 2 paid\r\n COALESCE(c.acute_inpatient_paid, 0) AS acute_inpatient_paid,\r\n COALESCE(c.ambulance_paid, 0) AS ambulance_paid,\r\n COALESCE(c.ambulatory_surgery_paid, 0) AS ambulatory_surgery_paid,\r\n COALESCE(c.dialysis_paid, 0) AS dialysis_paid,\r\n COALESCE(c.durable_medical_equipment_paid, 0) AS durable_medical_equipment_paid,\r\n COALESCE(c.emergency_department_paid, 0) AS emergency_department_paid,\r\n COALESCE(c.home_health_paid, 0) AS home_health_paid,\r\n COALESCE(c.hospice_paid, 0) AS hospice_paid,\r\n COALESCE(c.inpatient_psychiatric_paid, 0) AS inpatient_psychiatric_paid,\r\n COALESCE(c.inpatient_rehabilitation_paid, 0) AS inpatient_rehabilitation_paid,\r\n COALESCE(c.lab_paid, 0) AS lab_paid,\r\n COALESCE(c.office_visit_paid, 0) AS office_visit_paid_2,\r\n COALESCE(c.outpatient_hospital_or_clinic_paid, 0) AS outpatient_hospital_or_clinic_paid,\r\n COALESCE(c.outpatient_psychiatric_paid, 0) AS outpatient_psychiatric_paid,\r\n COALESCE(c.outpatient_rehabilitation_paid, 0) AS outpatient_rehabilitation_paid,\r\n COALESCE(c.skilled_nursing_paid, 0) AS skilled_nursing_paid,\r\n COALESCE(c.urgent_care_paid, 0) AS urgent_care_paid,\r\n \r\n -- service cat 1 allowed\r\n COALESCE(d.inpatient_allowed, 0) AS inpatient_allowed,\r\n COALESCE(d.outpatient_allowed, 0) AS outpatient_allowed,\r\n COALESCE(d.office_visit_allowed, 0) AS office_visit_allowed,\r\n COALESCE(d.ancillary_allowed, 0) AS ancillary_allowed,\r\n COALESCE(d.pharmacy_allowed, 0) AS pharmacy_allowed,\r\n COALESCE(d.other_allowed, 0) AS other_allowed,\r\n \r\n -- service cat 2 allowed\r\n COALESCE(e.acute_inpatient_allowed, 0) AS acute_inpatient_allowed,\r\n COALESCE(e.ambulance_allowed, 0) AS ambulance_allowed,\r\n COALESCE(e.ambulatory_surgery_allowed, 0) AS ambulatory_surgery_allowed,\r\n COALESCE(e.dialysis_allowed, 0) AS dialysis_allowed,\r\n COALESCE(e.durable_medical_equipment_allowed, 0) AS durable_medical_equipment_allowed,\r\n COALESCE(e.emergency_department_allowed, 0) AS emergency_department_allowed,\r\n COALESCE(e.home_health_allowed, 0) AS home_health_allowed,\r\n COALESCE(e.hospice_allowed, 0) AS hospice_allowed,\r\n COALESCE(e.inpatient_psychiatric_allowed, 0) AS inpatient_psychiatric_allowed,\r\n COALESCE(e.inpatient_rehabilitation_allowed, 0) AS inpatient_rehabilitation_allowed,\r\n COALESCE(e.lab_allowed, 0) AS lab_allowed,\r\n COALESCE(e.office_visit_allowed, 0) AS office_visit_allowed_2,\r\n COALESCE(e.outpatient_hospital_or_clinic_allowed, 0) AS outpatient_hospital_or_clinic_allowed,\r\n COALESCE(e.outpatient_psychiatric_allowed, 0) AS outpatient_psychiatric_allowed,\r\n COALESCE(e.outpatient_rehabilitation_allowed, 0) AS outpatient_rehabilitation_allowed,\r\n COALESCE(e.skilled_nursing_allowed, 0) AS skilled_nursing_allowed,\r\n COALESCE(e.urgent_care_allowed, 0) AS urgent_care_allowed\r\nFROM {{ ref('financial_pmpm__member_months') }} a\r\nleft join {{ ref('financial_pmpm__service_category_1_paid_pivot') }} b\r\n on a.patient_id = b.patient_id\r\n and a.year_month = b.year_month\r\n and a.payer = b.payer\r\n and a.plan = b.plan\r\nleft join {{ ref('financial_pmpm__service_category_2_paid_pivot') }} c\r\n on a.patient_id = c.patient_id\r\n and a.year_month = c.year_month\r\n and a.payer = c.payer\r\n and a.plan = c.plan\r\nleft join {{ ref('financial_pmpm__service_category_1_allowed_pivot') }} d\r\n on a.patient_id = d.patient_id\r\n and a.year_month = d.year_month\r\n and a.payer = d.payer\r\n and a.plan = d.plan\r\nleft join {{ ref('financial_pmpm__service_category_2_allowed_pivot') }} e\r\n on a.patient_id = e.patient_id\r\n and a.year_month = e.year_month\r\n and a.payer = e.payer\r\n and a.plan = e.plan \r\n)\r\n\r\nselect *\r\n, inpatient_paid + outpatient_paid + office_visit_paid + ancillary_paid + other_paid + pharmacy_paid as total_paid\r\n, inpatient_paid + outpatient_paid + office_visit_paid + ancillary_paid + other_paid as medical_paid\r\n, inpatient_allowed + outpatient_allowed + office_visit_allowed + ancillary_allowed + other_allowed + pharmacy_allowed as total_allowed\r\n, inpatient_allowed + outpatient_allowed + office_visit_allowed + ancillary_allowed + other_allowed as medical_allowed\r\n, '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom combine", "language": "sql", "refs": [["financial_pmpm__member_months"], ["financial_pmpm__service_category_1_paid_pivot"], ["financial_pmpm__service_category_2_paid_pivot"], ["financial_pmpm__service_category_1_allowed_pivot"], ["financial_pmpm__service_category_2_allowed_pivot"]], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.financial_pmpm__member_months", "model.the_tuva_project.financial_pmpm__service_category_1_paid_pivot", "model.the_tuva_project.financial_pmpm__service_category_2_paid_pivot", "model.the_tuva_project.financial_pmpm__service_category_1_allowed_pivot", "model.the_tuva_project.financial_pmpm__service_category_2_allowed_pivot"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\financial_pmpm\\final\\financial_pmpm__pmpm_prep.sql", "compiled": true, "compiled_code": "\n\nwith combine as (\nSELECT\n a.patient_id,\n a.year_month,\n a.payer,\n a.plan, \n a.data_source,\n \n -- service cat 1 paid\n COALESCE(b.inpatient_paid, 0) AS inpatient_paid,\n COALESCE(b.outpatient_paid, 0) AS outpatient_paid,\n COALESCE(b.office_visit_paid, 0) AS office_visit_paid,\n COALESCE(b.ancillary_paid, 0) AS ancillary_paid,\n COALESCE(b.pharmacy_paid, 0) AS pharmacy_paid,\n COALESCE(b.other_paid, 0) AS other_paid,\n \n -- service cat 2 paid\n COALESCE(c.acute_inpatient_paid, 0) AS acute_inpatient_paid,\n COALESCE(c.ambulance_paid, 0) AS ambulance_paid,\n COALESCE(c.ambulatory_surgery_paid, 0) AS ambulatory_surgery_paid,\n COALESCE(c.dialysis_paid, 0) AS dialysis_paid,\n COALESCE(c.durable_medical_equipment_paid, 0) AS durable_medical_equipment_paid,\n COALESCE(c.emergency_department_paid, 0) AS emergency_department_paid,\n COALESCE(c.home_health_paid, 0) AS home_health_paid,\n COALESCE(c.hospice_paid, 0) AS hospice_paid,\n COALESCE(c.inpatient_psychiatric_paid, 0) AS inpatient_psychiatric_paid,\n COALESCE(c.inpatient_rehabilitation_paid, 0) AS inpatient_rehabilitation_paid,\n COALESCE(c.lab_paid, 0) AS lab_paid,\n COALESCE(c.office_visit_paid, 0) AS office_visit_paid_2,\n COALESCE(c.outpatient_hospital_or_clinic_paid, 0) AS outpatient_hospital_or_clinic_paid,\n COALESCE(c.outpatient_psychiatric_paid, 0) AS outpatient_psychiatric_paid,\n COALESCE(c.outpatient_rehabilitation_paid, 0) AS outpatient_rehabilitation_paid,\n COALESCE(c.skilled_nursing_paid, 0) AS skilled_nursing_paid,\n COALESCE(c.urgent_care_paid, 0) AS urgent_care_paid,\n \n -- service cat 1 allowed\n COALESCE(d.inpatient_allowed, 0) AS inpatient_allowed,\n COALESCE(d.outpatient_allowed, 0) AS outpatient_allowed,\n COALESCE(d.office_visit_allowed, 0) AS office_visit_allowed,\n COALESCE(d.ancillary_allowed, 0) AS ancillary_allowed,\n COALESCE(d.pharmacy_allowed, 0) AS pharmacy_allowed,\n COALESCE(d.other_allowed, 0) AS other_allowed,\n \n -- service cat 2 allowed\n COALESCE(e.acute_inpatient_allowed, 0) AS acute_inpatient_allowed,\n COALESCE(e.ambulance_allowed, 0) AS ambulance_allowed,\n COALESCE(e.ambulatory_surgery_allowed, 0) AS ambulatory_surgery_allowed,\n COALESCE(e.dialysis_allowed, 0) AS dialysis_allowed,\n COALESCE(e.durable_medical_equipment_allowed, 0) AS durable_medical_equipment_allowed,\n COALESCE(e.emergency_department_allowed, 0) AS emergency_department_allowed,\n COALESCE(e.home_health_allowed, 0) AS home_health_allowed,\n COALESCE(e.hospice_allowed, 0) AS hospice_allowed,\n COALESCE(e.inpatient_psychiatric_allowed, 0) AS inpatient_psychiatric_allowed,\n COALESCE(e.inpatient_rehabilitation_allowed, 0) AS inpatient_rehabilitation_allowed,\n COALESCE(e.lab_allowed, 0) AS lab_allowed,\n COALESCE(e.office_visit_allowed, 0) AS office_visit_allowed_2,\n COALESCE(e.outpatient_hospital_or_clinic_allowed, 0) AS outpatient_hospital_or_clinic_allowed,\n COALESCE(e.outpatient_psychiatric_allowed, 0) AS outpatient_psychiatric_allowed,\n COALESCE(e.outpatient_rehabilitation_allowed, 0) AS outpatient_rehabilitation_allowed,\n COALESCE(e.skilled_nursing_allowed, 0) AS skilled_nursing_allowed,\n COALESCE(e.urgent_care_allowed, 0) AS urgent_care_allowed\nFROM devforrest.financial_pmpm.member_months a\nleft join devforrest.financial_pmpm._int_service_category_1_paid_pivot b\n on a.patient_id = b.patient_id\n and a.year_month = b.year_month\n and a.payer = b.payer\n and a.plan = b.plan\nleft join devforrest.financial_pmpm._int_service_category_2_paid_pivot c\n on a.patient_id = c.patient_id\n and a.year_month = c.year_month\n and a.payer = c.payer\n and a.plan = c.plan\nleft join devforrest.financial_pmpm._int_service_category_1_allowed_pivot d\n on a.patient_id = d.patient_id\n and a.year_month = d.year_month\n and a.payer = d.payer\n and a.plan = d.plan\nleft join devforrest.financial_pmpm._int_service_category_2_allowed_pivot e\n on a.patient_id = e.patient_id\n and a.year_month = e.year_month\n and a.payer = e.payer\n and a.plan = e.plan \n)\n\nselect *\n, inpatient_paid + outpatient_paid + office_visit_paid + ancillary_paid + other_paid + pharmacy_paid as total_paid\n, inpatient_paid + outpatient_paid + office_visit_paid + ancillary_paid + other_paid as medical_paid\n, inpatient_allowed + outpatient_allowed + office_visit_allowed + ancillary_allowed + other_allowed + pharmacy_allowed as total_allowed\n, inpatient_allowed + outpatient_allowed + office_visit_allowed + ancillary_allowed + other_allowed as medical_allowed\n, '2023-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom combine", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.financial_pmpm__patient_spend_with_service_categories": {"database": "devforrest", "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": "38d1da4a9246768aef131715ff0830e931b32a80f286cd50910b999f497db9fd"}, "config": {"enabled": true, "alias": "_int_patient_spend_with_service_categories", "schema": "financial_pmpm", "database": null, "tags": ["financial_pmpm"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#abab26"}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["financial_pmpm"], "description": "Adds service categories to claims and sums paid and allowed amounts to the year-month level.\n", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#abab26"}, "patch_path": "the_tuva_project://models\\financial_pmpm\\financial_pmpm_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "financial_pmpm", "alias": "_int_patient_spend_with_service_categories", "tags": ["financial_pmpm"], "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#abab26"}}, "created_at": 1702481696.9681628, "relation_name": "devforrest.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\n select\r\n a.patient_id\r\n , a.payer\r\n , a.plan\r\n , a.service_category_1\r\n , a.service_category_2\r\n , coalesce(a.claim_start_date,a.claim_end_date) as claim_date\r\n , a.paid_amount\r\n , a.allowed_amount\r\n , data_source\r\n from {{ ref('financial_pmpm__stg_medical_claim') }} a\r\n)\r\n\r\n, medical_claims_year_month as (\r\n select\r\n patient_id\r\n , payer\r\n , plan\r\n , service_category_1\r\n , service_category_2\r\n , cast({{ date_part(\"year\", \"claim_date\" ) }} as {{ dbt.type_string() }} ) || lpad(cast({{ date_part(\"month\", \"claim_date\" ) }} as {{ dbt.type_string() }} ),2,'0') AS year_month\r\n , paid_amount\r\n , allowed_amount\r\n , data_source\r\n from claims_with_service_categories\r\n)\r\n\r\n, rx_claims as (\r\n select\r\n patient_id\r\n , payer\r\n , plan\r\n , 'Pharmacy' as service_category_1\r\n , cast(null as {{ dbt.type_string() }}) as service_category_2\r\n , {{try_to_cast_date('dispensing_date','YYYMMDD') }} as claim_date\r\n , paid_amount\r\n , allowed_amount\r\n , data_source\r\n from {{ ref('financial_pmpm__stg_pharmacy_claim') }}\r\n)\r\n\r\n, rx_claims_year_month as (\r\n select\r\n patient_id\r\n , payer\r\n , plan\r\n , service_category_1\r\n , service_category_2\r\n , cast({{ date_part(\"year\", \"claim_date\" ) }} as {{ dbt.type_string() }} ) || lpad(cast({{ date_part(\"month\", \"claim_date\" ) }} as {{ dbt.type_string() }} ),2,'0') AS year_month\r\n , paid_amount\r\n , allowed_amount\r\n , data_source\r\n from rx_claims\r\n)\r\n\r\n, combine_medical_and_rx as (\r\nselect *\r\nfrom medical_claims_year_month\r\n\r\nunion all\r\n\r\nselect *\r\nfrom rx_claims_year_month\r\n)\r\n\r\nselect\r\n patient_id\r\n , year_month\r\n , payer\r\n , plan\r\n , service_category_1\r\n , service_category_2\r\n , sum(paid_amount) as total_paid\r\n , sum(allowed_amount) as total_allowed\r\n , data_source\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\n from combine_medical_and_rx\r\ngroup by 1,2,3,4,5,6,9", "language": "sql", "refs": [["financial_pmpm__stg_medical_claim"], ["financial_pmpm__stg_pharmacy_claim"]], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.the_tuva_project.date_part", "macro.dbt.type_string", "macro.the_tuva_project.try_to_cast_date"], "nodes": ["model.the_tuva_project.financial_pmpm__stg_medical_claim", "model.the_tuva_project.financial_pmpm__stg_pharmacy_claim"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\financial_pmpm\\intermediate\\financial_pmpm__patient_spend_with_service_categories.sql", "compiled": true, "compiled_code": "\n\nwith __dbt__cte__financial_pmpm__stg_medical_claim as (\n\n\n\nSELECT\n patient_id\n, claim_id\n, claim_line_number\n, claim_start_date\n, claim_end_date\n, service_category_1\n, service_category_2\n, paid_amount\n, allowed_amount\n, payer\n, plan\n, data_source\n, '2023-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom devforrest.core.medical_claim\n), __dbt__cte__financial_pmpm__stg_pharmacy_claim as (\n\n\n\nSELECT\n patient_id\n, dispensing_date\n, paid_amount\n, allowed_amount\n, payer\n, plan\n, data_source\n, '2023-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom devforrest.core.pharmacy_claim\n),claims_with_service_categories as (\n select\n a.patient_id\n , a.payer\n , a.plan\n , a.service_category_1\n , a.service_category_2\n , coalesce(a.claim_start_date,a.claim_end_date) as claim_date\n , a.paid_amount\n , a.allowed_amount\n , data_source\n from __dbt__cte__financial_pmpm__stg_medical_claim a\n)\n\n, medical_claims_year_month as (\n select\n patient_id\n , payer\n , plan\n , service_category_1\n , service_category_2\n , cast(date_part('year', claim_date) as TEXT ) || lpad(cast(date_part('month', claim_date) as TEXT ),2,'0') AS year_month\n , paid_amount\n , allowed_amount\n , data_source\n from claims_with_service_categories\n)\n\n, rx_claims as (\n select\n patient_id\n , payer\n , plan\n , 'Pharmacy' as service_category_1\n , cast(null as TEXT) as service_category_2\n , try_cast( dispensing_date as date ) as claim_date\n , paid_amount\n , allowed_amount\n , data_source\n from __dbt__cte__financial_pmpm__stg_pharmacy_claim\n)\n\n, rx_claims_year_month as (\n select\n patient_id\n , payer\n , plan\n , service_category_1\n , service_category_2\n , cast(date_part('year', claim_date) as TEXT ) || lpad(cast(date_part('month', claim_date) as TEXT ),2,'0') AS year_month\n , paid_amount\n , allowed_amount\n , data_source\n from rx_claims\n)\n\n, combine_medical_and_rx as (\nselect *\nfrom medical_claims_year_month\n\nunion all\n\nselect *\nfrom rx_claims_year_month\n)\n\nselect\n patient_id\n , year_month\n , payer\n , plan\n , service_category_1\n , service_category_2\n , sum(paid_amount) as total_paid\n , sum(allowed_amount) as total_allowed\n , data_source\n , '2023-12-13 23:31:59.089856+00:00' as tuva_last_run\n from combine_medical_and_rx\ngroup by 1,2,3,4,5,6,9", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.the_tuva_project.financial_pmpm__stg_medical_claim", "sql": " __dbt__cte__financial_pmpm__stg_medical_claim as (\n\n\n\nSELECT\n patient_id\n, claim_id\n, claim_line_number\n, claim_start_date\n, claim_end_date\n, service_category_1\n, service_category_2\n, paid_amount\n, allowed_amount\n, payer\n, plan\n, data_source\n, '2023-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom devforrest.core.medical_claim\n)"}, {"id": "model.the_tuva_project.financial_pmpm__stg_pharmacy_claim", "sql": " __dbt__cte__financial_pmpm__stg_pharmacy_claim as (\n\n\n\nSELECT\n patient_id\n, dispensing_date\n, paid_amount\n, allowed_amount\n, payer\n, plan\n, data_source\n, '2023-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom devforrest.core.pharmacy_claim\n)"}]}, "model.the_tuva_project.financial_pmpm__service_category_1_allowed_pivot": {"database": "devforrest", "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": "70bb17bb3c9bbee2309725987a1dd619f5a2bbe96aa71700f4fde7505694b35e"}, "config": {"enabled": true, "alias": "_int_service_category_1_allowed_pivot", "schema": "financial_pmpm", "database": null, "tags": ["financial_pmpm"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#abab26"}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["financial_pmpm"], "description": "Pivots out allowed amounts into columns by service category level 1.\n", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#abab26"}, "patch_path": "the_tuva_project://models\\financial_pmpm\\financial_pmpm_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "financial_pmpm", "alias": "_int_service_category_1_allowed_pivot", "tags": ["financial_pmpm"], "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#abab26"}}, "created_at": 1702481696.9711628, "relation_name": "devforrest.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, payer\r\n, plan\r\n, service_category_1\r\n, data_source\r\n, sum(total_allowed) as total_allowed\r\nfrom {{ ref('financial_pmpm__patient_spend_with_service_categories') }}\r\ngroup by 1,2,3,4,5,6\r\n)\r\n\r\nselect\r\n patient_id\r\n, year_month\r\n, payer\r\n, plan\r\n, data_source\r\n, {{ dbt_utils.pivot(\r\n column='service_category_1'\r\n , values=('Inpatient','Outpatient','Office Visit','Ancillary','Other','Pharmacy')\r\n , agg='sum'\r\n , then_value='total_allowed'\r\n , else_value= 0\r\n , quote_identifiers = False\r\n , suffix='_allowed'\r\n ) }}\r\n, '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom service_cat_1\r\ngroup by 1,2,3,4,5", "language": "sql", "refs": [["financial_pmpm__patient_spend_with_service_categories"]], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt_utils.pivot"], "nodes": ["model.the_tuva_project.financial_pmpm__patient_spend_with_service_categories"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\financial_pmpm\\intermediate\\financial_pmpm__service_category_1_allowed_pivot.sql", "compiled": true, "compiled_code": "\n\nwith service_cat_1 as (\nselect\n patient_id\n, year_month\n, payer\n, plan\n, service_category_1\n, data_source\n, sum(total_allowed) as total_allowed\nfrom devforrest.financial_pmpm._int_patient_spend_with_service_categories\ngroup by 1,2,3,4,5,6\n)\n\nselect\n patient_id\n, year_month\n, payer\n, plan\n, data_source\n, \n \n sum(\n \n case\n when service_category_1 = 'Inpatient'\n then total_allowed\n else 0\n end\n )\n \n \n as inpatient_allowed\n \n \n ,\n \n sum(\n \n case\n when service_category_1 = 'Outpatient'\n then total_allowed\n else 0\n end\n )\n \n \n as outpatient_allowed\n \n \n ,\n \n sum(\n \n case\n when service_category_1 = 'Office Visit'\n then total_allowed\n else 0\n end\n )\n \n \n as office_visit_allowed\n \n \n ,\n \n sum(\n \n case\n when service_category_1 = 'Ancillary'\n then total_allowed\n else 0\n end\n )\n \n \n as ancillary_allowed\n \n \n ,\n \n sum(\n \n case\n when service_category_1 = 'Other'\n then total_allowed\n else 0\n end\n )\n \n \n as other_allowed\n \n \n ,\n \n sum(\n \n case\n when service_category_1 = 'Pharmacy'\n then total_allowed\n else 0\n end\n )\n \n \n as pharmacy_allowed\n \n \n \n \n\n, '2023-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom service_cat_1\ngroup by 1,2,3,4,5", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.financial_pmpm__service_category_1_paid_pivot": {"database": "devforrest", "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": "5ed6e5a5a2d70b1f05321eb2d7dc60ac4380ac07c2e76a5dc88be489459cb648"}, "config": {"enabled": true, "alias": "_int_service_category_1_paid_pivot", "schema": "financial_pmpm", "database": null, "tags": ["financial_pmpm"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#abab26"}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["financial_pmpm"], "description": "Pivots out paid amounts into columns by service category level 1.\n", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#abab26"}, "patch_path": "the_tuva_project://models\\financial_pmpm\\financial_pmpm_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "financial_pmpm", "alias": "_int_service_category_1_paid_pivot", "tags": ["financial_pmpm"], "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#abab26"}}, "created_at": 1702481696.9731543, "relation_name": "devforrest.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, payer\r\n, plan\r\n, service_category_1\r\n, data_source\r\n, sum(total_paid) as total_paid\r\nfrom {{ ref('financial_pmpm__patient_spend_with_service_categories') }}\r\ngroup by 1,2,3,4,5,6\r\n)\r\n\r\nselect\r\n patient_id\r\n, year_month\r\n, payer\r\n, plan\r\n, data_source\r\n, {{ dbt_utils.pivot(\r\n column='service_category_1'\r\n , values=('Inpatient','Outpatient','Office Visit','Ancillary','Other','Pharmacy')\r\n , agg='sum'\r\n , then_value='total_paid'\r\n , else_value= 0\r\n , quote_identifiers = False\r\n , suffix='_paid'\r\n ) }}\r\n, '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom service_cat_1\r\ngroup by 1,2,3,4,5", "language": "sql", "refs": [["financial_pmpm__patient_spend_with_service_categories"]], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt_utils.pivot"], "nodes": ["model.the_tuva_project.financial_pmpm__patient_spend_with_service_categories"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\financial_pmpm\\intermediate\\financial_pmpm__service_category_1_paid_pivot.sql", "compiled": true, "compiled_code": "\n\nwith service_cat_1 as (\nselect\n patient_id\n, year_month\n, payer\n, plan\n, service_category_1\n, data_source\n, sum(total_paid) as total_paid\nfrom devforrest.financial_pmpm._int_patient_spend_with_service_categories\ngroup by 1,2,3,4,5,6\n)\n\nselect\n patient_id\n, year_month\n, payer\n, plan\n, data_source\n, \n \n sum(\n \n case\n when service_category_1 = 'Inpatient'\n then total_paid\n else 0\n end\n )\n \n \n as inpatient_paid\n \n \n ,\n \n sum(\n \n case\n when service_category_1 = 'Outpatient'\n then total_paid\n else 0\n end\n )\n \n \n as outpatient_paid\n \n \n ,\n \n sum(\n \n case\n when service_category_1 = 'Office Visit'\n then total_paid\n else 0\n end\n )\n \n \n as office_visit_paid\n \n \n ,\n \n sum(\n \n case\n when service_category_1 = 'Ancillary'\n then total_paid\n else 0\n end\n )\n \n \n as ancillary_paid\n \n \n ,\n \n sum(\n \n case\n when service_category_1 = 'Other'\n then total_paid\n else 0\n end\n )\n \n \n as other_paid\n \n \n ,\n \n sum(\n \n case\n when service_category_1 = 'Pharmacy'\n then total_paid\n else 0\n end\n )\n \n \n as pharmacy_paid\n \n \n \n \n\n, '2023-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom service_cat_1\ngroup by 1,2,3,4,5", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.financial_pmpm__service_category_2_allowed_pivot": {"database": "devforrest", "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": "57ba6bc48fe792dc6f97f2eaacc97965229a4b3e06a20e4a1db212739e209a32"}, "config": {"enabled": true, "alias": "_int_service_category_2_allowed_pivot", "schema": "financial_pmpm", "database": null, "tags": ["financial_pmpm"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#abab26"}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["financial_pmpm"], "description": "Pivots out allowed amounts into columns by service category level 2.\n", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#abab26"}, "patch_path": "the_tuva_project://models\\financial_pmpm\\financial_pmpm_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "financial_pmpm", "alias": "_int_service_category_2_allowed_pivot", "tags": ["financial_pmpm"], "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#abab26"}}, "created_at": 1702481696.9731543, "relation_name": "devforrest.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, payer\r\n, plan\r\n, service_category_2\r\n, data_source\r\n, sum(total_allowed) as total_allowed\r\nfrom {{ ref('financial_pmpm__patient_spend_with_service_categories') }}\r\ngroup by 1,2,3,4,5,6\r\n)\r\n\r\nselect\r\n patient_id \r\n, year_month \r\n, payer\r\n, plan\r\n, data_source\r\n, {{ dbt_utils.pivot(\r\n column='service_category_2'\r\n , values=('Acute Inpatient',\r\n 'Ambulance',\r\n 'Ambulatory Surgery',\r\n 'Dialysis',\r\n 'Durable Medical Equipment',\r\n 'Emergency Department',\r\n 'Home Health',\r\n 'Hospice',\r\n 'Inpatient Psychiatric',\r\n 'Inpatient Rehabilitation',\r\n 'Lab',\r\n 'Office Visit',\r\n 'Outpatient Hospital or Clinic',\r\n 'Outpatient Psychiatric',\r\n 'Outpatient Rehabilitation',\r\n 'Skilled Nursing',\r\n 'Urgent Care' \r\n )\r\n , agg='sum'\r\n , then_value='total_allowed'\r\n , else_value= 0\r\n , quote_identifiers = False\r\n , suffix='_allowed'\r\n) }}\r\n, '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom service_cat_2\r\ngroup by 1,2,3,4,5", "language": "sql", "refs": [["financial_pmpm__patient_spend_with_service_categories"]], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt_utils.pivot"], "nodes": ["model.the_tuva_project.financial_pmpm__patient_spend_with_service_categories"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\financial_pmpm\\intermediate\\financial_pmpm__service_category_2_allowed_pivot.sql", "compiled": true, "compiled_code": "\n\nwith service_cat_2 as (\nselect\n patient_id\n, year_month\n, payer\n, plan\n, service_category_2\n, data_source\n, sum(total_allowed) as total_allowed\nfrom devforrest.financial_pmpm._int_patient_spend_with_service_categories\ngroup by 1,2,3,4,5,6\n)\n\nselect\n patient_id \n, year_month \n, payer\n, plan\n, data_source\n, \n \n sum(\n \n case\n when service_category_2 = 'Acute Inpatient'\n then total_allowed\n else 0\n end\n )\n \n \n as acute_inpatient_allowed\n \n \n ,\n \n sum(\n \n case\n when service_category_2 = 'Ambulance'\n then total_allowed\n else 0\n end\n )\n \n \n as ambulance_allowed\n \n \n ,\n \n sum(\n \n case\n when service_category_2 = 'Ambulatory Surgery'\n then total_allowed\n else 0\n end\n )\n \n \n as ambulatory_surgery_allowed\n \n \n ,\n \n sum(\n \n case\n when service_category_2 = 'Dialysis'\n then total_allowed\n else 0\n end\n )\n \n \n as dialysis_allowed\n \n \n ,\n \n sum(\n \n case\n when service_category_2 = 'Durable Medical Equipment'\n then total_allowed\n else 0\n end\n )\n \n \n as durable_medical_equipment_allowed\n \n \n ,\n \n sum(\n \n case\n when service_category_2 = 'Emergency Department'\n then total_allowed\n else 0\n end\n )\n \n \n as emergency_department_allowed\n \n \n ,\n \n sum(\n \n case\n when service_category_2 = 'Home Health'\n then total_allowed\n else 0\n end\n )\n \n \n as home_health_allowed\n \n \n ,\n \n sum(\n \n case\n when service_category_2 = 'Hospice'\n then total_allowed\n else 0\n end\n )\n \n \n as hospice_allowed\n \n \n ,\n \n sum(\n \n case\n when service_category_2 = 'Inpatient Psychiatric'\n then total_allowed\n else 0\n end\n )\n \n \n as inpatient_psychiatric_allowed\n \n \n ,\n \n sum(\n \n case\n when service_category_2 = 'Inpatient Rehabilitation'\n then total_allowed\n else 0\n end\n )\n \n \n as inpatient_rehabilitation_allowed\n \n \n ,\n \n sum(\n \n case\n when service_category_2 = 'Lab'\n then total_allowed\n else 0\n end\n )\n \n \n as lab_allowed\n \n \n ,\n \n sum(\n \n case\n when service_category_2 = 'Office Visit'\n then total_allowed\n else 0\n end\n )\n \n \n as office_visit_allowed\n \n \n ,\n \n sum(\n \n case\n when service_category_2 = 'Outpatient Hospital or Clinic'\n then total_allowed\n else 0\n end\n )\n \n \n as outpatient_hospital_or_clinic_allowed\n \n \n ,\n \n sum(\n \n case\n when service_category_2 = 'Outpatient Psychiatric'\n then total_allowed\n else 0\n end\n )\n \n \n as outpatient_psychiatric_allowed\n \n \n ,\n \n sum(\n \n case\n when service_category_2 = 'Outpatient Rehabilitation'\n then total_allowed\n else 0\n end\n )\n \n \n as outpatient_rehabilitation_allowed\n \n \n ,\n \n sum(\n \n case\n when service_category_2 = 'Skilled Nursing'\n then total_allowed\n else 0\n end\n )\n \n \n as skilled_nursing_allowed\n \n \n ,\n \n sum(\n \n case\n when service_category_2 = 'Urgent Care'\n then total_allowed\n else 0\n end\n )\n \n \n as urgent_care_allowed\n \n \n \n \n\n, '2023-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom service_cat_2\ngroup by 1,2,3,4,5", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.financial_pmpm__service_category_2_paid_pivot": {"database": "devforrest", "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": "ba952c87902e949c6511910d88a315536ecada4ee8cb6322cc18face1230f39a"}, "config": {"enabled": true, "alias": "_int_service_category_2_paid_pivot", "schema": "financial_pmpm", "database": null, "tags": ["financial_pmpm"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#abab26"}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["financial_pmpm"], "description": "Pivots out paid amounts into columns by service category level 2.\n", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#abab26"}, "patch_path": "the_tuva_project://models\\financial_pmpm\\financial_pmpm_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "financial_pmpm", "alias": "_int_service_category_2_paid_pivot", "tags": ["financial_pmpm"], "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#abab26"}}, "created_at": 1702481696.9731543, "relation_name": "devforrest.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, payer\r\n, plan\r\n, service_category_2\r\n, data_source\r\n, sum(total_paid) as total_paid\r\nfrom {{ ref('financial_pmpm__patient_spend_with_service_categories') }}\r\ngroup by 1,2,3,4,5,6\r\n)\r\n\r\nselect\r\n patient_id\r\n, year_month\r\n, payer\r\n, plan\r\n, data_source\r\n, {{ dbt_utils.pivot(\r\n column='service_category_2'\r\n , values=('Acute Inpatient',\r\n 'Ambulance',\r\n 'Ambulatory Surgery',\r\n 'Dialysis',\r\n 'Durable Medical Equipment',\r\n 'Emergency Department',\r\n 'Home Health',\r\n 'Hospice',\r\n 'Inpatient Psychiatric',\r\n 'Inpatient Rehabilitation',\r\n 'Lab',\r\n 'Office Visit',\r\n 'Outpatient Hospital or Clinic',\r\n 'Outpatient Psychiatric',\r\n 'Outpatient Rehabilitation',\r\n 'Skilled Nursing',\r\n 'Urgent Care' \r\n )\r\n , agg='sum'\r\n , then_value='total_paid'\r\n , else_value= 0\r\n , quote_identifiers = False\r\n , suffix='_paid'\r\n ) }}\r\n, '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom service_cat_2\r\ngroup by 1,2,3,4,5", "language": "sql", "refs": [["financial_pmpm__patient_spend_with_service_categories"]], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt_utils.pivot"], "nodes": ["model.the_tuva_project.financial_pmpm__patient_spend_with_service_categories"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\financial_pmpm\\intermediate\\financial_pmpm__service_category_2_paid_pivot.sql", "compiled": true, "compiled_code": "\n\nwith service_cat_2 as (\nselect\n patient_id\n, year_month\n, payer\n, plan\n, service_category_2\n, data_source\n, sum(total_paid) as total_paid\nfrom devforrest.financial_pmpm._int_patient_spend_with_service_categories\ngroup by 1,2,3,4,5,6\n)\n\nselect\n patient_id\n, year_month\n, payer\n, plan\n, data_source\n, \n \n sum(\n \n case\n when service_category_2 = 'Acute Inpatient'\n then total_paid\n else 0\n end\n )\n \n \n as acute_inpatient_paid\n \n \n ,\n \n sum(\n \n case\n when service_category_2 = 'Ambulance'\n then total_paid\n else 0\n end\n )\n \n \n as ambulance_paid\n \n \n ,\n \n sum(\n \n case\n when service_category_2 = 'Ambulatory Surgery'\n then total_paid\n else 0\n end\n )\n \n \n as ambulatory_surgery_paid\n \n \n ,\n \n sum(\n \n case\n when service_category_2 = 'Dialysis'\n then total_paid\n else 0\n end\n )\n \n \n as dialysis_paid\n \n \n ,\n \n sum(\n \n case\n when service_category_2 = 'Durable Medical Equipment'\n then total_paid\n else 0\n end\n )\n \n \n as durable_medical_equipment_paid\n \n \n ,\n \n sum(\n \n case\n when service_category_2 = 'Emergency Department'\n then total_paid\n else 0\n end\n )\n \n \n as emergency_department_paid\n \n \n ,\n \n sum(\n \n case\n when service_category_2 = 'Home Health'\n then total_paid\n else 0\n end\n )\n \n \n as home_health_paid\n \n \n ,\n \n sum(\n \n case\n when service_category_2 = 'Hospice'\n then total_paid\n else 0\n end\n )\n \n \n as hospice_paid\n \n \n ,\n \n sum(\n \n case\n when service_category_2 = 'Inpatient Psychiatric'\n then total_paid\n else 0\n end\n )\n \n \n as inpatient_psychiatric_paid\n \n \n ,\n \n sum(\n \n case\n when service_category_2 = 'Inpatient Rehabilitation'\n then total_paid\n else 0\n end\n )\n \n \n as inpatient_rehabilitation_paid\n \n \n ,\n \n sum(\n \n case\n when service_category_2 = 'Lab'\n then total_paid\n else 0\n end\n )\n \n \n as lab_paid\n \n \n ,\n \n sum(\n \n case\n when service_category_2 = 'Office Visit'\n then total_paid\n else 0\n end\n )\n \n \n as office_visit_paid\n \n \n ,\n \n sum(\n \n case\n when service_category_2 = 'Outpatient Hospital or Clinic'\n then total_paid\n else 0\n end\n )\n \n \n as outpatient_hospital_or_clinic_paid\n \n \n ,\n \n sum(\n \n case\n when service_category_2 = 'Outpatient Psychiatric'\n then total_paid\n else 0\n end\n )\n \n \n as outpatient_psychiatric_paid\n \n \n ,\n \n sum(\n \n case\n when service_category_2 = 'Outpatient Rehabilitation'\n then total_paid\n else 0\n end\n )\n \n \n as outpatient_rehabilitation_paid\n \n \n ,\n \n sum(\n \n case\n when service_category_2 = 'Skilled Nursing'\n then total_paid\n else 0\n end\n )\n \n \n as skilled_nursing_paid\n \n \n ,\n \n sum(\n \n case\n when service_category_2 = 'Urgent Care'\n then total_paid\n else 0\n end\n )\n \n \n as urgent_care_paid\n \n \n \n \n\n, '2023-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom service_cat_2\ngroup by 1,2,3,4,5", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.financial_pmpm__stg_eligibility": {"database": "devforrest", "schema": "dbt_forrest", "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": "453011c05b6781efb90e06c678dabb0b19210c4207ba719839c030303bb64062"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["financial_pmpm"], "meta": {}, "materialized": "ephemeral", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#abab26"}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["financial_pmpm"], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#abab26"}, "patch_path": "the_tuva_project://models\\financial_pmpm\\financial_pmpm_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"tags": ["financial_pmpm"], "materialized": "ephemeral", "enabled": true, "bind": false, "docs": {"node_color": "#abab26"}}, "created_at": 1702481696.9731543, "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, plan\r\n, data_source\r\n, '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('core__eligibility') }}", "language": "sql", "refs": [["core__eligibility"]], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.core__eligibility"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\financial_pmpm\\staging\\financial_pmpm__stg_eligibility.sql", "compiled": true, "compiled_code": "\n\nselect\n patient_id\n, enrollment_start_date\n, enrollment_end_date\n, payer\n, plan\n, data_source\n, '2023-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom devforrest.core.eligibility", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.financial_pmpm__stg_medical_claim": {"database": "devforrest", "schema": "dbt_forrest", "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": "44abcba1c14a8165a1b4a042c36c795e51d99c9b201792c4f119a85501fc2504"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["financial_pmpm"], "meta": {}, "materialized": "ephemeral", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#abab26"}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["financial_pmpm"], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#abab26"}, "patch_path": "the_tuva_project://models\\financial_pmpm\\financial_pmpm_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"tags": "financial_pmpm", "materialized": "ephemeral", "enabled": true, "bind": false, "docs": {"node_color": "#abab26"}}, "created_at": 1702481696.9731543, "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, payer\r\n, plan\r\n, data_source\r\n, '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('core__medical_claim') }}", "language": "sql", "refs": [["core__medical_claim"]], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.core__medical_claim"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\financial_pmpm\\staging\\financial_pmpm__stg_medical_claim.sql", "compiled": true, "compiled_code": "\n\n\nSELECT\n patient_id\n, claim_id\n, claim_line_number\n, claim_start_date\n, claim_end_date\n, service_category_1\n, service_category_2\n, paid_amount\n, allowed_amount\n, payer\n, plan\n, data_source\n, '2023-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom devforrest.core.medical_claim", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.financial_pmpm__stg_pharmacy_claim": {"database": "devforrest", "schema": "dbt_forrest", "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": "536e3fe661e51d6beb4d2061442c13226ff72778dc3e31aa18d5d06e83e81c50"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["financial_pmpm"], "meta": {}, "materialized": "ephemeral", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#abab26"}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["financial_pmpm"], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#abab26"}, "patch_path": "the_tuva_project://models\\financial_pmpm\\financial_pmpm_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"tags": "financial_pmpm", "materialized": "ephemeral", "enabled": true, "bind": false, "docs": {"node_color": "#abab26"}}, "created_at": 1702481696.9731543, "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, payer\r\n, plan\r\n, data_source\r\n, '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('core__pharmacy_claim') }}", "language": "sql", "refs": [["core__pharmacy_claim"]], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.core__pharmacy_claim"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\financial_pmpm\\staging\\financial_pmpm__stg_pharmacy_claim.sql", "compiled": true, "compiled_code": "\n\n\nSELECT\n patient_id\n, dispensing_date\n, paid_amount\n, allowed_amount\n, payer\n, plan\n, data_source\n, '2023-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom devforrest.core.pharmacy_claim", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.insights__count_claim_by_claim_type": {"database": "devforrest", "schema": "insights", "name": "insights__count_claim_by_claim_type", "resource_type": "model", "package_name": "the_tuva_project", "path": "insights\\final\\insights__count_claim_by_claim_type.sql", "original_file_path": "models\\insights\\final\\insights__count_claim_by_claim_type.sql", "unique_id": "model.the_tuva_project.insights__count_claim_by_claim_type", "fqn": ["the_tuva_project", "insights", "final", "insights__count_claim_by_claim_type"], "alias": "count_claim_by_claim_type", "checksum": {"name": "sha256", "checksum": "aac53ff2bb99be715d6cad672ed44d502f2bf6ff0c6db695caa45600408b1b1f"}, "config": {"enabled": true, "alias": "count_claim_by_claim_type", "schema": "insights", "database": null, "tags": ["insights"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "bind": false, "columns": [{"name": "claim_type", "description": "Indicates whether the claim is professional (CMS-1500), institutional (UB-04), dental, vision, or pharmacy."}, {"name": "distinct_claim_count", "description": "Count of distinct claims."}], "post-hook": [], "pre-hook": []}, "tags": ["insights"], "description": "Count of distinct claims by claim type.", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://models\\insights\\insights_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "insights", "alias": "count_claim_by_claim_type", "tags": ["insights"], "materialized": "table", "columns": [{"name": "claim_type", "description": "Indicates whether the claim is professional (CMS-1500), institutional (UB-04), dental, vision, or pharmacy."}, {"name": "distinct_claim_count", "description": "Count of distinct claims."}], "enabled": true, "bind": false}, "created_at": 1702481696.9888995, "relation_name": "devforrest.insights.count_claim_by_claim_type", "raw_code": "{{ config(\r\n enabled = var('insights_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r\n )\r\n}}\r\n\r\n\r\nselect \r\n claim_type\r\n , count(distinct claim_id) as distinct_claim_count\r\nfrom {{ ref('core__medical_claim') }}\r\ngroup by claim_type\r\nunion all\r\nselect \r\n 'pharmacy'\r\n , count(distinct claim_id) as distinct_claim_count\r\nfrom {{ ref('core__pharmacy_claim') }}", "language": "sql", "refs": [["core__medical_claim"], ["core__pharmacy_claim"]], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.core__medical_claim", "model.the_tuva_project.core__pharmacy_claim"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\insights\\final\\insights__count_claim_by_claim_type.sql", "compiled": true, "compiled_code": "\n\n\nselect \n claim_type\n , count(distinct claim_id) as distinct_claim_count\nfrom devforrest.core.medical_claim\ngroup by claim_type\nunion all\nselect \n 'pharmacy'\n , count(distinct claim_id) as distinct_claim_count\nfrom devforrest.core.pharmacy_claim", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.insights__count_claim_by_date_column": {"database": "devforrest", "schema": "insights", "name": "insights__count_claim_by_date_column", "resource_type": "model", "package_name": "the_tuva_project", "path": "insights\\final\\insights__count_claim_by_date_column.sql", "original_file_path": "models\\insights\\final\\insights__count_claim_by_date_column.sql", "unique_id": "model.the_tuva_project.insights__count_claim_by_date_column", "fqn": ["the_tuva_project", "insights", "final", "insights__count_claim_by_date_column"], "alias": "count_claim_by_date_column", "checksum": {"name": "sha256", "checksum": "f0cb82ac880516df2b77723c56e7e494b935730b8a41cf97b206a8dbcbbb9bb3"}, "config": {"enabled": true, "alias": "count_claim_by_date_column", "schema": "insights", "database": null, "tags": ["insights"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "bind": false, "columns": [{"name": "year_month", "description": "Year and month of the claim end date or the member enrollment."}, {"name": "member_months", "description": "Count of unique member months."}, {"name": "claim_start_date", "description": "Count of unique medical claims."}, {"name": "claim_end_date", "description": "Count of unique medical claims."}, {"name": "admission_date", "description": "Count of unique medical claims."}, {"name": "discharge_date", "description": "Count of unique medical claims."}, {"name": "medical_paid_date", "description": "Count of unique medical claims."}, {"name": "dispensing_date", "description": "Count of unique pharmacy claims."}, {"name": "pharmacy_paid_date", "description": "Count of unique pharmacy claims."}], "post-hook": [], "pre-hook": []}, "tags": ["insights"], "description": "Count of distinct claims by multiple dates.", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://models\\insights\\insights_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "insights", "alias": "count_claim_by_date_column", "tags": ["insights"], "materialized": "table", "columns": [{"name": "year_month", "description": "Year and month of the claim end date or the member enrollment."}, {"name": "member_months", "description": "Count of unique member months."}, {"name": "claim_start_date", "description": "Count of unique medical claims."}, {"name": "claim_end_date", "description": "Count of unique medical claims."}, {"name": "admission_date", "description": "Count of unique medical claims."}, {"name": "discharge_date", "description": "Count of unique medical claims."}, {"name": "medical_paid_date", "description": "Count of unique medical claims."}, {"name": "dispensing_date", "description": "Count of unique pharmacy claims."}, {"name": "pharmacy_paid_date", "description": "Count of unique pharmacy claims."}], "enabled": true, "bind": false}, "created_at": 1702481696.9888995, "relation_name": "devforrest.insights.count_claim_by_date_column", "raw_code": "{{ config(\r\n enabled = var('insights_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r\n )\r\n}}\r\n\r\nwith date_stage as(\r\n\r\n select\r\n 'claim_start_date' as date_field\r\n , cast({{ date_part(\"year\", \"claim_start_date\") }} as {{ dbt.type_string() }}) || right('0'||cast({{ date_part(\"month\", \"claim_start_date\") }} as {{ dbt.type_string() }}),2) as year_month\r\n , count(distinct claim_id) as distinct_count\r\n from {{ ref('core__medical_claim') }}\r\n group by \r\n year_month\r\n\r\n union all\r\n\r\n select\r\n 'claim_end_date' as date_field\r\n , cast({{ date_part(\"year\", \"claim_end_date\") }} as {{ dbt.type_string() }}) || right('0'||cast({{ date_part(\"month\", \"claim_end_date\") }} as {{ dbt.type_string() }}),2) as year_month\r\n , count(distinct claim_id) as distinct_count\r\n from {{ ref('core__medical_claim') }}\r\n group by \r\n year_month\r\n union all\r\n\r\n select\r\n 'admission_date' as date_field\r\n , cast({{ date_part(\"year\", \"admission_date\") }} as {{ dbt.type_string() }}) || right('0'||cast({{ date_part(\"month\", \"admission_date\") }} as {{ dbt.type_string() }}),2) as year_month\r\n , count(distinct claim_id) as distinct_count\r\n from {{ ref('core__medical_claim') }}\r\n group by \r\n year_month\r\n\r\n union all\r\n\r\n select\r\n 'discharge_date' as date_field\r\n , cast({{ date_part(\"year\", \"discharge_date\") }} as {{ dbt.type_string() }}) || right('0'||cast({{ date_part(\"month\", \"discharge_date\") }} as {{ dbt.type_string() }}),2) as year_month\r\n , count(distinct claim_id) as distinct_count\r\n from {{ ref('core__medical_claim') }}\r\n group by \r\n year_month\r\n\r\n union all\r\n\r\n select\r\n 'medical paid_date' as date_field\r\n , cast({{ date_part(\"year\", \"paid_date\") }} as {{ dbt.type_string() }}) || right('0'||cast({{ date_part(\"month\", \"paid_date\") }} as {{ dbt.type_string() }}),2) as year_month\r\n , count(distinct claim_id) as distinct_count\r\n from {{ ref('core__medical_claim') }}\r\n group by \r\n year_month\r\n\r\n union all\r\n\r\n select\r\n 'dispensing_date' as date_field\r\n , cast({{ date_part(\"year\", \"dispensing_date\") }} as {{ dbt.type_string() }}) || right('0'||cast({{ date_part(\"month\", \"dispensing_date\") }} as {{ dbt.type_string() }}),2) as year_month\r\n , count(distinct claim_id) as distinct_count\r\n from {{ ref('core__pharmacy_claim') }}\r\n group by \r\n year_month\r\n\r\n union all\r\n\r\n select\r\n 'pharmacy paid_date' as date_field\r\n , cast({{ date_part(\"year\", \"paid_date\") }} as {{ dbt.type_string() }}) || right('0'||cast({{ date_part(\"month\", \"paid_date\") }} as {{ dbt.type_string() }}),2) as year_month\r\n , count(distinct claim_id) as distinct_count\r\n from {{ ref('core__pharmacy_claim') }}\r\n group by \r\n year_month\r\n\r\n union all \r\n\r\n select\r\n 'member_months' as date_field\r\n , year_month\r\n , count(*) as distinct_count\r\n from {{ ref('financial_pmpm__member_months') }}\r\n group by\r\n year_month\r\n)\r\n\r\n\r\n, all_date_range as (\r\n select distinct \r\n replace(cal.year_month,'-','') as year_month\r\n from {{ ref('terminology__calendar') }} cal\r\n where (cal.year_month >= (select min(year_month) from date_stage)\r\n and cal.year_month <= (select max(year_month) from date_stage))\r\n \r\n)\r\n\r\nselect\r\n cast(all_date.year_month as {{ dbt.type_int() }} ) as year_month\r\n , member_months.distinct_count as member_months\r\n , claim_start.distinct_count as claim_start_date\r\n , claim_end.distinct_count as claim_end_date\r\n , admission_date.distinct_count as admission_date\r\n , discharge_date.distinct_count as discharge_date\r\n , med_paid_date.distinct_count as medical_paid_date\r\n , dispensing_date.distinct_count as dispensing_date\r\n , pharm_paid_date.distinct_count as pharmacy_paid_date\r\nfrom all_date_range all_date\r\nleft join date_stage member_months\r\n on all_date.year_month = member_months.year_month\r\n and member_months.date_field = 'member_months'\r\nleft join date_stage claim_start\r\n on all_date.year_month = claim_start.year_month\r\n and claim_start.date_field = 'claim_start_date'\r\nleft join date_stage claim_end\r\n on all_date.year_month = claim_end.year_month\r\n and claim_end.date_field = 'claim_end_date'\r\nleft join date_stage admission_date\r\n on all_date.year_month = admission_date.year_month\r\n and admission_date.date_field = 'admission_date'\r\nleft join date_stage discharge_date\r\n on all_date.year_month = discharge_date.year_month\r\n and discharge_date.date_field = 'discharge_date'\r\nleft join date_stage med_paid_date\r\n on all_date.year_month = med_paid_date.year_month\r\n and med_paid_date.date_field = 'medical paid_date'\r\nleft join date_stage dispensing_date\r\n on all_date.year_month = dispensing_date.year_month\r\n and dispensing_date.date_field = 'dispensing_date'\r\nleft join date_stage pharm_paid_date\r\n on all_date.year_month = pharm_paid_date.year_month\r\n and pharm_paid_date.date_field = 'pharmacy paid_date'", "language": "sql", "refs": [["core__medical_claim"], ["core__medical_claim"], ["core__medical_claim"], ["core__medical_claim"], ["core__medical_claim"], ["core__pharmacy_claim"], ["core__pharmacy_claim"], ["financial_pmpm__member_months"], ["terminology__calendar"]], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.the_tuva_project.date_part", "macro.dbt.type_string", "macro.dbt.type_int"], "nodes": ["model.the_tuva_project.core__medical_claim", "model.the_tuva_project.core__medical_claim", "model.the_tuva_project.core__medical_claim", "model.the_tuva_project.core__medical_claim", "model.the_tuva_project.core__medical_claim", "model.the_tuva_project.core__pharmacy_claim", "model.the_tuva_project.core__pharmacy_claim", "model.the_tuva_project.financial_pmpm__member_months", "seed.the_tuva_project.terminology__calendar"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\insights\\final\\insights__count_claim_by_date_column.sql", "compiled": true, "compiled_code": "\n\nwith date_stage as(\n\n select\n 'claim_start_date' as date_field\n , cast(date_part('year', claim_start_date) as TEXT) || right('0'||cast(date_part('month', claim_start_date) as TEXT),2) as year_month\n , count(distinct claim_id) as distinct_count\n from devforrest.core.medical_claim\n group by \n year_month\n\n union all\n\n select\n 'claim_end_date' as date_field\n , cast(date_part('year', claim_end_date) as TEXT) || right('0'||cast(date_part('month', claim_end_date) as TEXT),2) as year_month\n , count(distinct claim_id) as distinct_count\n from devforrest.core.medical_claim\n group by \n year_month\n union all\n\n select\n 'admission_date' as date_field\n , cast(date_part('year', admission_date) as TEXT) || right('0'||cast(date_part('month', admission_date) as TEXT),2) as year_month\n , count(distinct claim_id) as distinct_count\n from devforrest.core.medical_claim\n group by \n year_month\n\n union all\n\n select\n 'discharge_date' as date_field\n , cast(date_part('year', discharge_date) as TEXT) || right('0'||cast(date_part('month', discharge_date) as TEXT),2) as year_month\n , count(distinct claim_id) as distinct_count\n from devforrest.core.medical_claim\n group by \n year_month\n\n union all\n\n select\n 'medical paid_date' as date_field\n , cast(date_part('year', paid_date) as TEXT) || right('0'||cast(date_part('month', paid_date) as TEXT),2) as year_month\n , count(distinct claim_id) as distinct_count\n from devforrest.core.medical_claim\n group by \n year_month\n\n union all\n\n select\n 'dispensing_date' as date_field\n , cast(date_part('year', dispensing_date) as TEXT) || right('0'||cast(date_part('month', dispensing_date) as TEXT),2) as year_month\n , count(distinct claim_id) as distinct_count\n from devforrest.core.pharmacy_claim\n group by \n year_month\n\n union all\n\n select\n 'pharmacy paid_date' as date_field\n , cast(date_part('year', paid_date) as TEXT) || right('0'||cast(date_part('month', paid_date) as TEXT),2) as year_month\n , count(distinct claim_id) as distinct_count\n from devforrest.core.pharmacy_claim\n group by \n year_month\n\n union all \n\n select\n 'member_months' as date_field\n , year_month\n , count(*) as distinct_count\n from devforrest.financial_pmpm.member_months\n group by\n year_month\n)\n\n\n, all_date_range as (\n select distinct \n replace(cal.year_month,'-','') as year_month\n from devforrest.terminology.calendar cal\n where (cal.year_month >= (select min(year_month) from date_stage)\n and cal.year_month <= (select max(year_month) from date_stage))\n \n)\n\nselect\n cast(all_date.year_month as INT ) as year_month\n , member_months.distinct_count as member_months\n , claim_start.distinct_count as claim_start_date\n , claim_end.distinct_count as claim_end_date\n , admission_date.distinct_count as admission_date\n , discharge_date.distinct_count as discharge_date\n , med_paid_date.distinct_count as medical_paid_date\n , dispensing_date.distinct_count as dispensing_date\n , pharm_paid_date.distinct_count as pharmacy_paid_date\nfrom all_date_range all_date\nleft join date_stage member_months\n on all_date.year_month = member_months.year_month\n and member_months.date_field = 'member_months'\nleft join date_stage claim_start\n on all_date.year_month = claim_start.year_month\n and claim_start.date_field = 'claim_start_date'\nleft join date_stage claim_end\n on all_date.year_month = claim_end.year_month\n and claim_end.date_field = 'claim_end_date'\nleft join date_stage admission_date\n on all_date.year_month = admission_date.year_month\n and admission_date.date_field = 'admission_date'\nleft join date_stage discharge_date\n on all_date.year_month = discharge_date.year_month\n and discharge_date.date_field = 'discharge_date'\nleft join date_stage med_paid_date\n on all_date.year_month = med_paid_date.year_month\n and med_paid_date.date_field = 'medical paid_date'\nleft join date_stage dispensing_date\n on all_date.year_month = dispensing_date.year_month\n and dispensing_date.date_field = 'dispensing_date'\nleft join date_stage pharm_paid_date\n on all_date.year_month = pharm_paid_date.year_month\n and pharm_paid_date.date_field = 'pharmacy paid_date'", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.insights__count_claim_by_service_category": {"database": "devforrest", "schema": "insights", "name": "insights__count_claim_by_service_category", "resource_type": "model", "package_name": "the_tuva_project", "path": "insights\\final\\insights__count_claim_by_service_category.sql", "original_file_path": "models\\insights\\final\\insights__count_claim_by_service_category.sql", "unique_id": "model.the_tuva_project.insights__count_claim_by_service_category", "fqn": ["the_tuva_project", "insights", "final", "insights__count_claim_by_service_category"], "alias": "count_claim_by_service_category", "checksum": {"name": "sha256", "checksum": "a609ab061fbf9f188e5f00f37160f10b8037dac58cb6f9aeb7791d235f3907ae"}, "config": {"enabled": true, "alias": "count_claim_by_service_category", "schema": "insights", "database": null, "tags": ["insights"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "bind": false, "columns": [{"name": "service_category_type", "description": "The broader service category a claim belongs to."}, {"name": "service_category", "description": "The more specific service category a claim belongs to."}, {"name": "distinct_claim_count", "description": "Count of distinct claims."}], "post-hook": [], "pre-hook": []}, "tags": ["insights"], "description": "Count of distinct claims by service category.", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://models\\insights\\insights_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "insights", "alias": "count_claim_by_service_category", "tags": ["insights"], "materialized": "table", "columns": [{"name": "service_category_type", "description": "The broader service category a claim belongs to."}, {"name": "service_category", "description": "The more specific service category a claim belongs to."}, {"name": "distinct_claim_count", "description": "Count of distinct claims."}], "enabled": true, "bind": false}, "created_at": 1702481696.9888995, "relation_name": "devforrest.insights.count_claim_by_service_category", "raw_code": "{{ config(\r\n enabled = var('insights_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r\n )\r\n}}\r\n\r\nselect \r\n 'service_category_1' as service_category_type\r\n , service_category_1 as service_category\r\n , count(distinct claim_id) as distinct_claim_count\r\nfrom {{ ref('core__medical_claim') }}\r\ngroup by service_category_1\r\n\r\nunion all\r\n\r\nselect \r\n 'service_category_2' as service_category_type\r\n , service_category_2 as service_category\r\n , count(distinct claim_id) as distinct_claim_count\r\nfrom {{ ref('core__medical_claim') }}\r\ngroup by service_category_2", "language": "sql", "refs": [["core__medical_claim"], ["core__medical_claim"]], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.core__medical_claim", "model.the_tuva_project.core__medical_claim"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\insights\\final\\insights__count_claim_by_service_category.sql", "compiled": true, "compiled_code": "\n\nselect \n 'service_category_1' as service_category_type\n , service_category_1 as service_category\n , count(distinct claim_id) as distinct_claim_count\nfrom devforrest.core.medical_claim\ngroup by service_category_1\n\nunion all\n\nselect \n 'service_category_2' as service_category_type\n , service_category_2 as service_category\n , count(distinct claim_id) as distinct_claim_count\nfrom devforrest.core.medical_claim\ngroup by service_category_2", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.insights__orphan_claim_by_claim_type": {"database": "devforrest", "schema": "insights", "name": "insights__orphan_claim_by_claim_type", "resource_type": "model", "package_name": "the_tuva_project", "path": "insights\\final\\insights__orphan_claim_by_claim_type.sql", "original_file_path": "models\\insights\\final\\insights__orphan_claim_by_claim_type.sql", "unique_id": "model.the_tuva_project.insights__orphan_claim_by_claim_type", "fqn": ["the_tuva_project", "insights", "final", "insights__orphan_claim_by_claim_type"], "alias": "orphan_claim_by_claim_type", "checksum": {"name": "sha256", "checksum": "fc94f0c9fcdd42adfdb72bc8a8d971a77a148619d31beb093850f9c46d9f5f6c"}, "config": {"enabled": true, "alias": "orphan_claim_by_claim_type", "schema": "insights", "database": null, "tags": ["insights"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "bind": false, "columns": [{"name": "claim_category", "description": "The broader claim type a claim belongs to e.g. medical or pharmacy."}, {"name": "distinct_claim_count", "description": "Count of distinct claims."}], "post-hook": [], "pre-hook": []}, "tags": ["insights"], "description": "Count of medical and pharmacy claims without a corresponding eligibilty record.", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://models\\insights\\insights_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "insights", "alias": "orphan_claim_by_claim_type", "tags": ["insights"], "materialized": "table", "columns": [{"name": "claim_category", "description": "The broader claim type a claim belongs to e.g. medical or pharmacy."}, {"name": "distinct_claim_count", "description": "Count of distinct claims."}], "enabled": true, "bind": false}, "created_at": 1702481697.00453, "relation_name": "devforrest.insights.orphan_claim_by_claim_type", "raw_code": "{{ config(\r\n enabled = var('insights_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r\n )\r\n}}\r\n\r\nwith medical_claim_orphan as(\r\nselect\r\n 'medical_claim' as claim_category\r\n , claim_id\r\n , patient_id\r\n , cast({{ date_part(\"year\", \"claim_end_date\") }} as {{ dbt.type_string() }}) || right('0'||cast({{ date_part(\"month\", \"claim_end_date\") }} as {{ dbt.type_string() }}),2) as year_month\r\nfrom {{ ref('core__medical_claim') }}\r\n)\r\n\r\n, pharmacy_claim_orphan as(\r\nselect\r\n 'pharmacy_claim' as claim_category\r\n , claim_id\r\n , patient_id\r\n , cast({{ date_part(\"year\", \"dispensing_date\") }} as {{ dbt.type_string() }}) || right('0'||cast({{ date_part(\"month\", \"dispensing_date\") }} as {{ dbt.type_string() }}),2) as year_month\r\nfrom {{ ref('core__pharmacy_claim') }}\r\n)\r\n, union_orphans as(\r\n select \r\n med.* \r\n from medical_claim_orphan med\r\n left join {{ ref('financial_pmpm__member_months') }} months\r\n on med.patient_id = months.patient_id\r\n and med.year_month = months.year_month\r\n where months.patient_id is null\r\n\r\n union all\r\n\r\n select \r\n med.* \r\n from pharmacy_claim_orphan med\r\n left join {{ ref('financial_pmpm__member_months') }} months\r\n on med.patient_id = months.patient_id\r\n and med.year_month = months.year_month\r\n where months.patient_id is null\r\n)\r\n\r\nselect\r\n claim_category\r\n , count(distinct claim_id) as distinct_claim_count\r\nfrom union_orphans\r\ngroup by claim_category", "language": "sql", "refs": [["core__medical_claim"], ["core__pharmacy_claim"], ["financial_pmpm__member_months"], ["financial_pmpm__member_months"]], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.the_tuva_project.date_part", "macro.dbt.type_string"], "nodes": ["model.the_tuva_project.core__medical_claim", "model.the_tuva_project.core__pharmacy_claim", "model.the_tuva_project.financial_pmpm__member_months", "model.the_tuva_project.financial_pmpm__member_months"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\insights\\final\\insights__orphan_claim_by_claim_type.sql", "compiled": true, "compiled_code": "\n\nwith medical_claim_orphan as(\nselect\n 'medical_claim' as claim_category\n , claim_id\n , patient_id\n , cast(date_part('year', claim_end_date) as TEXT) || right('0'||cast(date_part('month', claim_end_date) as TEXT),2) as year_month\nfrom devforrest.core.medical_claim\n)\n\n, pharmacy_claim_orphan as(\nselect\n 'pharmacy_claim' as claim_category\n , claim_id\n , patient_id\n , cast(date_part('year', dispensing_date) as TEXT) || right('0'||cast(date_part('month', dispensing_date) as TEXT),2) as year_month\nfrom devforrest.core.pharmacy_claim\n)\n, union_orphans as(\n select \n med.* \n from medical_claim_orphan med\n left join devforrest.financial_pmpm.member_months months\n on med.patient_id = months.patient_id\n and med.year_month = months.year_month\n where months.patient_id is null\n\n union all\n\n select \n med.* \n from pharmacy_claim_orphan med\n left join devforrest.financial_pmpm.member_months months\n on med.patient_id = months.patient_id\n and med.year_month = months.year_month\n where months.patient_id is null\n)\n\nselect\n claim_category\n , count(distinct claim_id) as distinct_claim_count\nfrom union_orphans\ngroup by claim_category", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.insights__sum_amount_by_claim_type": {"database": "devforrest", "schema": "insights", "name": "insights__sum_amount_by_claim_type", "resource_type": "model", "package_name": "the_tuva_project", "path": "insights\\final\\insights__sum_amount_by_claim_type.sql", "original_file_path": "models\\insights\\final\\insights__sum_amount_by_claim_type.sql", "unique_id": "model.the_tuva_project.insights__sum_amount_by_claim_type", "fqn": ["the_tuva_project", "insights", "final", "insights__sum_amount_by_claim_type"], "alias": "sum_amount_by_claim_type", "checksum": {"name": "sha256", "checksum": "1850231cfaf383fe60720e0636c24cd3a351e593aa2956e28565c008303a171d"}, "config": {"enabled": true, "alias": "sum_amount_by_claim_type", "schema": "insights", "database": null, "tags": ["insights"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "bind": false, "columns": [{"name": "claim_type", "description": "Indicates whether the claim is professional (CMS-1500), institutional (UB-04), dental, vision, or pharmacy."}, {"name": "total_paid_amount", "description": "Sum of paid_amount."}, {"name": "total_allowed_amount", "description": "Sum of allowed_amount."}, {"name": "total_charge_amount", "description": "Sum of charge_amount."}], "post-hook": [], "pre-hook": []}, "tags": ["insights"], "description": "Sum of paid_amount, allowed_amount, and charge_amount by claim type", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://models\\insights\\insights_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "insights", "alias": "sum_amount_by_claim_type", "tags": ["insights"], "materialized": "table", "columns": [{"name": "claim_type", "description": "Indicates whether the claim is professional (CMS-1500), institutional (UB-04), dental, vision, or pharmacy."}, {"name": "total_paid_amount", "description": "Sum of paid_amount."}, {"name": "total_allowed_amount", "description": "Sum of allowed_amount."}, {"name": "total_charge_amount", "description": "Sum of charge_amount."}], "enabled": true, "bind": false}, "created_at": 1702481697.00453, "relation_name": "devforrest.insights.sum_amount_by_claim_type", "raw_code": "{{ config(\r\n enabled = var('insights_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r\n )\r\n}}\r\n\r\nselect \r\n claim_type\r\n , sum(paid_amount) as total_paid_amount\r\n , sum(allowed_amount) as total_allowed_amount\r\n , sum(charge_amount) as total_charge_amount\r\nfrom {{ ref('core__medical_claim') }}\r\ngroup by claim_type\r\n\r\nunion all\r\n\r\nselect \r\n 'pharmacy'\r\n , sum(paid_amount) as total_paid_amount\r\n , sum(allowed_amount) as total_allowed_amount\r\n , null as total_charge_amount\r\nfrom {{ ref('core__pharmacy_claim') }}", "language": "sql", "refs": [["core__medical_claim"], ["core__pharmacy_claim"]], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.core__medical_claim", "model.the_tuva_project.core__pharmacy_claim"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\insights\\final\\insights__sum_amount_by_claim_type.sql", "compiled": true, "compiled_code": "\n\nselect \n claim_type\n , sum(paid_amount) as total_paid_amount\n , sum(allowed_amount) as total_allowed_amount\n , sum(charge_amount) as total_charge_amount\nfrom devforrest.core.medical_claim\ngroup by claim_type\n\nunion all\n\nselect \n 'pharmacy'\n , sum(paid_amount) as total_paid_amount\n , sum(allowed_amount) as total_allowed_amount\n , null as total_charge_amount\nfrom devforrest.core.pharmacy_claim", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.insights__sum_amount_by_service_category": {"database": "devforrest", "schema": "insights", "name": "insights__sum_amount_by_service_category", "resource_type": "model", "package_name": "the_tuva_project", "path": "insights\\final\\insights__sum_amount_by_service_category.sql", "original_file_path": "models\\insights\\final\\insights__sum_amount_by_service_category.sql", "unique_id": "model.the_tuva_project.insights__sum_amount_by_service_category", "fqn": ["the_tuva_project", "insights", "final", "insights__sum_amount_by_service_category"], "alias": "sum_amount_by_service_category", "checksum": {"name": "sha256", "checksum": "d6b11197aed8609cfdb1117b04d8c31dabdd622025616b92b2d82264f9436cf8"}, "config": {"enabled": true, "alias": "sum_amount_by_service_category", "schema": "insights", "database": null, "tags": ["insights"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "bind": false, "columns": [{"name": "service_category_type", "description": "The broader service category a claim belongs to."}, {"name": "service_category", "description": "The more specific service category a claim belongs to."}, {"name": "total_paid_amount", "description": "Sum of paid_amount."}, {"name": "total_allowed_amount", "description": "Sum of allowed_amount."}, {"name": "total_charge_amount", "description": "Sum of charge_amount."}], "post-hook": [], "pre-hook": []}, "tags": ["insights"], "description": "Sum of paid_amount, allowed_amount, and charge_amount by service category", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://models\\insights\\insights_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "insights", "alias": "sum_amount_by_service_category", "tags": ["insights"], "materialized": "table", "columns": [{"name": "service_category_type", "description": "The broader service category a claim belongs to."}, {"name": "service_category", "description": "The more specific service category a claim belongs to."}, {"name": "total_paid_amount", "description": "Sum of paid_amount."}, {"name": "total_allowed_amount", "description": "Sum of allowed_amount."}, {"name": "total_charge_amount", "description": "Sum of charge_amount."}], "enabled": true, "bind": false}, "created_at": 1702481697.00453, "relation_name": "devforrest.insights.sum_amount_by_service_category", "raw_code": "{{ config(\r\n enabled = var('insights_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r\n )\r\n}}\r\n\r\nselect\r\n 'service_category_1' as service_category_type\r\n , service_category_1\r\n , sum(paid_amount) as total_paid_amount\r\n , sum(allowed_amount) as total_allowed_amount\r\n , sum(charge_amount) as total_charge_amount\r\nfrom {{ ref('core__medical_claim') }}\r\ngroup by service_category_1\r\n\r\nunion all\r\n\r\nselect\r\n 'service_category_2' as service_category_type\r\n , service_category_2\r\n , sum(paid_amount) as total_paid_amount\r\n , sum(allowed_amount) as total_allowed_amount\r\n , sum(charge_amount) as total_charge_amount\r\nfrom {{ ref('core__medical_claim') }}\r\ngroup by service_category_2", "language": "sql", "refs": [["core__medical_claim"], ["core__medical_claim"]], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.core__medical_claim", "model.the_tuva_project.core__medical_claim"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\insights\\final\\insights__sum_amount_by_service_category.sql", "compiled": true, "compiled_code": "\n\nselect\n 'service_category_1' as service_category_type\n , service_category_1\n , sum(paid_amount) as total_paid_amount\n , sum(allowed_amount) as total_allowed_amount\n , sum(charge_amount) as total_charge_amount\nfrom devforrest.core.medical_claim\ngroup by service_category_1\n\nunion all\n\nselect\n 'service_category_2' as service_category_type\n , service_category_2\n , sum(paid_amount) as total_paid_amount\n , sum(allowed_amount) as total_allowed_amount\n , sum(charge_amount) as total_charge_amount\nfrom devforrest.core.medical_claim\ngroup by service_category_2", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.insights__trend_count_claim_by_claim_type": {"database": "devforrest", "schema": "insights", "name": "insights__trend_count_claim_by_claim_type", "resource_type": "model", "package_name": "the_tuva_project", "path": "insights\\final\\insights__trend_count_claim_by_claim_type.sql", "original_file_path": "models\\insights\\final\\insights__trend_count_claim_by_claim_type.sql", "unique_id": "model.the_tuva_project.insights__trend_count_claim_by_claim_type", "fqn": ["the_tuva_project", "insights", "final", "insights__trend_count_claim_by_claim_type"], "alias": "trend_count_claim_by_claim_type", "checksum": {"name": "sha256", "checksum": "840c120c80c7edd82f4b970067c62781f8f517a7fde240f3dbfe0ed69f4b7ab4"}, "config": {"enabled": true, "alias": "trend_count_claim_by_claim_type", "schema": "insights", "database": null, "tags": ["insights"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "bind": false, "columns": [{"name": "year_month", "description": "Year and month of the claim end date."}, {"name": "claim_type", "description": "Indicates whether the claim is professional (CMS-1500), institutional (UB-04), dental, or vision."}, {"name": "distinct_claim_count", "description": "Count of distinct claims."}, {"name": "distinct_claim_count_change", "description": "Change in distinct claim count from the previous year month."}, {"name": "distinct_claim_percentage_change", "description": "Percent in distinct claim count change from the previous year month."}], "post-hook": [], "pre-hook": []}, "tags": ["insights"], "description": "Monthly trend of distinct claims by claim type", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://models\\insights\\insights_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "insights", "alias": "trend_count_claim_by_claim_type", "tags": ["insights"], "materialized": "table", "columns": [{"name": "year_month", "description": "Year and month of the claim end date."}, {"name": "claim_type", "description": "Indicates whether the claim is professional (CMS-1500), institutional (UB-04), dental, or vision."}, {"name": "distinct_claim_count", "description": "Count of distinct claims."}, {"name": "distinct_claim_count_change", "description": "Change in distinct claim count from the previous year month."}, {"name": "distinct_claim_percentage_change", "description": "Percent in distinct claim count change from the previous year month."}], "enabled": true, "bind": false}, "created_at": 1702481697.021361, "relation_name": "devforrest.insights.trend_count_claim_by_claim_type", "raw_code": "{{ config(\r\n enabled = var('insights_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r\n )\r\n}}\r\n\r\nwith trend_by_claim_type as(\r\n select\r\n cast({{ date_part(\"year\", \"claim_end_date\") }} as {{ dbt.type_string() }}) || right('0'||cast({{ date_part(\"month\", \"claim_end_date\") }} as {{ dbt.type_string() }}),2) as year_month\r\n , claim_type\r\n , count(distinct claim_id) as distinct_claim_count\r\n from {{ ref('core__medical_claim') }}\r\n group by \r\n year_month\r\n , claim_type\r\n)\r\n, trend_with_previous_count as(\r\n select \r\n year_month\r\n , claim_type\r\n , distinct_claim_count\r\n , lag(distinct_claim_count) over (partition by claim_type order by year_month) as previous_distinct_claim_count\r\n from trend_by_claim_type\r\n)\r\n\r\nselect\r\n year_month\r\n , claim_type\r\n , distinct_claim_count\r\n , distinct_claim_count - previous_distinct_claim_count as distinct_claim_count_change\r\n , case\r\n when distinct_claim_count <> 0 then ((distinct_claim_count-previous_distinct_claim_count) / distinct_claim_count) * 100 \r\n else distinct_claim_count\r\n end as distinct_claim_percentage_change\r\nfrom trend_with_previous_count", "language": "sql", "refs": [["core__medical_claim"]], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.the_tuva_project.date_part", "macro.dbt.type_string"], "nodes": ["model.the_tuva_project.core__medical_claim"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\insights\\final\\insights__trend_count_claim_by_claim_type.sql", "compiled": true, "compiled_code": "\n\nwith trend_by_claim_type as(\n select\n cast(date_part('year', claim_end_date) as TEXT) || right('0'||cast(date_part('month', claim_end_date) as TEXT),2) as year_month\n , claim_type\n , count(distinct claim_id) as distinct_claim_count\n from devforrest.core.medical_claim\n group by \n year_month\n , claim_type\n)\n, trend_with_previous_count as(\n select \n year_month\n , claim_type\n , distinct_claim_count\n , lag(distinct_claim_count) over (partition by claim_type order by year_month) as previous_distinct_claim_count\n from trend_by_claim_type\n)\n\nselect\n year_month\n , claim_type\n , distinct_claim_count\n , distinct_claim_count - previous_distinct_claim_count as distinct_claim_count_change\n , case\n when distinct_claim_count <> 0 then ((distinct_claim_count-previous_distinct_claim_count) / distinct_claim_count) * 100 \n else distinct_claim_count\n end as distinct_claim_percentage_change\nfrom trend_with_previous_count", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.insights__trend_count_claim_by_service_category": {"database": "devforrest", "schema": "insights", "name": "insights__trend_count_claim_by_service_category", "resource_type": "model", "package_name": "the_tuva_project", "path": "insights\\final\\insights__trend_count_claim_by_service_category.sql", "original_file_path": "models\\insights\\final\\insights__trend_count_claim_by_service_category.sql", "unique_id": "model.the_tuva_project.insights__trend_count_claim_by_service_category", "fqn": ["the_tuva_project", "insights", "final", "insights__trend_count_claim_by_service_category"], "alias": "trend_count_claim_by_service_category", "checksum": {"name": "sha256", "checksum": "f3ca33dfdd8f451c8c44b16b2b2037d08430e93eb153e92965b8593be400562e"}, "config": {"enabled": true, "alias": "trend_count_claim_by_service_category", "schema": "insights", "database": null, "tags": ["insights"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "bind": false, "columns": [{"name": "year_month", "description": "Year and month of the claim end date"}, {"name": "service_category", "description": "The more specific service category a claim belongs to."}, {"name": "distinct_claim_count", "description": "Count of distinct claims."}, {"name": "distinct_claim_count_change", "description": "Change in distinct claim count from the previous year month."}, {"name": "distinct_claim_percentage_change", "description": "Percent in distinct claim count change from the previous year month."}], "post-hook": [], "pre-hook": []}, "tags": ["insights"], "description": "Monthly trend of distinct claims by service category", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://models\\insights\\insights_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "insights", "alias": "trend_count_claim_by_service_category", "tags": ["insights"], "materialized": "table", "columns": [{"name": "year_month", "description": "Year and month of the claim end date"}, {"name": "service_category", "description": "The more specific service category a claim belongs to."}, {"name": "distinct_claim_count", "description": "Count of distinct claims."}, {"name": "distinct_claim_count_change", "description": "Change in distinct claim count from the previous year month."}, {"name": "distinct_claim_percentage_change", "description": "Percent in distinct claim count change from the previous year month."}], "enabled": true, "bind": false}, "created_at": 1702481697.026548, "relation_name": "devforrest.insights.trend_count_claim_by_service_category", "raw_code": "{{ config(\r\n enabled = var('insights_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r\n )\r\n}}\r\n\r\nwith trend_by_service_category_1 as (\r\n select \r\n cast({{ date_part(\"year\", \"claim_end_date\") }} as {{ dbt.type_string() }}) || right('0'||cast({{ date_part(\"month\", \"claim_end_date\") }} as {{ dbt.type_string() }}),2) as year_month\r\n , service_category_1\r\n , count(distinct claim_id) as distinct_claim_count\r\n from {{ ref('core__medical_claim') }}\r\n group by \r\n year_month\r\n , service_category_1\r\n)\r\n, trend_by_service_category_2 as (\r\n select \r\n cast({{ date_part(\"year\", \"claim_end_date\") }} as {{ dbt.type_string() }}) || right('0'||cast({{ date_part(\"month\", \"claim_end_date\") }} as {{ dbt.type_string() }}),2) as year_month\r\n , service_category_2\r\n , count(distinct claim_id) as distinct_claim_count\r\n from {{ ref('core__medical_claim') }}\r\n group by \r\n year_month\r\n , service_category_2\r\n)\r\n, previous_service_category_1_claim_count as(\r\n select\r\n year_month\r\n , service_category_1\r\n , distinct_claim_count\r\n , lag(distinct_claim_count) over (partition by service_category_1 order by year_month) as previous_distinct_claim_count\r\n from trend_by_service_category_1\r\n)\r\n, previous_service_category_2_claim_count as(\r\n select\r\n year_month\r\n , service_category_2\r\n , distinct_claim_count\r\n , lag(distinct_claim_count) over (partition by service_category_2 order by year_month) as previous_distinct_claim_count\r\n from trend_by_service_category_2\r\n)\r\nselect \r\n year_month\r\n , service_category_1 as service_category\r\n , distinct_claim_count\r\n , distinct_claim_count-previous_distinct_claim_count as distinct_claim_count_change\r\n , case\r\n when distinct_claim_count <> 0 then ((distinct_claim_count-previous_distinct_claim_count) / distinct_claim_count) * 100 \r\n else distinct_claim_count\r\n end as distinct_claim_percentage_change\r\nfrom previous_service_category_1_claim_count\r\n\r\n union all\r\n\r\n select \r\n year_month\r\n , service_category_2 as service_category\r\n , distinct_claim_count\r\n , distinct_claim_count-previous_distinct_claim_count as distinct_claim_count_change\r\n , case\r\n when distinct_claim_count <> 0 then ((distinct_claim_count-previous_distinct_claim_count) / distinct_claim_count) * 100 \r\n else distinct_claim_count\r\n end as distinct_claim_percentage_change\r\nfrom previous_service_category_2_claim_count", "language": "sql", "refs": [["core__medical_claim"], ["core__medical_claim"]], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.the_tuva_project.date_part", "macro.dbt.type_string"], "nodes": ["model.the_tuva_project.core__medical_claim", "model.the_tuva_project.core__medical_claim"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\insights\\final\\insights__trend_count_claim_by_service_category.sql", "compiled": true, "compiled_code": "\n\nwith trend_by_service_category_1 as (\n select \n cast(date_part('year', claim_end_date) as TEXT) || right('0'||cast(date_part('month', claim_end_date) as TEXT),2) as year_month\n , service_category_1\n , count(distinct claim_id) as distinct_claim_count\n from devforrest.core.medical_claim\n group by \n year_month\n , service_category_1\n)\n, trend_by_service_category_2 as (\n select \n cast(date_part('year', claim_end_date) as TEXT) || right('0'||cast(date_part('month', claim_end_date) as TEXT),2) as year_month\n , service_category_2\n , count(distinct claim_id) as distinct_claim_count\n from devforrest.core.medical_claim\n group by \n year_month\n , service_category_2\n)\n, previous_service_category_1_claim_count as(\n select\n year_month\n , service_category_1\n , distinct_claim_count\n , lag(distinct_claim_count) over (partition by service_category_1 order by year_month) as previous_distinct_claim_count\n from trend_by_service_category_1\n)\n, previous_service_category_2_claim_count as(\n select\n year_month\n , service_category_2\n , distinct_claim_count\n , lag(distinct_claim_count) over (partition by service_category_2 order by year_month) as previous_distinct_claim_count\n from trend_by_service_category_2\n)\nselect \n year_month\n , service_category_1 as service_category\n , distinct_claim_count\n , distinct_claim_count-previous_distinct_claim_count as distinct_claim_count_change\n , case\n when distinct_claim_count <> 0 then ((distinct_claim_count-previous_distinct_claim_count) / distinct_claim_count) * 100 \n else distinct_claim_count\n end as distinct_claim_percentage_change\nfrom previous_service_category_1_claim_count\n\n union all\n\n select \n year_month\n , service_category_2 as service_category\n , distinct_claim_count\n , distinct_claim_count-previous_distinct_claim_count as distinct_claim_count_change\n , case\n when distinct_claim_count <> 0 then ((distinct_claim_count-previous_distinct_claim_count) / distinct_claim_count) * 100 \n else distinct_claim_count\n end as distinct_claim_percentage_change\nfrom previous_service_category_2_claim_count", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.insights__trend_sum_amount_by_claim_type": {"database": "devforrest", "schema": "insights", "name": "insights__trend_sum_amount_by_claim_type", "resource_type": "model", "package_name": "the_tuva_project", "path": "insights\\final\\insights__trend_sum_amount_by_claim_type.sql", "original_file_path": "models\\insights\\final\\insights__trend_sum_amount_by_claim_type.sql", "unique_id": "model.the_tuva_project.insights__trend_sum_amount_by_claim_type", "fqn": ["the_tuva_project", "insights", "final", "insights__trend_sum_amount_by_claim_type"], "alias": "trend_sum_amount_by_claim_type", "checksum": {"name": "sha256", "checksum": "4e464a22d2d898b7d5fd096f3bd16bb3c57a887875544aef1e01c17ebd857ec6"}, "config": {"enabled": true, "alias": "trend_sum_amount_by_claim_type", "schema": "insights", "database": null, "tags": ["insights"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "bind": false, "columns": [{"name": "year_month", "description": "Year and month of the claim end date"}, {"name": "claim_type", "description": "Indicates whether the claim is professional (CMS-1500), institutional (UB-04), dental, vision, or pharmacy."}, {"name": "total_paid_amount", "description": "Sum of paid_amount."}, {"name": "total_paid_amount_change", "description": "Change in paid_amount from the previous month."}, {"name": "total_paid_amount_percent_change", "description": "Percent change in paid_amount from the previous month."}, {"name": "total_allowed_amount", "description": "Sum of allowed_amount."}, {"name": "total_allowed_amount_change", "description": "Change in allowed_amount from the previous month."}, {"name": "total_allowed_amount_percent_change", "description": "Percent change in allowed_amount from the previous month."}, {"name": "total_charge_amount", "description": "Sum of charge_amount."}, {"name": "total_charge_amount_change", "description": "Change in charge_amount from the previous month."}, {"name": "total_charge_amount_percent_change", "description": "Percent change in charge_amount from the previous month."}], "post-hook": [], "pre-hook": []}, "tags": ["insights"], "description": "Monthly trend of paid_amount, alllowed_amount, and charge_amount by claim type", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://models\\insights\\insights_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "insights", "alias": "trend_sum_amount_by_claim_type", "tags": ["insights"], "materialized": "table", "columns": [{"name": "year_month", "description": "Year and month of the claim end date"}, {"name": "claim_type", "description": "Indicates whether the claim is professional (CMS-1500), institutional (UB-04), dental, vision, or pharmacy."}, {"name": "total_paid_amount", "description": "Sum of paid_amount."}, {"name": "total_paid_amount_change", "description": "Change in paid_amount from the previous month."}, {"name": "total_paid_amount_percent_change", "description": "Percent change in paid_amount from the previous month."}, {"name": "total_allowed_amount", "description": "Sum of allowed_amount."}, {"name": "total_allowed_amount_change", "description": "Change in allowed_amount from the previous month."}, {"name": "total_allowed_amount_percent_change", "description": "Percent change in allowed_amount from the previous month."}, {"name": "total_charge_amount", "description": "Sum of charge_amount."}, {"name": "total_charge_amount_change", "description": "Change in charge_amount from the previous month."}, {"name": "total_charge_amount_percent_change", "description": "Percent change in charge_amount from the previous month."}], "enabled": true, "bind": false}, "created_at": 1702481697.0335348, "relation_name": "devforrest.insights.trend_sum_amount_by_claim_type", "raw_code": "{{ config(\r\n enabled = var('insights_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r\n )\r\n}}\r\n\r\nwith trend_by_medical_claim_type as(\r\n select\r\n cast({{ date_part(\"year\", \"claim_end_date\") }} as {{ dbt.type_string() }}) || right('0'||cast({{ date_part(\"month\", \"claim_end_date\") }} as {{ dbt.type_string() }}),2) as year_month\r\n , claim_type\r\n , sum(paid_amount) as total_paid_amount\r\n , sum(allowed_amount) as total_allowed_amount\r\n , sum(charge_amount) as total_charge_amount\r\n from {{ ref('core__medical_claim') }}\r\n group by \r\n year_month\r\n , claim_type\r\n)\r\n, trend_by_pharmacy_claim_type as(\r\n select\r\n cast({{ date_part(\"year\", \"dispensing_date\") }} as {{ dbt.type_string() }}) || right('0'||cast({{ date_part(\"month\", \"dispensing_date\") }} as {{ dbt.type_string() }}),2) as year_month\r\n , cast('pharmacy' as {{ dbt.type_string() }}) as claim_type\r\n , sum(paid_amount) as total_paid_amount\r\n , sum(allowed_amount) as total_allowed_amount\r\n , 0 as total_charge_amount\r\n from {{ ref('core__pharmacy_claim') }}\r\n group by \r\n year_month\r\n)\r\n, trend_with_previous_medical_sum as(\r\n select \r\n year_month\r\n , claim_type\r\n , total_paid_amount\r\n , lag(total_paid_amount) over (partition by claim_type order by year_month) as previous_total_paid_amount\r\n , total_allowed_amount\r\n , lag(total_allowed_amount) over (partition by claim_type order by year_month) as previous_total_allowed_amount\r\n , total_charge_amount\r\n , lag(total_charge_amount) over (partition by claim_type order by year_month) as previous_total_charge_amount\r\n from trend_by_medical_claim_type\r\n)\r\n, trend_with_previous_pharmacy_sum as(\r\n select \r\n year_month\r\n , claim_type\r\n , total_paid_amount\r\n , lag(total_paid_amount) over (partition by claim_type order by year_month) as previous_total_paid_amount\r\n , total_allowed_amount\r\n , lag(total_allowed_amount) over (partition by claim_type order by year_month) as previous_total_allowed_amount\r\n , total_charge_amount\r\n , lag(total_charge_amount) over (partition by claim_type order by year_month) as previous_total_charge_amount\r\n from trend_by_pharmacy_claim_type\r\n)\r\nselect\r\n year_month\r\n , claim_type\r\n , total_paid_amount\r\n , total_paid_amount - previous_total_paid_amount as total_paid_amount_change\r\n , case \r\n when total_paid_amount <> 0 then ((total_paid_amount - previous_total_paid_amount)/total_paid_amount)*100\r\n else total_paid_amount\r\n end as total_paid_amount_percent_change\r\n , total_allowed_amount\r\n , total_allowed_amount - previous_total_allowed_amount as total_allowed_amount_change\r\n , case \r\n when total_allowed_amount <> 0 then ((total_allowed_amount - previous_total_allowed_amount)/total_allowed_amount)*100\r\n else total_allowed_amount\r\n end as total_allowed_amount_percent_change\r\n , total_charge_amount\r\n , total_charge_amount - previous_total_charge_amount as total_charge_amount_change\r\n , case \r\n when total_charge_amount <> 0 then ((total_charge_amount - previous_total_charge_amount)/total_charge_amount)*100\r\n else total_charge_amount\r\n end as total_charge_amount_percent_change\r\nfrom trend_with_previous_medical_sum\r\n\r\nunion all \r\n\r\nselect\r\n year_month\r\n , claim_type\r\n , total_paid_amount\r\n , total_paid_amount - previous_total_paid_amount as total_paid_amount_change\r\n , case \r\n when total_paid_amount <> 0 then ((total_paid_amount - previous_total_paid_amount)/total_paid_amount)*100\r\n else total_paid_amount\r\n end as total_paid_amount_percent_change\r\n , total_allowed_amount\r\n , total_allowed_amount - previous_total_allowed_amount as total_allowed_amount_change\r\n , case \r\n when total_allowed_amount <> 0 then ((total_allowed_amount - previous_total_allowed_amount)/total_allowed_amount)*100\r\n else total_allowed_amount\r\n end as total_allowed_amount_percent_change\r\n , total_charge_amount\r\n , total_charge_amount - previous_total_charge_amount as total_charge_amount_change\r\n , case \r\n when total_charge_amount <> 0 then ((total_charge_amount - previous_total_charge_amount)/total_charge_amount)*100\r\n else total_charge_amount\r\n end as total_charge_amount_percent_change\r\nfrom trend_with_previous_pharmacy_sum", "language": "sql", "refs": [["core__medical_claim"], ["core__pharmacy_claim"]], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.the_tuva_project.date_part", "macro.dbt.type_string"], "nodes": ["model.the_tuva_project.core__medical_claim", "model.the_tuva_project.core__pharmacy_claim"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\insights\\final\\insights__trend_sum_amount_by_claim_type.sql", "compiled": true, "compiled_code": "\n\nwith trend_by_medical_claim_type as(\n select\n cast(date_part('year', claim_end_date) as TEXT) || right('0'||cast(date_part('month', claim_end_date) as TEXT),2) as year_month\n , claim_type\n , sum(paid_amount) as total_paid_amount\n , sum(allowed_amount) as total_allowed_amount\n , sum(charge_amount) as total_charge_amount\n from devforrest.core.medical_claim\n group by \n year_month\n , claim_type\n)\n, trend_by_pharmacy_claim_type as(\n select\n cast(date_part('year', dispensing_date) as TEXT) || right('0'||cast(date_part('month', dispensing_date) as TEXT),2) as year_month\n , cast('pharmacy' as TEXT) as claim_type\n , sum(paid_amount) as total_paid_amount\n , sum(allowed_amount) as total_allowed_amount\n , 0 as total_charge_amount\n from devforrest.core.pharmacy_claim\n group by \n year_month\n)\n, trend_with_previous_medical_sum as(\n select \n year_month\n , claim_type\n , total_paid_amount\n , lag(total_paid_amount) over (partition by claim_type order by year_month) as previous_total_paid_amount\n , total_allowed_amount\n , lag(total_allowed_amount) over (partition by claim_type order by year_month) as previous_total_allowed_amount\n , total_charge_amount\n , lag(total_charge_amount) over (partition by claim_type order by year_month) as previous_total_charge_amount\n from trend_by_medical_claim_type\n)\n, trend_with_previous_pharmacy_sum as(\n select \n year_month\n , claim_type\n , total_paid_amount\n , lag(total_paid_amount) over (partition by claim_type order by year_month) as previous_total_paid_amount\n , total_allowed_amount\n , lag(total_allowed_amount) over (partition by claim_type order by year_month) as previous_total_allowed_amount\n , total_charge_amount\n , lag(total_charge_amount) over (partition by claim_type order by year_month) as previous_total_charge_amount\n from trend_by_pharmacy_claim_type\n)\nselect\n year_month\n , claim_type\n , total_paid_amount\n , total_paid_amount - previous_total_paid_amount as total_paid_amount_change\n , case \n when total_paid_amount <> 0 then ((total_paid_amount - previous_total_paid_amount)/total_paid_amount)*100\n else total_paid_amount\n end as total_paid_amount_percent_change\n , total_allowed_amount\n , total_allowed_amount - previous_total_allowed_amount as total_allowed_amount_change\n , case \n when total_allowed_amount <> 0 then ((total_allowed_amount - previous_total_allowed_amount)/total_allowed_amount)*100\n else total_allowed_amount\n end as total_allowed_amount_percent_change\n , total_charge_amount\n , total_charge_amount - previous_total_charge_amount as total_charge_amount_change\n , case \n when total_charge_amount <> 0 then ((total_charge_amount - previous_total_charge_amount)/total_charge_amount)*100\n else total_charge_amount\n end as total_charge_amount_percent_change\nfrom trend_with_previous_medical_sum\n\nunion all \n\nselect\n year_month\n , claim_type\n , total_paid_amount\n , total_paid_amount - previous_total_paid_amount as total_paid_amount_change\n , case \n when total_paid_amount <> 0 then ((total_paid_amount - previous_total_paid_amount)/total_paid_amount)*100\n else total_paid_amount\n end as total_paid_amount_percent_change\n , total_allowed_amount\n , total_allowed_amount - previous_total_allowed_amount as total_allowed_amount_change\n , case \n when total_allowed_amount <> 0 then ((total_allowed_amount - previous_total_allowed_amount)/total_allowed_amount)*100\n else total_allowed_amount\n end as total_allowed_amount_percent_change\n , total_charge_amount\n , total_charge_amount - previous_total_charge_amount as total_charge_amount_change\n , case \n when total_charge_amount <> 0 then ((total_charge_amount - previous_total_charge_amount)/total_charge_amount)*100\n else total_charge_amount\n end as total_charge_amount_percent_change\nfrom trend_with_previous_pharmacy_sum", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.insights__trend_sum_amount_by_service_category": {"database": "devforrest", "schema": "insights", "name": "insights__trend_sum_amount_by_service_category", "resource_type": "model", "package_name": "the_tuva_project", "path": "insights\\final\\insights__trend_sum_amount_by_service_category.sql", "original_file_path": "models\\insights\\final\\insights__trend_sum_amount_by_service_category.sql", "unique_id": "model.the_tuva_project.insights__trend_sum_amount_by_service_category", "fqn": ["the_tuva_project", "insights", "final", "insights__trend_sum_amount_by_service_category"], "alias": "trend_sum_amount_by_service_category", "checksum": {"name": "sha256", "checksum": "d1729b1b296fed0f471e170e1314fafbdbcacbab452faed47fb0731e2fc5f1e8"}, "config": {"enabled": true, "alias": "trend_sum_amount_by_service_category", "schema": "insights", "database": null, "tags": ["insights"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "bind": false, "columns": [{"name": "year_month", "description": "Year and month of the claim end date"}, {"name": "service_category_type", "description": "The broader service category a claim belongs to."}, {"name": "service_category", "description": "The more specific service category a claim belongs to."}, {"name": "total_paid_amount", "description": "Sum of paid_amount."}, {"name": "total_paid_amount_change", "description": "Change in paid_amount from the previous month."}, {"name": "total_paid_amount_percent_change", "description": "Percent change in paid_amount from the previous month."}, {"name": "total_allowed_amount", "description": "Sum of allowed_amount."}, {"name": "total_allowed_amount_change", "description": "Change in allowed_amount from the previous month."}, {"name": "total_allowed_amount_percent_change", "description": "Percent change in allowed_amount from the previous month."}, {"name": "total_charge_amount", "description": "Sum of charge_amount."}, {"name": "total_charge_amount_change", "description": "Change in charge_amount from the previous month."}, {"name": "total_charge_amount_percent_change", "description": "Percent change in charge_amount from the previous month."}], "post-hook": [], "pre-hook": []}, "tags": ["insights"], "description": "Monthly trend of paid_amount, alllowed_amount, and charge_amount by service category", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://models\\insights\\insights_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "insights", "alias": "trend_sum_amount_by_service_category", "tags": ["insights"], "materialized": "table", "columns": [{"name": "year_month", "description": "Year and month of the claim end date"}, {"name": "service_category_type", "description": "The broader service category a claim belongs to."}, {"name": "service_category", "description": "The more specific service category a claim belongs to."}, {"name": "total_paid_amount", "description": "Sum of paid_amount."}, {"name": "total_paid_amount_change", "description": "Change in paid_amount from the previous month."}, {"name": "total_paid_amount_percent_change", "description": "Percent change in paid_amount from the previous month."}, {"name": "total_allowed_amount", "description": "Sum of allowed_amount."}, {"name": "total_allowed_amount_change", "description": "Change in allowed_amount from the previous month."}, {"name": "total_allowed_amount_percent_change", "description": "Percent change in allowed_amount from the previous month."}, {"name": "total_charge_amount", "description": "Sum of charge_amount."}, {"name": "total_charge_amount_change", "description": "Change in charge_amount from the previous month."}, {"name": "total_charge_amount_percent_change", "description": "Percent change in charge_amount from the previous month."}], "enabled": true, "bind": false}, "created_at": 1702481697.0416276, "relation_name": "devforrest.insights.trend_sum_amount_by_service_category", "raw_code": "{{ config(\r\n enabled = var('insights_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r\n )\r\n}}\r\n\r\n\r\nwith trend_by_service_category_1 as(\r\n select\r\n cast({{ date_part(\"year\", \"claim_end_date\") }} as {{ dbt.type_string() }}) || right('0'||cast({{ date_part(\"month\", \"claim_end_date\") }} as {{ dbt.type_string() }}),2) as year_month\r\n , 'service_category_1' as service_category_type\r\n , service_category_1 as service_category\r\n , sum(paid_amount) as total_paid_amount\r\n , sum(allowed_amount) as total_allowed_amount\r\n , sum(charge_amount) as total_charge_amount\r\n from {{ ref('core__medical_claim') }}\r\n group by \r\n year_month\r\n , service_category_1\r\n)\r\n, trend_by_service_category_2 as(\r\n select\r\n cast({{ date_part(\"year\", \"claim_end_date\") }} as {{ dbt.type_string() }}) || right('0'||cast({{ date_part(\"month\", \"claim_end_date\") }} as {{ dbt.type_string() }}),2) as year_month\r\n , 'service_category_2' as service_category_type\r\n , service_category_2 as service_category\r\n , sum(paid_amount) as total_paid_amount\r\n , sum(allowed_amount) as total_allowed_amount\r\n , sum(charge_amount) as total_charge_amount\r\n from {{ ref('core__medical_claim') }}\r\n group by \r\n year_month\r\n , service_category_2\r\n)\r\n, trend_with_previous_service_category_1_sum as(\r\n select \r\n year_month\r\n , service_category_type\r\n , service_category\r\n , total_paid_amount\r\n , lag(total_paid_amount) over (partition by service_category order by year_month) as previous_total_paid_amount\r\n , total_allowed_amount\r\n , lag(total_allowed_amount) over (partition by service_category order by year_month) as previous_total_allowed_amount\r\n , total_charge_amount\r\n , lag(total_charge_amount) over (partition by service_category order by year_month) as previous_total_charge_amount\r\n from trend_by_service_category_1\r\n)\r\n, trend_with_previous_service_category_2_sum as(\r\n select \r\n year_month\r\n , service_category_type\r\n , service_category\r\n , total_paid_amount\r\n , lag(total_paid_amount) over (partition by service_category order by year_month) as previous_total_paid_amount\r\n , total_allowed_amount\r\n , lag(total_allowed_amount) over (partition by service_category order by year_month) as previous_total_allowed_amount\r\n , total_charge_amount\r\n , lag(total_charge_amount) over (partition by service_category order by year_month) as previous_total_charge_amount\r\n from trend_by_service_category_2\r\n)\r\nselect\r\n year_month\r\n , service_category_type\r\n , service_category\r\n , total_paid_amount\r\n , total_paid_amount - previous_total_paid_amount as total_paid_amount_change\r\n , case \r\n when total_paid_amount <> 0 then ((total_paid_amount - previous_total_paid_amount)/total_paid_amount)*100\r\n else total_paid_amount\r\n end as total_paid_amount_percent_change\r\n , total_allowed_amount\r\n , total_allowed_amount - previous_total_allowed_amount as total_allowed_amount_change\r\n , case \r\n when total_allowed_amount <> 0 then ((total_allowed_amount - previous_total_allowed_amount)/total_allowed_amount)*100\r\n else total_allowed_amount\r\n end as total_allowed_amount_percent_change\r\n , total_charge_amount\r\n , total_charge_amount - previous_total_charge_amount as total_charge_amount_change\r\n , case \r\n when total_charge_amount <> 0 then ((total_charge_amount - previous_total_charge_amount)/total_charge_amount)*100\r\n else total_charge_amount\r\n end as total_charge_amount_percent_change\r\nfrom trend_with_previous_service_category_1_sum\r\n\r\nunion all \r\n\r\nselect\r\n year_month\r\n , service_category_type\r\n , service_category\r\n , total_paid_amount\r\n , total_paid_amount - previous_total_paid_amount as total_paid_amount_change\r\n , case \r\n when total_paid_amount <> 0 then ((total_paid_amount - previous_total_paid_amount)/total_paid_amount)*100\r\n else total_paid_amount\r\n end as total_paid_amount_percent_change\r\n , total_allowed_amount\r\n , total_allowed_amount - previous_total_allowed_amount as total_allowed_amount_change\r\n , case \r\n when total_allowed_amount <> 0 then ((total_allowed_amount - previous_total_allowed_amount)/total_allowed_amount)*100\r\n else total_allowed_amount\r\n end as total_allowed_amount_percent_change\r\n , total_charge_amount\r\n , total_charge_amount - previous_total_charge_amount as total_charge_amount_change\r\n , case \r\n when total_charge_amount <> 0 then ((total_charge_amount - previous_total_charge_amount)/total_charge_amount)*100\r\n else total_charge_amount\r\n end as total_charge_amount_percent_change\r\nfrom trend_with_previous_service_category_2_sum", "language": "sql", "refs": [["core__medical_claim"], ["core__medical_claim"]], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.the_tuva_project.date_part", "macro.dbt.type_string"], "nodes": ["model.the_tuva_project.core__medical_claim", "model.the_tuva_project.core__medical_claim"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\insights\\final\\insights__trend_sum_amount_by_service_category.sql", "compiled": true, "compiled_code": "\n\n\nwith trend_by_service_category_1 as(\n select\n cast(date_part('year', claim_end_date) as TEXT) || right('0'||cast(date_part('month', claim_end_date) as TEXT),2) as year_month\n , 'service_category_1' as service_category_type\n , service_category_1 as service_category\n , sum(paid_amount) as total_paid_amount\n , sum(allowed_amount) as total_allowed_amount\n , sum(charge_amount) as total_charge_amount\n from devforrest.core.medical_claim\n group by \n year_month\n , service_category_1\n)\n, trend_by_service_category_2 as(\n select\n cast(date_part('year', claim_end_date) as TEXT) || right('0'||cast(date_part('month', claim_end_date) as TEXT),2) as year_month\n , 'service_category_2' as service_category_type\n , service_category_2 as service_category\n , sum(paid_amount) as total_paid_amount\n , sum(allowed_amount) as total_allowed_amount\n , sum(charge_amount) as total_charge_amount\n from devforrest.core.medical_claim\n group by \n year_month\n , service_category_2\n)\n, trend_with_previous_service_category_1_sum as(\n select \n year_month\n , service_category_type\n , service_category\n , total_paid_amount\n , lag(total_paid_amount) over (partition by service_category order by year_month) as previous_total_paid_amount\n , total_allowed_amount\n , lag(total_allowed_amount) over (partition by service_category order by year_month) as previous_total_allowed_amount\n , total_charge_amount\n , lag(total_charge_amount) over (partition by service_category order by year_month) as previous_total_charge_amount\n from trend_by_service_category_1\n)\n, trend_with_previous_service_category_2_sum as(\n select \n year_month\n , service_category_type\n , service_category\n , total_paid_amount\n , lag(total_paid_amount) over (partition by service_category order by year_month) as previous_total_paid_amount\n , total_allowed_amount\n , lag(total_allowed_amount) over (partition by service_category order by year_month) as previous_total_allowed_amount\n , total_charge_amount\n , lag(total_charge_amount) over (partition by service_category order by year_month) as previous_total_charge_amount\n from trend_by_service_category_2\n)\nselect\n year_month\n , service_category_type\n , service_category\n , total_paid_amount\n , total_paid_amount - previous_total_paid_amount as total_paid_amount_change\n , case \n when total_paid_amount <> 0 then ((total_paid_amount - previous_total_paid_amount)/total_paid_amount)*100\n else total_paid_amount\n end as total_paid_amount_percent_change\n , total_allowed_amount\n , total_allowed_amount - previous_total_allowed_amount as total_allowed_amount_change\n , case \n when total_allowed_amount <> 0 then ((total_allowed_amount - previous_total_allowed_amount)/total_allowed_amount)*100\n else total_allowed_amount\n end as total_allowed_amount_percent_change\n , total_charge_amount\n , total_charge_amount - previous_total_charge_amount as total_charge_amount_change\n , case \n when total_charge_amount <> 0 then ((total_charge_amount - previous_total_charge_amount)/total_charge_amount)*100\n else total_charge_amount\n end as total_charge_amount_percent_change\nfrom trend_with_previous_service_category_1_sum\n\nunion all \n\nselect\n year_month\n , service_category_type\n , service_category\n , total_paid_amount\n , total_paid_amount - previous_total_paid_amount as total_paid_amount_change\n , case \n when total_paid_amount <> 0 then ((total_paid_amount - previous_total_paid_amount)/total_paid_amount)*100\n else total_paid_amount\n end as total_paid_amount_percent_change\n , total_allowed_amount\n , total_allowed_amount - previous_total_allowed_amount as total_allowed_amount_change\n , case \n when total_allowed_amount <> 0 then ((total_allowed_amount - previous_total_allowed_amount)/total_allowed_amount)*100\n else total_allowed_amount\n end as total_allowed_amount_percent_change\n , total_charge_amount\n , total_charge_amount - previous_total_charge_amount as total_charge_amount_change\n , case \n when total_charge_amount <> 0 then ((total_charge_amount - previous_total_charge_amount)/total_charge_amount)*100\n else total_charge_amount\n end as total_charge_amount_percent_change\nfrom trend_with_previous_service_category_2_sum", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.quality_measures__summary_wide": {"database": "devforrest", "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": "1039adb16e1c4c92cc731d17fad90d7cd052a32da688ecc5e0acefcc636ecb56"}, "config": {"enabled": true, "alias": "summary_wide", "schema": "quality_measures", "database": null, "tags": ["quality_measures"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["quality_measures"], "description": "Wide view of the results for the reporting version of all measures. This model pivots measures on the patient level (i.e. one row per patient with flags for each measure. The false flags can be treated as care gaps as exclusions have been included in the pivot logic.\n", "columns": {"patient_id": {"name": "patient_id", "description": "Unique patient_id for each person.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "nqf_2372": {"name": "nqf_2372", "description": "Each measure has a boolean flag which is the result of evaluating the denominator, numerator, and exclusion indicators for the patient. A null indicates that the measure was not applicable for the patient.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The date and timestamp of the dbt run.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://models\\quality_measures\\quality_measures_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "quality_measures", "alias": "summary_wide", "tags": "quality_measures", "materialized": "table", "enabled": true, "bind": false}, "created_at": 1702481697.1113484, "relation_name": "devforrest.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, nqf_0034 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 = 'NQF0034'\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 left join nqf_0034\r\n on measures_long.patient_id = nqf_0034.patient_id\r\n\r\n)\r\n\r\n, add_data_types as (\r\n\r\n select\r\n cast(patient_id as {{ dbt.type_string() }}) as patient_id\r\n , cast(nqf_2372 as integer) as nqf_2372\r\n from joined\r\n\r\n)\r\n\r\nselect\r\n patient_id\r\n , nqf_2372\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom add_data_types", "language": "sql", "refs": [["quality_measures__summary_long"]], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.type_string"], "nodes": ["model.the_tuva_project.quality_measures__summary_long"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\quality_measures\\final\\quality_measures__summary_wide.sql", "compiled": true, "compiled_code": "\n\n/*\n Each measure is pivoted into a boolean column by evaluating the\n denominator, numerator, and exclusion flags.\n*/\nwith measures_long as (\n\n select\n patient_id\n , denominator_flag\n , numerator_flag\n , exclusion_flag\n , measure_id\n from devforrest.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, nqf_0034 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 = 'NQF0034'\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 left join nqf_0034\n on measures_long.patient_id = nqf_0034.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-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom add_data_types", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.quality_measures__int_nqf0034_denominator": {"database": "devforrest", "schema": "quality_measures", "name": "quality_measures__int_nqf0034_denominator", "resource_type": "model", "package_name": "the_tuva_project", "path": "quality_measures\\intermediate\\nqf0034_colorectal_cancer_screening\\quality_measures__int_nqf0034_denominator.sql", "original_file_path": "models\\quality_measures\\intermediate\\nqf0034_colorectal_cancer_screening\\quality_measures__int_nqf0034_denominator.sql", "unique_id": "model.the_tuva_project.quality_measures__int_nqf0034_denominator", "fqn": ["the_tuva_project", "quality_measures", "intermediate", "nqf0034_colorectal_cancer_screening", "quality_measures__int_nqf0034_denominator"], "alias": "_int_nqf0034_denominator", "checksum": {"name": "sha256", "checksum": "4490a14b80a0fe0f21477c3db24119f1c2f794e4a5057af8dabd897fc2a1fb43"}, "config": {"enabled": true, "alias": "_int_nqf0034_denominator", "schema": "quality_measures", "database": null, "tags": ["quality_measures"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["quality_measures"], "description": "Denominator logic for the reporting version of NQF 0034, Colorectal Cancer Screening. \n", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://models\\quality_measures\\quality_measures_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "quality_measures", "alias": "_int_nqf0034_denominator", "tags": "quality_measures", "materialized": "table", "enabled": true, "bind": false}, "created_at": 1702481697.159808, "relation_name": "devforrest.quality_measures._int_nqf0034_denominator", "raw_code": "{{ config(\r\n enabled = var('quality_measures_enabled',var('claims_enabled',var('clinical_enabled',var('tuva_marts_enabled',False))))\r\n )\r\n}}\r\n\r\n/*\r\nDENOMINATOR:\r\nPatients 45-75 years of age with a visit during the measurement period\r\nDENOMINATOR NOTE: To assess the age for exclusions, the patient\u2019s age on the date of the encounter\r\nshould be used\r\n*Signifies that this CPT Category I code is a non-covered service under the Medicare Part B Physician Fee\r\nSchedule (PFS). These non-covered services should be counted in the denominator population for MIPS\r\nCQMs.\r\nDenominator Criteria (Eligible Cases):\r\nPatients 45 to 75 years of age on date of encounter\r\nAND\r\nPatient encounter during the performance period (CPT or HCPCS): 99202, 99203, 99204, 99205,\r\n99212, 99213, 99214, 99215, 99341, 99342, 99344, 99345, 99347, 99348, 99349, 99350, 99386*, 99387*,\r\n99396*, 99397*, G0438, G0439\r\n*/\r\n\r\nwith visit_codes as (\r\n\r\n select\r\n code\r\n , code_system\r\n from {{ ref('quality_measures__value_sets') }}\r\n where concept_name in (\r\n 'Office Visit'\r\n , 'Home Healthcare Services'\r\n , 'Preventive Care Services Established Office Visit, 18 and Up'\r\n , 'Preventive Care Services Initial Office Visit, 18 and Up'\r\n , 'Annual Wellness Visit'\r\n , 'Telephone Visits'\r\n , 'Online Assessments'\r\n )\r\n\r\n), visits_encounters as (\r\n select PATIENT_ID\r\n , coalesce(ENCOUNTER.ENCOUNTER_START_DATE,ENCOUNTER.ENCOUNTER_END_DATE) as min_date\r\n , coalesce(ENCOUNTER.ENCOUNTER_END_DATE,ENCOUNTER.ENCOUNTER_START_DATE) as max_date\r\n From {{ref('quality_measures__stg_core__encounter')}} encounter\r\n inner join {{ref('quality_measures__int_nqf0034__performance_period')}} as pp\r\n on coalesce(ENCOUNTER.ENCOUNTER_END_DATE,ENCOUNTER.ENCOUNTER_START_DATE) >= pp.performance_period_begin\r\n and coalesce(ENCOUNTER.ENCOUNTER_START_DATE,ENCOUNTER.ENCOUNTER_END_DATE) <= pp.performance_period_end\r\n where ENCOUNTER_TYPE in (\r\n 'home health'\r\n , 'office visit'\r\n , 'outpatient'\r\n , 'outpatient rehabilitation'\r\n , 'telehealth'\r\n )\r\n\r\n\r\n )\r\n\r\n,procedure_encounters as (\r\n select patient_id, PROCEDURE_DATE as min_date, PROCEDURE_DATE as max_date\r\n from {{ref('quality_measures__stg_core__procedure')}} proc\r\n inner join {{ref('quality_measures__int_nqf0034__performance_period')}} as pp\r\n on PROCEDURE_DATE between pp.performance_period_begin and pp.performance_period_end\r\n inner join visit_codes\r\n on coalesce(proc.normalized_code,proc.source_code) = visit_codes.code\r\n\r\n\r\n)\r\n,\r\nclaims_encounters as (\r\n select PATIENT_ID\r\n , coalesce(CLAIM_START_DATE,CLAIM_END_DATE) as min_date\r\n , coalesce(CLAIM_END_DATE,CLAIM_START_DATE) as max_date\r\n from {{ref('quality_measures__stg_medical_claim')}} medical_claim\r\n inner join {{ref('quality_measures__int_nqf0034__performance_period')}} as pp on\r\n coalesce(CLAIM_END_DATE,CLAIM_START_DATE) >= pp.performance_period_begin\r\n and coalesce(CLAIM_START_DATE,CLAIM_END_DATE) <= pp.performance_period_end\r\n inner join visit_codes\r\n on medical_claim.hcpcs_code= visit_codes.code\r\n\r\n\r\n)\r\n\r\n,all_encounters as (\r\n select *, 'v' as visit_enc,cast(null as {{ dbt.type_string() }}) as proc_enc, cast(null as {{ dbt.type_string() }}) as claim_enc\r\n from visits_encounters\r\n union all\r\n select *, cast(null as {{ dbt.type_string() }}) as visit_enc, 'p' as proc_enc, cast(null as {{ dbt.type_string() }}) as claim_enc\r\n from procedure_encounters\r\n union all\r\n select *, cast(null as {{ dbt.type_string() }}) as visit_enc,cast(null as {{ dbt.type_string() }}) as proc_enc, 'c' as claim_enc\r\n from claims_encounters\r\n)\r\n\r\n, encounters_by_patient as (\r\n select patient_id,min(min_date) min_date, max(max_date) max_date,\r\n concat(concat(\r\n coalesce(min(visit_enc),'')\r\n ,coalesce(min(proc_enc),''))\r\n ,coalesce(min(claim_enc),'')\r\n ) as qualifying_types\r\n from all_encounters\r\n group by patient_id\r\n)\r\n\r\n, patients_with_age as (\r\n select\r\n p.PATIENT_ID\r\n , min_date\r\n , floor({{ datediff('birth_date', 'e.min_date', 'hour') }} / 8766.0) as min_age\r\n , max_date\r\n ,floor({{ datediff('birth_date', 'e.max_date', 'hour') }} / 8766.0) as max_age\r\n , qualifying_types\r\n from {{ref('quality_measures__stg_core__patient')}} p\r\n inner join encounters_by_patient e\r\n on p.PATIENT_ID = e.PATIENT_ID\r\n where p.BIRTH_DATE is not null\r\n\r\n)\r\n\r\nselect PATIENT_ID,\r\n min_age,\r\n max_age,\r\n qualifying_types\r\nFrom patients_with_age\r\nwhere max_age >= 45 and min_age <= 75", "language": "sql", "refs": [["quality_measures__value_sets"], ["quality_measures__stg_core__encounter"], ["quality_measures__int_nqf0034__performance_period"], ["quality_measures__stg_core__procedure"], ["quality_measures__int_nqf0034__performance_period"], ["quality_measures__stg_medical_claim"], ["quality_measures__int_nqf0034__performance_period"], ["quality_measures__stg_core__patient"]], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.type_string", "macro.dbt.datediff"], "nodes": ["seed.the_tuva_project.quality_measures__value_sets", "model.the_tuva_project.quality_measures__stg_core__encounter", "model.the_tuva_project.quality_measures__int_nqf0034__performance_period", "model.the_tuva_project.quality_measures__stg_core__procedure", "model.the_tuva_project.quality_measures__int_nqf0034__performance_period", "model.the_tuva_project.quality_measures__stg_medical_claim", "model.the_tuva_project.quality_measures__int_nqf0034__performance_period", "model.the_tuva_project.quality_measures__stg_core__patient"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\quality_measures\\intermediate\\nqf0034_colorectal_cancer_screening\\quality_measures__int_nqf0034_denominator.sql", "compiled": true, "compiled_code": "\n\n/*\nDENOMINATOR:\nPatients 45-75 years of age with a visit during the measurement period\nDENOMINATOR NOTE: To assess the age for exclusions, the patient\u2019s age on the date of the encounter\nshould be used\n*Signifies that this CPT Category I code is a non-covered service under the Medicare Part B Physician Fee\nSchedule (PFS). These non-covered services should be counted in the denominator population for MIPS\nCQMs.\nDenominator Criteria (Eligible Cases):\nPatients 45 to 75 years of age on date of encounter\nAND\nPatient encounter during the performance period (CPT or HCPCS): 99202, 99203, 99204, 99205,\n99212, 99213, 99214, 99215, 99341, 99342, 99344, 99345, 99347, 99348, 99349, 99350, 99386*, 99387*,\n99396*, 99397*, G0438, G0439\n*/\n\nwith __dbt__cte__quality_measures__stg_core__encounter as (\n\n\nselect\n patient_id\n , encounter_type\n , encounter_start_date\n , encounter_end_date\n , '2023-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom devforrest.core.encounter\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-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom devforrest.core.procedure\n), __dbt__cte__quality_measures__stg_medical_claim as (\n\n\nselect\n patient_id\n , claim_id\n , claim_start_date\n , claim_end_date\n , place_of_service_code\n , hcpcs_code\n , '2023-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom devforrest.core.medical_claim\n\n\n), __dbt__cte__quality_measures__stg_core__patient as (\n\nselect\n patient_id\n , sex\n , birth_date\n , death_date\n , '2023-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom devforrest.core.patient\n),visit_codes as (\n\n select\n code\n , code_system\n from devforrest.quality_measures._value_set_codes\n where concept_name in (\n 'Office Visit'\n , 'Home Healthcare Services'\n , 'Preventive Care Services Established Office Visit, 18 and Up'\n , 'Preventive Care Services Initial Office Visit, 18 and Up'\n , 'Annual Wellness Visit'\n , 'Telephone Visits'\n , 'Online Assessments'\n )\n\n), visits_encounters as (\n select PATIENT_ID\n , coalesce(ENCOUNTER.ENCOUNTER_START_DATE,ENCOUNTER.ENCOUNTER_END_DATE) as min_date\n , coalesce(ENCOUNTER.ENCOUNTER_END_DATE,ENCOUNTER.ENCOUNTER_START_DATE) as max_date\n From __dbt__cte__quality_measures__stg_core__encounter encounter\n inner join devforrest.quality_measures._int_nqf0034__performance_period as pp\n on coalesce(ENCOUNTER.ENCOUNTER_END_DATE,ENCOUNTER.ENCOUNTER_START_DATE) >= pp.performance_period_begin\n and coalesce(ENCOUNTER.ENCOUNTER_START_DATE,ENCOUNTER.ENCOUNTER_END_DATE) <= pp.performance_period_end\n where ENCOUNTER_TYPE in (\n 'home health'\n , 'office visit'\n , 'outpatient'\n , 'outpatient rehabilitation'\n , 'telehealth'\n )\n\n\n )\n\n,procedure_encounters as (\n select patient_id, PROCEDURE_DATE as min_date, PROCEDURE_DATE as max_date\n from __dbt__cte__quality_measures__stg_core__procedure proc\n inner join devforrest.quality_measures._int_nqf0034__performance_period as pp\n on PROCEDURE_DATE between pp.performance_period_begin and pp.performance_period_end\n inner join visit_codes\n on coalesce(proc.normalized_code,proc.source_code) = visit_codes.code\n\n\n)\n,\nclaims_encounters as (\n select PATIENT_ID\n , coalesce(CLAIM_START_DATE,CLAIM_END_DATE) as min_date\n , coalesce(CLAIM_END_DATE,CLAIM_START_DATE) as max_date\n from __dbt__cte__quality_measures__stg_medical_claim medical_claim\n inner join devforrest.quality_measures._int_nqf0034__performance_period as pp on\n coalesce(CLAIM_END_DATE,CLAIM_START_DATE) >= pp.performance_period_begin\n and coalesce(CLAIM_START_DATE,CLAIM_END_DATE) <= pp.performance_period_end\n inner join visit_codes\n on medical_claim.hcpcs_code= visit_codes.code\n\n\n)\n\n,all_encounters as (\n select *, 'v' as visit_enc,cast(null as TEXT) as proc_enc, cast(null as TEXT) as claim_enc\n from visits_encounters\n union all\n select *, cast(null as TEXT) as visit_enc, 'p' as proc_enc, cast(null as TEXT) as claim_enc\n from procedure_encounters\n union all\n select *, cast(null as TEXT) as visit_enc,cast(null as TEXT) as proc_enc, 'c' as claim_enc\n from claims_encounters\n)\n\n, encounters_by_patient as (\n select patient_id,min(min_date) min_date, max(max_date) max_date,\n concat(concat(\n coalesce(min(visit_enc),'')\n ,coalesce(min(proc_enc),''))\n ,coalesce(min(claim_enc),'')\n ) as qualifying_types\n from all_encounters\n group by patient_id\n)\n\n, patients_with_age as (\n select\n p.PATIENT_ID\n , min_date\n , floor(datediff(\n hour,\n birth_date,\n e.min_date\n ) / 8766.0) as min_age\n , max_date\n ,floor(datediff(\n hour,\n birth_date,\n e.max_date\n ) / 8766.0) as max_age\n , qualifying_types\n from __dbt__cte__quality_measures__stg_core__patient p\n inner join encounters_by_patient e\n on p.PATIENT_ID = e.PATIENT_ID\n where p.BIRTH_DATE is not null\n\n)\n\nselect PATIENT_ID,\n min_age,\n max_age,\n qualifying_types\nFrom patients_with_age\nwhere max_age >= 45 and min_age <= 75", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.the_tuva_project.quality_measures__stg_core__encounter", "sql": " __dbt__cte__quality_measures__stg_core__encounter as (\n\n\nselect\n patient_id\n , encounter_type\n , encounter_start_date\n , encounter_end_date\n , '2023-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom devforrest.core.encounter\n\n\n)"}, {"id": "model.the_tuva_project.quality_measures__stg_core__procedure", "sql": " __dbt__cte__quality_measures__stg_core__procedure as (\n\nselect\n patient_id\n , procedure_date\n , source_code_type\n , source_code\n , normalized_code_type\n , normalized_code\n , '2023-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom devforrest.core.procedure\n)"}, {"id": "model.the_tuva_project.quality_measures__stg_medical_claim", "sql": " __dbt__cte__quality_measures__stg_medical_claim as (\n\n\nselect\n patient_id\n , claim_id\n , claim_start_date\n , claim_end_date\n , place_of_service_code\n , hcpcs_code\n , '2023-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom devforrest.core.medical_claim\n\n\n)"}, {"id": "model.the_tuva_project.quality_measures__stg_core__patient", "sql": " __dbt__cte__quality_measures__stg_core__patient as (\n\nselect\n patient_id\n , sex\n , birth_date\n , death_date\n , '2023-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom devforrest.core.patient\n)"}]}, "model.the_tuva_project.quality_measures__int_nqf0034_exclude_advanced_illness": {"database": "devforrest", "schema": "quality_measures", "name": "quality_measures__int_nqf0034_exclude_advanced_illness", "resource_type": "model", "package_name": "the_tuva_project", "path": "quality_measures\\intermediate\\nqf0034_colorectal_cancer_screening\\quality_measures__int_nqf0034_exclude_advanced_illness.sql", "original_file_path": "models\\quality_measures\\intermediate\\nqf0034_colorectal_cancer_screening\\quality_measures__int_nqf0034_exclude_advanced_illness.sql", "unique_id": "model.the_tuva_project.quality_measures__int_nqf0034_exclude_advanced_illness", "fqn": ["the_tuva_project", "quality_measures", "intermediate", "nqf0034_colorectal_cancer_screening", "quality_measures__int_nqf0034_exclude_advanced_illness"], "alias": "_int_nqf0034_exclude_advanced_illness", "checksum": {"name": "sha256", "checksum": "cc5220abd042c9f8661adfaca9bc7ca9bde5b4aed3c31903f86169284d55ecaa"}, "config": {"enabled": true, "alias": "_int_nqf0034_exclude_advanced_illness", "schema": "quality_measures", "database": null, "tags": ["quality_measures"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["quality_measures"], "description": "Exclusion logic for patients with frailty and advanced illness for the reporting version of NQF 0034, Colorectal Cancer Screening. \n", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://models\\quality_measures\\quality_measures_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "quality_measures", "alias": "_int_nqf0034_exclude_advanced_illness", "tags": "quality_measures", "materialized": "table", "enabled": true, "bind": false}, "created_at": 1702481697.159808, "relation_name": "devforrest.quality_measures._int_nqf0034_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 encounter_exclusion_codes as (\r\n\r\n select\r\n code\r\n , code_system\r\n , concept_name\r\n , case when concept_name = 'Acute Inpatient' then 'Acute Inpatient'\r\n else 'Other Encounter' end as concept_category\r\n , case when concept_name = 'Acute Inpatient' then 1\r\n else 2 end as qualifying_count\r\n from {{ ref('quality_measures__value_sets') }}\r\n where concept_name in (\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, condition_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 'Advanced Illness'\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 select\r\n conditions.patient_id\r\n , conditions.claim_id\r\n , conditions.recorded_date\r\n , condition_exclusion_codes.concept_name\r\n from conditions\r\n inner join {{ref('quality_measures__int_nqf0034__performance_period')}} pp\r\n on conditions.recorded_date between pp.performance_period_begin_1yp and pp.performance_period_end\r\n inner join condition_exclusion_codes\r\n on conditions.code = condition_exclusion_codes.code\r\n and conditions.code_type = condition_exclusion_codes.code_system\r\n\r\n union all\r\n select\r\n observations.patient_id\r\n , cast(null as {{ dbt.type_string() }}) as claim_id\r\n , observations.observation_date\r\n , condition_exclusion_codes.concept_name\r\n from observations\r\n inner join {{ref('quality_measures__int_nqf0034__performance_period')}} pp\r\n on observations.observation_date between pp.performance_period_begin_1yp and pp.performance_period_end\r\n\r\n inner join condition_exclusion_codes\r\n on observations.code = condition_exclusion_codes.code\r\n and observations.code_type = condition_exclusion_codes.code_system\r\n\r\n\r\n\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 , encounter_exclusion_codes.concept_name\r\n , encounter_exclusion_codes.concept_category\r\n , encounter_exclusion_codes.qualifying_count\r\n from medical_claim\r\n inner join {{ref('quality_measures__int_nqf0034__performance_period')}} pp\r\n on coalesce(medical_claim.claim_start_date,medical_claim.claim_end_date) between pp.performance_period_begin_1yp and pp.performance_period_end\r\n inner join encounter_exclusion_codes\r\n on medical_claim.hcpcs_code = encounter_exclusion_codes.code\r\n where encounter_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 , encounter_exclusion_codes.concept_name\r\n , encounter_exclusion_codes.concept_category\r\n , encounter_exclusion_codes.qualifying_count\r\n from observations\r\n inner join {{ref('quality_measures__int_nqf0034__performance_period')}} pp\r\n on observations.observation_date between pp.performance_period_begin_1yp and pp.performance_period_end\r\n\r\n inner join encounter_exclusion_codes\r\n on observations.code = encounter_exclusion_codes.code\r\n and observations.code_type = encounter_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 , encounter_exclusion_codes.concept_name\r\n , encounter_exclusion_codes.concept_category\r\n , encounter_exclusion_codes.qualifying_count\r\n from procedures\r\n inner join {{ref('quality_measures__int_nqf0034__performance_period')}} pp\r\n on procedures.procedure_date between pp.performance_period_begin_1yp and pp.performance_period_end\r\n\r\n inner join encounter_exclusion_codes\r\n on procedures.code = encounter_exclusion_codes.code\r\n and procedures.code_type = encounter_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 patient_id\r\n , exclusion_date\r\n , concept_name\r\nfrom {{ref('quality_measures__int_nqf0034__frailty')}}\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 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, encounters_with_conditions 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 , med_claim_exclusions.concept_category\r\n , med_claim_exclusions.qualifying_count\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\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 , observation_exclusions.concept_category\r\n , observation_exclusions.qualifying_count\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 inner join condition_exclusions\r\n on observation_exclusions.patient_id = condition_exclusions.patient_id\r\n and observation_exclusions.observation_date = condition_exclusions.recorded_date\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 , procedure_exclusions.concept_category\r\n , procedure_exclusions.qualifying_count\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\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\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\r\n\r\n, qualifying_encounters as (\r\n\r\n select\r\n patient_id\r\n , exclusion_date\r\n , exclusion_reason\r\nfrom encounters_with_conditions e\r\nqualify dense_rank() over(partition by patient_id,concept_category order by exclusion_date) >= qualifying_count\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 qualifying_encounters", "language": "sql", "refs": [["quality_measures__value_sets"], ["quality_measures__value_sets"], ["quality_measures__stg_core__condition"], ["quality_measures__stg_medical_claim"], ["quality_measures__stg_core__observation"], ["quality_measures__stg_core__procedure"], ["quality_measures__int_nqf0034__performance_period"], ["quality_measures__int_nqf0034__performance_period"], ["quality_measures__int_nqf0034__performance_period"], ["quality_measures__int_nqf0034__performance_period"], ["quality_measures__int_nqf0034__performance_period"], ["quality_measures__int_nqf0034__frailty"]], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.type_string"], "nodes": ["seed.the_tuva_project.quality_measures__value_sets", "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", "model.the_tuva_project.quality_measures__int_nqf0034__performance_period", "model.the_tuva_project.quality_measures__int_nqf0034__performance_period", "model.the_tuva_project.quality_measures__int_nqf0034__performance_period", "model.the_tuva_project.quality_measures__int_nqf0034__performance_period", "model.the_tuva_project.quality_measures__int_nqf0034__performance_period", "model.the_tuva_project.quality_measures__int_nqf0034__frailty"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\quality_measures\\intermediate\\nqf0034_colorectal_cancer_screening\\quality_measures__int_nqf0034_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-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom devforrest.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-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom devforrest.core.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-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom devforrest.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-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom devforrest.core.procedure\n),encounter_exclusion_codes as (\n\n select\n code\n , code_system\n , concept_name\n , case when concept_name = 'Acute Inpatient' then 'Acute Inpatient'\n else 'Other Encounter' end as concept_category\n , case when concept_name = 'Acute Inpatient' then 1\n else 2 end as qualifying_count\n from devforrest.quality_measures._value_set_codes\n where concept_name in (\n 'Acute Inpatient'\n , 'Encounter Inpatient'\n , 'Outpatient'\n , 'Observation'\n , 'Emergency Department Visit'\n , 'Nonacute Inpatient'\n )\n\n)\n\n, condition_exclusion_codes as (\n\n select\n code\n , code_system\n , concept_name\n from devforrest.quality_measures._value_set_codes\n where concept_name in (\n 'Advanced Illness'\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 select\n conditions.patient_id\n , conditions.claim_id\n , conditions.recorded_date\n , condition_exclusion_codes.concept_name\n from conditions\n inner join devforrest.quality_measures._int_nqf0034__performance_period pp\n on conditions.recorded_date between pp.performance_period_begin_1yp and pp.performance_period_end\n inner join condition_exclusion_codes\n on conditions.code = condition_exclusion_codes.code\n and conditions.code_type = condition_exclusion_codes.code_system\n\n union all\n select\n observations.patient_id\n , cast(null as TEXT) as claim_id\n , observations.observation_date\n , condition_exclusion_codes.concept_name\n from observations\n inner join devforrest.quality_measures._int_nqf0034__performance_period pp\n on observations.observation_date between pp.performance_period_begin_1yp and pp.performance_period_end\n\n inner join condition_exclusion_codes\n on observations.code = condition_exclusion_codes.code\n and observations.code_type = condition_exclusion_codes.code_system\n\n\n\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 , encounter_exclusion_codes.concept_name\n , encounter_exclusion_codes.concept_category\n , encounter_exclusion_codes.qualifying_count\n from medical_claim\n inner join devforrest.quality_measures._int_nqf0034__performance_period pp\n on coalesce(medical_claim.claim_start_date,medical_claim.claim_end_date) between pp.performance_period_begin_1yp and pp.performance_period_end\n inner join encounter_exclusion_codes\n on medical_claim.hcpcs_code = encounter_exclusion_codes.code\n where encounter_exclusion_codes.code_system = 'hcpcs'\n\n)\n\n, observation_exclusions as (\n\n select\n observations.patient_id\n , observations.observation_date\n , encounter_exclusion_codes.concept_name\n , encounter_exclusion_codes.concept_category\n , encounter_exclusion_codes.qualifying_count\n from observations\n inner join devforrest.quality_measures._int_nqf0034__performance_period pp\n on observations.observation_date between pp.performance_period_begin_1yp and pp.performance_period_end\n\n inner join encounter_exclusion_codes\n on observations.code = encounter_exclusion_codes.code\n and observations.code_type = encounter_exclusion_codes.code_system\n\n)\n\n, procedure_exclusions as (\n\n select\n procedures.patient_id\n , procedures.procedure_date\n , encounter_exclusion_codes.concept_name\n , encounter_exclusion_codes.concept_category\n , encounter_exclusion_codes.qualifying_count\n from procedures\n inner join devforrest.quality_measures._int_nqf0034__performance_period pp\n on procedures.procedure_date between pp.performance_period_begin_1yp and pp.performance_period_end\n\n inner join encounter_exclusion_codes\n on procedures.code = encounter_exclusion_codes.code\n and procedures.code_type = encounter_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 patient_id\n , exclusion_date\n , concept_name\nfrom devforrest.quality_measures._int_nqf0034__frailty\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 one acute inpatient encounter with a diagnosis of advanced illness\n during measurement period or the year prior to measurement period\n*/\n, encounters_with_conditions 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 , med_claim_exclusions.concept_category\n , med_claim_exclusions.qualifying_count\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\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 , observation_exclusions.concept_category\n , observation_exclusions.qualifying_count\n from patients_with_frailty\n inner join observation_exclusions\n on patients_with_frailty.patient_id = observation_exclusions.patient_id\n inner join condition_exclusions\n on observation_exclusions.patient_id = condition_exclusions.patient_id\n and observation_exclusions.observation_date = condition_exclusions.recorded_date\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 , procedure_exclusions.concept_category\n , procedure_exclusions.qualifying_count\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\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\n/*\n Filter to patients who have had one acute inpatient encounter or\n two nonacute outpatient encounters\n*/\n\n\n, qualifying_encounters as (\n\n select\n patient_id\n , exclusion_date\n , exclusion_reason\nfrom encounters_with_conditions e\nqualify dense_rank() over(partition by patient_id,concept_category order by exclusion_date) >= qualifying_count\n)\n\nselect\n patient_id\n , exclusion_date\n , exclusion_reason\n , '2023-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom qualifying_encounters", "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-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom devforrest.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-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom devforrest.core.medical_claim\n\n\n)"}, {"id": "model.the_tuva_project.quality_measures__stg_core__observation", "sql": " __dbt__cte__quality_measures__stg_core__observation as (\n\n\nselect\n patient_id\n , observation_date\n , source_code_type\n , source_code\n , normalized_code_type\n , normalized_code\n , '2023-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom devforrest.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-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom devforrest.core.procedure\n)"}]}, "model.the_tuva_project.quality_measures__int_nqf0034_exclude_colectomy_cancer": {"database": "devforrest", "schema": "quality_measures", "name": "quality_measures__int_nqf0034_exclude_colectomy_cancer", "resource_type": "model", "package_name": "the_tuva_project", "path": "quality_measures\\intermediate\\nqf0034_colorectal_cancer_screening\\quality_measures__int_nqf0034_exclude_colectomy_cancer.sql", "original_file_path": "models\\quality_measures\\intermediate\\nqf0034_colorectal_cancer_screening\\quality_measures__int_nqf0034_exclude_colectomy_cancer.sql", "unique_id": "model.the_tuva_project.quality_measures__int_nqf0034_exclude_colectomy_cancer", "fqn": ["the_tuva_project", "quality_measures", "intermediate", "nqf0034_colorectal_cancer_screening", "quality_measures__int_nqf0034_exclude_colectomy_cancer"], "alias": "_int_nqf0034_exclude_colectomy_cancer", "checksum": {"name": "sha256", "checksum": "945f5710e87b3f54c84bcfbd44c65a8a584264a56e482768d402f79aad514533"}, "config": {"enabled": true, "alias": "_int_nqf0034_exclude_colectomy_cancer", "schema": "quality_measures", "database": null, "tags": ["quality_measures"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["quality_measures"], "description": "Exclusion logic for patients with frailty and advanced illness for the reporting version of NQF 0034, Colorectal Cancer Screening. \n", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://models\\quality_measures\\quality_measures_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "quality_measures", "alias": "_int_nqf0034_exclude_colectomy_cancer", "tags": "quality_measures", "materialized": "table", "enabled": true, "bind": false}, "created_at": 1702481697.159808, "relation_name": "devforrest.quality_measures._int_nqf0034_exclude_colectomy_cancer", "raw_code": "{{ config(\r\n enabled = var('quality_measures_enabled',var('claims_enabled',var('clinical_enabled',var('tuva_marts_enabled',False))))\r\n )\r\n}}\r\n\r\n/*\r\nDENOMINATOR EXCLUSIONS:\r\nPatients with a diagnosis or past history of total colectomy or colorectal cancer: G9711\r\n*/\r\n\r\n\r\nwith exclusion_codes as (\r\n select\r\n code\r\n , case code_system\r\n when 'SNOMEDCT' then 'snomed-ct'\r\n when 'ICD9CM' then 'icd-9-cm'\r\n when 'ICD10CM' then 'icd-10-cm'\r\n when 'CPT' then 'hcpcs'\r\n when 'ICD10PCS' then 'icd-10-pcs'\r\n else lower(code_system) end as code_system\r\n , concept_name\r\n From {{ref('quality_measures__value_sets')}}\r\n where concept_name in (\r\n 'Malignant Neoplasm of Colon'\r\n , 'Total Colectomy'\r\n )\r\n\r\n)\r\n\r\n, conditions as (\r\n\r\n select\r\n patient_id\r\n , claim_id\r\n , recorded_date\r\n , coalesce (\r\n normalized_code_type\r\n , case\r\n when lower(source_code_type) = 'snomed' then 'snomed-ct'\r\n else lower(source_code_type)\r\n end\r\n ) as code_type\r\n , coalesce (\r\n normalized_code\r\n , source_code\r\n ) as code\r\n from {{ ref('quality_measures__stg_core__condition') }}\r\n\r\n)\r\n\r\n, medical_claim as (\r\n\r\n select\r\n patient_id\r\n , claim_id\r\n , claim_start_date\r\n , claim_end_date\r\n , hcpcs_code\r\n , place_of_service_code\r\n from {{ ref('quality_measures__stg_medical_claim') }}\r\n\r\n)\r\n\r\n, observations as (\r\n\r\n select\r\n patient_id\r\n , observation_date\r\n , coalesce (\r\n normalized_code_type\r\n , case\r\n when lower(source_code_type) = 'cpt' then 'hcpcs'\r\n when lower(source_code_type) = 'snomed' then 'snomed-ct'\r\n else lower(source_code_type)\r\n end\r\n ) as code_type\r\n , coalesce (\r\n normalized_code\r\n , source_code\r\n ) as code\r\n from {{ ref('quality_measures__stg_core__observation') }}\r\n\r\n)\r\n\r\n, procedures as (\r\n\r\n select\r\n patient_id\r\n , procedure_date\r\n , coalesce (\r\n normalized_code_type\r\n , case\r\n when lower(source_code_type) = 'cpt' then 'hcpcs'\r\n when lower(source_code_type) = 'snomed' then 'snomed-ct'\r\n else lower(source_code_type)\r\n end\r\n ) as code_type\r\n , coalesce (\r\n normalized_code\r\n , source_code\r\n ) as code\r\n from {{ ref('quality_measures__stg_core__procedure') }}\r\n\r\n)\r\n\r\n, condition_exclusions as (\r\n\r\n select\r\n conditions.patient_id\r\n , conditions.claim_id\r\n , conditions.recorded_date\r\n , exclusion_codes.concept_name as concept_name\r\n from conditions\r\n inner join exclusion_codes\r\n on conditions.code = exclusion_codes.code\r\n and conditions.code_type = exclusion_codes.code_system\r\n\r\n)\r\n\r\n, med_claim_exclusions as (\r\n\r\n select\r\n medical_claim.patient_id\r\n , medical_claim.claim_id\r\n , medical_claim.claim_start_date\r\n , medical_claim.claim_end_date\r\n , medical_claim.hcpcs_code\r\n , exclusion_codes.concept_name as concept_name\r\n from medical_claim\r\n inner join exclusion_codes\r\n on medical_claim.hcpcs_code = exclusion_codes.code\r\n where exclusion_codes.code_system = 'hcpcs'\r\n\r\n)\r\n\r\n, observation_exclusions as (\r\n\r\n select\r\n observations.patient_id\r\n , observations.observation_date\r\n , exclusion_codes.concept_name as concept_name\r\n from observations\r\n inner join exclusion_codes\r\n on observations.code = exclusion_codes.code\r\n and observations.code_type = exclusion_codes.code_system\r\n\r\n)\r\n\r\n, procedure_exclusions as (\r\n\r\n select\r\n procedures.patient_id\r\n , procedures.procedure_date\r\n , exclusion_codes.concept_name as concept_name\r\n from procedures\r\n inner join exclusion_codes\r\n on procedures.code = exclusion_codes.code\r\n and procedures.code_type = exclusion_codes.code_system\r\n\r\n)\r\n\r\n, patients_with_exclusions as(\r\n select patient_id\r\n , recorded_date as exclusion_date\r\n , concept_name as exclusion_reason\r\n from condition_exclusions\r\n\r\n union all\r\n\r\n select patient_id\r\n , coalesce(claim_end_date, claim_start_date) as exclusion_date\r\n , concept_name as exclusion_reason\r\n from med_claim_exclusions\r\n\r\n union all\r\n\r\n select patient_id\r\n , observation_date as exclusion_date\r\n , concept_name as exclusion_reason\r\n from observation_exclusions\r\n\r\n union all\r\n\r\n select patient_id\r\n , procedure_date as exclusion_date\r\n , concept_name as exclusion_reason\r\n from procedure_exclusions\r\n\r\n)\r\n\r\n\r\n\r\nselect\r\n patient_id\r\n , exclusion_date\r\n , exclusion_reason\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom patients_with_exclusions", "language": "sql", "refs": [["quality_measures__value_sets"], ["quality_measures__stg_core__condition"], ["quality_measures__stg_medical_claim"], ["quality_measures__stg_core__observation"], ["quality_measures__stg_core__procedure"]], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["seed.the_tuva_project.quality_measures__value_sets", "model.the_tuva_project.quality_measures__stg_core__condition", "model.the_tuva_project.quality_measures__stg_medical_claim", "model.the_tuva_project.quality_measures__stg_core__observation", "model.the_tuva_project.quality_measures__stg_core__procedure"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\quality_measures\\intermediate\\nqf0034_colorectal_cancer_screening\\quality_measures__int_nqf0034_exclude_colectomy_cancer.sql", "compiled": true, "compiled_code": "\n\n/*\nDENOMINATOR EXCLUSIONS:\nPatients with a diagnosis or past history of total colectomy or colorectal cancer: G9711\n*/\n\n\nwith __dbt__cte__quality_measures__stg_core__condition as (\n\nselect\n patient_id\n , claim_id\n , recorded_date\n , source_code_type\n , source_code\n , normalized_code_type\n , normalized_code\n , '2023-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom devforrest.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-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom devforrest.core.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-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom devforrest.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-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom devforrest.core.procedure\n),exclusion_codes as (\n select\n code\n , case code_system\n when 'SNOMEDCT' then 'snomed-ct'\n when 'ICD9CM' then 'icd-9-cm'\n when 'ICD10CM' then 'icd-10-cm'\n when 'CPT' then 'hcpcs'\n when 'ICD10PCS' then 'icd-10-pcs'\n else lower(code_system) end as code_system\n , concept_name\n From devforrest.quality_measures._value_set_codes\n where concept_name in (\n 'Malignant Neoplasm of Colon'\n , 'Total Colectomy'\n )\n\n)\n\n, conditions as (\n\n select\n patient_id\n , claim_id\n , recorded_date\n , coalesce (\n normalized_code_type\n , case\n when lower(source_code_type) = 'snomed' then 'snomed-ct'\n else lower(source_code_type)\n end\n ) as code_type\n , coalesce (\n normalized_code\n , source_code\n ) as code\n from __dbt__cte__quality_measures__stg_core__condition\n\n)\n\n, medical_claim as (\n\n select\n patient_id\n , claim_id\n , claim_start_date\n , claim_end_date\n , hcpcs_code\n , place_of_service_code\n from __dbt__cte__quality_measures__stg_medical_claim\n\n)\n\n, observations as (\n\n select\n patient_id\n , observation_date\n , coalesce (\n normalized_code_type\n , case\n when lower(source_code_type) = 'cpt' then 'hcpcs'\n when lower(source_code_type) = 'snomed' then 'snomed-ct'\n else lower(source_code_type)\n end\n ) as code_type\n , coalesce (\n normalized_code\n , source_code\n ) as code\n from __dbt__cte__quality_measures__stg_core__observation\n\n)\n\n, procedures as (\n\n select\n patient_id\n , procedure_date\n , coalesce (\n normalized_code_type\n , case\n when lower(source_code_type) = 'cpt' then 'hcpcs'\n when lower(source_code_type) = 'snomed' then 'snomed-ct'\n else lower(source_code_type)\n end\n ) as code_type\n , coalesce (\n normalized_code\n , source_code\n ) as code\n from __dbt__cte__quality_measures__stg_core__procedure\n\n)\n\n, condition_exclusions as (\n\n select\n conditions.patient_id\n , conditions.claim_id\n , conditions.recorded_date\n , exclusion_codes.concept_name as concept_name\n from conditions\n inner join exclusion_codes\n on conditions.code = exclusion_codes.code\n and conditions.code_type = exclusion_codes.code_system\n\n)\n\n, med_claim_exclusions as (\n\n select\n medical_claim.patient_id\n , medical_claim.claim_id\n , medical_claim.claim_start_date\n , medical_claim.claim_end_date\n , medical_claim.hcpcs_code\n , exclusion_codes.concept_name as concept_name\n from medical_claim\n inner join exclusion_codes\n on medical_claim.hcpcs_code = exclusion_codes.code\n where exclusion_codes.code_system = 'hcpcs'\n\n)\n\n, observation_exclusions as (\n\n select\n observations.patient_id\n , observations.observation_date\n , exclusion_codes.concept_name as concept_name\n from observations\n inner join exclusion_codes\n on observations.code = exclusion_codes.code\n and observations.code_type = exclusion_codes.code_system\n\n)\n\n, procedure_exclusions as (\n\n select\n procedures.patient_id\n , procedures.procedure_date\n , exclusion_codes.concept_name as concept_name\n from procedures\n inner join exclusion_codes\n on procedures.code = exclusion_codes.code\n and procedures.code_type = exclusion_codes.code_system\n\n)\n\n, patients_with_exclusions as(\n select patient_id\n , recorded_date as exclusion_date\n , concept_name as exclusion_reason\n from condition_exclusions\n\n union all\n\n select patient_id\n , coalesce(claim_end_date, claim_start_date) as exclusion_date\n , concept_name as exclusion_reason\n from med_claim_exclusions\n\n union all\n\n select patient_id\n , observation_date as exclusion_date\n , concept_name as exclusion_reason\n from observation_exclusions\n\n union all\n\n select patient_id\n , procedure_date as exclusion_date\n , concept_name as exclusion_reason\n from procedure_exclusions\n\n)\n\n\n\nselect\n patient_id\n , exclusion_date\n , exclusion_reason\n , '2023-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom patients_with_exclusions", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.the_tuva_project.quality_measures__stg_core__condition", "sql": " __dbt__cte__quality_measures__stg_core__condition as (\n\nselect\n patient_id\n , claim_id\n , recorded_date\n , source_code_type\n , source_code\n , normalized_code_type\n , normalized_code\n , '2023-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom devforrest.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-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom devforrest.core.medical_claim\n\n\n)"}, {"id": "model.the_tuva_project.quality_measures__stg_core__observation", "sql": " __dbt__cte__quality_measures__stg_core__observation as (\n\n\nselect\n patient_id\n , observation_date\n , source_code_type\n , source_code\n , normalized_code_type\n , normalized_code\n , '2023-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom devforrest.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-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom devforrest.core.procedure\n)"}]}, "model.the_tuva_project.quality_measures__int_nqf0034_exclude_dementia": {"database": "devforrest", "schema": "quality_measures", "name": "quality_measures__int_nqf0034_exclude_dementia", "resource_type": "model", "package_name": "the_tuva_project", "path": "quality_measures\\intermediate\\nqf0034_colorectal_cancer_screening\\quality_measures__int_nqf0034_exclude_dementia.sql", "original_file_path": "models\\quality_measures\\intermediate\\nqf0034_colorectal_cancer_screening\\quality_measures__int_nqf0034_exclude_dementia.sql", "unique_id": "model.the_tuva_project.quality_measures__int_nqf0034_exclude_dementia", "fqn": ["the_tuva_project", "quality_measures", "intermediate", "nqf0034_colorectal_cancer_screening", "quality_measures__int_nqf0034_exclude_dementia"], "alias": "_int_nqf0034_exclude_dementia", "checksum": {"name": "sha256", "checksum": "f4d963adad52bf9c30cc3ccbfd0a00b0d425bfc32d1144b558fcc93139ef8a01"}, "config": {"enabled": true, "alias": "_int_nqf0034_exclude_dementia", "schema": "quality_measures", "database": null, "tags": ["quality_measures"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["quality_measures"], "description": "Exclusion logic for patients with frailty and taking dementia medications for the reporting version of NQF 0034, Colorectal Cancer Screening.\n", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://models\\quality_measures\\quality_measures_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "quality_measures", "alias": "_int_nqf0034_exclude_dementia", "tags": "quality_measures", "materialized": "table", "enabled": true, "bind": false}, "created_at": 1702481697.159808, "relation_name": "devforrest.quality_measures._int_nqf0034_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\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 ( 'Dementia Medications')\r\n )\r\n\r\n)\r\n\r\n, medications as (\r\n\r\n select\r\n patient_id\r\n , dispensing_date\r\n , source_code_type\r\n , source_code\r\n , ndc_code\r\n , rxnorm_code\r\n from {{ ref('quality_measures__stg_core__medication') }}\r\n\r\n)\r\n\r\n, pharmacy_claim as (\r\n\r\n select\r\n patient_id\r\n , dispensing_date\r\n , ndc_code\r\n , paid_date\r\n from {{ ref('quality_measures__stg_pharmacy_claim') }}\r\n\r\n)\r\n\r\n\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 {{ref('quality_measures__int_nqf0034__performance_period')}} pp\r\n on medications.dispensing_date between pp.performance_period_begin_1yp and pp.performance_period_end\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 {{ref('quality_measures__int_nqf0034__performance_period')}} pp\r\n on medications.dispensing_date between pp.performance_period_begin_1yp and pp.performance_period_end\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 {{ref('quality_measures__int_nqf0034__performance_period')}} pp\r\n on medications.dispensing_date between pp.performance_period_begin_1yp and pp.performance_period_end\r\n inner join exclusion_codes\r\n on medications.source_code = exclusion_codes.code\r\n and medications.source_code_type = exclusion_codes.code_system\r\n\r\n)\r\n\r\n, pharmacy_claim_exclusions as (\r\n\r\n select\r\n pharmacy_claim.patient_id\r\n , pharmacy_claim.dispensing_date\r\n , pharmacy_claim.ndc_code\r\n , pharmacy_claim.paid_date\r\n , exclusion_codes.concept_name\r\n from pharmacy_claim\r\n inner join {{ref('quality_measures__int_nqf0034__performance_period')}} pp\r\n on pharmacy_claim.dispensing_date between pp.performance_period_begin_1yp and pp.performance_period_end\r\n or pharmacy_claim.paid_date between pp.performance_period_begin_1yp and pp.performance_period_end\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\r\n\r\n, patients_with_frailty as (\r\n\r\n select\r\n patient_id\r\n , exclusion_date\r\n , concept_name\r\nfrom {{ref('quality_measures__int_nqf0034__frailty')}}\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\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\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 d", "language": "sql", "refs": [["quality_measures__value_sets"], ["quality_measures__stg_core__medication"], ["quality_measures__stg_pharmacy_claim"], ["quality_measures__int_nqf0034__performance_period"], ["quality_measures__int_nqf0034__performance_period"], ["quality_measures__int_nqf0034__performance_period"], ["quality_measures__int_nqf0034__performance_period"], ["quality_measures__int_nqf0034__frailty"]], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["seed.the_tuva_project.quality_measures__value_sets", "model.the_tuva_project.quality_measures__stg_core__medication", "model.the_tuva_project.quality_measures__stg_pharmacy_claim", "model.the_tuva_project.quality_measures__int_nqf0034__performance_period", "model.the_tuva_project.quality_measures__int_nqf0034__performance_period", "model.the_tuva_project.quality_measures__int_nqf0034__performance_period", "model.the_tuva_project.quality_measures__int_nqf0034__performance_period", "model.the_tuva_project.quality_measures__int_nqf0034__frailty"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\quality_measures\\intermediate\\nqf0034_colorectal_cancer_screening\\quality_measures__int_nqf0034_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\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-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom devforrest.core.medication\n\n\n), __dbt__cte__quality_measures__stg_pharmacy_claim as (\n\n\nselect\n patient_id\n , dispensing_date\n , ndc_code\n , paid_date\n , '2023-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom devforrest.core.pharmacy_claim\n\n\n),exclusion_codes as (\n\n select\n code\n , code_system\n , concept_name\n from devforrest.quality_measures._value_set_codes\n where concept_name in (\n ( 'Dementia Medications')\n )\n\n)\n\n, medications as (\n\n select\n patient_id\n , dispensing_date\n , source_code_type\n , source_code\n , ndc_code\n , rxnorm_code\n from __dbt__cte__quality_measures__stg_core__medication\n\n)\n\n, pharmacy_claim as (\n\n select\n patient_id\n , dispensing_date\n , ndc_code\n , paid_date\n from __dbt__cte__quality_measures__stg_pharmacy_claim\n\n)\n\n\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 devforrest.quality_measures._int_nqf0034__performance_period pp\n on medications.dispensing_date between pp.performance_period_begin_1yp and pp.performance_period_end\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 devforrest.quality_measures._int_nqf0034__performance_period pp\n on medications.dispensing_date between pp.performance_period_begin_1yp and pp.performance_period_end\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 devforrest.quality_measures._int_nqf0034__performance_period pp\n on medications.dispensing_date between pp.performance_period_begin_1yp and pp.performance_period_end\n inner join exclusion_codes\n on medications.source_code = exclusion_codes.code\n and medications.source_code_type = exclusion_codes.code_system\n\n)\n\n, pharmacy_claim_exclusions as (\n\n select\n pharmacy_claim.patient_id\n , pharmacy_claim.dispensing_date\n , pharmacy_claim.ndc_code\n , pharmacy_claim.paid_date\n , exclusion_codes.concept_name\n from pharmacy_claim\n inner join devforrest.quality_measures._int_nqf0034__performance_period pp\n on pharmacy_claim.dispensing_date between pp.performance_period_begin_1yp and pp.performance_period_end\n or pharmacy_claim.paid_date between pp.performance_period_begin_1yp and pp.performance_period_end\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\n\n, patients_with_frailty as (\n\n select\n patient_id\n , exclusion_date\n , concept_name\nfrom devforrest.quality_measures._int_nqf0034__frailty\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\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\n\n)\n\nselect\n patient_id\n , exclusion_date\n , exclusion_reason\n , '2023-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom frailty_with_dementia d", "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-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom devforrest.core.medication\n\n\n)"}, {"id": "model.the_tuva_project.quality_measures__stg_pharmacy_claim", "sql": " __dbt__cte__quality_measures__stg_pharmacy_claim as (\n\n\nselect\n patient_id\n , dispensing_date\n , ndc_code\n , paid_date\n , '2023-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom devforrest.core.pharmacy_claim\n\n\n)"}]}, "model.the_tuva_project.quality_measures__int_nqf0034_exclude_hospice_palliative": {"database": "devforrest", "schema": "quality_measures", "name": "quality_measures__int_nqf0034_exclude_hospice_palliative", "resource_type": "model", "package_name": "the_tuva_project", "path": "quality_measures\\intermediate\\nqf0034_colorectal_cancer_screening\\quality_measures__int_nqf0034_exclude_hospice_palliative.sql", "original_file_path": "models\\quality_measures\\intermediate\\nqf0034_colorectal_cancer_screening\\quality_measures__int_nqf0034_exclude_hospice_palliative.sql", "unique_id": "model.the_tuva_project.quality_measures__int_nqf0034_exclude_hospice_palliative", "fqn": ["the_tuva_project", "quality_measures", "intermediate", "nqf0034_colorectal_cancer_screening", "quality_measures__int_nqf0034_exclude_hospice_palliative"], "alias": "_int_nqf0034_exclude_hospice_palliative", "checksum": {"name": "sha256", "checksum": "b5af039a33b3bfbbc01c68082446172791098cfee99c03ab27b42cba89fdcc67"}, "config": {"enabled": true, "alias": "_int_nqf0034_exclude_hospice_palliative", "schema": "quality_measures", "database": null, "tags": ["quality_measures"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["quality_measures"], "description": "Exclusion logic for patients using hospice or palliative services for the reporting version of NQF 0034, Colorectal Cancer Screening. \n", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://models\\quality_measures\\quality_measures_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "quality_measures", "alias": "_int_nqf0034_exclude_hospice_palliative", "tags": "quality_measures", "materialized": "table", "enabled": true, "bind": false}, "created_at": 1702481697.1755376, "relation_name": "devforrest.quality_measures._int_nqf0034_exclude_hospice_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\nDENOMINATOR EXCLUSIONS:\r\nPatient was provided hospice services any time during the measurement period: G9710\r\n*/\r\n\r\n\r\nwith exclusion_codes as (\r\n select\r\n code\r\n , case code_system\r\n when 'SNOMEDCT' then 'snomed-ct'\r\n when 'ICD9CM' then 'icd-9-cm'\r\n when 'ICD10CM' then 'icd-10-cm'\r\n when 'CPT' then 'hcpcs'\r\n when 'ICD10PCS' then 'icd-10-pcs'\r\n else lower(code_system) end as code_system\r\n , concept_name\r\n From {{ref('quality_measures__value_sets')}}\r\n where concept_name in (\r\n 'Hospice Care Ambulatory'\r\n , 'Hospice Encounter'\r\n , 'Palliative Care Encounter'\r\n , 'Palliative Care Intervention'\r\n )\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, medical_claim as (\r\n\r\n select\r\n patient_id\r\n , claim_id\r\n , claim_start_date\r\n , claim_end_date\r\n , hcpcs_code\r\n , place_of_service_code\r\n from {{ ref('quality_measures__stg_medical_claim') }}\r\n\r\n)\r\n\r\n, observations as (\r\n\r\n select\r\n patient_id\r\n , observation_date\r\n , coalesce (\r\n normalized_code_type\r\n , case\r\n when lower(source_code_type) = 'cpt' then 'hcpcs'\r\n when lower(source_code_type) = 'snomed' then 'snomed-ct'\r\n else lower(source_code_type)\r\n end\r\n ) as code_type\r\n , coalesce (\r\n normalized_code\r\n , source_code\r\n ) as code\r\n from {{ ref('quality_measures__stg_core__observation') }}\r\n\r\n)\r\n\r\n, procedures as (\r\n\r\n select\r\n patient_id\r\n , procedure_date\r\n , coalesce (\r\n normalized_code_type\r\n , case\r\n when lower(source_code_type) = 'cpt' then 'hcpcs'\r\n when lower(source_code_type) = 'snomed' then 'snomed-ct'\r\n else lower(source_code_type)\r\n end\r\n ) as code_type\r\n , coalesce (\r\n normalized_code\r\n , source_code\r\n ) as code\r\n from {{ ref('quality_measures__stg_core__procedure') }}\r\n\r\n)\r\n\r\n, condition_exclusions as (\r\n\r\n select\r\n conditions.patient_id\r\n , conditions.claim_id\r\n , conditions.recorded_date\r\n , exclusion_codes.concept_name as concept_name\r\n from conditions\r\n inner join exclusion_codes\r\n on conditions.code = exclusion_codes.code\r\n and conditions.code_type = exclusion_codes.code_system\r\n inner join {{ref('quality_measures__int_nqf0034__performance_period')}} as pp\r\n on recorded_date between pp.performance_period_begin and pp.performance_period_end\r\n\r\n)\r\n\r\n, med_claim_exclusions as (\r\n\r\n select\r\n medical_claim.patient_id\r\n , medical_claim.claim_id\r\n , medical_claim.claim_start_date\r\n , medical_claim.claim_end_date\r\n , medical_claim.hcpcs_code\r\n , exclusion_codes.concept_name as concept_name\r\n from medical_claim\r\n inner join exclusion_codes\r\n on medical_claim.hcpcs_code = exclusion_codes.code\r\n inner join {{ref('quality_measures__int_nqf0034__performance_period')}} as pp on 1=1\r\n where exclusion_codes.code_system = 'hcpcs'\r\n and claim_start_date between pp.performance_period_begin and pp.performance_period_end\r\n)\r\n\r\n, observation_exclusions as (\r\n\r\n select\r\n observations.patient_id\r\n , observations.observation_date\r\n , exclusion_codes.concept_name as concept_name\r\n from observations\r\n inner join exclusion_codes\r\n on observations.code = exclusion_codes.code\r\n and observations.code_type = exclusion_codes.code_system\r\n inner join {{ref('quality_measures__int_nqf0034__performance_period')}} as pp on 1=1\r\n where observation_date between pp.performance_period_begin and pp.performance_period_end\r\n\r\n)\r\n\r\n, procedure_exclusions as (\r\n\r\n select\r\n procedures.patient_id\r\n , procedures.procedure_date\r\n , exclusion_codes.concept_name as concept_name\r\n from procedures\r\n inner join exclusion_codes\r\n on procedures.code = exclusion_codes.code\r\n and procedures.code_type = exclusion_codes.code_system\r\n inner join {{ref('quality_measures__int_nqf0034__performance_period')}} as pp on 1=1\r\n where procedure_date between pp.performance_period_begin and pp.performance_period_end\r\n\r\n)\r\n\r\n, patients_with_exclusions as(\r\n select patient_id\r\n , recorded_date as exclusion_date\r\n , concept_name as exclusion_reason\r\n from condition_exclusions\r\n\r\n union all\r\n\r\n select patient_id\r\n , coalesce(claim_end_date, claim_start_date) as exclusion_date\r\n , concept_name as exclusion_reason\r\n from med_claim_exclusions\r\n\r\n union all\r\n\r\n select patient_id\r\n , observation_date as exclusion_date\r\n , concept_name as exclusion_reason\r\n from observation_exclusions\r\n\r\n union all\r\n\r\n select patient_id\r\n , procedure_date as exclusion_date\r\n , concept_name as exclusion_reason\r\n from procedure_exclusions\r\n\r\n)\r\n\r\n\r\n\r\nselect\r\n patient_id\r\n , exclusion_date\r\n , exclusion_reason\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom patients_with_exclusions", "language": "sql", "refs": [["quality_measures__value_sets"], ["quality_measures__stg_core__condition"], ["quality_measures__stg_medical_claim"], ["quality_measures__stg_core__observation"], ["quality_measures__stg_core__procedure"], ["quality_measures__int_nqf0034__performance_period"], ["quality_measures__int_nqf0034__performance_period"], ["quality_measures__int_nqf0034__performance_period"], ["quality_measures__int_nqf0034__performance_period"]], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["seed.the_tuva_project.quality_measures__value_sets", "model.the_tuva_project.quality_measures__stg_core__condition", "model.the_tuva_project.quality_measures__stg_medical_claim", "model.the_tuva_project.quality_measures__stg_core__observation", "model.the_tuva_project.quality_measures__stg_core__procedure", "model.the_tuva_project.quality_measures__int_nqf0034__performance_period", "model.the_tuva_project.quality_measures__int_nqf0034__performance_period", "model.the_tuva_project.quality_measures__int_nqf0034__performance_period", "model.the_tuva_project.quality_measures__int_nqf0034__performance_period"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\quality_measures\\intermediate\\nqf0034_colorectal_cancer_screening\\quality_measures__int_nqf0034_exclude_hospice_palliative.sql", "compiled": true, "compiled_code": "\n\n/*\nDENOMINATOR EXCLUSIONS:\nPatient was provided hospice services any time during the measurement period: G9710\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-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom devforrest.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-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom devforrest.core.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-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom devforrest.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-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom devforrest.core.procedure\n),exclusion_codes as (\n select\n code\n , case code_system\n when 'SNOMEDCT' then 'snomed-ct'\n when 'ICD9CM' then 'icd-9-cm'\n when 'ICD10CM' then 'icd-10-cm'\n when 'CPT' then 'hcpcs'\n when 'ICD10PCS' then 'icd-10-pcs'\n else lower(code_system) end as code_system\n , concept_name\n From devforrest.quality_measures._value_set_codes\n where concept_name in (\n 'Hospice Care Ambulatory'\n , 'Hospice Encounter'\n , 'Palliative Care Encounter'\n , 'Palliative Care Intervention'\n )\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, medical_claim as (\n\n select\n patient_id\n , claim_id\n , claim_start_date\n , claim_end_date\n , hcpcs_code\n , place_of_service_code\n from __dbt__cte__quality_measures__stg_medical_claim\n\n)\n\n, observations as (\n\n select\n patient_id\n , observation_date\n , coalesce (\n normalized_code_type\n , case\n when lower(source_code_type) = 'cpt' then 'hcpcs'\n when lower(source_code_type) = 'snomed' then 'snomed-ct'\n else lower(source_code_type)\n end\n ) as code_type\n , coalesce (\n normalized_code\n , source_code\n ) as code\n from __dbt__cte__quality_measures__stg_core__observation\n\n)\n\n, procedures as (\n\n select\n patient_id\n , procedure_date\n , coalesce (\n normalized_code_type\n , case\n when lower(source_code_type) = 'cpt' then 'hcpcs'\n when lower(source_code_type) = 'snomed' then 'snomed-ct'\n else lower(source_code_type)\n end\n ) as code_type\n , coalesce (\n normalized_code\n , source_code\n ) as code\n from __dbt__cte__quality_measures__stg_core__procedure\n\n)\n\n, condition_exclusions as (\n\n select\n conditions.patient_id\n , conditions.claim_id\n , conditions.recorded_date\n , exclusion_codes.concept_name as concept_name\n from conditions\n inner join exclusion_codes\n on conditions.code = exclusion_codes.code\n and conditions.code_type = exclusion_codes.code_system\n inner join devforrest.quality_measures._int_nqf0034__performance_period as pp\n on recorded_date between pp.performance_period_begin and pp.performance_period_end\n\n)\n\n, med_claim_exclusions as (\n\n select\n medical_claim.patient_id\n , medical_claim.claim_id\n , medical_claim.claim_start_date\n , medical_claim.claim_end_date\n , medical_claim.hcpcs_code\n , exclusion_codes.concept_name as concept_name\n from medical_claim\n inner join exclusion_codes\n on medical_claim.hcpcs_code = exclusion_codes.code\n inner join devforrest.quality_measures._int_nqf0034__performance_period as pp on 1=1\n where exclusion_codes.code_system = 'hcpcs'\n and claim_start_date between pp.performance_period_begin and pp.performance_period_end\n)\n\n, observation_exclusions as (\n\n select\n observations.patient_id\n , observations.observation_date\n , exclusion_codes.concept_name as concept_name\n from observations\n inner join exclusion_codes\n on observations.code = exclusion_codes.code\n and observations.code_type = exclusion_codes.code_system\n inner join devforrest.quality_measures._int_nqf0034__performance_period as pp on 1=1\n where observation_date between pp.performance_period_begin and pp.performance_period_end\n\n)\n\n, procedure_exclusions as (\n\n select\n procedures.patient_id\n , procedures.procedure_date\n , exclusion_codes.concept_name as concept_name\n from procedures\n inner join exclusion_codes\n on procedures.code = exclusion_codes.code\n and procedures.code_type = exclusion_codes.code_system\n inner join devforrest.quality_measures._int_nqf0034__performance_period as pp on 1=1\n where procedure_date between pp.performance_period_begin and pp.performance_period_end\n\n)\n\n, patients_with_exclusions as(\n select patient_id\n , recorded_date as exclusion_date\n , concept_name as exclusion_reason\n from condition_exclusions\n\n union all\n\n select patient_id\n , coalesce(claim_end_date, claim_start_date) as exclusion_date\n , concept_name as exclusion_reason\n from med_claim_exclusions\n\n union all\n\n select patient_id\n , observation_date as exclusion_date\n , concept_name as exclusion_reason\n from observation_exclusions\n\n union all\n\n select patient_id\n , procedure_date as exclusion_date\n , concept_name as exclusion_reason\n from procedure_exclusions\n\n)\n\n\n\nselect\n patient_id\n , exclusion_date\n , exclusion_reason\n , '2023-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom patients_with_exclusions", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.the_tuva_project.quality_measures__stg_core__condition", "sql": " __dbt__cte__quality_measures__stg_core__condition as (\n\nselect\n patient_id\n , claim_id\n , recorded_date\n , source_code_type\n , source_code\n , normalized_code_type\n , normalized_code\n , '2023-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom devforrest.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-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom devforrest.core.medical_claim\n\n\n)"}, {"id": "model.the_tuva_project.quality_measures__stg_core__observation", "sql": " __dbt__cte__quality_measures__stg_core__observation as (\n\n\nselect\n patient_id\n , observation_date\n , source_code_type\n , source_code\n , normalized_code_type\n , normalized_code\n , '2023-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom devforrest.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-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom devforrest.core.procedure\n)"}]}, "model.the_tuva_project.quality_measures__int_nqf0034_exclude_institutional_snp": {"database": "devforrest", "schema": "quality_measures", "name": "quality_measures__int_nqf0034_exclude_institutional_snp", "resource_type": "model", "package_name": "the_tuva_project", "path": "quality_measures\\intermediate\\nqf0034_colorectal_cancer_screening\\quality_measures__int_nqf0034_exclude_institutional_snp.sql", "original_file_path": "models\\quality_measures\\intermediate\\nqf0034_colorectal_cancer_screening\\quality_measures__int_nqf0034_exclude_institutional_snp.sql", "unique_id": "model.the_tuva_project.quality_measures__int_nqf0034_exclude_institutional_snp", "fqn": ["the_tuva_project", "quality_measures", "intermediate", "nqf0034_colorectal_cancer_screening", "quality_measures__int_nqf0034_exclude_institutional_snp"], "alias": "_int_nqf0034_exclude_institutional_snp", "checksum": {"name": "sha256", "checksum": "8781a6346e1e41b0fa32f3b3888bc6c4e09463676bc7eff6b1b2e0f8d72e00b3"}, "config": {"enabled": true, "alias": "_int_nqf0034_exclude_institutional_snp", "schema": "quality_measures", "database": null, "tags": ["quality_measures"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["quality_measures"], "description": "Exclusion logic for patients staying in an institution for the reporting version of NQF 0034, Colorectal Cancer Screening. \n", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://models\\quality_measures\\quality_measures_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "quality_measures", "alias": "_int_nqf0034_exclude_institutional_snp", "tags": "quality_measures", "materialized": "table", "enabled": true, "bind": false}, "created_at": 1702481697.1799047, "relation_name": "devforrest.quality_measures._int_nqf0034_exclude_institutional_snp", "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 aged_patients as (\r\n select distinct patient_id\r\n from {{ref('quality_measures__int_nqf0034_denominator')}}\r\n where max_age >=66\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 aged_patients.patient_id\r\n , coalesce(\r\n medical_claim.claim_start_date\r\n , medical_claim.claim_end_date\r\n ) as exclusion_date\r\n , 'Institutional or Long Term Care' as exclusion_reason\r\n from aged_patients\r\n inner join medical_claim\r\n on aged_patients.patient_id = medical_claim.patient_id\r\n\r\n inner join {{ref('quality_measures__int_nqf0034__performance_period')}} pp\r\n on coalesce(\r\n medical_claim.claim_start_date\r\n , medical_claim.claim_end_date\r\n ) between pp.performance_period_begin and pp.performance_period_end\r\n\r\n where place_of_service_code in ('32', '33', '34', '54', '56')\r\n and {{ datediff('medical_claim.claim_start_date', 'medical_claim.claim_end_date', 'day') }} >= 90\r\n)\r\n\r\nselect\r\n patient_id\r\n , exclusion_date\r\n , exclusion_reason\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom exclusions", "language": "sql", "refs": [["quality_measures__int_nqf0034_denominator"], ["quality_measures__stg_medical_claim"], ["quality_measures__int_nqf0034__performance_period"]], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.datediff"], "nodes": ["model.the_tuva_project.quality_measures__int_nqf0034_denominator", "model.the_tuva_project.quality_measures__stg_medical_claim", "model.the_tuva_project.quality_measures__int_nqf0034__performance_period"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\quality_measures\\intermediate\\nqf0034_colorectal_cancer_screening\\quality_measures__int_nqf0034_exclude_institutional_snp.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-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom devforrest.core.medical_claim\n\n\n),aged_patients as (\n select distinct patient_id\n from devforrest.quality_measures._int_nqf0034_denominator\n where max_age >=66\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 aged_patients.patient_id\n , coalesce(\n medical_claim.claim_start_date\n , medical_claim.claim_end_date\n ) as exclusion_date\n , 'Institutional or Long Term Care' as exclusion_reason\n from aged_patients\n inner join medical_claim\n on aged_patients.patient_id = medical_claim.patient_id\n\n inner join devforrest.quality_measures._int_nqf0034__performance_period pp\n on coalesce(\n medical_claim.claim_start_date\n , medical_claim.claim_end_date\n ) between pp.performance_period_begin and pp.performance_period_end\n\n where place_of_service_code in ('32', '33', '34', '54', '56')\n and datediff(\n day,\n medical_claim.claim_start_date,\n medical_claim.claim_end_date\n ) >= 90\n)\n\nselect\n patient_id\n , exclusion_date\n , exclusion_reason\n , '2023-12-13 23:31:59.089856+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-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom devforrest.core.medical_claim\n\n\n)"}]}, "model.the_tuva_project.quality_measures__int_nqf0034_exclusions": {"database": "devforrest", "schema": "quality_measures", "name": "quality_measures__int_nqf0034_exclusions", "resource_type": "model", "package_name": "the_tuva_project", "path": "quality_measures\\intermediate\\nqf0034_colorectal_cancer_screening\\quality_measures__int_nqf0034_exclusions.sql", "original_file_path": "models\\quality_measures\\intermediate\\nqf0034_colorectal_cancer_screening\\quality_measures__int_nqf0034_exclusions.sql", "unique_id": "model.the_tuva_project.quality_measures__int_nqf0034_exclusions", "fqn": ["the_tuva_project", "quality_measures", "intermediate", "nqf0034_colorectal_cancer_screening", "quality_measures__int_nqf0034_exclusions"], "alias": "_int_nqf0034_exclusions", "checksum": {"name": "sha256", "checksum": "0cb9c8bfb4b9db42484eacb1b941dd98f7d8a86b4ed022be5bee0eb759d69f96"}, "config": {"enabled": true, "alias": "_int_nqf0034_exclusions", "schema": "quality_measures", "database": null, "tags": ["quality_measures"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["quality_measures"], "description": "Combined exclusion logic for the reporting version of NQF 0034, Colorectal Cancer Screening. \n", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://models\\quality_measures\\quality_measures_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "quality_measures", "alias": "_int_nqf0034_exclusions", "tags": "quality_measures", "materialized": "table", "enabled": true, "bind": false}, "created_at": 1702481697.1821315, "relation_name": "devforrest.quality_measures._int_nqf0034_exclusions", "raw_code": "{{ config(\r\n enabled = var('quality_measures_enabled',var('claims_enabled',var('clinical_enabled',var('tuva_marts_enabled',False))))\r\n )\r\n}}\r\n\r\nwith exclusions as (\r\nselect *\r\nFrom {{ref('quality_measures__int_nqf0034_exclude_advanced_illness')}}\r\n\r\nunion all\r\n\r\nselect *\r\nFrom {{ref('quality_measures__int_nqf0034_exclude_colectomy_cancer')}}\r\n\r\nunion all\r\n\r\nselect *\r\nFrom {{ref('quality_measures__int_nqf0034_exclude_dementia')}}\r\n\r\nunion all\r\n\r\nselect *\r\nFrom {{ref('quality_measures__int_nqf0034_exclude_hospice_palliative')}}\r\n\r\nunion all\r\n\r\nselect *\r\nFrom {{ref('quality_measures__int_nqf0034_exclude_institutional_snp')}}\r\n)\r\n\r\nselect exclusions.*\r\nfrom exclusions\r\ninner join {{ref('quality_measures__int_nqf0034_denominator')}} p\r\n on exclusions.patient_id = p.patient_id", "language": "sql", "refs": [["quality_measures__int_nqf0034_exclude_advanced_illness"], ["quality_measures__int_nqf0034_exclude_colectomy_cancer"], ["quality_measures__int_nqf0034_exclude_dementia"], ["quality_measures__int_nqf0034_exclude_hospice_palliative"], ["quality_measures__int_nqf0034_exclude_institutional_snp"], ["quality_measures__int_nqf0034_denominator"]], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.quality_measures__int_nqf0034_exclude_advanced_illness", "model.the_tuva_project.quality_measures__int_nqf0034_exclude_colectomy_cancer", "model.the_tuva_project.quality_measures__int_nqf0034_exclude_dementia", "model.the_tuva_project.quality_measures__int_nqf0034_exclude_hospice_palliative", "model.the_tuva_project.quality_measures__int_nqf0034_exclude_institutional_snp", "model.the_tuva_project.quality_measures__int_nqf0034_denominator"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\quality_measures\\intermediate\\nqf0034_colorectal_cancer_screening\\quality_measures__int_nqf0034_exclusions.sql", "compiled": true, "compiled_code": "\n\nwith exclusions as (\nselect *\nFrom devforrest.quality_measures._int_nqf0034_exclude_advanced_illness\n\nunion all\n\nselect *\nFrom devforrest.quality_measures._int_nqf0034_exclude_colectomy_cancer\n\nunion all\n\nselect *\nFrom devforrest.quality_measures._int_nqf0034_exclude_dementia\n\nunion all\n\nselect *\nFrom devforrest.quality_measures._int_nqf0034_exclude_hospice_palliative\n\nunion all\n\nselect *\nFrom devforrest.quality_measures._int_nqf0034_exclude_institutional_snp\n)\n\nselect exclusions.*\nfrom exclusions\ninner join devforrest.quality_measures._int_nqf0034_denominator p\n on exclusions.patient_id = p.patient_id", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.quality_measures__int_nqf0034_long": {"database": "devforrest", "schema": "quality_measures", "name": "quality_measures__int_nqf0034_long", "resource_type": "model", "package_name": "the_tuva_project", "path": "quality_measures\\intermediate\\nqf0034_colorectal_cancer_screening\\quality_measures__int_nqf0034_long.sql", "original_file_path": "models\\quality_measures\\intermediate\\nqf0034_colorectal_cancer_screening\\quality_measures__int_nqf0034_long.sql", "unique_id": "model.the_tuva_project.quality_measures__int_nqf0034_long", "fqn": ["the_tuva_project", "quality_measures", "intermediate", "nqf0034_colorectal_cancer_screening", "quality_measures__int_nqf0034_long"], "alias": "_int_nqf0034_long", "checksum": {"name": "sha256", "checksum": "dbf946dc2ee2b18c062dea0a8e76be919db63c09f791454c8a61f0d7f335f80c"}, "config": {"enabled": true, "alias": "_int_nqf0034_long", "schema": "quality_measures", "database": null, "tags": ["quality_measures"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["quality_measures"], "description": "Final preparation of the reporting version of NQF 0034, Colorectal Cancer Screening before combining with other measures. \n", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://models\\quality_measures\\quality_measures_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "quality_measures", "alias": "_int_nqf0034_long", "tags": "quality_measures", "materialized": "table", "enabled": true, "bind": false}, "created_at": 1702481697.1821315, "relation_name": "devforrest.quality_measures._int_nqf0034_long", "raw_code": "{{ config(\r\n enabled = var('quality_measures_enabled',var('claims_enabled',var('clinical_enabled',var('tuva_marts_enabled',False))))\r\n )\r\n}}\r\n\r\n\r\n{%- set measure_id -%}\r\n(\r\n select id\r\nfrom {{ ref('quality_measures__measures') }}\r\nwhere id = 'NQF0034'\r\n )\r\n{%- endset -%}\r\n\r\n{%- set measure_name -%}\r\n(\r\n\r\n select name\r\nfrom {{ ref('quality_measures__measures') }}\r\nwhere id = 'NQF0034'\r\n\r\n )\r\n{%- endset -%}\r\n\r\n{%- set measure_version -%}\r\n(\r\n select version\r\nfrom {{ ref('quality_measures__measures') }}\r\nwhere id = 'NQF0034'\r\n\r\n )\r\n{%- endset -%}\r\n\r\n\r\n\r\n/* selecting the full patient population as the grain of this table */\r\nwith patient as (\r\n\r\n select distinct patient_id\r\n from {{ ref('quality_measures__stg_core__patient') }}\r\n\r\n)\r\n\r\n, denominator as (\r\n\r\n select\r\n patient_id\r\n from {{ ref('quality_measures__int_nqf0034_denominator') }}\r\n\r\n)\r\n\r\n, numerator as (\r\n\r\n select\r\n patient_id\r\n , evidence_date\r\n from {{ ref('quality_measures__int_nqf0034_numerator') }}\r\n\r\n)\r\n\r\n, exclusions as (\r\n\r\n select\r\n patient_id\r\n , exclusion_date\r\n , exclusion_reason\r\n from {{ ref('quality_measures__int_nqf0034_exclusions') }}\r\n\r\n)\r\n\r\n, measure_flags as (\r\n\r\n select\r\n patient.patient_id\r\n , case\r\n when denominator.patient_id is not null\r\n then 1\r\n else null\r\n end as denominator_flag\r\n , case\r\n when numerator.patient_id is not null\r\n then 1\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 1\r\n else null\r\n end as exclusion_flag\r\n , numerator.evidence_date\r\n , exclusions.exclusion_date\r\n , exclusions.exclusion_reason\r\n , pp.performance_period_begin\r\n , pp.performance_period_end\r\n , {{ measure_id }} as measure_id\r\n , {{ measure_name }} as measure_name\r\n , {{ measure_version }} as measure_version\r\n from patient\r\n inner join {{ref('quality_measures__int_nqf0034__performance_period')}} pp\r\n on 1 = 1\r\n left join denominator\r\n on patient.patient_id = denominator.patient_id\r\n left join numerator\r\n on patient.patient_id = numerator.patient_id\r\n left join exclusions\r\n on patient.patient_id = exclusions.patient_id\r\n\r\n)\r\n\r\n/*\r\n Deduplicate measure rows by latest evidence date or exclusion date\r\n*/\r\n, add_rownum as (\r\n\r\n select\r\n patient_id\r\n , denominator_flag\r\n , numerator_flag\r\n , exclusion_flag\r\n , evidence_date\r\n , exclusion_date\r\n , exclusion_reason\r\n , performance_period_begin\r\n , performance_period_end\r\n , measure_id\r\n , measure_name\r\n , measure_version\r\n , row_number() over(\r\n partition by\r\n patient_id\r\n , performance_period_begin\r\n , performance_period_end\r\n , measure_id\r\n , measure_name\r\n order by\r\n evidence_date desc nulls last\r\n , exclusion_date desc nulls last\r\n ) as row_num\r\n from measure_flags\r\n\r\n)\r\n\r\n, deduped as (\r\n\r\n select\r\n patient_id\r\n , denominator_flag\r\n , numerator_flag\r\n , exclusion_flag\r\n , evidence_date\r\n , exclusion_date\r\n , exclusion_reason\r\n , performance_period_begin\r\n , performance_period_end\r\n , measure_id\r\n , measure_name\r\n , measure_version\r\n from add_rownum\r\n where row_num = 1\r\n\r\n)\r\n\r\n, add_data_types as (\r\n\r\n select\r\n cast(patient_id as {{ dbt.type_string() }}) as patient_id\r\n , cast(denominator_flag as integer) as denominator_flag\r\n , cast(numerator_flag as integer) as numerator_flag\r\n , cast(exclusion_flag as integer) as exclusion_flag\r\n , cast(evidence_date as date) as evidence_date\r\n , cast(exclusion_date as date) as exclusion_date\r\n , cast(exclusion_reason as {{ dbt.type_string() }}) as exclusion_reason\r\n , cast(performance_period_begin as date) as performance_period_begin\r\n , cast(performance_period_end as date) as performance_period_end\r\n , cast(measure_id as {{ dbt.type_string() }}) as measure_id\r\n , cast(measure_name as {{ dbt.type_string() }}) as measure_name\r\n , cast(measure_version as {{ dbt.type_string() }}) as measure_version\r\n from deduped\r\n\r\n)\r\n\r\nselect\r\n patient_id\r\n , denominator_flag\r\n , numerator_flag\r\n , exclusion_flag\r\n , evidence_date\r\n , exclusion_date\r\n , exclusion_reason\r\n , performance_period_begin\r\n , performance_period_end\r\n , measure_id\r\n , measure_name\r\n , measure_version\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom add_data_types", "language": "sql", "refs": [["quality_measures__measures"], ["quality_measures__measures"], ["quality_measures__measures"], ["quality_measures__stg_core__patient"], ["quality_measures__int_nqf0034_denominator"], ["quality_measures__int_nqf0034_numerator"], ["quality_measures__int_nqf0034_exclusions"], ["quality_measures__int_nqf0034__performance_period"]], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.type_string"], "nodes": ["seed.the_tuva_project.quality_measures__measures", "seed.the_tuva_project.quality_measures__measures", "seed.the_tuva_project.quality_measures__measures", "model.the_tuva_project.quality_measures__stg_core__patient", "model.the_tuva_project.quality_measures__int_nqf0034_denominator", "model.the_tuva_project.quality_measures__int_nqf0034_numerator", "model.the_tuva_project.quality_measures__int_nqf0034_exclusions", "model.the_tuva_project.quality_measures__int_nqf0034__performance_period"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\quality_measures\\intermediate\\nqf0034_colorectal_cancer_screening\\quality_measures__int_nqf0034_long.sql", "compiled": true, "compiled_code": "/* selecting the full patient population as the grain of this table */\nwith __dbt__cte__quality_measures__stg_core__patient as (\n\nselect\n patient_id\n , sex\n , birth_date\n , death_date\n , '2023-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom devforrest.core.patient\n),patient as (\n\n select distinct patient_id\n from __dbt__cte__quality_measures__stg_core__patient\n\n)\n\n, denominator as (\n\n select\n patient_id\n from devforrest.quality_measures._int_nqf0034_denominator\n\n)\n\n, numerator as (\n\n select\n patient_id\n , evidence_date\n from devforrest.quality_measures._int_nqf0034_numerator\n\n)\n\n, exclusions as (\n\n select\n patient_id\n , exclusion_date\n , exclusion_reason\n from devforrest.quality_measures._int_nqf0034_exclusions\n\n)\n\n, measure_flags as (\n\n select\n patient.patient_id\n , case\n when denominator.patient_id is not null\n then 1\n else null\n end as denominator_flag\n , case\n when numerator.patient_id is not null\n then 1\n else null\n end as numerator_flag\n , case\n when exclusions.patient_id is not null\n then 1\n else null\n end as exclusion_flag\n , numerator.evidence_date\n , exclusions.exclusion_date\n , exclusions.exclusion_reason\n , pp.performance_period_begin\n , pp.performance_period_end\n , (\n select id\nfrom devforrest.quality_measures._value_set_measures\nwhere id = 'NQF0034'\n ) as measure_id\n , (\n\n select name\nfrom devforrest.quality_measures._value_set_measures\nwhere id = 'NQF0034'\n\n ) as measure_name\n , (\n select version\nfrom devforrest.quality_measures._value_set_measures\nwhere id = 'NQF0034'\n\n ) as measure_version\n from patient\n inner join devforrest.quality_measures._int_nqf0034__performance_period pp\n on 1 = 1\n left join denominator\n on patient.patient_id = denominator.patient_id\n left join numerator\n on patient.patient_id = numerator.patient_id\n left join exclusions\n on patient.patient_id = exclusions.patient_id\n\n)\n\n/*\n Deduplicate measure rows by latest evidence date or exclusion date\n*/\n, add_rownum as (\n\n select\n patient_id\n , denominator_flag\n , numerator_flag\n , exclusion_flag\n , evidence_date\n , exclusion_date\n , exclusion_reason\n , performance_period_begin\n , performance_period_end\n , measure_id\n , measure_name\n , measure_version\n , row_number() over(\n partition by\n patient_id\n , performance_period_begin\n , performance_period_end\n , measure_id\n , measure_name\n order by\n evidence_date desc nulls last\n , exclusion_date desc nulls last\n ) as row_num\n from measure_flags\n\n)\n\n, deduped as (\n\n select\n patient_id\n , denominator_flag\n , numerator_flag\n , exclusion_flag\n , evidence_date\n , exclusion_date\n , exclusion_reason\n , performance_period_begin\n , performance_period_end\n , measure_id\n , measure_name\n , measure_version\n from add_rownum\n where row_num = 1\n\n)\n\n, add_data_types as (\n\n select\n cast(patient_id as TEXT) as patient_id\n , cast(denominator_flag as integer) as denominator_flag\n , cast(numerator_flag as integer) as numerator_flag\n , cast(exclusion_flag as integer) as exclusion_flag\n , cast(evidence_date as date) as evidence_date\n , cast(exclusion_date as date) as exclusion_date\n , cast(exclusion_reason as TEXT) as exclusion_reason\n , cast(performance_period_begin as date) as performance_period_begin\n , cast(performance_period_end as date) as performance_period_end\n , cast(measure_id as TEXT) as measure_id\n , cast(measure_name as TEXT) as measure_name\n , cast(measure_version as TEXT) as measure_version\n from deduped\n\n)\n\nselect\n patient_id\n , denominator_flag\n , numerator_flag\n , exclusion_flag\n , evidence_date\n , exclusion_date\n , exclusion_reason\n , performance_period_begin\n , performance_period_end\n , measure_id\n , measure_name\n , measure_version\n , '2023-12-13 23:31:59.089856+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-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom devforrest.core.patient\n)"}]}, "model.the_tuva_project.quality_measures__int_nqf0034_numerator": {"database": "devforrest", "schema": "quality_measures", "name": "quality_measures__int_nqf0034_numerator", "resource_type": "model", "package_name": "the_tuva_project", "path": "quality_measures\\intermediate\\nqf0034_colorectal_cancer_screening\\quality_measures__int_nqf0034_numerator.sql", "original_file_path": "models\\quality_measures\\intermediate\\nqf0034_colorectal_cancer_screening\\quality_measures__int_nqf0034_numerator.sql", "unique_id": "model.the_tuva_project.quality_measures__int_nqf0034_numerator", "fqn": ["the_tuva_project", "quality_measures", "intermediate", "nqf0034_colorectal_cancer_screening", "quality_measures__int_nqf0034_numerator"], "alias": "_int_nqf0034_numerator", "checksum": {"name": "sha256", "checksum": "b0dd0aee07a195f970b5049ce15ae4173ab52a64a35430ed58c720911a3214aa"}, "config": {"enabled": true, "alias": "_int_nqf0034_numerator", "schema": "quality_measures", "database": null, "tags": ["quality_measures"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["quality_measures"], "description": "Numerator logic for the reporting version of NQF 0034, Colorectal Cancer Screening\n", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://models\\quality_measures\\quality_measures_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "quality_measures", "alias": "_int_nqf0034_numerator", "tags": "quality_measures", "materialized": "table", "enabled": true, "bind": false}, "created_at": 1702481697.1821315, "relation_name": "devforrest.quality_measures._int_nqf0034_numerator", "raw_code": "{{ config(\r\n enabled = var('quality_measures_enabled',var('claims_enabled',var('clinical_enabled',var('tuva_marts_enabled',False))))\r\n )\r\n}}\r\n\r\n\r\n/*\r\nPatients with one or more screenings for colorectal cancer. Appropriate screenings are defined by any one of the\r\nfollowing criteria:\r\n- Fecal occult blood test (FOBT) during the measurement period\r\n- Flexible sigmoidoscopy during the measurement period or the four years prior to the measurement period\r\n- Colonoscopy during the measurement period or the nine years prior to the measurement period\r\n- Computed tomography (CT) colonography during the measurement period or the four years prior to the\r\nmeasurement period.\r\n- Fecal immunochemical DNA test (FIT-DNA) during the measurement period or the two years prior to the\r\nmeasurement period.\r\n\r\n*/\r\n\r\nwith denominator as (\r\n\r\n select\r\n patient_id\r\n\r\n from {{ ref('quality_measures__int_nqf0034_denominator') }}\r\n\r\n)\r\n, screening_codes as\r\n(\r\n select\r\n code\r\n , case code_system\r\n when 'SNOMEDCT' then 'snomed-ct'\r\n when 'ICD9CM' then 'icd-9-cm'\r\n when 'ICD10CM' then 'icd-10-cm'\r\n when 'CPT' then 'hcpcs'\r\n when 'ICD10PCS' then 'icd-10-pcs'\r\n else lower(code_system) end as code_system\r\n , concept_name\r\n From {{ref('quality_measures__value_sets')}}\r\n where concept_name in (\r\n 'Fecal Occult Blood Test (FOBT)' -- mp\r\n ,'Flexible Sigmoidoscopy' --mp+4\r\n ,'Colonoscopy' -- mp+9\r\n ,'CT Colonography' -- mp+4\r\n ,'sDNA FIT Test' -- mp+2\r\n )\r\n)\r\n, screening_periods as (\r\n select *,\r\n case concept_name\r\n when 'Fecal Occult Blood Test (FOBT)' then pp.performance_period_begin --mp\r\n when 'Flexible Sigmoidoscopy' then pp.performance_period_begin_4yp --mp+4\r\n when 'Colonoscopy' then pp.performance_period_begin_9yp -- mp+9\r\n when 'CT Colonography' then pp.performance_period_begin_4yp -- mp+4\r\n when 'sDNA FIT Test' then pp.performance_period_begin_2yp -- mp+2\r\n else pp.performance_period_begin end as effective_performance_period_begin\r\n\r\n from screening_codes\r\n inner join {{ref('quality_measures__int_nqf0034__performance_period')}} pp\r\n on 1 = 1\r\n )\r\n\r\n\r\n, medical_claim as (\r\n\r\n select\r\n patient_id\r\n , claim_start_date\r\n , claim_end_date\r\n , hcpcs_code\r\n from {{ ref('quality_measures__stg_medical_claim') }}\r\n\r\n)\r\n\r\n, observations as (\r\n\r\n select\r\n patient_id\r\n , observation_date\r\n , coalesce (\r\n normalized_code_type\r\n , case\r\n when lower(source_code_type) = 'cpt' then 'hcpcs'\r\n when lower(source_code_type) = 'snomed' then 'snomed-ct'\r\n else lower(source_code_type)\r\n end\r\n ) as code_type\r\n , coalesce (\r\n normalized_code\r\n , source_code\r\n ) as code\r\n from {{ ref('quality_measures__stg_core__observation') }}\r\n\r\n)\r\n\r\n, procedures as (\r\n\r\n select\r\n patient_id\r\n , procedure_date\r\n , coalesce(\r\n normalized_code_type\r\n , case\r\n when lower(source_code_type) = 'cpt' then 'hcpcs'\r\n when lower(source_code_type) = 'snomed' then 'snomed-ct'\r\n else lower(source_code_type)\r\n end\r\n ) as code_type\r\n , coalesce(\r\n normalized_code\r\n , source_code\r\n ) as code\r\n from {{ ref('quality_measures__stg_core__procedure') }}\r\n\r\n)\r\n\r\n, labs as (\r\n select patient_id\r\n , result_date\r\n , collection_date\r\n , source_code_type\r\n , source_code\r\n , normalized_code_type\r\n , normalized_code\r\n from {{ ref('quality_measures__stg_core__lab_result')}}\r\n )\r\n\r\n\r\n, qualifying_claims as (\r\n\r\n select\r\n medical_claim.patient_id\r\n , coalesce( medical_claim.claim_start_date, medical_claim.claim_end_date) as claim_date\r\n , screening_codes.concept_name\r\n from medical_claim\r\n inner join screening_periods\r\n on medical_claim.claim_start_date between screening_periods.effective_performance_period_begin and screening_periods.performance_period_end\r\n or medical_claim.claim_end_date between screening_periods.effective_performance_period_begin and screening_periods.performance_period_end\r\n inner join screening_codes\r\n on medical_claim.hcpcs_code = screening_codes.code\r\n where screening_codes.code_system in ('hcpcs', 'cpt' )\r\n\r\n)\r\n\r\n, qualifying_observations as (\r\n\r\n select\r\n observations.patient_id\r\n , observations.observation_date\r\n , screening_codes.concept_name\r\n from observations\r\n inner join screening_periods\r\n on observations.observation_date between screening_periods.effective_performance_period_begin and screening_periods.performance_period_end\r\n inner join screening_codes\r\n on observations.code = screening_codes.code\r\n and observations.code_type = screening_codes.code_system\r\n)\r\n\r\n, qualifying_procedures as (\r\n\r\n select\r\n procedures.patient_id\r\n , procedures.procedure_date\r\n , screening_codes.concept_name\r\n from procedures\r\n inner join screening_periods\r\n on procedures.procedure_date between screening_periods.effective_performance_period_begin and screening_periods.performance_period_end\r\n inner join screening_codes\r\n on procedures.code = screening_codes.code\r\n and procedures.code_type = screening_codes.code_system\r\n\r\n)\r\n\r\n,qualifying_labs as (\r\n select\r\n patient_id\r\n , coalesce(collection_date,result_date) as lab_date\r\n , screening_codes.concept_name\r\n from labs\r\n inner join screening_periods\r\n on coalesce(labs.collection_date, labs.result_date) between screening_periods.effective_performance_period_begin and screening_periods.performance_period_end\r\n inner join screening_codes\r\n on ( labs.normalized_code = screening_codes.code\r\n and labs.normalized_code_type = screening_codes.code_system )\r\n or ( labs.source_code = screening_codes.code\r\n and labs.source_code_type = screening_codes.code_system )\r\n )\r\n\r\n,qualifying_events as (\r\n select\r\n patient_id\r\n , claim_date as evidence_date\r\n , concept_name as evidence\r\n from qualifying_claims\r\n\r\n union all\r\n\r\n select\r\n patient_id\r\n , observation_date as evidence_date\r\n , concept_name as evidence\r\n from qualifying_observations\r\n\r\n union all\r\n\r\n select\r\n patient_id\r\n , procedure_date as evidence_date\r\n , concept_name as evidence\r\n from qualifying_procedures\r\n\r\n union all\r\n\r\n select\r\n patient_id\r\n , lab_date as evidence_date\r\n , concept_name as evidence\r\n from qualifying_labs\r\n\r\n )\r\n\r\nselect\r\n cast (qualifying_events.patient_id as {{ dbt.type_string() }}) patient_id\r\n ,cast( evidence_date as date) as evidence_date\r\n ,cast( evidence as {{ dbt.type_string() }}) as evidence\r\n\r\nfrom qualifying_events\r\ninner join denominator\r\n on qualifying_events.patient_id = denominator.patient_id", "language": "sql", "refs": [["quality_measures__int_nqf0034_denominator"], ["quality_measures__value_sets"], ["quality_measures__int_nqf0034__performance_period"], ["quality_measures__stg_medical_claim"], ["quality_measures__stg_core__observation"], ["quality_measures__stg_core__procedure"], ["quality_measures__stg_core__lab_result"]], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.type_string"], "nodes": ["model.the_tuva_project.quality_measures__int_nqf0034_denominator", "seed.the_tuva_project.quality_measures__value_sets", "model.the_tuva_project.quality_measures__int_nqf0034__performance_period", "model.the_tuva_project.quality_measures__stg_medical_claim", "model.the_tuva_project.quality_measures__stg_core__observation", "model.the_tuva_project.quality_measures__stg_core__procedure", "model.the_tuva_project.quality_measures__stg_core__lab_result"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\quality_measures\\intermediate\\nqf0034_colorectal_cancer_screening\\quality_measures__int_nqf0034_numerator.sql", "compiled": true, "compiled_code": "\n\n\n/*\nPatients with one or more screenings for colorectal cancer. Appropriate screenings are defined by any one of the\nfollowing criteria:\n- Fecal occult blood test (FOBT) during the measurement period\n- Flexible sigmoidoscopy during the measurement period or the four years prior to the measurement period\n- Colonoscopy during the measurement period or the nine years prior to the measurement period\n- Computed tomography (CT) colonography during the measurement period or the four years prior to the\nmeasurement period.\n- Fecal immunochemical DNA test (FIT-DNA) during the measurement period or the two years prior to the\nmeasurement period.\n\n*/\n\nwith __dbt__cte__quality_measures__stg_medical_claim as (\n\n\nselect\n patient_id\n , claim_id\n , claim_start_date\n , claim_end_date\n , place_of_service_code\n , hcpcs_code\n , '2023-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom devforrest.core.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-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom devforrest.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-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom devforrest.core.procedure\n), __dbt__cte__quality_measures__stg_core__lab_result as (\n\n\nselect\n patient_id\n , result_date\n , collection_date\n , source_code_type\n , source_code\n , normalized_code_type\n , normalized_code\n , '2023-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom devforrest.core.lab_result\n\n\n),denominator as (\n\n select\n patient_id\n\n from devforrest.quality_measures._int_nqf0034_denominator\n\n)\n, screening_codes as\n(\n select\n code\n , case code_system\n when 'SNOMEDCT' then 'snomed-ct'\n when 'ICD9CM' then 'icd-9-cm'\n when 'ICD10CM' then 'icd-10-cm'\n when 'CPT' then 'hcpcs'\n when 'ICD10PCS' then 'icd-10-pcs'\n else lower(code_system) end as code_system\n , concept_name\n From devforrest.quality_measures._value_set_codes\n where concept_name in (\n 'Fecal Occult Blood Test (FOBT)' -- mp\n ,'Flexible Sigmoidoscopy' --mp+4\n ,'Colonoscopy' -- mp+9\n ,'CT Colonography' -- mp+4\n ,'sDNA FIT Test' -- mp+2\n )\n)\n, screening_periods as (\n select *,\n case concept_name\n when 'Fecal Occult Blood Test (FOBT)' then pp.performance_period_begin --mp\n when 'Flexible Sigmoidoscopy' then pp.performance_period_begin_4yp --mp+4\n when 'Colonoscopy' then pp.performance_period_begin_9yp -- mp+9\n when 'CT Colonography' then pp.performance_period_begin_4yp -- mp+4\n when 'sDNA FIT Test' then pp.performance_period_begin_2yp -- mp+2\n else pp.performance_period_begin end as effective_performance_period_begin\n\n from screening_codes\n inner join devforrest.quality_measures._int_nqf0034__performance_period pp\n on 1 = 1\n )\n\n\n, medical_claim as (\n\n select\n patient_id\n , claim_start_date\n , claim_end_date\n , hcpcs_code\n from __dbt__cte__quality_measures__stg_medical_claim\n\n)\n\n, observations as (\n\n select\n patient_id\n , observation_date\n , coalesce (\n normalized_code_type\n , case\n when lower(source_code_type) = 'cpt' then 'hcpcs'\n when lower(source_code_type) = 'snomed' then 'snomed-ct'\n else lower(source_code_type)\n end\n ) as code_type\n , coalesce (\n normalized_code\n , source_code\n ) as code\n from __dbt__cte__quality_measures__stg_core__observation\n\n)\n\n, procedures as (\n\n select\n patient_id\n , procedure_date\n , coalesce(\n normalized_code_type\n , case\n when lower(source_code_type) = 'cpt' then 'hcpcs'\n when lower(source_code_type) = 'snomed' then 'snomed-ct'\n else lower(source_code_type)\n end\n ) as code_type\n , coalesce(\n normalized_code\n , source_code\n ) as code\n from __dbt__cte__quality_measures__stg_core__procedure\n\n)\n\n, labs as (\n select patient_id\n , result_date\n , collection_date\n , source_code_type\n , source_code\n , normalized_code_type\n , normalized_code\n from __dbt__cte__quality_measures__stg_core__lab_result\n )\n\n\n, qualifying_claims as (\n\n select\n medical_claim.patient_id\n , coalesce( medical_claim.claim_start_date, medical_claim.claim_end_date) as claim_date\n , screening_codes.concept_name\n from medical_claim\n inner join screening_periods\n on medical_claim.claim_start_date between screening_periods.effective_performance_period_begin and screening_periods.performance_period_end\n or medical_claim.claim_end_date between screening_periods.effective_performance_period_begin and screening_periods.performance_period_end\n inner join screening_codes\n on medical_claim.hcpcs_code = screening_codes.code\n where screening_codes.code_system in ('hcpcs', 'cpt' )\n\n)\n\n, qualifying_observations as (\n\n select\n observations.patient_id\n , observations.observation_date\n , screening_codes.concept_name\n from observations\n inner join screening_periods\n on observations.observation_date between screening_periods.effective_performance_period_begin and screening_periods.performance_period_end\n inner join screening_codes\n on observations.code = screening_codes.code\n and observations.code_type = screening_codes.code_system\n)\n\n, qualifying_procedures as (\n\n select\n procedures.patient_id\n , procedures.procedure_date\n , screening_codes.concept_name\n from procedures\n inner join screening_periods\n on procedures.procedure_date between screening_periods.effective_performance_period_begin and screening_periods.performance_period_end\n inner join screening_codes\n on procedures.code = screening_codes.code\n and procedures.code_type = screening_codes.code_system\n\n)\n\n,qualifying_labs as (\n select\n patient_id\n , coalesce(collection_date,result_date) as lab_date\n , screening_codes.concept_name\n from labs\n inner join screening_periods\n on coalesce(labs.collection_date, labs.result_date) between screening_periods.effective_performance_period_begin and screening_periods.performance_period_end\n inner join screening_codes\n on ( labs.normalized_code = screening_codes.code\n and labs.normalized_code_type = screening_codes.code_system )\n or ( labs.source_code = screening_codes.code\n and labs.source_code_type = screening_codes.code_system )\n )\n\n,qualifying_events as (\n select\n patient_id\n , claim_date as evidence_date\n , concept_name as evidence\n from qualifying_claims\n\n union all\n\n select\n patient_id\n , observation_date as evidence_date\n , concept_name as evidence\n from qualifying_observations\n\n union all\n\n select\n patient_id\n , procedure_date as evidence_date\n , concept_name as evidence\n from qualifying_procedures\n\n union all\n\n select\n patient_id\n , lab_date as evidence_date\n , concept_name as evidence\n from qualifying_labs\n\n )\n\nselect\n cast (qualifying_events.patient_id as TEXT) patient_id\n ,cast( evidence_date as date) as evidence_date\n ,cast( evidence as TEXT) as evidence\n\nfrom qualifying_events\ninner join denominator\n on qualifying_events.patient_id = denominator.patient_id", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.the_tuva_project.quality_measures__stg_medical_claim", "sql": " __dbt__cte__quality_measures__stg_medical_claim as (\n\n\nselect\n patient_id\n , claim_id\n , claim_start_date\n , claim_end_date\n , place_of_service_code\n , hcpcs_code\n , '2023-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom devforrest.core.medical_claim\n\n\n)"}, {"id": "model.the_tuva_project.quality_measures__stg_core__observation", "sql": " __dbt__cte__quality_measures__stg_core__observation as (\n\n\nselect\n patient_id\n , observation_date\n , source_code_type\n , source_code\n , normalized_code_type\n , normalized_code\n , '2023-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom devforrest.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-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom devforrest.core.procedure\n)"}, {"id": "model.the_tuva_project.quality_measures__stg_core__lab_result", "sql": " __dbt__cte__quality_measures__stg_core__lab_result as (\n\n\nselect\n patient_id\n , result_date\n , collection_date\n , source_code_type\n , source_code\n , normalized_code_type\n , normalized_code\n , '2023-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom devforrest.core.lab_result\n\n\n)"}]}, "model.the_tuva_project.quality_measures__int_nqf0034__frailty": {"database": "devforrest", "schema": "quality_measures", "name": "quality_measures__int_nqf0034__frailty", "resource_type": "model", "package_name": "the_tuva_project", "path": "quality_measures\\intermediate\\nqf0034_colorectal_cancer_screening\\quality_measures__int_nqf0034__frailty.sql", "original_file_path": "models\\quality_measures\\intermediate\\nqf0034_colorectal_cancer_screening\\quality_measures__int_nqf0034__frailty.sql", "unique_id": "model.the_tuva_project.quality_measures__int_nqf0034__frailty", "fqn": ["the_tuva_project", "quality_measures", "intermediate", "nqf0034_colorectal_cancer_screening", "quality_measures__int_nqf0034__frailty"], "alias": "_int_nqf0034__frailty", "checksum": {"name": "sha256", "checksum": "741002b44b13a2ee4a384e8991b0428c80b0bc226ca3cc25248b25870b8729da"}, "config": {"enabled": true, "alias": "_int_nqf0034__frailty", "schema": "quality_measures", "database": null, "tags": ["quality_measures"], "meta": {}, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["quality_measures"], "description": "Frailty definition for nqf 0034 colorectal cancer screening used in multiple exclusions\n", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://models\\quality_measures\\quality_measures_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "quality_measures", "alias": "_int_nqf0034__frailty", "tags": "quality_measures", "materialized": "view", "enabled": true, "bind": false}, "created_at": 1702481697.192217, "relation_name": "devforrest.quality_measures._int_nqf0034__frailty", "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\nDENOMINATOR EXCLUSIONS:\r\nPatients 66 years of age and older with at least one claim/encounter\r\nfor frailty during the measurement period (not full exclusion, used\r\nin conjunction with dementia medication or\r\n*/\r\n\r\n\r\nwith aged_patients as (\r\n select distinct patient_id\r\n from {{ref('quality_measures__int_nqf0034_denominator')}}\r\n where max_age >=66\r\n\r\n)\r\n\r\n, exclusion_codes as (\r\n select\r\n code\r\n , case code_system\r\n when 'SNOMEDCT' then 'snomed-ct'\r\n when 'ICD9CM' then 'icd-9-cm'\r\n when 'ICD10CM' then 'icd-10-cm'\r\n when 'CPT' then 'hcpcs'\r\n when 'ICD10PCS' then 'icd-10-pcs'\r\n else lower(code_system) end as code_system\r\n , concept_name\r\n , case when code in ('G2100','G2101') then 1 else 0 end as meets_all_criteria\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 )\r\n\r\n\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, 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\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 aged_patients\r\n on conditions.patient_id = aged_patients.patient_id\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 inner join {{ref('quality_measures__int_nqf0034__performance_period')}} as pp on\r\n recorded_date between pp.performance_period_begin and pp.performance_period_end\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 aged_patients\r\n on medical_claim.patient_id = aged_patients.patient_id\r\n inner join exclusion_codes\r\n on medical_claim.hcpcs_code = exclusion_codes.code\r\n inner join {{ref('quality_measures__int_nqf0034__performance_period')}} as pp\r\n on claim_start_date between pp.performance_period_begin and pp.performance_period_end\r\n where exclusion_codes.code_system = 'hcpcs'\r\n\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 aged_patients\r\n on observations.patient_id = aged_patients.patient_id\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 inner join {{ref('quality_measures__int_nqf0034__performance_period')}} as pp\r\n on observation_date between pp.performance_period_begin and pp.performance_period_end\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 aged_patients\r\n on procedures.patient_id = aged_patients.patient_id\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 inner join {{ref('quality_measures__int_nqf0034__performance_period')}} as pp on\r\n procedure_date between pp.performance_period_begin and pp.performance_period_end\r\n\r\n)\r\n\r\n, patients_with_exclusions as(\r\n select patient_id\r\n , recorded_date as exclusion_date\r\n , concept_name as concept_name\r\n from condition_exclusions\r\n\r\n union distinct\r\n\r\n select 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 , concept_name as concept_name\r\n from med_claim_exclusions\r\n\r\n union distinct\r\n\r\n select patient_id\r\n , observation_date as exclusion_date\r\n , concept_name as concept_name\r\n from observation_exclusions\r\n\r\n union distinct\r\n\r\n select patient_id\r\n , procedure_date as exclusion_date\r\n , concept_name as concept_name\r\n from procedure_exclusions\r\n\r\n)\r\n, ordered_exclusions as (\r\n select patient_id\r\n , exclusion_date\r\n , concept_name\r\n , row_number() over (partition by patient_id order by exclusion_date) as exclusion_row\r\n from patients_with_exclusions\r\n )\r\n\r\nselect patient_id\r\n , exclusion_date\r\n , concept_name\r\nfrom ordered_exclusions", "language": "sql", "refs": [["quality_measures__int_nqf0034_denominator"], ["quality_measures__value_sets"], ["quality_measures__stg_core__condition"], ["quality_measures__stg_medical_claim"], ["quality_measures__stg_core__observation"], ["quality_measures__stg_core__procedure"], ["quality_measures__int_nqf0034__performance_period"], ["quality_measures__int_nqf0034__performance_period"], ["quality_measures__int_nqf0034__performance_period"], ["quality_measures__int_nqf0034__performance_period"]], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.quality_measures__int_nqf0034_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", "model.the_tuva_project.quality_measures__int_nqf0034__performance_period", "model.the_tuva_project.quality_measures__int_nqf0034__performance_period", "model.the_tuva_project.quality_measures__int_nqf0034__performance_period", "model.the_tuva_project.quality_measures__int_nqf0034__performance_period"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\quality_measures\\intermediate\\nqf0034_colorectal_cancer_screening\\quality_measures__int_nqf0034__frailty.sql", "compiled": true, "compiled_code": "\n\n/*\nDENOMINATOR EXCLUSIONS:\nPatients 66 years of age and older with at least one claim/encounter\nfor frailty during the measurement period (not full exclusion, used\nin conjunction with dementia medication or\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-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom devforrest.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-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom devforrest.core.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-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom devforrest.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-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom devforrest.core.procedure\n),aged_patients as (\n select distinct patient_id\n from devforrest.quality_measures._int_nqf0034_denominator\n where max_age >=66\n\n)\n\n, exclusion_codes as (\n select\n code\n , case code_system\n when 'SNOMEDCT' then 'snomed-ct'\n when 'ICD9CM' then 'icd-9-cm'\n when 'ICD10CM' then 'icd-10-cm'\n when 'CPT' then 'hcpcs'\n when 'ICD10PCS' then 'icd-10-pcs'\n else lower(code_system) end as code_system\n , concept_name\n , case when code in ('G2100','G2101') then 1 else 0 end as meets_all_criteria\n From devforrest.quality_measures._value_set_codes\n where concept_name in (\n 'Frailty Device'\n , 'Frailty Diagnosis'\n , 'Frailty Encounter'\n , 'Frailty Symptom'\n )\n\n\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, 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\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 aged_patients\n on conditions.patient_id = aged_patients.patient_id\n inner join exclusion_codes\n on conditions.code = exclusion_codes.code\n and conditions.code_type = exclusion_codes.code_system\n inner join devforrest.quality_measures._int_nqf0034__performance_period as pp on\n recorded_date between pp.performance_period_begin and pp.performance_period_end\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 aged_patients\n on medical_claim.patient_id = aged_patients.patient_id\n inner join exclusion_codes\n on medical_claim.hcpcs_code = exclusion_codes.code\n inner join devforrest.quality_measures._int_nqf0034__performance_period as pp\n on claim_start_date between pp.performance_period_begin and pp.performance_period_end\n where exclusion_codes.code_system = 'hcpcs'\n\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 aged_patients\n on observations.patient_id = aged_patients.patient_id\n inner join exclusion_codes\n on observations.code = exclusion_codes.code\n and observations.code_type = exclusion_codes.code_system\n inner join devforrest.quality_measures._int_nqf0034__performance_period as pp\n on observation_date between pp.performance_period_begin and pp.performance_period_end\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 aged_patients\n on procedures.patient_id = aged_patients.patient_id\n inner join exclusion_codes\n on procedures.code = exclusion_codes.code\n and procedures.code_type = exclusion_codes.code_system\n inner join devforrest.quality_measures._int_nqf0034__performance_period as pp on\n procedure_date between pp.performance_period_begin and pp.performance_period_end\n\n)\n\n, patients_with_exclusions as(\n select patient_id\n , recorded_date as exclusion_date\n , concept_name as concept_name\n from condition_exclusions\n\n union distinct\n\n select patient_id\n , coalesce(\n med_claim_exclusions.claim_start_date\n , med_claim_exclusions.claim_end_date\n ) as exclusion_date\n , concept_name as concept_name\n from med_claim_exclusions\n\n union distinct\n\n select patient_id\n , observation_date as exclusion_date\n , concept_name as concept_name\n from observation_exclusions\n\n union distinct\n\n select patient_id\n , procedure_date as exclusion_date\n , concept_name as concept_name\n from procedure_exclusions\n\n)\n, ordered_exclusions as (\n select patient_id\n , exclusion_date\n , concept_name\n , row_number() over (partition by patient_id order by exclusion_date) as exclusion_row\n from patients_with_exclusions\n )\n\nselect patient_id\n , exclusion_date\n , concept_name\nfrom ordered_exclusions", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.the_tuva_project.quality_measures__stg_core__condition", "sql": " __dbt__cte__quality_measures__stg_core__condition as (\n\nselect\n patient_id\n , claim_id\n , recorded_date\n , source_code_type\n , source_code\n , normalized_code_type\n , normalized_code\n , '2023-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom devforrest.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-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom devforrest.core.medical_claim\n\n\n)"}, {"id": "model.the_tuva_project.quality_measures__stg_core__observation", "sql": " __dbt__cte__quality_measures__stg_core__observation as (\n\n\nselect\n patient_id\n , observation_date\n , source_code_type\n , source_code\n , normalized_code_type\n , normalized_code\n , '2023-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom devforrest.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-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom devforrest.core.procedure\n)"}]}, "model.the_tuva_project.quality_measures__int_nqf0034__performance_period": {"database": "devforrest", "schema": "quality_measures", "name": "quality_measures__int_nqf0034__performance_period", "resource_type": "model", "package_name": "the_tuva_project", "path": "quality_measures\\intermediate\\nqf0034_colorectal_cancer_screening\\quality_measures__int_nqf0034__performance_period.sql", "original_file_path": "models\\quality_measures\\intermediate\\nqf0034_colorectal_cancer_screening\\quality_measures__int_nqf0034__performance_period.sql", "unique_id": "model.the_tuva_project.quality_measures__int_nqf0034__performance_period", "fqn": ["the_tuva_project", "quality_measures", "intermediate", "nqf0034_colorectal_cancer_screening", "quality_measures__int_nqf0034__performance_period"], "alias": "_int_nqf0034__performance_period", "checksum": {"name": "sha256", "checksum": "0a048ddc7e41c9d64f28fc5fd4958aca0f2d5546089ad8d9948249b6af47f912"}, "config": {"enabled": true, "alias": "_int_nqf0034__performance_period", "schema": "quality_measures", "database": null, "tags": ["quality_measures"], "meta": {}, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["quality_measures"], "description": "Performance Period definition for NQF 0034 Colorectal Cancer screening.\n", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://models\\quality_measures\\quality_measures_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "quality_measures", "alias": "_int_nqf0034__performance_period", "tags": "quality_measures", "materialized": "view", "enabled": true, "bind": false}, "created_at": 1702481697.1953387, "relation_name": "devforrest.quality_measures._int_nqf0034__performance_period", "raw_code": "{{ config(\r\n enabled = var('quality_measures_enabled',var('claims_enabled',var('clinical_enabled',var('tuva_marts_enabled',False))))\r\n )\r\n}}\r\n/*\r\n set performance period end to the end of the current calendar year\r\n or use the quality_measures_period_end variable if provided\r\n*/\r\nwith period_end as (\r\n\r\n select\r\n {% if var('quality_measures_period_end',False) == False -%}\r\n {{ last_day(dbt.current_timestamp(), 'year') }}\r\n {% else -%}\r\n cast('{{ var('quality_measures_period_end') }}' as date)\r\n {%- endif %}\r\n as performance_period_end\r\n)\r\n\r\n/*\r\n set performance period begin to a year and a day prior\r\n for a complete calendar year\r\n*/\r\n, period_begin as (\r\n\r\n select\r\n performance_period_end\r\n , {{ dbt.dateadd (\r\n datepart = \"day\"\r\n , interval = +1\r\n , from_date_or_timestamp =\r\n dbt.dateadd (\r\n datepart = \"year\"\r\n , interval = -1\r\n , from_date_or_timestamp = \"performance_period_end\"\r\n )\r\n ) }} as performance_period_begin\r\n from period_end\r\n\r\n)\r\n\r\n/*\r\n set performance lookback periods for each type of test\r\n\r\n during the measurement period:\r\n - Fecal occult blood test (FOBT) during the measurement period\r\n\r\n during the measurement period or the two years prior:\r\n - Fecal immunochemical DNA test (FIT-DNA)\r\n\r\n during the measurement period or the four years prior:\r\n - Flexible sigmoidoscopy\r\n - Computed tomography (CT) colonography\r\n\r\n during the measurement period or the nine years prior:\r\n - Colonoscopy\r\n\r\n*/\r\n, period_lookback as (\r\n\r\n select\r\n performance_period_end\r\n , performance_period_begin\r\n , {{ dbt.dateadd(\r\n datepart = \"year\"\r\n , interval = -2\r\n , from_date_or_timestamp = \"performance_period_end\"\r\n ) }} as performance_period_begin_1yp\r\n , {{ dbt.dateadd(\r\n datepart = \"year\"\r\n , interval = -3\r\n , from_date_or_timestamp = \"performance_period_end\"\r\n ) }} as performance_period_begin_2yp\r\n , {{ dbt.dateadd(\r\n datepart = \"year\"\r\n , interval = -5\r\n , from_date_or_timestamp = \"performance_period_end\"\r\n ) }} as performance_period_begin_4yp\r\n , {{ dbt.dateadd(\r\n datepart = \"year\"\r\n , interval = -10\r\n , from_date_or_timestamp = \"performance_period_end\"\r\n ) }} as performance_period_begin_9yp\r\n from period_begin\r\n\r\n)\r\n\r\nselect\r\n cast(performance_period_begin as date) as performance_period_begin\r\n , cast(performance_period_end as date) as performance_period_end\r\n , cast(performance_period_begin_1yp as date) as performance_period_begin_1yp\r\n , cast(performance_period_begin_2yp as date) as performance_period_begin_2yp\r\n , cast(performance_period_begin_4yp as date) as performance_period_begin_4yp\r\n , cast(performance_period_begin_9yp as date) as performance_period_begin_9yp\r\nfrom period_lookback", "language": "sql", "refs": [], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.current_timestamp", "macro.dbt.last_day", "macro.dbt.dateadd"], "nodes": []}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\quality_measures\\intermediate\\nqf0034_colorectal_cancer_screening\\quality_measures__int_nqf0034__performance_period.sql", "compiled": true, "compiled_code": "\n/*\n set performance period end to the end of the current calendar year\n or use the quality_measures_period_end variable if provided\n*/\nwith period_end as (\n\n select\n cast(\n \n\n dateadd(\n day,\n -1,\n \n\n dateadd(\n year,\n 1,\n date_trunc('year', convert_timezone('UTC', current_timestamp()))\n )\n\n\n )\n\n\n as date)\n \n as performance_period_end\n)\n\n/*\n set performance period begin to a year and a day prior\n for a complete calendar year\n*/\n, period_begin as (\n\n select\n performance_period_end\n , \n\n dateadd(\n day,\n 1,\n \n\n dateadd(\n year,\n -1,\n performance_period_end\n )\n\n\n )\n\n as performance_period_begin\n from period_end\n\n)\n\n/*\n set performance lookback periods for each type of test\n\n during the measurement period:\n - Fecal occult blood test (FOBT) during the measurement period\n\n during the measurement period or the two years prior:\n - Fecal immunochemical DNA test (FIT-DNA)\n\n during the measurement period or the four years prior:\n - Flexible sigmoidoscopy\n - Computed tomography (CT) colonography\n\n during the measurement period or the nine years prior:\n - Colonoscopy\n\n*/\n, period_lookback as (\n\n select\n performance_period_end\n , performance_period_begin\n , \n\n dateadd(\n year,\n -2,\n performance_period_end\n )\n\n as performance_period_begin_1yp\n , \n\n dateadd(\n year,\n -3,\n performance_period_end\n )\n\n as performance_period_begin_2yp\n , \n\n dateadd(\n year,\n -5,\n performance_period_end\n )\n\n as performance_period_begin_4yp\n , \n\n dateadd(\n year,\n -10,\n performance_period_end\n )\n\n as performance_period_begin_9yp\n from period_begin\n\n)\n\nselect\n cast(performance_period_begin as date) as performance_period_begin\n , cast(performance_period_end as date) as performance_period_end\n , cast(performance_period_begin_1yp as date) as performance_period_begin_1yp\n , cast(performance_period_begin_2yp as date) as performance_period_begin_2yp\n , cast(performance_period_begin_4yp as date) as performance_period_begin_4yp\n , cast(performance_period_begin_9yp as date) as performance_period_begin_9yp\nfrom period_lookback", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.quality_measures__int_nqf2372_denominator": {"database": "devforrest", "schema": "quality_measures", "name": "quality_measures__int_nqf2372_denominator", "resource_type": "model", "package_name": "the_tuva_project", "path": "quality_measures\\intermediate\\nqf2372_breast_cancer_screening\\quality_measures__int_nqf2372_denominator.sql", "original_file_path": "models\\quality_measures\\intermediate\\nqf2372_breast_cancer_screening\\quality_measures__int_nqf2372_denominator.sql", "unique_id": "model.the_tuva_project.quality_measures__int_nqf2372_denominator", "fqn": ["the_tuva_project", "quality_measures", "intermediate", "nqf2372_breast_cancer_screening", "quality_measures__int_nqf2372_denominator"], "alias": "_int_nqf2372_denominator", "checksum": {"name": "sha256", "checksum": "d01a42a3ecf14cca0014306d97d622e253616587b0e48f9ed7e945450a2f9044"}, "config": {"enabled": true, "alias": "_int_nqf2372_denominator", "schema": "quality_measures", "database": null, "tags": ["quality_measures"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["quality_measures"], "description": "Denominator logic for the reporting version of NQF 2372, Breast Cancer Screening.\n", "columns": {"patient_id": {"name": "patient_id", "description": "Unique patient_id for each person.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "age": {"name": "age", "description": "Patient's age as of the performance_period_begin date.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "performance_period_begin": {"name": "performance_period_begin", "description": "Beginning date of the performance or measurement period.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "performance_period_end": {"name": "performance_period_end", "description": "Ending date of the performance or measurement period.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "measure_id": {"name": "measure_id", "description": "Unique measure identification number.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "measure_name": {"name": "measure_name", "description": "Name of the measure.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "measure_version": {"name": "measure_version", "description": "Version of the measure.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "denominator_flag": {"name": "denominator_flag", "description": "The denominator is associated with a given patient population that may be counted as eligible to meet a measure\u2019s inclusion requirements.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The date and timestamp of the dbt run.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://models\\quality_measures\\quality_measures_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "quality_measures", "alias": "_int_nqf2372_denominator", "tags": "quality_measures", "materialized": "table", "enabled": true, "bind": false}, "created_at": 1702481697.122689, "relation_name": "devforrest.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\r\nwith performance_period as (\r\n\r\n select\r\n measure_id\r\n , measure_name\r\n , measure_version\r\n , performance_period_end\r\n , performance_period_begin\r\n , performance_period_lookback\r\n from {{ ref('quality_measures__int_nqf2372__performance_period') }}\r\n\r\n)\r\n\r\n, patient as (\r\n\r\n select\r\n patient_id\r\n , sex\r\n , birth_date\r\n , death_date\r\n from {{ ref('quality_measures__stg_core__patient') }}\r\n\r\n)\r\n\r\n, encounters as (\r\n\r\n select\r\n patient_id\r\n , encounter_type\r\n , encounter_start_date\r\n from {{ ref('quality_measures__stg_core__encounter') }}\r\n\r\n)\r\n\r\n, medical_claim as (\r\n\r\n select\r\n patient_id\r\n , claim_start_date\r\n , claim_end_date\r\n , hcpcs_code\r\n from {{ ref('quality_measures__stg_medical_claim') }}\r\n\r\n)\r\n\r\n, procedures as (\r\n\r\n select\r\n patient_id\r\n , procedure_date\r\n , coalesce (\r\n normalized_code_type\r\n , case\r\n when lower(source_code_type) = 'cpt' then 'hcpcs'\r\n when lower(source_code_type) = 'snomed' then 'snomed-ct'\r\n else lower(source_code_type)\r\n end\r\n ) as code_type\r\n , coalesce (\r\n normalized_code\r\n , source_code\r\n ) as code\r\n from {{ ref('quality_measures__stg_core__procedure') }}\r\n\r\n)\r\n\r\n, visit_codes as (\r\n\r\n select\r\n code\r\n , code_system\r\n from {{ ref('quality_measures__value_sets') }}\r\n where concept_name in (\r\n 'Office Visit'\r\n , 'Home Healthcare Services'\r\n , 'Preventive Care Services Established Office Visit, 18 and Up'\r\n , 'Preventive Care Services Initial Office Visit, 18 and Up'\r\n , 'Annual Wellness Visit'\r\n , 'Telephone Visits'\r\n , 'Online Assessments'\r\n )\r\n\r\n)\r\n\r\n, patient_with_age as (\r\n\r\n select\r\n patient.patient_id\r\n , patient.sex\r\n , patient.birth_date\r\n , patient.death_date\r\n , performance_period.measure_id\r\n , performance_period.measure_name\r\n , performance_period.measure_version\r\n , performance_period.performance_period_begin\r\n , performance_period.performance_period_end\r\n , performance_period.performance_period_lookback\r\n , floor({{ datediff('patient.birth_date', 'performance_period.performance_period_end', 'hour') }} / 8766.0) as age\r\n from patient\r\n cross join performance_period\r\n\r\n)\r\n\r\n/*\r\n Filter patient to living women 51 - 74 years of age\r\n at the beginning of the measurement period\r\n*/\r\n, patient_filtered as (\r\n\r\n select\r\n patient_id\r\n , age\r\n , measure_id\r\n , measure_name\r\n , measure_version\r\n , performance_period_begin\r\n , performance_period_end\r\n , performance_period_lookback\r\n , 1 as denominator_flag\r\n from patient_with_age\r\n where lower(sex) = 'female'\r\n and age between 51 and 74\r\n and death_date is null\r\n\r\n)\r\n\r\n/*\r\n Filter to qualifying visit types by claim procedures\r\n*/\r\n, visit_claims as (\r\n\r\n select\r\n medical_claim.patient_id\r\n , medical_claim.claim_start_date\r\n , medical_claim.claim_end_date\r\n , medical_claim.hcpcs_code\r\n from medical_claim\r\n inner join visit_codes\r\n on medical_claim.hcpcs_code = visit_codes.code\r\n where visit_codes.code_system = 'hcpcs'\r\n\r\n)\r\n\r\n/*\r\n Filter encounters to qualifying visit type\r\n*/\r\n, visit_encounters as (\r\n\r\n select\r\n patient_id\r\n , encounter_start_date\r\n from encounters\r\n where lower(encounter_type) in (\r\n 'home health'\r\n , 'office visit'\r\n , 'outpatient'\r\n , 'outpatient rehabilitation'\r\n , 'telehealth'\r\n )\r\n\r\n)\r\n\r\n/*\r\n Filter to qualifying visit types by procedure\r\n*/\r\n, visit_procedures as (\r\n\r\n select\r\n procedures.patient_id\r\n , procedures.procedure_date\r\n from procedures\r\n inner join visit_codes\r\n on procedures.code = visit_codes.code\r\n and procedures.code_type = visit_codes.code_system\r\n\r\n)\r\n\r\n/*\r\n Filter to final eligible population/denominator before exclusions\r\n with a qualifying visit during the measurement period\r\n*/\r\n, eligible_population as (\r\n\r\n select\r\n patient_filtered.patient_id\r\n , patient_filtered.age\r\n , patient_filtered.measure_id\r\n , patient_filtered.measure_name\r\n , patient_filtered.measure_version\r\n , patient_filtered.performance_period_begin\r\n , patient_filtered.performance_period_end\r\n , performance_period_lookback\r\n , patient_filtered.denominator_flag\r\n from patient_filtered\r\n left join visit_claims\r\n on patient_filtered.patient_id = visit_claims.patient_id\r\n left join visit_procedures\r\n on patient_filtered.patient_id = visit_procedures.patient_id\r\n left join visit_encounters\r\n on patient_filtered.patient_id = visit_encounters.patient_id\r\n where (\r\n visit_claims.claim_start_date\r\n between patient_filtered.performance_period_begin\r\n and patient_filtered.performance_period_end\r\n or visit_claims.claim_end_date\r\n between patient_filtered.performance_period_begin\r\n and patient_filtered.performance_period_end\r\n or visit_procedures.procedure_date\r\n between patient_filtered.performance_period_begin\r\n and patient_filtered.performance_period_end\r\n or visit_encounters.encounter_start_date\r\n between patient_filtered.performance_period_begin\r\n and patient_filtered.performance_period_end\r\n )\r\n\r\n)\r\n\r\n, add_data_types as (\r\n\r\n select distinct\r\n cast(patient_id as {{ dbt.type_string() }}) as patient_id\r\n , cast(age as integer) as age\r\n , cast(performance_period_begin as date) as performance_period_begin\r\n , cast(performance_period_end as date) as performance_period_end\r\n , cast(performance_period_lookback as date) as performance_period_lookback\r\n , cast(measure_id as {{ dbt.type_string() }}) as measure_id\r\n , cast(measure_name as {{ dbt.type_string() }}) as measure_name\r\n , cast(measure_version as {{ dbt.type_string() }}) as measure_version\r\n , cast(denominator_flag as integer) as denominator_flag\r\n from eligible_population\r\n\r\n)\r\n\r\n select distinct\r\n patient_id\r\n , age\r\n , performance_period_begin\r\n , performance_period_end\r\n , performance_period_lookback\r\n , measure_id\r\n , measure_name\r\n , measure_version\r\n , denominator_flag\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom add_data_types", "language": "sql", "refs": [["quality_measures__int_nqf2372__performance_period"], ["quality_measures__stg_core__patient"], ["quality_measures__stg_core__encounter"], ["quality_measures__stg_medical_claim"], ["quality_measures__stg_core__procedure"], ["quality_measures__value_sets"]], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.datediff", "macro.dbt.type_string"], "nodes": ["model.the_tuva_project.quality_measures__int_nqf2372__performance_period", "model.the_tuva_project.quality_measures__stg_core__patient", "model.the_tuva_project.quality_measures__stg_core__encounter", "model.the_tuva_project.quality_measures__stg_medical_claim", "model.the_tuva_project.quality_measures__stg_core__procedure", "seed.the_tuva_project.quality_measures__value_sets"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\quality_measures\\intermediate\\nqf2372_breast_cancer_screening\\quality_measures__int_nqf2372_denominator.sql", "compiled": true, "compiled_code": "\n\nwith __dbt__cte__quality_measures__stg_core__patient as (\n\nselect\n patient_id\n , sex\n , birth_date\n , death_date\n , '2023-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom devforrest.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-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom devforrest.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-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom devforrest.core.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-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom devforrest.core.procedure\n),performance_period as (\n\n select\n measure_id\n , measure_name\n , measure_version\n , performance_period_end\n , performance_period_begin\n , performance_period_lookback\n from devforrest.quality_measures._int_nqf2372__performance_period\n\n)\n\n, patient as (\n\n select\n patient_id\n , sex\n , birth_date\n , death_date\n from __dbt__cte__quality_measures__stg_core__patient\n\n)\n\n, encounters as (\n\n select\n patient_id\n , encounter_type\n , encounter_start_date\n from __dbt__cte__quality_measures__stg_core__encounter\n\n)\n\n, medical_claim as (\n\n select\n patient_id\n , claim_start_date\n , claim_end_date\n , hcpcs_code\n from __dbt__cte__quality_measures__stg_medical_claim\n\n)\n\n, procedures as (\n\n select\n patient_id\n , procedure_date\n , coalesce (\n normalized_code_type\n , case\n when lower(source_code_type) = 'cpt' then 'hcpcs'\n when lower(source_code_type) = 'snomed' then 'snomed-ct'\n else lower(source_code_type)\n end\n ) as code_type\n , coalesce (\n normalized_code\n , source_code\n ) as code\n from __dbt__cte__quality_measures__stg_core__procedure\n\n)\n\n, visit_codes as (\n\n select\n code\n , code_system\n from devforrest.quality_measures._value_set_codes\n where concept_name in (\n 'Office Visit'\n , 'Home Healthcare Services'\n , 'Preventive Care Services Established Office Visit, 18 and Up'\n , 'Preventive Care Services Initial Office Visit, 18 and Up'\n , 'Annual Wellness Visit'\n , 'Telephone Visits'\n , 'Online Assessments'\n )\n\n)\n\n, patient_with_age as (\n\n select\n patient.patient_id\n , patient.sex\n , patient.birth_date\n , patient.death_date\n , performance_period.measure_id\n , performance_period.measure_name\n , performance_period.measure_version\n , performance_period.performance_period_begin\n , performance_period.performance_period_end\n , performance_period.performance_period_lookback\n , floor(datediff(\n hour,\n patient.birth_date,\n performance_period.performance_period_end\n ) / 8766.0) as age\n from patient\n cross join performance_period\n\n)\n\n/*\n Filter patient to living women 51 - 74 years of age\n at the beginning of the measurement period\n*/\n, patient_filtered as (\n\n select\n patient_id\n , age\n , measure_id\n , measure_name\n , measure_version\n , performance_period_begin\n , performance_period_end\n , performance_period_lookback\n , 1 as denominator_flag\n from patient_with_age\n where lower(sex) = 'female'\n and age between 51 and 74\n and death_date is null\n\n)\n\n/*\n Filter to qualifying visit types by claim procedures\n*/\n, visit_claims as (\n\n select\n medical_claim.patient_id\n , medical_claim.claim_start_date\n , medical_claim.claim_end_date\n , medical_claim.hcpcs_code\n from medical_claim\n inner join visit_codes\n on medical_claim.hcpcs_code = visit_codes.code\n where visit_codes.code_system = 'hcpcs'\n\n)\n\n/*\n Filter encounters to qualifying visit type\n*/\n, visit_encounters as (\n\n select\n patient_id\n , encounter_start_date\n from encounters\n where lower(encounter_type) in (\n 'home health'\n , 'office visit'\n , 'outpatient'\n , 'outpatient rehabilitation'\n , 'telehealth'\n )\n\n)\n\n/*\n Filter to qualifying visit types by procedure\n*/\n, visit_procedures as (\n\n select\n procedures.patient_id\n , procedures.procedure_date\n from procedures\n inner join visit_codes\n on procedures.code = visit_codes.code\n and procedures.code_type = visit_codes.code_system\n\n)\n\n/*\n Filter to final eligible population/denominator before exclusions\n with a qualifying visit during the measurement period\n*/\n, eligible_population as (\n\n select\n patient_filtered.patient_id\n , patient_filtered.age\n , patient_filtered.measure_id\n , patient_filtered.measure_name\n , patient_filtered.measure_version\n , patient_filtered.performance_period_begin\n , patient_filtered.performance_period_end\n , performance_period_lookback\n , patient_filtered.denominator_flag\n from patient_filtered\n left join visit_claims\n on patient_filtered.patient_id = visit_claims.patient_id\n left join visit_procedures\n on patient_filtered.patient_id = visit_procedures.patient_id\n left join visit_encounters\n on patient_filtered.patient_id = visit_encounters.patient_id\n where (\n visit_claims.claim_start_date\n between patient_filtered.performance_period_begin\n and patient_filtered.performance_period_end\n or visit_claims.claim_end_date\n between patient_filtered.performance_period_begin\n and patient_filtered.performance_period_end\n or visit_procedures.procedure_date\n between patient_filtered.performance_period_begin\n and patient_filtered.performance_period_end\n or visit_encounters.encounter_start_date\n between patient_filtered.performance_period_begin\n and patient_filtered.performance_period_end\n )\n\n)\n\n, add_data_types as (\n\n select distinct\n cast(patient_id as TEXT) as patient_id\n , cast(age as integer) as age\n , cast(performance_period_begin as date) as performance_period_begin\n , cast(performance_period_end as date) as performance_period_end\n , cast(performance_period_lookback as date) as performance_period_lookback\n , cast(measure_id as TEXT) as measure_id\n , cast(measure_name as TEXT) as measure_name\n , cast(measure_version as TEXT) as measure_version\n , cast(denominator_flag as integer) as denominator_flag\n from eligible_population\n\n)\n\n select distinct\n patient_id\n , age\n , performance_period_begin\n , performance_period_end\n , performance_period_lookback\n , measure_id\n , measure_name\n , measure_version\n , denominator_flag\n , '2023-12-13 23:31:59.089856+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-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom devforrest.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-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom devforrest.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-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom devforrest.core.medical_claim\n\n\n)"}, {"id": "model.the_tuva_project.quality_measures__stg_core__procedure", "sql": " __dbt__cte__quality_measures__stg_core__procedure as (\n\nselect\n patient_id\n , procedure_date\n , source_code_type\n , source_code\n , normalized_code_type\n , normalized_code\n , '2023-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom devforrest.core.procedure\n)"}]}, "model.the_tuva_project.quality_measures__int_nqf2372_exclude_advanced_illness": {"database": "devforrest", "schema": "quality_measures", "name": "quality_measures__int_nqf2372_exclude_advanced_illness", "resource_type": "model", "package_name": "the_tuva_project", "path": "quality_measures\\intermediate\\nqf2372_breast_cancer_screening\\quality_measures__int_nqf2372_exclude_advanced_illness.sql", "original_file_path": "models\\quality_measures\\intermediate\\nqf2372_breast_cancer_screening\\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", "nqf2372_breast_cancer_screening", "quality_measures__int_nqf2372_exclude_advanced_illness"], "alias": "_int_nqf2372_exclude_advanced_illness", "checksum": {"name": "sha256", "checksum": "663f1cb484eb82795aa9100880796d809b6e256b3707a3c426565961b9617544"}, "config": {"enabled": true, "alias": "_int_nqf2372_exclude_advanced_illness", "schema": "quality_measures", "database": null, "tags": ["quality_measures"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["quality_measures"], "description": "Exclusion logic for patients with frailty and advanced illness for the reporting version of NQF 2372, Breast Cancer Screening.\n", "columns": {"patient_id": {"name": "patient_id", "description": "Unique patient_id for each person.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "exclusion_date": {"name": "exclusion_date", "description": "Date of event or service that excludes patient from the measure.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "exclusion_reason": {"name": "exclusion_reason", "description": "Reason (usually the value set concept name) that excludes patient from the measure.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://models\\quality_measures\\quality_measures_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "quality_measures", "alias": "_int_nqf2372_exclude_advanced_illness", "tags": "quality_measures", "materialized": "table", "enabled": true, "bind": false}, "created_at": 1702481697.125699, "relation_name": "devforrest.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 patients_with_frailty as (\r\n\r\n select\r\n patient_id\r\n , performance_period_begin\r\n , performance_period_end\r\n , exclusion_date\r\n , exclusion_reason\r\n from {{ ref('quality_measures__int_nqf2372__frailty') }}\r\n\r\n)\r\n\r\n, exclusion_codes as (\r\n\r\n select\r\n code\r\n , code_system\r\n , concept_name\r\n from {{ ref('quality_measures__value_sets') }}\r\n where concept_name in (\r\n 'Advanced Illness'\r\n , 'Acute Inpatient'\r\n , 'Encounter Inpatient'\r\n , 'Outpatient'\r\n , 'Observation'\r\n , 'Emergency Department Visit'\r\n , 'Nonacute Inpatient'\r\n )\r\n\r\n)\r\n\r\n, conditions as (\r\n\r\n select\r\n patient_id\r\n , claim_id\r\n , recorded_date\r\n , coalesce (\r\n normalized_code_type\r\n , case\r\n when lower(source_code_type) = 'snomed' then 'snomed-ct'\r\n else lower(source_code_type)\r\n end\r\n ) as code_type\r\n , coalesce (\r\n normalized_code\r\n , source_code\r\n ) as code\r\n from {{ ref('quality_measures__stg_core__condition') }}\r\n\r\n)\r\n\r\n, medical_claim as (\r\n\r\n select\r\n patient_id\r\n , claim_id\r\n , claim_start_date\r\n , claim_end_date\r\n , hcpcs_code\r\n , place_of_service_code\r\n from {{ ref('quality_measures__stg_medical_claim') }}\r\n\r\n)\r\n\r\n, procedures as (\r\n\r\n select\r\n patient_id\r\n , procedure_date\r\n , coalesce (\r\n normalized_code_type\r\n , case\r\n when lower(source_code_type) = 'cpt' then 'hcpcs'\r\n when lower(source_code_type) = 'snomed' then 'snomed-ct'\r\n else lower(source_code_type)\r\n end\r\n ) as code_type\r\n , coalesce (\r\n normalized_code\r\n , source_code\r\n ) as code\r\n from {{ ref('quality_measures__stg_core__procedure') }}\r\n\r\n)\r\n\r\n, condition_exclusions as (\r\n\r\n select\r\n conditions.patient_id\r\n , conditions.claim_id\r\n , conditions.recorded_date\r\n , exclusion_codes.concept_name\r\n from conditions\r\n inner join exclusion_codes\r\n on conditions.code = exclusion_codes.code\r\n and conditions.code_type = exclusion_codes.code_system\r\n\r\n)\r\n\r\n, med_claim_exclusions as (\r\n\r\n select\r\n medical_claim.patient_id\r\n , medical_claim.claim_id\r\n , medical_claim.claim_start_date\r\n , medical_claim.claim_end_date\r\n , medical_claim.hcpcs_code\r\n , exclusion_codes.concept_name\r\n from medical_claim\r\n inner join exclusion_codes\r\n on medical_claim.hcpcs_code = exclusion_codes.code\r\n where exclusion_codes.code_system = 'hcpcs'\r\n\r\n)\r\n\r\n, procedure_exclusions as (\r\n\r\n select\r\n procedures.patient_id\r\n , procedures.procedure_date\r\n , exclusion_codes.concept_name\r\n from procedures\r\n inner join exclusion_codes\r\n on procedures.code = exclusion_codes.code\r\n and procedures.code_type = exclusion_codes.code_system\r\n\r\n)\r\n\r\n/*\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 , patients_with_frailty.exclusion_reason\r\n || ' with '\r\n || med_claim_exclusions.concept_name\r\n || ' and '\r\n || condition_exclusions.concept_name\r\n as exclusion_reason\r\n 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 , procedure_exclusions.procedure_date as exclusion_date\r\n , patients_with_frailty.exclusion_reason\r\n || ' with '\r\n || procedure_exclusions.concept_name\r\n || ' and '\r\n || condition_exclusions.concept_name\r\n as exclusion_reason\r\n 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 , patients_with_frailty.exclusion_reason\r\n || ' with '\r\n || med_claim_exclusions.concept_name\r\n || ' and '\r\n || condition_exclusions.concept_name\r\n as exclusion_reason\r\n 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 , procedure_exclusions.procedure_date as exclusion_date\r\n , patients_with_frailty.exclusion_reason\r\n || ' with '\r\n || procedure_exclusions.concept_name\r\n || ' and '\r\n || condition_exclusions.concept_name\r\n as exclusion_reason\r\n from patients_with_frailty\r\n inner join procedure_exclusions\r\n on patients_with_frailty.patient_id = procedure_exclusions.patient_id\r\n inner join condition_exclusions\r\n on procedure_exclusions.patient_id = condition_exclusions.patient_id\r\n and procedure_exclusions.procedure_date = condition_exclusions.recorded_date\r\n where procedure_exclusions.concept_name in (\r\n 'Encounter Inpatient'\r\n , 'Outpatient'\r\n , 'Observation'\r\n , 'Emergency Department Visit'\r\n , 'Nonacute Inpatient'\r\n )\r\n and condition_exclusions.concept_name = 'Advanced Illness'\r\n and (\r\n procedure_exclusions.procedure_date\r\n between {{ dbt.dateadd(datepart=\"year\", interval=-1, from_date_or_timestamp=\"patients_with_frailty.performance_period_begin\") }}\r\n and patients_with_frailty.performance_period_end\r\n )\r\n\r\n)\r\n\r\n/*\r\n Filter to patients who have had one acute inpatient encounter or\r\n two nonacute outpatient encounters\r\n*/\r\n, acute_inpatient_counts as (\r\n\r\n select\r\n patient_id\r\n , count(*) as encounter_count\r\n from acute_inpatient\r\n group by patient_id\r\n\r\n)\r\n\r\n, nonacute_outpatient_counts as (\r\n\r\n select\r\n patient_id\r\n , count(*) as encounter_count\r\n from nonacute_outpatient\r\n group by patient_id\r\n\r\n)\r\n\r\n, eligible_acute_inpatient as (\r\n\r\n select\r\n acute_inpatient.patient_id\r\n , acute_inpatient.exclusion_date\r\n , acute_inpatient.exclusion_reason\r\n from acute_inpatient\r\n left join acute_inpatient_counts\r\n on acute_inpatient.patient_id = acute_inpatient_counts.patient_id\r\n where acute_inpatient_counts.encounter_count >= 1\r\n\r\n)\r\n\r\n, eligible_nonacute_outpatient as (\r\n\r\n select\r\n nonacute_outpatient.patient_id\r\n , nonacute_outpatient.exclusion_date\r\n , nonacute_outpatient.exclusion_reason\r\n from nonacute_outpatient\r\n left join nonacute_outpatient_counts\r\n on nonacute_outpatient.patient_id = nonacute_outpatient_counts.patient_id\r\n where nonacute_outpatient_counts.encounter_count >= 2\r\n\r\n)\r\n\r\n, exclusions_unioned as (\r\n\r\n select\r\n eligible_acute_inpatient.patient_id\r\n , eligible_acute_inpatient.exclusion_date\r\n , eligible_acute_inpatient.exclusion_reason\r\n from eligible_acute_inpatient\r\n\r\n union all\r\n\r\n select\r\n eligible_nonacute_outpatient.patient_id\r\n , eligible_nonacute_outpatient.exclusion_date\r\n , eligible_nonacute_outpatient.exclusion_reason\r\n from eligible_nonacute_outpatient\r\n\r\n)\r\n\r\nselect\r\n patient_id\r\n , exclusion_date\r\n , exclusion_reason\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom exclusions_unioned", "language": "sql", "refs": [["quality_measures__int_nqf2372__frailty"], ["quality_measures__value_sets"], ["quality_measures__stg_core__condition"], ["quality_measures__stg_medical_claim"], ["quality_measures__stg_core__procedure"]], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.dateadd"], "nodes": ["model.the_tuva_project.quality_measures__int_nqf2372__frailty", "seed.the_tuva_project.quality_measures__value_sets", "model.the_tuva_project.quality_measures__stg_core__condition", "model.the_tuva_project.quality_measures__stg_medical_claim", "model.the_tuva_project.quality_measures__stg_core__procedure"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\quality_measures\\intermediate\\nqf2372_breast_cancer_screening\\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-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom devforrest.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-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom devforrest.core.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-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom devforrest.core.procedure\n),patients_with_frailty as (\n\n select\n patient_id\n , performance_period_begin\n , performance_period_end\n , exclusion_date\n , exclusion_reason\n from devforrest.quality_measures._int_nqf2372__frailty\n\n)\n\n, exclusion_codes as (\n\n select\n code\n , code_system\n , concept_name\n from devforrest.quality_measures._value_set_codes\n where concept_name in (\n 'Advanced Illness'\n , 'Acute Inpatient'\n , 'Encounter Inpatient'\n , 'Outpatient'\n , 'Observation'\n , 'Emergency Department Visit'\n , 'Nonacute Inpatient'\n )\n\n)\n\n, conditions as (\n\n select\n patient_id\n , claim_id\n , recorded_date\n , coalesce (\n normalized_code_type\n , case\n when lower(source_code_type) = 'snomed' then 'snomed-ct'\n else lower(source_code_type)\n end\n ) as code_type\n , coalesce (\n normalized_code\n , source_code\n ) as code\n from __dbt__cte__quality_measures__stg_core__condition\n\n)\n\n, medical_claim as (\n\n select\n patient_id\n , claim_id\n , claim_start_date\n , claim_end_date\n , hcpcs_code\n , place_of_service_code\n from __dbt__cte__quality_measures__stg_medical_claim\n\n)\n\n, procedures as (\n\n select\n patient_id\n , procedure_date\n , coalesce (\n normalized_code_type\n , case\n when lower(source_code_type) = 'cpt' then 'hcpcs'\n when lower(source_code_type) = 'snomed' then 'snomed-ct'\n else lower(source_code_type)\n end\n ) as code_type\n , coalesce (\n normalized_code\n , source_code\n ) as code\n from __dbt__cte__quality_measures__stg_core__procedure\n\n)\n\n, condition_exclusions as (\n\n select\n conditions.patient_id\n , conditions.claim_id\n , conditions.recorded_date\n , exclusion_codes.concept_name\n from conditions\n inner join exclusion_codes\n on conditions.code = exclusion_codes.code\n and conditions.code_type = exclusion_codes.code_system\n\n)\n\n, med_claim_exclusions as (\n\n select\n medical_claim.patient_id\n , medical_claim.claim_id\n , medical_claim.claim_start_date\n , medical_claim.claim_end_date\n , medical_claim.hcpcs_code\n , exclusion_codes.concept_name\n from medical_claim\n inner join exclusion_codes\n on medical_claim.hcpcs_code = exclusion_codes.code\n where exclusion_codes.code_system = 'hcpcs'\n\n)\n\n, procedure_exclusions as (\n\n select\n procedures.patient_id\n , procedures.procedure_date\n , exclusion_codes.concept_name\n from procedures\n inner join exclusion_codes\n on procedures.code = exclusion_codes.code\n and procedures.code_type = exclusion_codes.code_system\n\n)\n\n/*\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 , patients_with_frailty.exclusion_reason\n || ' with '\n || med_claim_exclusions.concept_name\n || ' and '\n || condition_exclusions.concept_name\n as exclusion_reason\n 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 , procedure_exclusions.procedure_date as exclusion_date\n , patients_with_frailty.exclusion_reason\n || ' with '\n || procedure_exclusions.concept_name\n || ' and '\n || condition_exclusions.concept_name\n as exclusion_reason\n 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 , patients_with_frailty.exclusion_reason\n || ' with '\n || med_claim_exclusions.concept_name\n || ' and '\n || condition_exclusions.concept_name\n as exclusion_reason\n 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 , procedure_exclusions.procedure_date as exclusion_date\n , patients_with_frailty.exclusion_reason\n || ' with '\n || procedure_exclusions.concept_name\n || ' and '\n || condition_exclusions.concept_name\n as exclusion_reason\n 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-12-13 23:31:59.089856+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-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom devforrest.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-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom devforrest.core.medical_claim\n\n\n)"}, {"id": "model.the_tuva_project.quality_measures__stg_core__procedure", "sql": " __dbt__cte__quality_measures__stg_core__procedure as (\n\nselect\n patient_id\n , procedure_date\n , source_code_type\n , source_code\n , normalized_code_type\n , normalized_code\n , '2023-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom devforrest.core.procedure\n)"}]}, "model.the_tuva_project.quality_measures__int_nqf2372_exclude_dementia": {"database": "devforrest", "schema": "quality_measures", "name": "quality_measures__int_nqf2372_exclude_dementia", "resource_type": "model", "package_name": "the_tuva_project", "path": "quality_measures\\intermediate\\nqf2372_breast_cancer_screening\\quality_measures__int_nqf2372_exclude_dementia.sql", "original_file_path": "models\\quality_measures\\intermediate\\nqf2372_breast_cancer_screening\\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", "nqf2372_breast_cancer_screening", "quality_measures__int_nqf2372_exclude_dementia"], "alias": "_int_nqf2372_exclude_dementia", "checksum": {"name": "sha256", "checksum": "0666abeb618f02d2e5ca8d7377766de1dff77b224313f0efe90f58c7c106a904"}, "config": {"enabled": true, "alias": "_int_nqf2372_exclude_dementia", "schema": "quality_measures", "database": null, "tags": ["quality_measures"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["quality_measures"], "description": "Exclusion logic for patients with frailty and taking dementia medications for the reporting version of NQF 2372, Breast Cancer Screening.\n", "columns": {"patient_id": {"name": "patient_id", "description": "Unique patient_id for each person.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "exclusion_date": {"name": "exclusion_date", "description": "Date of event or service that excludes patient from the measure.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "exclusion_reason": {"name": "exclusion_reason", "description": "Reason (usually the value set concept name) that excludes patient from the measure.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://models\\quality_measures\\quality_measures_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "quality_measures", "alias": "_int_nqf2372_exclude_dementia", "tags": "quality_measures", "materialized": "table", "enabled": true, "bind": false}, "created_at": 1702481697.1278899, "relation_name": "devforrest.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 patients_with_frailty as (\r\n\r\n select\r\n patient_id\r\n , performance_period_begin\r\n , performance_period_end\r\n , exclusion_date\r\n , exclusion_reason\r\n from {{ ref('quality_measures__int_nqf2372__frailty') }}\r\n\r\n)\r\n\r\n, exclusion_codes as (\r\n\r\n select\r\n code\r\n , code_system\r\n , concept_name\r\n from {{ ref('quality_measures__value_sets') }}\r\n where concept_name in (\r\n 'Dementia Medications'\r\n )\r\n\r\n)\r\n\r\n, medications as (\r\n\r\n select\r\n patient_id\r\n , dispensing_date\r\n , source_code_type\r\n , source_code\r\n , ndc_code\r\n , rxnorm_code\r\n from {{ ref('quality_measures__stg_core__medication') }}\r\n\r\n)\r\n\r\n, pharmacy_claim as (\r\n\r\n select\r\n patient_id\r\n , dispensing_date\r\n , ndc_code\r\n , paid_date\r\n from {{ ref('quality_measures__stg_pharmacy_claim') }}\r\n\r\n)\r\n\r\n, medication_exclusions as (\r\n\r\n select\r\n medications.patient_id\r\n , medications.dispensing_date\r\n , exclusion_codes.concept_name\r\n from medications\r\n inner join exclusion_codes\r\n on medications.ndc_code = exclusion_codes.code\r\n where exclusion_codes.code_system = 'ndc'\r\n\r\n union all\r\n\r\n select\r\n medications.patient_id\r\n , medications.dispensing_date\r\n , exclusion_codes.concept_name\r\n from medications\r\n inner join exclusion_codes\r\n on medications.rxnorm_code = exclusion_codes.code\r\n where exclusion_codes.code_system = 'rxnorm'\r\n\r\n union all\r\n\r\n select\r\n medications.patient_id\r\n , medications.dispensing_date\r\n , exclusion_codes.concept_name\r\n from medications\r\n inner join exclusion_codes\r\n on medications.source_code = exclusion_codes.code\r\n and medications.source_code_type = exclusion_codes.code_system\r\n\r\n)\r\n\r\n, pharmacy_claim_exclusions as (\r\n\r\n select\r\n pharmacy_claim.patient_id\r\n , pharmacy_claim.dispensing_date\r\n , pharmacy_claim.ndc_code\r\n , pharmacy_claim.paid_date\r\n , exclusion_codes.concept_name\r\n from pharmacy_claim\r\n inner join exclusion_codes\r\n on pharmacy_claim.ndc_code = exclusion_codes.code\r\n where exclusion_codes.code_system = 'ndc'\r\n\r\n)\r\n\r\n, frailty_with_dementia as (\r\n\r\n select\r\n patients_with_frailty.patient_id\r\n , patients_with_frailty.exclusion_date\r\n , patients_with_frailty.exclusion_reason\r\n || ' with '\r\n || pharmacy_claim_exclusions.concept_name\r\n as exclusion_reason\r\n 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 {{ 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 pharmacy_claim_exclusions.paid_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\r\n patients_with_frailty.patient_id\r\n , medication_exclusions.dispensing_date as exclusion_date\r\n , patients_with_frailty.exclusion_reason\r\n || ' with '\r\n || medication_exclusions.concept_name\r\n as exclusion_reason\r\n 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 {{ 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\nselect\r\n patient_id\r\n , exclusion_date\r\n , exclusion_reason\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom frailty_with_dementia", "language": "sql", "refs": [["quality_measures__int_nqf2372__frailty"], ["quality_measures__value_sets"], ["quality_measures__stg_core__medication"], ["quality_measures__stg_pharmacy_claim"]], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.dateadd"], "nodes": ["model.the_tuva_project.quality_measures__int_nqf2372__frailty", "seed.the_tuva_project.quality_measures__value_sets", "model.the_tuva_project.quality_measures__stg_core__medication", "model.the_tuva_project.quality_measures__stg_pharmacy_claim"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\quality_measures\\intermediate\\nqf2372_breast_cancer_screening\\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__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-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom devforrest.core.medication\n\n\n), __dbt__cte__quality_measures__stg_pharmacy_claim as (\n\n\nselect\n patient_id\n , dispensing_date\n , ndc_code\n , paid_date\n , '2023-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom devforrest.core.pharmacy_claim\n\n\n),patients_with_frailty as (\n\n select\n patient_id\n , performance_period_begin\n , performance_period_end\n , exclusion_date\n , exclusion_reason\n from devforrest.quality_measures._int_nqf2372__frailty\n\n)\n\n, exclusion_codes as (\n\n select\n code\n , code_system\n , concept_name\n from devforrest.quality_measures._value_set_codes\n where concept_name in (\n 'Dementia Medications'\n )\n\n)\n\n, medications as (\n\n select\n patient_id\n , dispensing_date\n , source_code_type\n , source_code\n , ndc_code\n , rxnorm_code\n from __dbt__cte__quality_measures__stg_core__medication\n\n)\n\n, pharmacy_claim as (\n\n select\n patient_id\n , dispensing_date\n , ndc_code\n , paid_date\n from __dbt__cte__quality_measures__stg_pharmacy_claim\n\n)\n\n, medication_exclusions as (\n\n select\n medications.patient_id\n , medications.dispensing_date\n , exclusion_codes.concept_name\n from medications\n inner join exclusion_codes\n on medications.ndc_code = exclusion_codes.code\n where exclusion_codes.code_system = 'ndc'\n\n union all\n\n select\n medications.patient_id\n , medications.dispensing_date\n , exclusion_codes.concept_name\n from medications\n inner join exclusion_codes\n on medications.rxnorm_code = exclusion_codes.code\n where exclusion_codes.code_system = 'rxnorm'\n\n union all\n\n select\n medications.patient_id\n , medications.dispensing_date\n , exclusion_codes.concept_name\n from medications\n inner join exclusion_codes\n on medications.source_code = exclusion_codes.code\n and medications.source_code_type = exclusion_codes.code_system\n\n)\n\n, pharmacy_claim_exclusions as (\n\n select\n pharmacy_claim.patient_id\n , pharmacy_claim.dispensing_date\n , pharmacy_claim.ndc_code\n , pharmacy_claim.paid_date\n , exclusion_codes.concept_name\n from pharmacy_claim\n inner join exclusion_codes\n on pharmacy_claim.ndc_code = exclusion_codes.code\n where exclusion_codes.code_system = 'ndc'\n\n)\n\n, frailty_with_dementia as (\n\n select\n patients_with_frailty.patient_id\n , patients_with_frailty.exclusion_date\n , patients_with_frailty.exclusion_reason\n || ' with '\n || pharmacy_claim_exclusions.concept_name\n as exclusion_reason\n 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 \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 pharmacy_claim_exclusions.paid_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\n patients_with_frailty.patient_id\n , medication_exclusions.dispensing_date as exclusion_date\n , patients_with_frailty.exclusion_reason\n || ' with '\n || medication_exclusions.concept_name\n as exclusion_reason\n 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 \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\nselect\n patient_id\n , exclusion_date\n , exclusion_reason\n , '2023-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom frailty_with_dementia", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.the_tuva_project.quality_measures__stg_core__medication", "sql": " __dbt__cte__quality_measures__stg_core__medication as (\n\n\nselect\n patient_id\n , dispensing_date\n , source_code_type\n , source_code\n , ndc_code\n , rxnorm_code\n , '2023-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom devforrest.core.medication\n\n\n)"}, {"id": "model.the_tuva_project.quality_measures__stg_pharmacy_claim", "sql": " __dbt__cte__quality_measures__stg_pharmacy_claim as (\n\n\nselect\n patient_id\n , dispensing_date\n , ndc_code\n , paid_date\n , '2023-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom devforrest.core.pharmacy_claim\n\n\n)"}]}, "model.the_tuva_project.quality_measures__int_nqf2372_exclude_hospice": {"database": "devforrest", "schema": "quality_measures", "name": "quality_measures__int_nqf2372_exclude_hospice", "resource_type": "model", "package_name": "the_tuva_project", "path": "quality_measures\\intermediate\\nqf2372_breast_cancer_screening\\quality_measures__int_nqf2372_exclude_hospice.sql", "original_file_path": "models\\quality_measures\\intermediate\\nqf2372_breast_cancer_screening\\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", "nqf2372_breast_cancer_screening", "quality_measures__int_nqf2372_exclude_hospice"], "alias": "_int_nqf2372_exclude_hospice", "checksum": {"name": "sha256", "checksum": "c365583052dce282be4b21ed1542a4bb03b8c0f456c860dfd76cefb605053075"}, "config": {"enabled": true, "alias": "_int_nqf2372_exclude_hospice", "schema": "quality_measures", "database": null, "tags": ["quality_measures"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["quality_measures"], "description": "Exclusion logic for patients using hospice services for the reporting version of NQF 2372, Breast Cancer Screening.\n", "columns": {"patient_id": {"name": "patient_id", "description": "Unique patient_id for each person.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "exclusion_date": {"name": "exclusion_date", "description": "Date of event or service that excludes patient from the measure.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "exclusion_reason": {"name": "exclusion_reason", "description": "Reason (usually the value set concept name) that excludes patient from the measure.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://models\\quality_measures\\quality_measures_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "quality_measures", "alias": "_int_nqf2372_exclude_hospice", "tags": "quality_measures", "materialized": "table", "enabled": true, "bind": false}, "created_at": 1702481697.1278899, "relation_name": "devforrest.quality_measures._int_nqf2372_exclude_hospice", "raw_code": "{{ config(\r\n enabled = var('quality_measures_enabled',var('claims_enabled',var('clinical_enabled',var('tuva_marts_enabled',False))))\r\n )\r\n}}\r\n\r\n/*\r\n Hospice services used by patient any time during the measurement period\r\n*/\r\n\r\nwith denominator as (\r\n\r\n select\r\n patient_id\r\n , performance_period_begin\r\n , performance_period_end\r\n from {{ ref('quality_measures__int_nqf2372_denominator') }}\r\n\r\n)\r\n\r\n, exclusion_codes as (\r\n\r\n select\r\n code\r\n , code_system\r\n , concept_name\r\n from {{ ref('quality_measures__value_sets') }}\r\n where concept_name in (\r\n 'Hospice Care Ambulatory'\r\n , 'Hospice Encounter'\r\n )\r\n\r\n)\r\n\r\n, observations as (\r\n\r\n select\r\n patient_id\r\n , observation_date\r\n , coalesce (\r\n normalized_code_type\r\n , case\r\n when lower(source_code_type) = 'cpt' then 'hcpcs'\r\n when lower(source_code_type) = 'snomed' then 'snomed-ct'\r\n else lower(source_code_type)\r\n end\r\n ) as code_type\r\n , coalesce(\r\n normalized_code\r\n , source_code\r\n ) as code\r\n from {{ ref('quality_measures__stg_core__observation') }}\r\n\r\n)\r\n\r\n, medical_claim as (\r\n\r\n select\r\n patient_id\r\n , claim_start_date\r\n , claim_end_date\r\n , hcpcs_code\r\n , place_of_service_code\r\n from {{ ref('quality_measures__stg_medical_claim') }}\r\n\r\n)\r\n\r\n, procedures as (\r\n\r\n select\r\n patient_id\r\n , procedure_date\r\n , normalized_code_type\r\n , normalized_code\r\n from {{ ref('quality_measures__stg_core__procedure') }}\r\n\r\n)\r\n\r\n, observation_exclusions as (\r\n\r\n select\r\n observations.patient_id\r\n , observations.observation_date\r\n , exclusion_codes.concept_name\r\n from observations\r\n inner join exclusion_codes\r\n on observations.code = exclusion_codes.code\r\n and observations.code_type = exclusion_codes.code_system\r\n\r\n)\r\n\r\n, med_claim_exclusions as (\r\n\r\n select\r\n medical_claim.patient_id\r\n , medical_claim.claim_start_date\r\n , medical_claim.claim_end_date\r\n , medical_claim.hcpcs_code\r\n , exclusion_codes.concept_name\r\n from medical_claim\r\n inner join exclusion_codes\r\n on medical_claim.hcpcs_code = exclusion_codes.code\r\n where exclusion_codes.code_system = 'hcpcs'\r\n\r\n)\r\n\r\n, procedure_exclusions as (\r\n\r\n select\r\n procedures.patient_id\r\n , procedures.procedure_date\r\n , exclusion_codes.concept_name\r\n from procedures\r\n inner join exclusion_codes\r\n on procedures.normalized_code = exclusion_codes.code\r\n and procedures.normalized_code_type = exclusion_codes.code_system\r\n\r\n)\r\n\r\n, hospice as (\r\n\r\n select\r\n denominator.patient_id\r\n , observation_exclusions.observation_date as exclusion_date\r\n , observation_exclusions.concept_name as exclusion_reason\r\n from denominator\r\n inner join observation_exclusions\r\n on denominator.patient_id = observation_exclusions.patient_id\r\n where observation_exclusions.observation_date\r\n between denominator.performance_period_begin\r\n and denominator.performance_period_end\r\n\r\n union all\r\n\r\n select\r\n denominator.patient_id\r\n , coalesce (\r\n med_claim_exclusions.claim_start_date\r\n , med_claim_exclusions.claim_end_date\r\n ) as exclusion_date\r\n , med_claim_exclusions.concept_name as exclusion_reason\r\n from denominator\r\n inner join med_claim_exclusions\r\n on denominator.patient_id = med_claim_exclusions.patient_id\r\n where (\r\n med_claim_exclusions.claim_start_date\r\n between denominator.performance_period_begin\r\n and denominator.performance_period_end\r\n or med_claim_exclusions.claim_end_date\r\n between denominator.performance_period_begin\r\n and denominator.performance_period_end\r\n )\r\n\r\n union all\r\n\r\n select\r\n denominator.patient_id\r\n , procedure_exclusions.procedure_date as exclusion_date\r\n , procedure_exclusions.concept_name as exclusion_reason\r\n from denominator\r\n inner join procedure_exclusions\r\n on denominator.patient_id = procedure_exclusions.patient_id\r\n where procedure_exclusions.procedure_date\r\n between denominator.performance_period_begin\r\n and denominator.performance_period_end\r\n\r\n)\r\n\r\nselect\r\n patient_id\r\n , exclusion_date\r\n , exclusion_reason\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom hospice", "language": "sql", "refs": [["quality_measures__int_nqf2372_denominator"], ["quality_measures__value_sets"], ["quality_measures__stg_core__observation"], ["quality_measures__stg_medical_claim"], ["quality_measures__stg_core__procedure"]], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.quality_measures__int_nqf2372_denominator", "seed.the_tuva_project.quality_measures__value_sets", "model.the_tuva_project.quality_measures__stg_core__observation", "model.the_tuva_project.quality_measures__stg_medical_claim", "model.the_tuva_project.quality_measures__stg_core__procedure"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\quality_measures\\intermediate\\nqf2372_breast_cancer_screening\\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-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom devforrest.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-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom devforrest.core.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-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom devforrest.core.procedure\n),denominator as (\n\n select\n patient_id\n , performance_period_begin\n , performance_period_end\n from devforrest.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 devforrest.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-12-13 23:31:59.089856+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-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom devforrest.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-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom devforrest.core.medical_claim\n\n\n)"}, {"id": "model.the_tuva_project.quality_measures__stg_core__procedure", "sql": " __dbt__cte__quality_measures__stg_core__procedure as (\n\nselect\n patient_id\n , procedure_date\n , source_code_type\n , source_code\n , normalized_code_type\n , normalized_code\n , '2023-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom devforrest.core.procedure\n)"}]}, "model.the_tuva_project.quality_measures__int_nqf2372_exclude_institutional": {"database": "devforrest", "schema": "quality_measures", "name": "quality_measures__int_nqf2372_exclude_institutional", "resource_type": "model", "package_name": "the_tuva_project", "path": "quality_measures\\intermediate\\nqf2372_breast_cancer_screening\\quality_measures__int_nqf2372_exclude_institutional.sql", "original_file_path": "models\\quality_measures\\intermediate\\nqf2372_breast_cancer_screening\\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", "nqf2372_breast_cancer_screening", "quality_measures__int_nqf2372_exclude_institutional"], "alias": "_int_nqf2372_exclude_institutional", "checksum": {"name": "sha256", "checksum": "93785cc031729a541dbb40caf801559a4408be7dbcb5c6e5824263ee557cd4da"}, "config": {"enabled": true, "alias": "_int_nqf2372_exclude_institutional", "schema": "quality_measures", "database": null, "tags": ["quality_measures"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["quality_measures"], "description": "Exclusion logic for patients staying in an institution for the reporting version of NQF 2372, Breast Cancer Screening.\n", "columns": {"patient_id": {"name": "patient_id", "description": "Unique patient_id for each person.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "exclusion_date": {"name": "exclusion_date", "description": "Date of event or service that excludes patient from the measure.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "exclusion_reason": {"name": "exclusion_reason", "description": "Reason (usually the value set concept name) that excludes patient from the measure.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://models\\quality_measures\\quality_measures_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "quality_measures", "alias": "_int_nqf2372_exclude_institutional", "tags": "quality_measures", "materialized": "table", "enabled": true, "bind": false}, "created_at": 1702481697.1278899, "relation_name": "devforrest.quality_measures._int_nqf2372_exclude_institutional", "raw_code": "{{ config(\r\n enabled = var('quality_measures_enabled',var('claims_enabled',var('clinical_enabled',var('tuva_marts_enabled',False))))\r\n )\r\n}}\r\n\r\n/*\r\n Patients greater than or equal to 66 in Institutional Special Needs Plans (SNP)\r\n or residing in long term care\r\n\r\n Future enhancement: group claims into encounters\r\n*/\r\n\r\nwith denominator as (\r\n\r\n select\r\n patient_id\r\n , age\r\n , performance_period_begin\r\n , performance_period_end\r\n from {{ ref('quality_measures__int_nqf2372_denominator') }}\r\n\r\n)\r\n\r\n, medical_claim as (\r\n\r\n select\r\n patient_id\r\n , claim_start_date\r\n , claim_end_date\r\n , hcpcs_code\r\n , place_of_service_code\r\n from {{ ref('quality_measures__stg_medical_claim') }}\r\n\r\n)\r\n\r\n, exclusions as (\r\n\r\n select\r\n denominator.patient_id\r\n , coalesce(\r\n medical_claim.claim_start_date\r\n , medical_claim.claim_end_date\r\n ) as exclusion_date\r\n , 'Institutional or Long Term Care' as exclusion_reason\r\n from denominator\r\n inner join medical_claim\r\n on denominator.patient_id = medical_claim.patient_id\r\n where denominator.age >= 66\r\n and (\r\n medical_claim.claim_start_date\r\n between denominator.performance_period_begin\r\n and denominator.performance_period_end\r\n or medical_claim.claim_end_date\r\n between denominator.performance_period_begin\r\n and denominator.performance_period_end\r\n )\r\n and place_of_service_code in ('32', '33', '34', '54', '56')\r\n and {{ datediff('medical_claim.claim_start_date', 'medical_claim.claim_end_date', 'day') }} >= 90\r\n\r\n)\r\n\r\nselect\r\n patient_id\r\n , exclusion_date\r\n , exclusion_reason\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom exclusions", "language": "sql", "refs": [["quality_measures__int_nqf2372_denominator"], ["quality_measures__stg_medical_claim"]], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.datediff"], "nodes": ["model.the_tuva_project.quality_measures__int_nqf2372_denominator", "model.the_tuva_project.quality_measures__stg_medical_claim"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\quality_measures\\intermediate\\nqf2372_breast_cancer_screening\\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-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom devforrest.core.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 devforrest.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-12-13 23:31:59.089856+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-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom devforrest.core.medical_claim\n\n\n)"}]}, "model.the_tuva_project.quality_measures__int_nqf2372_exclude_mastectomy": {"database": "devforrest", "schema": "quality_measures", "name": "quality_measures__int_nqf2372_exclude_mastectomy", "resource_type": "model", "package_name": "the_tuva_project", "path": "quality_measures\\intermediate\\nqf2372_breast_cancer_screening\\quality_measures__int_nqf2372_exclude_mastectomy.sql", "original_file_path": "models\\quality_measures\\intermediate\\nqf2372_breast_cancer_screening\\quality_measures__int_nqf2372_exclude_mastectomy.sql", "unique_id": "model.the_tuva_project.quality_measures__int_nqf2372_exclude_mastectomy", "fqn": ["the_tuva_project", "quality_measures", "intermediate", "nqf2372_breast_cancer_screening", "quality_measures__int_nqf2372_exclude_mastectomy"], "alias": "_int_nqf2372_exclude_mastectomy", "checksum": {"name": "sha256", "checksum": "6b9036af7abb970495206c5f27ea207544d127ad90d1967027b105fdbafd2a7c"}, "config": {"enabled": true, "alias": "_int_nqf2372_exclude_mastectomy", "schema": "quality_measures", "database": null, "tags": ["quality_measures"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["quality_measures"], "description": "Exclusion logic for patients with a mastectomy for the reporting version of NQF 2372, Breast Cancer Screening.\n", "columns": {"patient_id": {"name": "patient_id", "description": "Unique patient_id for each person.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "exclusion_date": {"name": "exclusion_date", "description": "Date of event or service that excludes patient from the measure.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "exclusion_reason": {"name": "exclusion_reason", "description": "Reason (usually the value set concept name) that excludes patient from the measure.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://models\\quality_measures\\quality_measures_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "quality_measures", "alias": "_int_nqf2372_exclude_mastectomy", "tags": "quality_measures", "materialized": "table", "enabled": true, "bind": false}, "created_at": 1702481697.1278899, "relation_name": "devforrest.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 Women who had a bilateral mastectomy or who have a history of a bilateral\r\n mastectomy or for whom there is evidence of a right and a left\r\n unilateral mastectomy\r\n*/\r\n\r\nwith denominator as (\r\n\r\n select\r\n patient_id\r\n , performance_period_begin\r\n , performance_period_end\r\n from {{ ref('quality_measures__int_nqf2372_denominator') }}\r\n\r\n)\r\n\r\n, exclusion_codes as (\r\n\r\n select\r\n code\r\n , code_system\r\n , concept_name\r\n from {{ ref('quality_measures__value_sets') }}\r\n where concept_name in (\r\n 'Bilateral Mastectomy'\r\n , 'History of bilateral mastectomy'\r\n , 'Status Post Left Mastectomy'\r\n , 'Status Post Right Mastectomy'\r\n , 'Unilateral Mastectomy Left'\r\n , 'Unilateral Mastectomy Right'\r\n , 'Unilateral Mastectomy, Unspecified Laterality'\r\n )\r\n\r\n)\r\n\r\n, conditions as (\r\n\r\n select\r\n patient_id\r\n , recorded_date\r\n , coalesce (\r\n normalized_code_type\r\n , case\r\n when lower(source_code_type) = 'snomed' then 'snomed-ct'\r\n else lower(source_code_type)\r\n end\r\n ) as code_type\r\n , coalesce(\r\n normalized_code\r\n , source_code\r\n ) as code\r\n from {{ ref('quality_measures__stg_core__condition') }}\r\n\r\n)\r\n\r\n, observations as (\r\n\r\n select\r\n patient_id\r\n , observation_date\r\n , coalesce (\r\n normalized_code_type\r\n , case\r\n when lower(source_code_type) = 'cpt' then 'hcpcs'\r\n when lower(source_code_type) = 'snomed' then 'snomed-ct'\r\n else lower(source_code_type)\r\n end\r\n ) as code_type\r\n , coalesce(\r\n normalized_code\r\n , source_code\r\n ) as code\r\n from {{ ref('quality_measures__stg_core__observation') }}\r\n\r\n)\r\n\r\n, procedures as (\r\n\r\n select\r\n patient_id\r\n , procedure_date\r\n , coalesce (\r\n normalized_code_type\r\n , case\r\n when lower(source_code_type) = 'cpt' then 'hcpcs'\r\n when lower(source_code_type) = 'snomed' then 'snomed-ct'\r\n else lower(source_code_type)\r\n end\r\n ) as code_type\r\n , coalesce(\r\n normalized_code\r\n , source_code\r\n ) as code\r\n from {{ ref('quality_measures__stg_core__procedure') }}\r\n\r\n)\r\n\r\n, condition_exclusions as (\r\n\r\n select\r\n conditions.patient_id\r\n , conditions.recorded_date\r\n , exclusion_codes.concept_name\r\n from conditions\r\n inner join exclusion_codes\r\n on conditions.code = exclusion_codes.code\r\n and conditions.code_type = exclusion_codes.code_system\r\n\r\n)\r\n\r\n, observation_exclusions as (\r\n\r\n select\r\n observations.patient_id\r\n , observations.observation_date\r\n , exclusion_codes.concept_name\r\n from observations\r\n inner join exclusion_codes\r\n on observations.code = exclusion_codes.code\r\n and observations.code_type = exclusion_codes.code_system\r\n\r\n)\r\n\r\n, procedure_exclusions as (\r\n\r\n select\r\n procedures.patient_id\r\n , procedures.procedure_date\r\n , exclusion_codes.concept_name\r\n from procedures\r\n inner join exclusion_codes\r\n on procedures.code = exclusion_codes.code\r\n and procedures.code_type = exclusion_codes.code_system\r\n\r\n)\r\n\r\n, all_mastectomy as (\r\n\r\n select\r\n denominator.patient_id\r\n , condition_exclusions.recorded_date as exclusion_date\r\n , condition_exclusions.concept_name as exclusion_reason\r\n from denominator\r\n inner join condition_exclusions\r\n on denominator.patient_id = condition_exclusions.patient_id\r\n\r\n union all\r\n\r\n select\r\n denominator.patient_id\r\n , observation_exclusions.observation_date as exclusion_date\r\n , observation_exclusions.concept_name as exclusion_reason\r\n from denominator\r\n inner join observation_exclusions\r\n on denominator.patient_id = observation_exclusions.patient_id\r\n\r\n union all\r\n\r\n select\r\n denominator.patient_id\r\n , procedure_exclusions.procedure_date as exclusion_date\r\n , procedure_exclusions.concept_name as exclusion_reason\r\n from denominator\r\n inner join procedure_exclusions\r\n on denominator.patient_id = procedure_exclusions.patient_id\r\n\r\n)\r\n\r\n/*\r\n Women who had a bilateral mastectomy or who have a history of a bilateral\r\n mastectomy\r\n*/\r\n, bilateral_mastectomy as (\r\n\r\n select\r\n patient_id\r\n , exclusion_date\r\n , exclusion_reason\r\n from all_mastectomy\r\n where exclusion_reason in (\r\n 'Bilateral Mastectomy'\r\n , 'History of bilateral mastectomy'\r\n )\r\n\r\n)\r\n\r\n, right_mastectomy as (\r\n\r\n select\r\n patient_id\r\n , exclusion_date\r\n , exclusion_reason\r\n from all_mastectomy\r\n where exclusion_reason in (\r\n 'Status Post Right Mastectomy'\r\n , 'Unilateral Mastectomy Right'\r\n )\r\n\r\n)\r\n\r\n, left_mastectomy as (\r\n\r\n select\r\n patient_id\r\n , exclusion_date\r\n , exclusion_reason\r\n from all_mastectomy\r\n where exclusion_reason in (\r\n 'Status Post Left Mastectomy'\r\n , 'Unilateral Mastectomy Left'\r\n )\r\n\r\n)\r\n\r\n, unspecified_mastectomy as (\r\n\r\n select\r\n patient_id\r\n , exclusion_date\r\n , exclusion_reason\r\n from all_mastectomy\r\n where exclusion_reason in (\r\n 'Unilateral Mastectomy, Unspecified Laterality'\r\n )\r\n\r\n)\r\n\r\n/*\r\n Women for whom there is evidence of a right AND a left unilateral mastectomy\r\n or unspecific mastectomies on different dates\r\n*/\r\n, unilateral_mastectomy as (\r\n\r\n select\r\n right_mastectomy.patient_id\r\n , right_mastectomy.exclusion_date\r\n , right_mastectomy.exclusion_reason\r\n from right_mastectomy\r\n inner join left_mastectomy\r\n on right_mastectomy.patient_id = left_mastectomy.patient_id\r\n\r\n union all\r\n\r\n select\r\n unspecified_mastectomy.patient_id\r\n , unspecified_mastectomy.exclusion_date\r\n , unspecified_mastectomy.exclusion_reason\r\n from unspecified_mastectomy\r\n inner join unspecified_mastectomy as self_join\r\n on unspecified_mastectomy.patient_id = self_join.patient_id\r\n and unspecified_mastectomy.exclusion_date <> self_join.exclusion_date\r\n\r\n)\r\n\r\n, unioned as (\r\n\r\n select * from bilateral_mastectomy\r\n union all\r\n select * from unilateral_mastectomy\r\n)\r\n\r\nselect\r\n patient_id\r\n , exclusion_date\r\n , exclusion_reason\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom unioned", "language": "sql", "refs": [["quality_measures__int_nqf2372_denominator"], ["quality_measures__value_sets"], ["quality_measures__stg_core__condition"], ["quality_measures__stg_core__observation"], ["quality_measures__stg_core__procedure"]], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.quality_measures__int_nqf2372_denominator", "seed.the_tuva_project.quality_measures__value_sets", "model.the_tuva_project.quality_measures__stg_core__condition", "model.the_tuva_project.quality_measures__stg_core__observation", "model.the_tuva_project.quality_measures__stg_core__procedure"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\quality_measures\\intermediate\\nqf2372_breast_cancer_screening\\quality_measures__int_nqf2372_exclude_mastectomy.sql", "compiled": true, "compiled_code": "\n\n/*\n Women who had a bilateral mastectomy or who have a history of a bilateral\n mastectomy or for whom there is evidence of a right and a left\n unilateral mastectomy\n*/\n\nwith __dbt__cte__quality_measures__stg_core__condition as (\n\nselect\n patient_id\n , claim_id\n , recorded_date\n , source_code_type\n , source_code\n , normalized_code_type\n , normalized_code\n , '2023-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom devforrest.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-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom devforrest.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-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom devforrest.core.procedure\n),denominator as (\n\n select\n patient_id\n , performance_period_begin\n , performance_period_end\n from devforrest.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 devforrest.quality_measures._value_set_codes\n where concept_name in (\n 'Bilateral Mastectomy'\n , 'History of bilateral mastectomy'\n , 'Status Post Left Mastectomy'\n , 'Status Post Right Mastectomy'\n , 'Unilateral Mastectomy Left'\n , 'Unilateral Mastectomy Right'\n , 'Unilateral Mastectomy, Unspecified Laterality'\n )\n\n)\n\n, conditions as (\n\n select\n patient_id\n , recorded_date\n , coalesce (\n normalized_code_type\n , case\n when lower(source_code_type) = 'snomed' then 'snomed-ct'\n else lower(source_code_type)\n end\n ) as code_type\n , coalesce(\n normalized_code\n , source_code\n ) as code\n from __dbt__cte__quality_measures__stg_core__condition\n\n)\n\n, observations as (\n\n select\n patient_id\n , observation_date\n , coalesce (\n normalized_code_type\n , case\n when lower(source_code_type) = 'cpt' then 'hcpcs'\n when lower(source_code_type) = 'snomed' then 'snomed-ct'\n else lower(source_code_type)\n end\n ) as code_type\n , coalesce(\n normalized_code\n , source_code\n ) as code\n from __dbt__cte__quality_measures__stg_core__observation\n\n)\n\n, procedures as (\n\n select\n patient_id\n , procedure_date\n , coalesce (\n normalized_code_type\n , case\n when lower(source_code_type) = 'cpt' then 'hcpcs'\n when lower(source_code_type) = 'snomed' then 'snomed-ct'\n else lower(source_code_type)\n end\n ) as code_type\n , coalesce(\n normalized_code\n , source_code\n ) as code\n from __dbt__cte__quality_measures__stg_core__procedure\n\n)\n\n, condition_exclusions as (\n\n select\n conditions.patient_id\n , conditions.recorded_date\n , exclusion_codes.concept_name\n from conditions\n inner join exclusion_codes\n on conditions.code = exclusion_codes.code\n and conditions.code_type = exclusion_codes.code_system\n\n)\n\n, observation_exclusions as (\n\n select\n observations.patient_id\n , observations.observation_date\n , exclusion_codes.concept_name\n from observations\n inner join exclusion_codes\n on observations.code = exclusion_codes.code\n and observations.code_type = exclusion_codes.code_system\n\n)\n\n, procedure_exclusions as (\n\n select\n procedures.patient_id\n , procedures.procedure_date\n , exclusion_codes.concept_name\n from procedures\n inner join exclusion_codes\n on procedures.code = exclusion_codes.code\n and procedures.code_type = exclusion_codes.code_system\n\n)\n\n, all_mastectomy as (\n\n select\n denominator.patient_id\n , condition_exclusions.recorded_date as exclusion_date\n , condition_exclusions.concept_name as exclusion_reason\n from denominator\n inner join condition_exclusions\n on denominator.patient_id = condition_exclusions.patient_id\n\n union all\n\n select\n denominator.patient_id\n , observation_exclusions.observation_date as exclusion_date\n , observation_exclusions.concept_name as exclusion_reason\n from denominator\n inner join observation_exclusions\n on denominator.patient_id = observation_exclusions.patient_id\n\n union all\n\n select\n denominator.patient_id\n , procedure_exclusions.procedure_date as exclusion_date\n , procedure_exclusions.concept_name as exclusion_reason\n from denominator\n inner join procedure_exclusions\n on denominator.patient_id = procedure_exclusions.patient_id\n\n)\n\n/*\n Women who had a bilateral mastectomy or who have a history of a bilateral\n mastectomy\n*/\n, bilateral_mastectomy as (\n\n select\n patient_id\n , exclusion_date\n , exclusion_reason\n from all_mastectomy\n where exclusion_reason in (\n 'Bilateral Mastectomy'\n , 'History of bilateral mastectomy'\n )\n\n)\n\n, right_mastectomy as (\n\n select\n patient_id\n , exclusion_date\n , exclusion_reason\n from all_mastectomy\n where exclusion_reason in (\n 'Status Post Right Mastectomy'\n , 'Unilateral Mastectomy Right'\n )\n\n)\n\n, left_mastectomy as (\n\n select\n patient_id\n , exclusion_date\n , exclusion_reason\n from all_mastectomy\n where exclusion_reason in (\n 'Status Post Left Mastectomy'\n , 'Unilateral Mastectomy Left'\n )\n\n)\n\n, unspecified_mastectomy as (\n\n select\n patient_id\n , exclusion_date\n , exclusion_reason\n from all_mastectomy\n where exclusion_reason in (\n 'Unilateral Mastectomy, Unspecified Laterality'\n )\n\n)\n\n/*\n Women for whom there is evidence of a right AND a left unilateral mastectomy\n or unspecific mastectomies on different dates\n*/\n, unilateral_mastectomy as (\n\n select\n right_mastectomy.patient_id\n , right_mastectomy.exclusion_date\n , right_mastectomy.exclusion_reason\n from right_mastectomy\n inner join left_mastectomy\n on right_mastectomy.patient_id = left_mastectomy.patient_id\n\n union all\n\n select\n unspecified_mastectomy.patient_id\n , unspecified_mastectomy.exclusion_date\n , unspecified_mastectomy.exclusion_reason\n from unspecified_mastectomy\n inner join unspecified_mastectomy as self_join\n on unspecified_mastectomy.patient_id = self_join.patient_id\n and unspecified_mastectomy.exclusion_date <> self_join.exclusion_date\n\n)\n\n, unioned as (\n\n select * from bilateral_mastectomy\n union all\n select * from unilateral_mastectomy\n)\n\nselect\n patient_id\n , exclusion_date\n , exclusion_reason\n , '2023-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom unioned", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.the_tuva_project.quality_measures__stg_core__condition", "sql": " __dbt__cte__quality_measures__stg_core__condition as (\n\nselect\n patient_id\n , claim_id\n , recorded_date\n , source_code_type\n , source_code\n , normalized_code_type\n , normalized_code\n , '2023-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom devforrest.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-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom devforrest.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-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom devforrest.core.procedure\n)"}]}, "model.the_tuva_project.quality_measures__int_nqf2372_exclude_palliative": {"database": "devforrest", "schema": "quality_measures", "name": "quality_measures__int_nqf2372_exclude_palliative", "resource_type": "model", "package_name": "the_tuva_project", "path": "quality_measures\\intermediate\\nqf2372_breast_cancer_screening\\quality_measures__int_nqf2372_exclude_palliative.sql", "original_file_path": "models\\quality_measures\\intermediate\\nqf2372_breast_cancer_screening\\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", "nqf2372_breast_cancer_screening", "quality_measures__int_nqf2372_exclude_palliative"], "alias": "_int_nqf2372_exclude_palliative", "checksum": {"name": "sha256", "checksum": "93ff2352e6d99a84d4446780ab1398bb344392449826863d970661aabeb95044"}, "config": {"enabled": true, "alias": "_int_nqf2372_exclude_palliative", "schema": "quality_measures", "database": null, "tags": ["quality_measures"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["quality_measures"], "description": "Exclusion logic for patients using palliative services for the reporting version of NQF 2372, Breast Cancer Screening.\n", "columns": {"patient_id": {"name": "patient_id", "description": "Unique patient_id for each person.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "exclusion_date": {"name": "exclusion_date", "description": "Date of event or service that excludes patient from the measure.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "exclusion_reason": {"name": "exclusion_reason", "description": "Reason (usually the value set concept name) that excludes patient from the measure.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://models\\quality_measures\\quality_measures_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "quality_measures", "alias": "_int_nqf2372_exclude_palliative", "tags": "quality_measures", "materialized": "table", "enabled": true, "bind": false}, "created_at": 1702481697.1436064, "relation_name": "devforrest.quality_measures._int_nqf2372_exclude_palliative", "raw_code": "{{ config(\r\n enabled = var('quality_measures_enabled',var('claims_enabled',var('clinical_enabled',var('tuva_marts_enabled',False))))\r\n )\r\n}}\r\n\r\n/*\r\n Palliative care services used by patient any time during the measurement period\r\n*/\r\nwith denominator as (\r\n\r\n select\r\n patient_id\r\n , performance_period_begin\r\n , performance_period_end\r\n from {{ ref('quality_measures__int_nqf2372_denominator') }}\r\n\r\n)\r\n\r\n, exclusion_codes as (\r\n\r\n select\r\n code\r\n , code_system\r\n , concept_name\r\n from {{ ref('quality_measures__value_sets') }}\r\n where concept_name in (\r\n 'Palliative Care Encounter'\r\n , 'Palliative Care Intervention'\r\n )\r\n\r\n)\r\n\r\n, medical_claim as (\r\n\r\n select\r\n patient_id\r\n , claim_start_date\r\n , claim_end_date\r\n , hcpcs_code\r\n , place_of_service_code\r\n from {{ ref('quality_measures__stg_medical_claim') }}\r\n\r\n)\r\n\r\n, observations as (\r\n\r\n select\r\n patient_id\r\n , observation_date\r\n , coalesce (\r\n normalized_code_type\r\n , case\r\n when lower(source_code_type) = 'cpt' then 'hcpcs'\r\n when lower(source_code_type) = 'snomed' then 'snomed-ct'\r\n else lower(source_code_type)\r\n end\r\n ) as code_type\r\n , coalesce (\r\n normalized_code\r\n , source_code\r\n ) as code\r\n from {{ ref('quality_measures__stg_core__observation') }}\r\n\r\n)\r\n\r\n, procedures as (\r\n\r\n select\r\n patient_id\r\n , procedure_date\r\n , coalesce (\r\n normalized_code_type\r\n , case\r\n when lower(source_code_type) = 'cpt' then 'hcpcs'\r\n when lower(source_code_type) = 'snomed' then 'snomed-ct'\r\n else lower(source_code_type)\r\n end\r\n ) as code_type\r\n , coalesce (\r\n normalized_code\r\n , source_code\r\n ) as code\r\n from {{ ref('quality_measures__stg_core__procedure') }}\r\n\r\n)\r\n\r\n, med_claim_exclusions as (\r\n\r\n select\r\n medical_claim.patient_id\r\n , medical_claim.claim_start_date\r\n , medical_claim.claim_end_date\r\n , medical_claim.hcpcs_code\r\n , exclusion_codes.concept_name\r\n from medical_claim\r\n inner join exclusion_codes\r\n on medical_claim.hcpcs_code = exclusion_codes.code\r\n where exclusion_codes.code_system = 'hcpcs'\r\n\r\n)\r\n\r\n, observation_exclusions as (\r\n\r\n select\r\n observations.patient_id\r\n , observations.observation_date\r\n , exclusion_codes.concept_name\r\n from observations\r\n inner join exclusion_codes\r\n on observations.code = exclusion_codes.code\r\n and observations.code_type = exclusion_codes.code_system\r\n\r\n)\r\n\r\n, procedure_exclusions as (\r\n\r\n select\r\n procedures.patient_id\r\n , procedures.procedure_date\r\n , exclusion_codes.concept_name\r\n from procedures\r\n inner join exclusion_codes\r\n on procedures.code = exclusion_codes.code\r\n and procedures.code_type = exclusion_codes.code_system\r\n\r\n)\r\n\r\n, palliative_care as (\r\n\r\n select\r\n denominator.patient_id\r\n , coalesce (\r\n med_claim_exclusions.claim_start_date\r\n , med_claim_exclusions.claim_end_date\r\n ) as exclusion_date\r\n , med_claim_exclusions.concept_name as exclusion_reason\r\n from denominator\r\n inner join med_claim_exclusions\r\n on denominator.patient_id = med_claim_exclusions.patient_id\r\n where (\r\n med_claim_exclusions.claim_start_date\r\n between denominator.performance_period_begin\r\n and denominator.performance_period_end\r\n or med_claim_exclusions.claim_end_date\r\n between denominator.performance_period_begin\r\n and denominator.performance_period_end\r\n )\r\n\r\n union all\r\n\r\n select\r\n denominator.patient_id\r\n , observation_exclusions.observation_date as exclusion_date\r\n , observation_exclusions.concept_name as exclusion_reason\r\n from denominator\r\n inner join observation_exclusions\r\n on denominator.patient_id = observation_exclusions.patient_id\r\n where observation_exclusions.observation_date\r\n between denominator.performance_period_begin\r\n and denominator.performance_period_end\r\n\r\n union all\r\n\r\n select\r\n denominator.patient_id\r\n , procedure_exclusions.procedure_date as exclusion_date\r\n , procedure_exclusions.concept_name as exclusion_reason\r\n from denominator\r\n inner join procedure_exclusions\r\n on denominator.patient_id = procedure_exclusions.patient_id\r\n where procedure_exclusions.procedure_date\r\n between denominator.performance_period_begin\r\n and denominator.performance_period_end\r\n\r\n)\r\n\r\nselect\r\n patient_id\r\n , exclusion_date\r\n , exclusion_reason\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom palliative_care", "language": "sql", "refs": [["quality_measures__int_nqf2372_denominator"], ["quality_measures__value_sets"], ["quality_measures__stg_medical_claim"], ["quality_measures__stg_core__observation"], ["quality_measures__stg_core__procedure"]], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.quality_measures__int_nqf2372_denominator", "seed.the_tuva_project.quality_measures__value_sets", "model.the_tuva_project.quality_measures__stg_medical_claim", "model.the_tuva_project.quality_measures__stg_core__observation", "model.the_tuva_project.quality_measures__stg_core__procedure"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\quality_measures\\intermediate\\nqf2372_breast_cancer_screening\\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-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom devforrest.core.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-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom devforrest.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-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom devforrest.core.procedure\n),denominator as (\n\n select\n patient_id\n , performance_period_begin\n , performance_period_end\n from devforrest.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 devforrest.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-12-13 23:31:59.089856+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-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom devforrest.core.medical_claim\n\n\n)"}, {"id": "model.the_tuva_project.quality_measures__stg_core__observation", "sql": " __dbt__cte__quality_measures__stg_core__observation as (\n\n\nselect\n patient_id\n , observation_date\n , source_code_type\n , source_code\n , normalized_code_type\n , normalized_code\n , '2023-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom devforrest.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-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom devforrest.core.procedure\n)"}]}, "model.the_tuva_project.quality_measures__int_nqf2372_exclusions": {"database": "devforrest", "schema": "quality_measures", "name": "quality_measures__int_nqf2372_exclusions", "resource_type": "model", "package_name": "the_tuva_project", "path": "quality_measures\\intermediate\\nqf2372_breast_cancer_screening\\quality_measures__int_nqf2372_exclusions.sql", "original_file_path": "models\\quality_measures\\intermediate\\nqf2372_breast_cancer_screening\\quality_measures__int_nqf2372_exclusions.sql", "unique_id": "model.the_tuva_project.quality_measures__int_nqf2372_exclusions", "fqn": ["the_tuva_project", "quality_measures", "intermediate", "nqf2372_breast_cancer_screening", "quality_measures__int_nqf2372_exclusions"], "alias": "_int_nqf2372_exclusions", "checksum": {"name": "sha256", "checksum": "122797297c958130e18fc97373ccc56d2df7be6c71f8007a047601b4c3c33c64"}, "config": {"enabled": true, "alias": "_int_nqf2372_exclusions", "schema": "quality_measures", "database": null, "tags": ["quality_measures"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["quality_measures"], "description": "Combined exclusion logic for the reporting version of NQF 2372, Breast Cancer Screening.\n", "columns": {"patient_id": {"name": "patient_id", "description": "Unique patient_id for each person.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "performance_period_begin": {"name": "performance_period_begin", "description": "Beginning date of the performance or measurement period.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "performance_period_end": {"name": "performance_period_end", "description": "Ending date of the performance or measurement period.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "measure_id": {"name": "measure_id", "description": "Unique measure identification number.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "measure_name": {"name": "measure_name", "description": "Name of the measure.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "measure_version": {"name": "measure_version", "description": "Version of the measure.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "exclusion_date": {"name": "exclusion_date", "description": "Date of event or service that excludes patient from the measure.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "exclusion_reason": {"name": "exclusion_reason", "description": "Reason (usually the value set concept name) that excludes patient from the measure.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "exclusion_flag": {"name": "exclusion_flag", "description": "Specifications of those characteristics that would cause groups of individuals to be removed from the numerator and/or denominator of a measure although they experience the denominator index event.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The date and timestamp of the dbt run.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://models\\quality_measures\\quality_measures_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "quality_measures", "alias": "_int_nqf2372_exclusions", "tags": "quality_measures", "materialized": "table", "enabled": true, "bind": false}, "created_at": 1702481697.1436064, "relation_name": "devforrest.quality_measures._int_nqf2372_exclusions", "raw_code": "{{ config(\r\n enabled = var('quality_measures_enabled',var('claims_enabled',var('clinical_enabled',var('tuva_marts_enabled',False))))\r\n )\r\n}}\r\n\r\n/*\r\n Eligible population from the denominator model before exclusions\r\n*/\r\nwith denominator as (\r\n\r\n select\r\n patient_id\r\n , performance_period_begin\r\n , performance_period_end\r\n , measure_id\r\n , measure_name\r\n , measure_version\r\n from {{ ref('quality_measures__int_nqf2372_denominator') }}\r\n\r\n)\r\n\r\n, advanced_illness as (\r\n\r\n select\r\n patient_id\r\n , exclusion_date\r\n , exclusion_reason\r\n from {{ ref('quality_measures__int_nqf2372_exclude_advanced_illness') }}\r\n\r\n)\r\n\r\n, dementia as (\r\n\r\n select\r\n patient_id\r\n , exclusion_date\r\n , exclusion_reason\r\n from {{ ref('quality_measures__int_nqf2372_exclude_dementia') }}\r\n\r\n)\r\n\r\n, hospice as (\r\n\r\n select\r\n patient_id\r\n , exclusion_date\r\n , exclusion_reason\r\n from {{ ref('quality_measures__int_nqf2372_exclude_hospice') }}\r\n\r\n)\r\n\r\n, institutional as (\r\n\r\n select\r\n patient_id\r\n , exclusion_date\r\n , exclusion_reason\r\n from {{ ref('quality_measures__int_nqf2372_exclude_institutional') }}\r\n\r\n)\r\n\r\n, mastectomy as (\r\n\r\n select\r\n patient_id\r\n , exclusion_date\r\n , exclusion_reason\r\n from {{ ref('quality_measures__int_nqf2372_exclude_mastectomy') }}\r\n\r\n)\r\n\r\n, palliative as (\r\n\r\n select\r\n patient_id\r\n , exclusion_date\r\n , exclusion_reason\r\n from {{ ref('quality_measures__int_nqf2372_exclude_palliative') }}\r\n\r\n)\r\n\r\n, denominator_with_advanced_illness as (\r\n\r\n select\r\n denominator.patient_id\r\n , denominator.performance_period_begin\r\n , denominator.performance_period_end\r\n , denominator.measure_id\r\n , denominator.measure_name\r\n , denominator.measure_version\r\n , case\r\n when advanced_illness.patient_id is not null then 1\r\n else 0\r\n end as exclusion_flag\r\n , advanced_illness.exclusion_date\r\n , advanced_illness.exclusion_reason\r\n from denominator\r\n left join advanced_illness\r\n on denominator.patient_id = advanced_illness.patient_id\r\n\r\n)\r\n\r\n, denominator_with_dementia as (\r\n\r\n select\r\n denominator.patient_id\r\n , denominator.performance_period_begin\r\n , denominator.performance_period_end\r\n , denominator.measure_id\r\n , denominator.measure_name\r\n , denominator.measure_version\r\n , case\r\n when dementia.patient_id is not null then 1\r\n else 0\r\n end as exclusion_flag\r\n , dementia.exclusion_date\r\n , dementia.exclusion_reason\r\n from denominator\r\n left join dementia\r\n on denominator.patient_id = dementia.patient_id\r\n\r\n)\r\n\r\n, denominator_with_hospice as (\r\n\r\n select\r\n denominator.patient_id\r\n , denominator.performance_period_begin\r\n , denominator.performance_period_end\r\n , denominator.measure_id\r\n , denominator.measure_name\r\n , denominator.measure_version\r\n , case\r\n when hospice.patient_id is not null then 1\r\n else 0\r\n end as exclusion_flag\r\n , hospice.exclusion_date\r\n , hospice.exclusion_reason\r\n from denominator\r\n left join hospice\r\n on denominator.patient_id = hospice.patient_id\r\n\r\n)\r\n\r\n, denominator_with_institutional as (\r\n\r\n select\r\n denominator.patient_id\r\n , denominator.performance_period_begin\r\n , denominator.performance_period_end\r\n , denominator.measure_id\r\n , denominator.measure_name\r\n , denominator.measure_version\r\n , case\r\n when institutional.patient_id is not null then 1\r\n else 0\r\n end as exclusion_flag\r\n , institutional.exclusion_date\r\n , institutional.exclusion_reason\r\n from denominator\r\n left join institutional\r\n on denominator.patient_id = institutional.patient_id\r\n\r\n)\r\n\r\n, denominator_with_mastectomy as (\r\n\r\n select\r\n denominator.patient_id\r\n , denominator.performance_period_begin\r\n , denominator.performance_period_end\r\n , denominator.measure_id\r\n , denominator.measure_name\r\n , denominator.measure_version\r\n , case\r\n when mastectomy.patient_id is not null then 1\r\n else 0\r\n end as exclusion_flag\r\n , mastectomy.exclusion_date\r\n , mastectomy.exclusion_reason\r\n from denominator\r\n left join mastectomy\r\n on denominator.patient_id = mastectomy.patient_id\r\n\r\n)\r\n\r\n, denominator_with_palliative as (\r\n\r\n select\r\n denominator.patient_id\r\n , denominator.performance_period_begin\r\n , denominator.performance_period_end\r\n , denominator.measure_id\r\n , denominator.measure_name\r\n , denominator.measure_version\r\n , case\r\n when palliative.patient_id is not null then 1\r\n else 0\r\n end as exclusion_flag\r\n , palliative.exclusion_date\r\n , palliative.exclusion_reason\r\n from denominator\r\n left join palliative\r\n on denominator.patient_id = palliative.patient_id\r\n\r\n)\r\n\r\n, exclusions_unioned as (\r\n\r\n select * from denominator_with_advanced_illness\r\n union all\r\n select * from denominator_with_dementia\r\n union all\r\n select * from denominator_with_hospice\r\n union all\r\n select * from denominator_with_institutional\r\n union all\r\n select * from denominator_with_mastectomy\r\n union all\r\n select * from denominator_with_palliative\r\n\r\n)\r\n\r\n, add_data_types as (\r\n\r\n select\r\n cast(patient_id as {{ dbt.type_string() }}) as patient_id\r\n , cast(performance_period_begin as date) as performance_period_begin\r\n , cast(performance_period_end as date) as performance_period_end\r\n , cast(measure_id as {{ dbt.type_string() }}) as measure_id\r\n , cast(measure_name as {{ dbt.type_string() }}) as measure_name\r\n , cast(measure_version as {{ dbt.type_string() }}) as measure_version\r\n , cast(exclusion_date as date) as exclusion_date\r\n , cast(exclusion_reason as {{ dbt.type_string() }}) as exclusion_reason\r\n , cast(exclusion_flag as integer) as exclusion_flag\r\n from exclusions_unioned\r\n\r\n)\r\n\r\nselect\r\n patient_id\r\n , performance_period_begin\r\n , performance_period_end\r\n , measure_id\r\n , measure_name\r\n , measure_version\r\n , exclusion_date\r\n , exclusion_reason\r\n , exclusion_flag\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom add_data_types", "language": "sql", "refs": [["quality_measures__int_nqf2372_denominator"], ["quality_measures__int_nqf2372_exclude_advanced_illness"], ["quality_measures__int_nqf2372_exclude_dementia"], ["quality_measures__int_nqf2372_exclude_hospice"], ["quality_measures__int_nqf2372_exclude_institutional"], ["quality_measures__int_nqf2372_exclude_mastectomy"], ["quality_measures__int_nqf2372_exclude_palliative"]], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.type_string"], "nodes": ["model.the_tuva_project.quality_measures__int_nqf2372_denominator", "model.the_tuva_project.quality_measures__int_nqf2372_exclude_advanced_illness", "model.the_tuva_project.quality_measures__int_nqf2372_exclude_dementia", "model.the_tuva_project.quality_measures__int_nqf2372_exclude_hospice", "model.the_tuva_project.quality_measures__int_nqf2372_exclude_institutional", "model.the_tuva_project.quality_measures__int_nqf2372_exclude_mastectomy", "model.the_tuva_project.quality_measures__int_nqf2372_exclude_palliative"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\quality_measures\\intermediate\\nqf2372_breast_cancer_screening\\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 devforrest.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 devforrest.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 devforrest.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 devforrest.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 devforrest.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 devforrest.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 devforrest.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-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom add_data_types", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.quality_measures__int_nqf2372_long": {"database": "devforrest", "schema": "quality_measures", "name": "quality_measures__int_nqf2372_long", "resource_type": "model", "package_name": "the_tuva_project", "path": "quality_measures\\intermediate\\nqf2372_breast_cancer_screening\\quality_measures__int_nqf2372_long.sql", "original_file_path": "models\\quality_measures\\intermediate\\nqf2372_breast_cancer_screening\\quality_measures__int_nqf2372_long.sql", "unique_id": "model.the_tuva_project.quality_measures__int_nqf2372_long", "fqn": ["the_tuva_project", "quality_measures", "intermediate", "nqf2372_breast_cancer_screening", "quality_measures__int_nqf2372_long"], "alias": "_int_nqf2372_long", "checksum": {"name": "sha256", "checksum": "07b5be0a285c46fb425c0cf8550891c9ca5757e371d17c0891a3ec11c5d7213a"}, "config": {"enabled": true, "alias": "_int_nqf2372_long", "schema": "quality_measures", "database": null, "tags": ["quality_measures"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["quality_measures"], "description": "Final preparation of the reporting version of NQF 2372, Breast Cancer Screening before combining with other measures.\n", "columns": {"patient_id": {"name": "patient_id", "description": "Unique patient_id for each person.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "denominator_flag": {"name": "denominator_flag", "description": "The denominator is associated with a given patient population that may be counted as eligible to meet a measure\u2019s inclusion requirements.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "numerator_flag": {"name": "numerator_flag", "description": "The numerator reflects the subset of patients in the denominator for whom a particular service has been provided or for whom a particular outcome has been achieved.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "exclusion_flag": {"name": "exclusion_flag", "description": "Specifications of those characteristics that would cause groups of individuals to be removed from the numerator and/or denominator of a measure although they experience the denominator index event.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "evidence_date": {"name": "evidence_date", "description": "Date of event or service that places patient in the numerator.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "exclusion_date": {"name": "exclusion_date", "description": "Date of event or service that excludes patient from the measure.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "exclusion_reason": {"name": "exclusion_reason", "description": "Reason (usually the value set concept name) that excludes patient from the measure.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "performance_period_begin": {"name": "performance_period_begin", "description": "Beginning date of the performance or measurement period.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "performance_period_end": {"name": "performance_period_end", "description": "Ending date of the performance or measurement period.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "measure_id": {"name": "measure_id", "description": "Unique measure identification number.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "measure_name": {"name": "measure_name", "description": "Name of the measure.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "measure_version": {"name": "measure_version", "description": "Version of the measure.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The date and timestamp of the dbt run.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://models\\quality_measures\\quality_measures_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "quality_measures", "alias": "_int_nqf2372_long", "tags": "quality_measures", "materialized": "table", "enabled": true, "bind": false}, "created_at": 1702481697.1512082, "relation_name": "devforrest.quality_measures._int_nqf2372_long", "raw_code": "{{ config(\r\n enabled = var('quality_measures_enabled',var('claims_enabled',var('clinical_enabled',var('tuva_marts_enabled',False))))\r\n )\r\n}}\r\n\r\n/* selecting the full patient population as the grain of this table */\r\nwith patient as (\r\n\r\n select distinct patient_id\r\n from {{ ref('quality_measures__stg_core__patient') }}\r\n\r\n)\r\n\r\n, denominator as (\r\n\r\n select\r\n patient_id\r\n , performance_period_begin\r\n , performance_period_end\r\n , measure_id\r\n , measure_name\r\n , measure_version\r\n , denominator_flag\r\n from {{ ref('quality_measures__int_nqf2372_denominator') }}\r\n\r\n)\r\n\r\n, numerator as (\r\n\r\n select\r\n patient_id\r\n , performance_period_begin\r\n , performance_period_end\r\n , measure_id\r\n , measure_name\r\n , measure_version\r\n , evidence_date\r\n , numerator_flag\r\n from {{ ref('quality_measures__int_nqf2372_numerator') }}\r\n\r\n)\r\n\r\n, exclusions as (\r\n\r\n select\r\n patient_id\r\n , performance_period_begin\r\n , performance_period_end\r\n , measure_id\r\n , measure_name\r\n , measure_version\r\n , exclusion_date\r\n , exclusion_reason\r\n , exclusion_flag\r\n from {{ ref('quality_measures__int_nqf2372_exclusions') }}\r\n\r\n)\r\n\r\n, measure_flags as (\r\n\r\n select\r\n patient.patient_id\r\n , case\r\n when denominator.patient_id is not null\r\n then denominator.denominator_flag\r\n else null\r\n end as denominator_flag\r\n , case\r\n when numerator.patient_id is not null\r\n then numerator.numerator_flag\r\n else null\r\n end as numerator_flag\r\n , case\r\n when exclusions.patient_id is not null\r\n then exclusions.exclusion_flag\r\n else null\r\n end as exclusion_flag\r\n , numerator.evidence_date\r\n , exclusions.exclusion_date\r\n , exclusions.exclusion_reason\r\n , denominator.performance_period_begin\r\n , denominator.performance_period_end\r\n , denominator.measure_id\r\n , denominator.measure_name\r\n , denominator.measure_version\r\n from patient\r\n left join denominator\r\n on patient.patient_id = denominator.patient_id\r\n left join numerator\r\n on patient.patient_id = numerator.patient_id\r\n left join exclusions\r\n on patient.patient_id = exclusions.patient_id\r\n\r\n)\r\n\r\n/*\r\n Deduplicate measure rows by latest evidence date or exclusion date\r\n*/\r\n, add_rownum as (\r\n\r\n select\r\n patient_id\r\n , denominator_flag\r\n , numerator_flag\r\n , exclusion_flag\r\n , evidence_date\r\n , exclusion_date\r\n , exclusion_reason\r\n , performance_period_begin\r\n , performance_period_end\r\n , measure_id\r\n , measure_name\r\n , measure_version\r\n , row_number() over(\r\n partition by\r\n patient_id\r\n , performance_period_begin\r\n , performance_period_end\r\n , measure_id\r\n , measure_name\r\n order by\r\n evidence_date desc nulls last\r\n , exclusion_date desc nulls last\r\n ) as row_num\r\n from measure_flags\r\n\r\n)\r\n\r\n, deduped as (\r\n\r\n select\r\n patient_id\r\n , denominator_flag\r\n , numerator_flag\r\n , exclusion_flag\r\n , evidence_date\r\n , exclusion_date\r\n , exclusion_reason\r\n , performance_period_begin\r\n , performance_period_end\r\n , measure_id\r\n , measure_name\r\n , measure_version\r\n from add_rownum\r\n where row_num = 1\r\n\r\n)\r\n\r\n, add_data_types as (\r\n\r\n select\r\n cast(patient_id as {{ dbt.type_string() }}) as patient_id\r\n , cast(denominator_flag as integer) as denominator_flag\r\n , cast(numerator_flag as integer) as numerator_flag\r\n , cast(exclusion_flag as integer) as exclusion_flag\r\n , cast(evidence_date as date) as evidence_date\r\n , cast(exclusion_date as date) as exclusion_date\r\n , cast(exclusion_reason as {{ dbt.type_string() }}) as exclusion_reason\r\n , cast(performance_period_begin as date) as performance_period_begin\r\n , cast(performance_period_end as date) as performance_period_end\r\n , cast(measure_id as {{ dbt.type_string() }}) as measure_id\r\n , cast(measure_name as {{ dbt.type_string() }}) as measure_name\r\n , cast(measure_version as {{ dbt.type_string() }}) as measure_version\r\n from deduped\r\n\r\n)\r\n\r\nselect\r\n patient_id\r\n , denominator_flag\r\n , numerator_flag\r\n , exclusion_flag\r\n , evidence_date\r\n , exclusion_date\r\n , exclusion_reason\r\n , performance_period_begin\r\n , performance_period_end\r\n , measure_id\r\n , measure_name\r\n , measure_version\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom add_data_types", "language": "sql", "refs": [["quality_measures__stg_core__patient"], ["quality_measures__int_nqf2372_denominator"], ["quality_measures__int_nqf2372_numerator"], ["quality_measures__int_nqf2372_exclusions"]], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.type_string"], "nodes": ["model.the_tuva_project.quality_measures__stg_core__patient", "model.the_tuva_project.quality_measures__int_nqf2372_denominator", "model.the_tuva_project.quality_measures__int_nqf2372_numerator", "model.the_tuva_project.quality_measures__int_nqf2372_exclusions"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\quality_measures\\intermediate\\nqf2372_breast_cancer_screening\\quality_measures__int_nqf2372_long.sql", "compiled": true, "compiled_code": "\n\n/* selecting the full patient population as the grain of this table */\nwith __dbt__cte__quality_measures__stg_core__patient as (\n\nselect\n patient_id\n , sex\n , birth_date\n , death_date\n , '2023-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom devforrest.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 devforrest.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 devforrest.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 devforrest.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-12-13 23:31:59.089856+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-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom devforrest.core.patient\n)"}]}, "model.the_tuva_project.quality_measures__int_nqf2372_numerator": {"database": "devforrest", "schema": "quality_measures", "name": "quality_measures__int_nqf2372_numerator", "resource_type": "model", "package_name": "the_tuva_project", "path": "quality_measures\\intermediate\\nqf2372_breast_cancer_screening\\quality_measures__int_nqf2372_numerator.sql", "original_file_path": "models\\quality_measures\\intermediate\\nqf2372_breast_cancer_screening\\quality_measures__int_nqf2372_numerator.sql", "unique_id": "model.the_tuva_project.quality_measures__int_nqf2372_numerator", "fqn": ["the_tuva_project", "quality_measures", "intermediate", "nqf2372_breast_cancer_screening", "quality_measures__int_nqf2372_numerator"], "alias": "_int_nqf2372_numerator", "checksum": {"name": "sha256", "checksum": "4bda0fc70be63a9dfe8f6d0cfa86968a89bd62e215e9befdcccc13f7499b5d23"}, "config": {"enabled": true, "alias": "_int_nqf2372_numerator", "schema": "quality_measures", "database": null, "tags": ["quality_measures"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["quality_measures"], "description": "Numerator logic for the reporting version of NQF 2372, Breast Cancer Screening.\n", "columns": {"patient_id": {"name": "patient_id", "description": "Unique patient_id for each person.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "performance_period_begin": {"name": "performance_period_begin", "description": "Beginning date of the performance or measurement period.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "performance_period_end": {"name": "performance_period_end", "description": "Ending date of the performance or measurement period.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "measure_id": {"name": "measure_id", "description": "Unique measure identification number.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "measure_name": {"name": "measure_name", "description": "Name of the measure.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "measure_version": {"name": "measure_version", "description": "Version of the measure.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "evidence_date": {"name": "evidence_date", "description": "Date of event or service that places patient in the numerator.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "numerator_flag": {"name": "numerator_flag", "description": "The numerator reflects the subset of patients in the denominator for whom a particular service has been provided or for whom a particular outcome has been achieved.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The date and timestamp of the dbt run.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://models\\quality_measures\\quality_measures_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "quality_measures", "alias": "_int_nqf2372_numerator", "tags": "quality_measures", "materialized": "table", "enabled": true, "bind": false}, "created_at": 1702481697.159808, "relation_name": "devforrest.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 , performance_period_lookback\r\n , measure_id\r\n , measure_name\r\n , measure_version\r\n from {{ ref('quality_measures__int_nqf2372_denominator') }}\r\n\r\n)\r\n\r\n, mammography_codes as (\r\n\r\n select\r\n code\r\n , code_system\r\n from {{ ref('quality_measures__value_sets') }}\r\n where concept_name = 'Mammography'\r\n\r\n)\r\n\r\n, medical_claim as (\r\n\r\n select\r\n patient_id\r\n , claim_start_date\r\n , claim_end_date\r\n , hcpcs_code\r\n from {{ ref('quality_measures__stg_medical_claim') }}\r\n\r\n)\r\n\r\n, observations as (\r\n\r\n select\r\n patient_id\r\n , observation_date\r\n , coalesce (\r\n normalized_code_type\r\n , case\r\n when lower(source_code_type) = 'cpt' then 'hcpcs'\r\n when lower(source_code_type) = 'snomed' then 'snomed-ct'\r\n else lower(source_code_type)\r\n end\r\n ) as code_type\r\n , coalesce (\r\n normalized_code\r\n , source_code\r\n ) as code\r\n from {{ ref('quality_measures__stg_core__observation') }}\r\n\r\n)\r\n\r\n, procedures as (\r\n\r\n select\r\n patient_id\r\n , procedure_date\r\n , coalesce(\r\n normalized_code_type\r\n , case\r\n when lower(source_code_type) = 'cpt' then 'hcpcs'\r\n when lower(source_code_type) = 'snomed' then 'snomed-ct'\r\n else lower(source_code_type)\r\n end\r\n ) as code_type\r\n , coalesce(\r\n normalized_code\r\n , source_code\r\n ) as code\r\n from {{ ref('quality_measures__stg_core__procedure') }}\r\n\r\n)\r\n\r\n, qualifying_claims as (\r\n\r\n select\r\n medical_claim.patient_id\r\n , medical_claim.claim_start_date\r\n , medical_claim.claim_end_date\r\n from medical_claim\r\n inner join mammography_codes\r\n on medical_claim.hcpcs_code = mammography_codes.code\r\n where mammography_codes.code_system = 'hcpcs'\r\n\r\n)\r\n\r\n, qualifying_observations as (\r\n\r\n select\r\n observations.patient_id\r\n , observations.observation_date\r\n from observations\r\n inner join mammography_codes\r\n on observations.code = mammography_codes.code\r\n and observations.code_type = mammography_codes.code_system\r\n)\r\n\r\n, qualifying_procedures as (\r\n\r\n select\r\n procedures.patient_id\r\n , procedures.procedure_date\r\n from procedures\r\n inner join mammography_codes\r\n on procedures.code = mammography_codes.code\r\n and procedures.code_type = mammography_codes.code_system\r\n\r\n)\r\n\r\n/*\r\n Check if patients in the eligible population have had a screening,\r\n diagnostic, film, digital or digital breast tomosynthesis (3D)\r\n mammography results documented and reviewed.\r\n*/\r\n\r\n, patients_with_mammograms as (\r\n\r\n select\r\n denominator.patient_id\r\n , denominator.performance_period_begin\r\n , denominator.performance_period_end\r\n , denominator.performance_period_lookback\r\n , denominator.measure_id\r\n , denominator.measure_name\r\n , denominator.measure_version\r\n , case\r\n when qualifying_claims.claim_start_date\r\n between denominator.performance_period_lookback\r\n and denominator.performance_period_end\r\n then qualifying_claims.claim_start_date\r\n when qualifying_claims.claim_end_date\r\n between denominator.performance_period_lookback\r\n and denominator.performance_period_end\r\n then qualifying_claims.claim_end_date\r\n when qualifying_observations.observation_date\r\n between denominator.performance_period_lookback\r\n and denominator.performance_period_end\r\n then qualifying_observations.observation_date\r\n when qualifying_procedures.procedure_date\r\n between denominator.performance_period_lookback\r\n and denominator.performance_period_end\r\n then qualifying_procedures.procedure_date\r\n else null\r\n end as evidence_date\r\n , case\r\n when qualifying_claims.claim_start_date\r\n between denominator.performance_period_lookback\r\n and denominator.performance_period_end\r\n then 1\r\n when qualifying_claims.claim_end_date\r\n between denominator.performance_period_lookback\r\n and denominator.performance_period_end\r\n then 1\r\n when qualifying_observations.observation_date\r\n between denominator.performance_period_lookback\r\n and denominator.performance_period_end\r\n then 1\r\n when qualifying_procedures.procedure_date\r\n between denominator.performance_period_lookback\r\n and denominator.performance_period_end\r\n then 1\r\n else 0\r\n end as numerator_flag\r\n from denominator\r\n left join qualifying_claims\r\n on denominator.patient_id = qualifying_claims.patient_id\r\n left join qualifying_observations\r\n on denominator.patient_id = qualifying_observations.patient_id\r\n left join qualifying_procedures\r\n on denominator.patient_id = qualifying_procedures.patient_id\r\n\r\n)\r\n\r\n, add_data_types as (\r\n\r\n select distinct\r\n cast(patient_id as {{ dbt.type_string() }}) as patient_id\r\n , cast(performance_period_begin as date) as performance_period_begin\r\n , cast(performance_period_end as date) as performance_period_end\r\n , cast(measure_id as {{ dbt.type_string() }}) as measure_id\r\n , cast(measure_name as {{ dbt.type_string() }}) as measure_name\r\n , cast(measure_version as {{ dbt.type_string() }}) as measure_version\r\n , cast(evidence_date as date) as evidence_date\r\n , cast(numerator_flag as integer) as numerator_flag\r\n from patients_with_mammograms\r\n\r\n)\r\n\r\nselect\r\n patient_id\r\n , performance_period_begin\r\n , performance_period_end\r\n , measure_id\r\n , measure_name\r\n , measure_version\r\n , evidence_date\r\n , numerator_flag\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom add_data_types", "language": "sql", "refs": [["quality_measures__int_nqf2372_denominator"], ["quality_measures__value_sets"], ["quality_measures__stg_medical_claim"], ["quality_measures__stg_core__observation"], ["quality_measures__stg_core__procedure"]], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.type_string"], "nodes": ["model.the_tuva_project.quality_measures__int_nqf2372_denominator", "seed.the_tuva_project.quality_measures__value_sets", "model.the_tuva_project.quality_measures__stg_medical_claim", "model.the_tuva_project.quality_measures__stg_core__observation", "model.the_tuva_project.quality_measures__stg_core__procedure"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\quality_measures\\intermediate\\nqf2372_breast_cancer_screening\\quality_measures__int_nqf2372_numerator.sql", "compiled": true, "compiled_code": "\n\n/*\n Eligible population from the denominator model before exclusions\n*/\nwith __dbt__cte__quality_measures__stg_medical_claim as (\n\n\nselect\n patient_id\n , claim_id\n , claim_start_date\n , claim_end_date\n , place_of_service_code\n , hcpcs_code\n , '2023-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom devforrest.core.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-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom devforrest.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-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom devforrest.core.procedure\n),denominator as (\n\n select\n patient_id\n , performance_period_begin\n , performance_period_end\n , performance_period_lookback\n , measure_id\n , measure_name\n , measure_version\n from devforrest.quality_measures._int_nqf2372_denominator\n\n)\n\n, mammography_codes as (\n\n select\n code\n , code_system\n from devforrest.quality_measures._value_set_codes\n where concept_name = 'Mammography'\n\n)\n\n, medical_claim as (\n\n select\n patient_id\n , claim_start_date\n , claim_end_date\n , hcpcs_code\n from __dbt__cte__quality_measures__stg_medical_claim\n\n)\n\n, observations as (\n\n select\n patient_id\n , observation_date\n , coalesce (\n normalized_code_type\n , case\n when lower(source_code_type) = 'cpt' then 'hcpcs'\n when lower(source_code_type) = 'snomed' then 'snomed-ct'\n else lower(source_code_type)\n end\n ) as code_type\n , coalesce (\n normalized_code\n , source_code\n ) as code\n from __dbt__cte__quality_measures__stg_core__observation\n\n)\n\n, procedures as (\n\n select\n patient_id\n , procedure_date\n , coalesce(\n normalized_code_type\n , case\n when lower(source_code_type) = 'cpt' then 'hcpcs'\n when lower(source_code_type) = 'snomed' then 'snomed-ct'\n else lower(source_code_type)\n end\n ) as code_type\n , coalesce(\n normalized_code\n , source_code\n ) as code\n from __dbt__cte__quality_measures__stg_core__procedure\n\n)\n\n, qualifying_claims as (\n\n select\n medical_claim.patient_id\n , medical_claim.claim_start_date\n , medical_claim.claim_end_date\n from medical_claim\n inner join mammography_codes\n on medical_claim.hcpcs_code = mammography_codes.code\n where mammography_codes.code_system = 'hcpcs'\n\n)\n\n, qualifying_observations as (\n\n select\n observations.patient_id\n , observations.observation_date\n from observations\n inner join mammography_codes\n on observations.code = mammography_codes.code\n and observations.code_type = mammography_codes.code_system\n)\n\n, qualifying_procedures as (\n\n select\n procedures.patient_id\n , procedures.procedure_date\n from procedures\n inner join mammography_codes\n on procedures.code = mammography_codes.code\n and procedures.code_type = mammography_codes.code_system\n\n)\n\n/*\n Check if patients in the eligible population have had a screening,\n diagnostic, film, digital or digital breast tomosynthesis (3D)\n mammography results documented and reviewed.\n*/\n\n, patients_with_mammograms as (\n\n select\n denominator.patient_id\n , denominator.performance_period_begin\n , denominator.performance_period_end\n , denominator.performance_period_lookback\n , denominator.measure_id\n , denominator.measure_name\n , denominator.measure_version\n , case\n when qualifying_claims.claim_start_date\n between denominator.performance_period_lookback\n and denominator.performance_period_end\n then qualifying_claims.claim_start_date\n when qualifying_claims.claim_end_date\n between denominator.performance_period_lookback\n and denominator.performance_period_end\n then qualifying_claims.claim_end_date\n when qualifying_observations.observation_date\n between denominator.performance_period_lookback\n and denominator.performance_period_end\n then qualifying_observations.observation_date\n when qualifying_procedures.procedure_date\n between denominator.performance_period_lookback\n and denominator.performance_period_end\n then qualifying_procedures.procedure_date\n else null\n end as evidence_date\n , case\n when qualifying_claims.claim_start_date\n between denominator.performance_period_lookback\n and denominator.performance_period_end\n then 1\n when qualifying_claims.claim_end_date\n between denominator.performance_period_lookback\n and denominator.performance_period_end\n then 1\n when qualifying_observations.observation_date\n between denominator.performance_period_lookback\n and denominator.performance_period_end\n then 1\n when qualifying_procedures.procedure_date\n between denominator.performance_period_lookback\n and denominator.performance_period_end\n then 1\n else 0\n end as numerator_flag\n from denominator\n left join qualifying_claims\n on denominator.patient_id = qualifying_claims.patient_id\n left join qualifying_observations\n on denominator.patient_id = qualifying_observations.patient_id\n left join qualifying_procedures\n on denominator.patient_id = qualifying_procedures.patient_id\n\n)\n\n, add_data_types as (\n\n select distinct\n cast(patient_id as TEXT) as patient_id\n , cast(performance_period_begin as date) as performance_period_begin\n , cast(performance_period_end as date) as performance_period_end\n , cast(measure_id as TEXT) as measure_id\n , cast(measure_name as TEXT) as measure_name\n , cast(measure_version as TEXT) as measure_version\n , cast(evidence_date as date) as evidence_date\n , cast(numerator_flag as integer) as numerator_flag\n from patients_with_mammograms\n\n)\n\nselect\n patient_id\n , performance_period_begin\n , performance_period_end\n , measure_id\n , measure_name\n , measure_version\n , evidence_date\n , numerator_flag\n , '2023-12-13 23:31:59.089856+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-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom devforrest.core.medical_claim\n\n\n)"}, {"id": "model.the_tuva_project.quality_measures__stg_core__observation", "sql": " __dbt__cte__quality_measures__stg_core__observation as (\n\n\nselect\n patient_id\n , observation_date\n , source_code_type\n , source_code\n , normalized_code_type\n , normalized_code\n , '2023-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom devforrest.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-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom devforrest.core.procedure\n)"}]}, "model.the_tuva_project.quality_measures__int_nqf2372__frailty": {"database": "devforrest", "schema": "quality_measures", "name": "quality_measures__int_nqf2372__frailty", "resource_type": "model", "package_name": "the_tuva_project", "path": "quality_measures\\intermediate\\nqf2372_breast_cancer_screening\\quality_measures__int_nqf2372__frailty.sql", "original_file_path": "models\\quality_measures\\intermediate\\nqf2372_breast_cancer_screening\\quality_measures__int_nqf2372__frailty.sql", "unique_id": "model.the_tuva_project.quality_measures__int_nqf2372__frailty", "fqn": ["the_tuva_project", "quality_measures", "intermediate", "nqf2372_breast_cancer_screening", "quality_measures__int_nqf2372__frailty"], "alias": "_int_nqf2372__frailty", "checksum": {"name": "sha256", "checksum": "07ca94dfd24398453cb86f235fa273101895136184c7d8dd4bd83b525e93cfa2"}, "config": {"enabled": true, "alias": "_int_nqf2372__frailty", "schema": "quality_measures", "database": null, "tags": ["quality_measures"], "meta": {}, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["quality_measures"], "description": "Exclusion logic for patients with frailty used by other exclusion models.\n", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://models\\quality_measures\\quality_measures_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "quality_measures", "alias": "_int_nqf2372__frailty", "tags": "quality_measures", "materialized": "view", "enabled": true, "bind": false}, "created_at": 1702481697.1167052, "relation_name": "devforrest.quality_measures._int_nqf2372__frailty", "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 This concept is used in multiple exclusions. Patients greater than\r\n or equal to 66 with at least one claim/encounter for frailty during\r\n the measurement period.\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 )\r\n\r\n)\r\n\r\n, conditions as (\r\n\r\n select\r\n patient_id\r\n , recorded_date\r\n , coalesce (\r\n normalized_code_type\r\n , case\r\n when lower(source_code_type) = 'snomed' then 'snomed-ct'\r\n else lower(source_code_type)\r\n end\r\n ) as code_type\r\n , coalesce (\r\n normalized_code\r\n , source_code\r\n ) as code\r\n from {{ ref('quality_measures__stg_core__condition') }}\r\n\r\n)\r\n\r\n, medical_claim as (\r\n\r\n select\r\n patient_id\r\n , claim_start_date\r\n , claim_end_date\r\n , hcpcs_code\r\n , place_of_service_code\r\n from {{ ref('quality_measures__stg_medical_claim') }}\r\n\r\n)\r\n\r\n, observations as (\r\n\r\n select\r\n patient_id\r\n , observation_date\r\n , coalesce (\r\n normalized_code_type\r\n , case\r\n when lower(source_code_type) = 'cpt' then 'hcpcs'\r\n when lower(source_code_type) = 'snomed' then 'snomed-ct'\r\n else lower(source_code_type)\r\n end\r\n ) as code_type\r\n , coalesce (\r\n normalized_code\r\n , source_code\r\n ) as code\r\n from {{ ref('quality_measures__stg_core__observation') }}\r\n\r\n)\r\n\r\n, procedures as (\r\n\r\n select\r\n patient_id\r\n , procedure_date\r\n , coalesce (\r\n normalized_code_type\r\n , case\r\n when lower(source_code_type) = 'cpt' then 'hcpcs'\r\n when lower(source_code_type) = 'snomed' then 'snomed-ct'\r\n else lower(source_code_type)\r\n end\r\n ) as code_type\r\n , coalesce (\r\n normalized_code\r\n , source_code\r\n ) as code\r\n from {{ ref('quality_measures__stg_core__procedure') }}\r\n\r\n)\r\n\r\n, condition_exclusions as (\r\n\r\n select\r\n conditions.patient_id\r\n , conditions.recorded_date\r\n , exclusion_codes.concept_name\r\n from conditions\r\n inner join exclusion_codes\r\n on conditions.code = exclusion_codes.code\r\n and conditions.code_type = exclusion_codes.code_system\r\n\r\n)\r\n\r\n, med_claim_exclusions as (\r\n\r\n select\r\n medical_claim.patient_id\r\n , medical_claim.claim_start_date\r\n , medical_claim.claim_end_date\r\n , medical_claim.hcpcs_code\r\n , exclusion_codes.concept_name\r\n from medical_claim\r\n inner join exclusion_codes\r\n on medical_claim.hcpcs_code = exclusion_codes.code\r\n where exclusion_codes.code_system = 'hcpcs'\r\n\r\n)\r\n\r\n, observation_exclusions as (\r\n\r\n select\r\n observations.patient_id\r\n , observations.observation_date\r\n , exclusion_codes.concept_name\r\n from observations\r\n inner join exclusion_codes\r\n on observations.code = exclusion_codes.code\r\n and observations.code_type = exclusion_codes.code_system\r\n\r\n)\r\n\r\n, procedure_exclusions as (\r\n\r\n select\r\n procedures.patient_id\r\n , procedures.procedure_date\r\n , exclusion_codes.concept_name\r\n from procedures\r\n inner join exclusion_codes\r\n on procedures.code = exclusion_codes.code\r\n and procedures.code_type = exclusion_codes.code_system\r\n\r\n)\r\n\r\n, patients_with_frailty as (\r\n\r\n select\r\n 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 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 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 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 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 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 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 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 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\nselect\r\n patient_id\r\n , performance_period_begin\r\n , performance_period_end\r\n , exclusion_date\r\n , exclusion_reason\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom patients_with_frailty", "language": "sql", "refs": [["quality_measures__int_nqf2372_denominator"], ["quality_measures__value_sets"], ["quality_measures__stg_core__condition"], ["quality_measures__stg_medical_claim"], ["quality_measures__stg_core__observation"], ["quality_measures__stg_core__procedure"]], "sources": [], "metrics": [], "depends_on": {"macros": [], "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\\nqf2372_breast_cancer_screening\\quality_measures__int_nqf2372__frailty.sql", "compiled": true, "compiled_code": "\n/*\n This concept is used in multiple exclusions. Patients greater than\n or equal to 66 with at least one claim/encounter for frailty during\n the measurement period.\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-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom devforrest.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-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom devforrest.core.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-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom devforrest.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-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom devforrest.core.procedure\n),denominator as (\n\n select\n patient_id\n , age\n , performance_period_begin\n , performance_period_end\n from devforrest.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 devforrest.quality_measures._value_set_codes\n where concept_name in (\n 'Frailty Device'\n , 'Frailty Diagnosis'\n , 'Frailty Encounter'\n , 'Frailty Symptom'\n )\n\n)\n\n, conditions as (\n\n select\n patient_id\n , recorded_date\n , coalesce (\n normalized_code_type\n , case\n when lower(source_code_type) = 'snomed' then 'snomed-ct'\n else lower(source_code_type)\n end\n ) as code_type\n , coalesce (\n normalized_code\n , source_code\n ) as code\n from __dbt__cte__quality_measures__stg_core__condition\n\n)\n\n, medical_claim as (\n\n select\n patient_id\n , claim_start_date\n , claim_end_date\n , hcpcs_code\n , place_of_service_code\n from __dbt__cte__quality_measures__stg_medical_claim\n\n)\n\n, observations as (\n\n select\n patient_id\n , observation_date\n , coalesce (\n normalized_code_type\n , case\n when lower(source_code_type) = 'cpt' then 'hcpcs'\n when lower(source_code_type) = 'snomed' then 'snomed-ct'\n else lower(source_code_type)\n end\n ) as code_type\n , coalesce (\n normalized_code\n , source_code\n ) as code\n from __dbt__cte__quality_measures__stg_core__observation\n\n)\n\n, procedures as (\n\n select\n patient_id\n , procedure_date\n , coalesce (\n normalized_code_type\n , case\n when lower(source_code_type) = 'cpt' then 'hcpcs'\n when lower(source_code_type) = 'snomed' then 'snomed-ct'\n else lower(source_code_type)\n end\n ) as code_type\n , coalesce (\n normalized_code\n , source_code\n ) as code\n from __dbt__cte__quality_measures__stg_core__procedure\n\n)\n\n, condition_exclusions as (\n\n select\n conditions.patient_id\n , conditions.recorded_date\n , exclusion_codes.concept_name\n from conditions\n inner join exclusion_codes\n on conditions.code = exclusion_codes.code\n and conditions.code_type = exclusion_codes.code_system\n\n)\n\n, med_claim_exclusions as (\n\n select\n medical_claim.patient_id\n , medical_claim.claim_start_date\n , medical_claim.claim_end_date\n , medical_claim.hcpcs_code\n , exclusion_codes.concept_name\n from medical_claim\n inner join exclusion_codes\n on medical_claim.hcpcs_code = exclusion_codes.code\n where exclusion_codes.code_system = 'hcpcs'\n\n)\n\n, observation_exclusions as (\n\n select\n observations.patient_id\n , observations.observation_date\n , exclusion_codes.concept_name\n from observations\n inner join exclusion_codes\n on observations.code = exclusion_codes.code\n and observations.code_type = exclusion_codes.code_system\n\n)\n\n, procedure_exclusions as (\n\n select\n procedures.patient_id\n , procedures.procedure_date\n , exclusion_codes.concept_name\n from procedures\n inner join exclusion_codes\n on procedures.code = exclusion_codes.code\n and procedures.code_type = exclusion_codes.code_system\n\n)\n\n, patients_with_frailty as (\n\n select\n 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 as exclusion_reason\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 as exclusion_reason\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 as exclusion_reason\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 as exclusion_reason\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\nselect\n patient_id\n , performance_period_begin\n , performance_period_end\n , exclusion_date\n , exclusion_reason\n , '2023-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom patients_with_frailty", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.the_tuva_project.quality_measures__stg_core__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-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom devforrest.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-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom devforrest.core.medical_claim\n\n\n)"}, {"id": "model.the_tuva_project.quality_measures__stg_core__observation", "sql": " __dbt__cte__quality_measures__stg_core__observation as (\n\n\nselect\n patient_id\n , observation_date\n , source_code_type\n , source_code\n , normalized_code_type\n , normalized_code\n , '2023-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom devforrest.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-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom devforrest.core.procedure\n)"}]}, "model.the_tuva_project.quality_measures__int_nqf2372__performance_period": {"database": "devforrest", "schema": "quality_measures", "name": "quality_measures__int_nqf2372__performance_period", "resource_type": "model", "package_name": "the_tuva_project", "path": "quality_measures\\intermediate\\nqf2372_breast_cancer_screening\\quality_measures__int_nqf2372__performance_period.sql", "original_file_path": "models\\quality_measures\\intermediate\\nqf2372_breast_cancer_screening\\quality_measures__int_nqf2372__performance_period.sql", "unique_id": "model.the_tuva_project.quality_measures__int_nqf2372__performance_period", "fqn": ["the_tuva_project", "quality_measures", "intermediate", "nqf2372_breast_cancer_screening", "quality_measures__int_nqf2372__performance_period"], "alias": "_int_nqf2372__performance_period", "checksum": {"name": "sha256", "checksum": "8652875c4630943526e5e0366dba3cddad946b6ee78edecb61a1cd7902ac39e1"}, "config": {"enabled": true, "alias": "_int_nqf2372__performance_period", "schema": "quality_measures", "database": null, "tags": ["quality_measures"], "meta": {}, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["quality_measures"], "description": "Performance Period definition for Breast Cancer screening.\n", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://models\\quality_measures\\quality_measures_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "quality_measures", "alias": "_int_nqf2372__performance_period", "tags": "quality_measures", "materialized": "view", "enabled": true, "bind": false}, "created_at": 1702481697.1145728, "relation_name": "devforrest.quality_measures._int_nqf2372__performance_period", "raw_code": "{{ config(\r\n enabled = var('quality_measures_enabled',var('claims_enabled',var('clinical_enabled',var('tuva_marts_enabled',False))))\r\n )\r\n}}\r\n{%- set measure_id -%}\r\n(select id\r\nfrom {{ ref('quality_measures__measures') }}\r\nwhere id = 'NQF2372')\r\n{%- endset -%}\r\n\r\n{%- set measure_name -%}\r\n(select name\r\nfrom {{ ref('quality_measures__measures') }}\r\nwhere id = 'NQF2372')\r\n{%- endset -%}\r\n\r\n{%- set measure_version -%}\r\n(select version\r\nfrom {{ ref('quality_measures__measures') }}\r\nwhere id = 'NQF2372')\r\n{%- endset -%}\r\n\r\n/*\r\n set performance period end to the end of the current calendar year\r\n or use the quality_measures_period_end variable if provided\r\n*/\r\nwith period_end as (\r\n\r\n select\r\n {% if var('quality_measures_period_end',False) == False -%}\r\n {{ last_day(dbt.current_timestamp(), 'year') }}\r\n {% else -%}\r\n cast('{{ var('quality_measures_period_end') }}' as date)\r\n {%- endif %}\r\n as performance_period_end\r\n)\r\n\r\n/*\r\n set performance period begin to a year and a day prior\r\n for a complete calendar year\r\n*/\r\n, period_begin as (\r\n\r\n select\r\n performance_period_end\r\n , {{ dbt.dateadd (\r\n datepart = \"day\"\r\n , interval = +1\r\n , from_date_or_timestamp =\r\n dbt.dateadd (\r\n datepart = \"year\"\r\n , interval = -1\r\n , from_date_or_timestamp = \"performance_period_end\"\r\n )\r\n ) }} as performance_period_begin\r\n from period_end\r\n\r\n)\r\n\r\n/*\r\n set performance lookback period to 27 months prior to the end of the\r\n performance period\r\n*/\r\n, period_lookback as (\r\n\r\n select\r\n performance_period_end\r\n , performance_period_begin\r\n , {{ dbt.dateadd (\r\n datepart = \"month\"\r\n , interval = -27\r\n , from_date_or_timestamp = \"performance_period_end\"\r\n ) }} as performance_period_lookback\r\n from period_begin\r\n\r\n\r\n)\r\n\r\nselect\r\n cast({{ measure_id }} as {{ dbt.type_string() }}) as measure_id\r\n , cast({{ measure_name }} as {{ dbt.type_string() }}) as measure_name\r\n , cast({{ measure_version }} as {{ dbt.type_string() }}) as measure_version\r\n , cast(performance_period_end as date) as performance_period_end\r\n , cast(performance_period_begin as date) as performance_period_begin\r\n , cast(performance_period_lookback as date) as performance_period_lookback\r\nfrom period_lookback", "language": "sql", "refs": [["quality_measures__measures"], ["quality_measures__measures"], ["quality_measures__measures"]], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.current_timestamp", "macro.dbt.last_day", "macro.dbt.dateadd", "macro.dbt.type_string"], "nodes": ["seed.the_tuva_project.quality_measures__measures", "seed.the_tuva_project.quality_measures__measures", "seed.the_tuva_project.quality_measures__measures"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\quality_measures\\intermediate\\nqf2372_breast_cancer_screening\\quality_measures__int_nqf2372__performance_period.sql", "compiled": true, "compiled_code": "/*\n set performance period end to the end of the current calendar year\n or use the quality_measures_period_end variable if provided\n*/\nwith period_end as (\n\n select\n cast(\n \n\n dateadd(\n day,\n -1,\n \n\n dateadd(\n year,\n 1,\n date_trunc('year', convert_timezone('UTC', current_timestamp()))\n )\n\n\n )\n\n\n as date)\n \n as performance_period_end\n)\n\n/*\n set performance period begin to a year and a day prior\n for a complete calendar year\n*/\n, period_begin as (\n\n select\n performance_period_end\n , \n\n dateadd(\n day,\n 1,\n \n\n dateadd(\n year,\n -1,\n performance_period_end\n )\n\n\n )\n\n as performance_period_begin\n from period_end\n\n)\n\n/*\n set performance lookback period to 27 months prior to the end of the\n performance period\n*/\n, period_lookback as (\n\n select\n performance_period_end\n , performance_period_begin\n , \n\n dateadd(\n month,\n -27,\n performance_period_end\n )\n\n as performance_period_lookback\n from period_begin\n\n\n)\n\nselect\n cast((select id\nfrom devforrest.quality_measures._value_set_measures\nwhere id = 'NQF2372') as TEXT) as measure_id\n , cast((select name\nfrom devforrest.quality_measures._value_set_measures\nwhere id = 'NQF2372') as TEXT) as measure_name\n , cast((select version\nfrom devforrest.quality_measures._value_set_measures\nwhere id = 'NQF2372') as TEXT) as measure_version\n , cast(performance_period_end as date) as performance_period_end\n , cast(performance_period_begin as date) as performance_period_begin\n , cast(performance_period_lookback as date) as performance_period_lookback\nfrom period_lookback", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.quality_measures__stg_core__condition": {"database": "devforrest", "schema": "quality_measures", "name": "quality_measures__stg_core__condition", "resource_type": "model", "package_name": "the_tuva_project", "path": "quality_measures\\staging\\quality_measures__stg_core__condition.sql", "original_file_path": "models\\quality_measures\\staging\\quality_measures__stg_core__condition.sql", "unique_id": "model.the_tuva_project.quality_measures__stg_core__condition", "fqn": ["the_tuva_project", "quality_measures", "staging", "quality_measures__stg_core__condition"], "alias": "_stg_condition", "checksum": {"name": "sha256", "checksum": "56563c7ec7ef01998a0ba50a2886f4e41e6f5027d977ec189a09fdfb4c1d3577"}, "config": {"enabled": true, "alias": "_stg_condition", "schema": "quality_measures", "database": null, "tags": ["quality_measures"], "meta": {}, "materialized": "ephemeral", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["quality_measures"], "description": "Staging conditions from core.", "columns": {"patient_id": {"name": "patient_id", "description": "", "meta": {}, "data_type": null, "quote": null, "tags": []}, "recorded_date": {"name": "recorded_date", "description": "", "meta": {}, "data_type": null, "quote": null, "tags": []}, "source_code_type": {"name": "source_code_type", "description": "", "meta": {}, "data_type": null, "quote": null, "tags": []}, "source_code": {"name": "source_code", "description": "", "meta": {}, "data_type": null, "quote": null, "tags": []}, "normalized_code_type": {"name": "normalized_code_type", "description": "", "meta": {}, "data_type": null, "quote": null, "tags": []}, "normalized_code": {"name": "normalized_code", "description": "", "meta": {}, "data_type": null, "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://models\\quality_measures\\quality_measures_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "quality_measures", "alias": "_stg_condition", "tags": "quality_measures", "materialized": "ephemeral", "enabled": true, "bind": false}, "created_at": 1702481697.199313, "relation_name": null, "raw_code": "{{ config(\r\n enabled = var('quality_measures_enabled',var('claims_enabled',var('clinical_enabled',var('tuva_marts_enabled',False))))\r\n )\r\n}}\r\nselect\r\n patient_id\r\n , claim_id\r\n , recorded_date\r\n , source_code_type\r\n , source_code\r\n , normalized_code_type\r\n , normalized_code\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('core__condition') }}", "language": "sql", "refs": [["core__condition"]], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.core__condition"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\quality_measures\\staging\\quality_measures__stg_core__condition.sql", "compiled": true, "compiled_code": "\nselect\n patient_id\n , claim_id\n , recorded_date\n , source_code_type\n , source_code\n , normalized_code_type\n , normalized_code\n , '2023-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom devforrest.core.condition", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.quality_measures__stg_core__encounter": {"database": "devforrest", "schema": "quality_measures", "name": "quality_measures__stg_core__encounter", "resource_type": "model", "package_name": "the_tuva_project", "path": "quality_measures\\staging\\quality_measures__stg_core__encounter.sql", "original_file_path": "models\\quality_measures\\staging\\quality_measures__stg_core__encounter.sql", "unique_id": "model.the_tuva_project.quality_measures__stg_core__encounter", "fqn": ["the_tuva_project", "quality_measures", "staging", "quality_measures__stg_core__encounter"], "alias": "_stg_encounter", "checksum": {"name": "sha256", "checksum": "17e7cbfc52695e3bd73821d4e66d41660a4a92a253c468531dd55adf1e0108b0"}, "config": {"enabled": true, "alias": "_stg_encounter", "schema": "quality_measures", "database": null, "tags": ["quality_measures"], "meta": {}, "materialized": "ephemeral", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["quality_measures"], "description": "Staging encounters from core. Creates an empty table if using claims only.\n", "columns": {"patient_id": {"name": "patient_id", "description": "", "meta": {}, "data_type": null, "quote": null, "tags": []}, "encounter_type": {"name": "encounter_type", "description": "", "meta": {}, "data_type": null, "quote": null, "tags": []}, "encounter_start_date": {"name": "encounter_start_date", "description": "", "meta": {}, "data_type": null, "quote": null, "tags": []}, "encounter_end_date": {"name": "encounter_end_date", "description": "", "meta": {}, "data_type": null, "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://models\\quality_measures\\quality_measures_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "quality_measures", "alias": "_stg_encounter", "tags": "quality_measures", "materialized": "ephemeral", "enabled": true, "bind": false}, "created_at": 1702481697.2033098, "relation_name": null, "raw_code": "{{ config(\r\n enabled = var('quality_measures_enabled',var('claims_enabled',var('clinical_enabled',var('tuva_marts_enabled',False))))\r\n )\r\n}}\r\n\r\n{% if var('clinical_enabled', var('tuva_marts_enabled',False)) == true and var('claims_enabled', var('tuva_marts_enabled',False)) == true -%}\r\n\r\nselect\r\n patient_id\r\n , encounter_type\r\n , encounter_start_date\r\n , encounter_end_date\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('core__encounter') }}\r\n\r\n{% elif var('clinical_enabled', var('tuva_marts_enabled',False)) == true -%}\r\n\r\nselect\r\n patient_id\r\n , encounter_type\r\n , encounter_start_date\r\n , encounter_end_date\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('core__encounter') }}\r\n\r\n{% elif var('claims_enabled', var('tuva_marts_enabled',False)) == true -%}\r\n\r\nselect\r\n cast(null as {{ dbt.type_string() }} ) as patient_id\r\n , cast(null as {{ dbt.type_string() }} ) as encounter_type\r\n , {{ try_to_cast_date('null', 'YYYY-MM-DD') }} as encounter_start_date\r\n , {{ try_to_cast_date('null', 'YYYY-MM-DD') }} as encounter_end_date\r\n , cast(null as {{ dbt.type_timestamp() }} ) as tuva_last_run\r\nlimit 0\r\n\r\n{%- endif %}", "language": "sql", "refs": [["core__encounter"]], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.core__encounter"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\quality_measures\\staging\\quality_measures__stg_core__encounter.sql", "compiled": true, "compiled_code": "\n\nselect\n patient_id\n , encounter_type\n , encounter_start_date\n , encounter_end_date\n , '2023-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom devforrest.core.encounter\n\n", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.quality_measures__stg_core__lab_result": {"database": "devforrest", "schema": "quality_measures", "name": "quality_measures__stg_core__lab_result", "resource_type": "model", "package_name": "the_tuva_project", "path": "quality_measures\\staging\\quality_measures__stg_core__lab_result.sql", "original_file_path": "models\\quality_measures\\staging\\quality_measures__stg_core__lab_result.sql", "unique_id": "model.the_tuva_project.quality_measures__stg_core__lab_result", "fqn": ["the_tuva_project", "quality_measures", "staging", "quality_measures__stg_core__lab_result"], "alias": "_stg_lab_result", "checksum": {"name": "sha256", "checksum": "0445ea2a85d06a513f3c2cf55d5cf13e93dc9820e2c6b30cfff17773f090adcc"}, "config": {"enabled": true, "alias": "_stg_lab_result", "schema": "quality_measures", "database": null, "tags": ["quality_measures"], "meta": {}, "materialized": "ephemeral", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["quality_measures"], "description": "Staging lab results from the input layer. Creates an empty table if using claims only.\n", "columns": {"patient_id": {"name": "patient_id", "description": "", "meta": {}, "data_type": null, "quote": null, "tags": []}, "result_date": {"name": "result_date", "description": "", "meta": {}, "data_type": null, "quote": null, "tags": []}, "collection_date": {"name": "collection_date", "description": "", "meta": {}, "data_type": null, "quote": null, "tags": []}, "source_code_type": {"name": "source_code_type", "description": "", "meta": {}, "data_type": null, "quote": null, "tags": []}, "source_code": {"name": "source_code", "description": "", "meta": {}, "data_type": null, "quote": null, "tags": []}, "normalized_code_type": {"name": "normalized_code_type", "description": "", "meta": {}, "data_type": null, "quote": null, "tags": []}, "normalized_code": {"name": "normalized_code", "description": "", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://models\\quality_measures\\quality_measures_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "quality_measures", "alias": "_stg_lab_result", "tags": "quality_measures", "materialized": "ephemeral", "enabled": true, "bind": false}, "created_at": 1702481697.2369404, "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 , result_date\r\n , collection_date\r\n , source_code_type\r\n , source_code\r\n , normalized_code_type\r\n , normalized_code\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('core__lab_result') }}\r\n\r\n{% elif var('clinical_enabled', var('tuva_marts_enabled',False)) == true -%}\r\n\r\nselect\r\n patient_id\r\n , result_date\r\n , collection_date\r\n , source_code_type\r\n , source_code\r\n , normalized_code_type\r\n , normalized_code\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('core__lab_result') }}\r\n\r\n{% elif var('claims_enabled', var('tuva_marts_enabled',False)) == true -%}\r\n\r\nselect\r\n cast(null as {{ dbt.type_string() }} ) as patient_id\r\n , {{ try_to_cast_date('null', 'YYYY-MM-DD') }} as result_date\r\n , {{ try_to_cast_date('null', 'YYYY-MM-DD') }} as collection_date\r\n , cast(null as {{ dbt.type_string() }} ) as source_code_type\r\n , cast(null as {{ dbt.type_string() }} ) as source_code\r\n , cast(null as {{ dbt.type_string() }} ) as normalized_code_type\r\n , cast(null as {{ dbt.type_string() }} ) as normalized_code\r\n , cast(null as {{ dbt.type_timestamp() }} ) as tuva_last_run\r\nlimit 0\r\n\r\n{%- endif %}", "language": "sql", "refs": [["core__lab_result"]], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.core__lab_result"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\quality_measures\\staging\\quality_measures__stg_core__lab_result.sql", "compiled": true, "compiled_code": "\n\nselect\n patient_id\n , result_date\n , collection_date\n , source_code_type\n , source_code\n , normalized_code_type\n , normalized_code\n , '2023-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom devforrest.core.lab_result\n\n", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.quality_measures__stg_core__medication": {"database": "devforrest", "schema": "quality_measures", "name": "quality_measures__stg_core__medication", "resource_type": "model", "package_name": "the_tuva_project", "path": "quality_measures\\staging\\quality_measures__stg_core__medication.sql", "original_file_path": "models\\quality_measures\\staging\\quality_measures__stg_core__medication.sql", "unique_id": "model.the_tuva_project.quality_measures__stg_core__medication", "fqn": ["the_tuva_project", "quality_measures", "staging", "quality_measures__stg_core__medication"], "alias": "_stg_medication", "checksum": {"name": "sha256", "checksum": "a4d8facab65414c5cedb3757f57d7536c76cdef9618c72767e91911af7446a28"}, "config": {"enabled": true, "alias": "_stg_medication", "schema": "quality_measures", "database": null, "tags": ["quality_measures"], "meta": {}, "materialized": "ephemeral", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["quality_measures"], "description": "Staging medications from core. Creates an empty table if using claims only.\n", "columns": {"patient_id": {"name": "patient_id", "description": "", "meta": {}, "data_type": null, "quote": null, "tags": []}, "dispensing_date": {"name": "dispensing_date", "description": "", "meta": {}, "data_type": null, "quote": null, "tags": []}, "ndc_code": {"name": "ndc_code", "description": "", "meta": {}, "data_type": null, "quote": null, "tags": []}, "rxnorm_code": {"name": "rxnorm_code", "description": "", "meta": {}, "data_type": null, "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://models\\quality_measures\\quality_measures_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "quality_measures", "alias": "_stg_medication", "tags": "quality_measures", "materialized": "ephemeral", "enabled": true, "bind": false}, "created_at": 1702481697.2083192, "relation_name": null, "raw_code": "{{ config(\r\n enabled = var('quality_measures_enabled',var('claims_enabled',var('clinical_enabled',var('tuva_marts_enabled',False))))\r\n )\r\n}}\r\n\r\n{% if var('clinical_enabled', var('tuva_marts_enabled',False)) == true and var('claims_enabled', var('tuva_marts_enabled',False)) == true -%}\r\n\r\nselect\r\n patient_id\r\n , dispensing_date\r\n , source_code_type\r\n , source_code\r\n , ndc_code\r\n , rxnorm_code\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('core__medication') }}\r\n\r\n{% elif var('clinical_enabled', var('tuva_marts_enabled',False)) == true -%}\r\n\r\nselect\r\n patient_id\r\n , dispensing_date\r\n , source_code_type\r\n , source_code\r\n , ndc_code\r\n , rxnorm_code\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('core__medication') }}\r\n\r\n{% elif var('claims_enabled', var('tuva_marts_enabled',False)) == true -%}\r\n\r\nselect\r\n cast(null as {{ dbt.type_string() }} ) as patient_id\r\n , {{ try_to_cast_date('null', 'YYYY-MM-DD') }} as dispensing_date\r\n , cast(null as {{ dbt.type_string() }} ) as source_code_type\r\n , cast(null as {{ dbt.type_string() }} ) as source_code\r\n , cast(null as {{ dbt.type_string() }} ) as ndc_code\r\n , cast(null as {{ dbt.type_string() }} ) as rxnorm_code\r\n , cast(null as {{ dbt.type_timestamp() }} ) as tuva_last_run\r\nlimit 0\r\n\r\n{%- endif %}", "language": "sql", "refs": [["core__medication"]], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.core__medication"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\quality_measures\\staging\\quality_measures__stg_core__medication.sql", "compiled": true, "compiled_code": "\n\nselect\n patient_id\n , dispensing_date\n , source_code_type\n , source_code\n , ndc_code\n , rxnorm_code\n , '2023-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom devforrest.core.medication\n\n", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.quality_measures__stg_core__observation": {"database": "devforrest", "schema": "quality_measures", "name": "quality_measures__stg_core__observation", "resource_type": "model", "package_name": "the_tuva_project", "path": "quality_measures\\staging\\quality_measures__stg_core__observation.sql", "original_file_path": "models\\quality_measures\\staging\\quality_measures__stg_core__observation.sql", "unique_id": "model.the_tuva_project.quality_measures__stg_core__observation", "fqn": ["the_tuva_project", "quality_measures", "staging", "quality_measures__stg_core__observation"], "alias": "_stg_observation", "checksum": {"name": "sha256", "checksum": "4b7ac2bebd61ab24034b2c12dc9ea7aa21e3da982ca97f2f32cb5a177e393ccb"}, "config": {"enabled": true, "alias": "_stg_observation", "schema": "quality_measures", "database": null, "tags": ["quality_measures"], "meta": {}, "materialized": "ephemeral", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["quality_measures"], "description": "Staging medications from core. Creates an empty table if using claims only.\n", "columns": {"patient_id": {"name": "patient_id", "description": "", "meta": {}, "data_type": null, "quote": null, "tags": []}, "observation_date": {"name": "observation_date", "description": "", "meta": {}, "data_type": null, "quote": null, "tags": []}, "source_code_type": {"name": "source_code_type", "description": "", "meta": {}, "data_type": null, "quote": null, "tags": []}, "source_code": {"name": "source_code", "description": "", "meta": {}, "data_type": null, "quote": null, "tags": []}, "normalized_code_type": {"name": "normalized_code_type", "description": "", "meta": {}, "data_type": null, "quote": null, "tags": []}, "normalized_code": {"name": "normalized_code", "description": "", "meta": {}, "data_type": null, "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://models\\quality_measures\\quality_measures_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "quality_measures", "alias": "_stg_observation", "tags": "quality_measures", "materialized": "ephemeral", "enabled": true, "bind": false}, "created_at": 1702481697.2130513, "relation_name": null, "raw_code": "{{ config(\r\n enabled = var('quality_measures_enabled',var('claims_enabled',var('clinical_enabled',var('tuva_marts_enabled',False))))\r\n )\r\n}}\r\n\r\n{% if var('clinical_enabled', var('tuva_marts_enabled',False)) == true and var('claims_enabled', var('tuva_marts_enabled',False)) == true -%}\r\n\r\nselect\r\n patient_id\r\n , observation_date\r\n , source_code_type\r\n , source_code\r\n , normalized_code_type\r\n , normalized_code\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('core__observation') }}\r\n\r\n{% elif var('clinical_enabled', var('tuva_marts_enabled',False)) == true -%}\r\n\r\nselect\r\n patient_id\r\n , observation_date\r\n , source_code_type\r\n , source_code\r\n , normalized_code_type\r\n , normalized_code\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('core__observation') }}\r\n\r\n{% elif var('claims_enabled', var('tuva_marts_enabled',False)) == true -%}\r\n\r\nselect\r\n cast(null as {{ dbt.type_string() }} ) as patient_id\r\n , {{ try_to_cast_date('null', 'YYYY-MM-DD') }} as observation_date\r\n , cast(null as {{ dbt.type_string() }} ) as source_code_type\r\n , cast(null as {{ dbt.type_string() }} ) as source_code\r\n , cast(null as {{ dbt.type_string() }} ) as normalized_code_type\r\n , cast(null as {{ dbt.type_string() }} ) as normalized_code\r\n , cast(null as {{ dbt.type_timestamp() }} ) as tuva_last_run\r\nlimit 0\r\n\r\n{%- endif %}", "language": "sql", "refs": [["core__observation"]], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.core__observation"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\quality_measures\\staging\\quality_measures__stg_core__observation.sql", "compiled": true, "compiled_code": "\n\nselect\n patient_id\n , observation_date\n , source_code_type\n , source_code\n , normalized_code_type\n , normalized_code\n , '2023-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom devforrest.core.observation\n\n", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.quality_measures__stg_core__patient": {"database": "devforrest", "schema": "quality_measures", "name": "quality_measures__stg_core__patient", "resource_type": "model", "package_name": "the_tuva_project", "path": "quality_measures\\staging\\quality_measures__stg_core__patient.sql", "original_file_path": "models\\quality_measures\\staging\\quality_measures__stg_core__patient.sql", "unique_id": "model.the_tuva_project.quality_measures__stg_core__patient", "fqn": ["the_tuva_project", "quality_measures", "staging", "quality_measures__stg_core__patient"], "alias": "_stg_patient", "checksum": {"name": "sha256", "checksum": "d5cf9006ec36a943ce06e8aaee881b3a0680f553d457ea3dcbab9697347fab8e"}, "config": {"enabled": true, "alias": "_stg_patient", "schema": "quality_measures", "database": null, "tags": ["quality_measures"], "meta": {}, "materialized": "ephemeral", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["quality_measures"], "description": "Staging eligibility from the input layer.", "columns": {"patient_id": {"name": "patient_id", "description": "", "meta": {}, "data_type": null, "quote": null, "tags": []}, "sex": {"name": "sex", "description": "", "meta": {}, "data_type": null, "quote": null, "tags": []}, "birth_date": {"name": "birth_date", "description": "", "meta": {}, "data_type": null, "quote": null, "tags": []}, "death_date": {"name": "death_date", "description": "", "meta": {}, "data_type": null, "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://models\\quality_measures\\quality_measures_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "quality_measures", "alias": "_stg_patient", "tags": "quality_measures", "materialized": "ephemeral", "enabled": true, "bind": false}, "created_at": 1702481697.2180493, "relation_name": null, "raw_code": "{{ config(\r\n enabled = var('quality_measures_enabled',var('claims_enabled',var('clinical_enabled',var('tuva_marts_enabled',False))))\r\n )\r\n}}\r\nselect\r\n patient_id\r\n , sex\r\n , birth_date\r\n , death_date\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('core__patient') }}", "language": "sql", "refs": [["core__patient"]], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.core__patient"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\quality_measures\\staging\\quality_measures__stg_core__patient.sql", "compiled": true, "compiled_code": "\nselect\n patient_id\n , sex\n , birth_date\n , death_date\n , '2023-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom devforrest.core.patient", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.quality_measures__stg_core__procedure": {"database": "devforrest", "schema": "quality_measures", "name": "quality_measures__stg_core__procedure", "resource_type": "model", "package_name": "the_tuva_project", "path": "quality_measures\\staging\\quality_measures__stg_core__procedure.sql", "original_file_path": "models\\quality_measures\\staging\\quality_measures__stg_core__procedure.sql", "unique_id": "model.the_tuva_project.quality_measures__stg_core__procedure", "fqn": ["the_tuva_project", "quality_measures", "staging", "quality_measures__stg_core__procedure"], "alias": "_stg_procedure", "checksum": {"name": "sha256", "checksum": "e3b00d13527fad61b98f018c4b996e7b03d6c34286dae32fe30aeca261c3e1f5"}, "config": {"enabled": true, "alias": "_stg_procedure", "schema": "quality_measures", "database": null, "tags": ["quality_measures"], "meta": {}, "materialized": "ephemeral", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["quality_measures"], "description": "Staging procedures from core.", "columns": {"patient_id": {"name": "patient_id", "description": "", "meta": {}, "data_type": null, "quote": null, "tags": []}, "procedure_date": {"name": "procedure_date", "description": "", "meta": {}, "data_type": null, "quote": null, "tags": []}, "source_code_type": {"name": "source_code_type", "description": "", "meta": {}, "data_type": null, "quote": null, "tags": []}, "source_code": {"name": "source_code", "description": "", "meta": {}, "data_type": null, "quote": null, "tags": []}, "normalized_code_type": {"name": "normalized_code_type", "description": "", "meta": {}, "data_type": null, "quote": null, "tags": []}, "normalized_code": {"name": "normalized_code", "description": "", "meta": {}, "data_type": null, "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://models\\quality_measures\\quality_measures_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "quality_measures", "alias": "_stg_procedure", "tags": "quality_measures", "materialized": "ephemeral", "enabled": true, "bind": false}, "created_at": 1702481697.2230506, "relation_name": null, "raw_code": "{{ config(\r\n enabled = var('quality_measures_enabled',var('claims_enabled',var('clinical_enabled',var('tuva_marts_enabled',False))))\r\n )\r\n}}\r\nselect\r\n patient_id\r\n , procedure_date\r\n , source_code_type\r\n , source_code\r\n , normalized_code_type\r\n , normalized_code\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('core__procedure') }}", "language": "sql", "refs": [["core__procedure"]], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.core__procedure"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\quality_measures\\staging\\quality_measures__stg_core__procedure.sql", "compiled": true, "compiled_code": "\nselect\n patient_id\n , procedure_date\n , source_code_type\n , source_code\n , normalized_code_type\n , normalized_code\n , '2023-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom devforrest.core.procedure", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.quality_measures__stg_medical_claim": {"database": "devforrest", "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": "c172a8e78043526172f0922cdbecef2dd403fbd8b58547e18cddf73e9a70d373"}, "config": {"enabled": true, "alias": "_stg_medical_claim", "schema": "quality_measures", "database": null, "tags": ["quality_measures"], "meta": {}, "materialized": "ephemeral", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["quality_measures"], "description": "Staging medical claims from the input layer. Creates an empty table if using clinical only.\n", "columns": {"patient_id": {"name": "patient_id", "description": "", "meta": {}, "data_type": null, "quote": null, "tags": []}, "claim_start_date": {"name": "claim_start_date", "description": "", "meta": {}, "data_type": null, "quote": null, "tags": []}, "claim_end_date": {"name": "claim_end_date", "description": "", "meta": {}, "data_type": null, "quote": null, "tags": []}, "place_of_service": {"name": "place_of_service", "description": "", "meta": {}, "data_type": null, "quote": null, "tags": []}, "hcpcs_code": {"name": "hcpcs_code", "description": "", "meta": {}, "data_type": null, "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://models\\quality_measures\\quality_measures_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "quality_measures", "alias": "_stg_medical_claim", "tags": "quality_measures", "materialized": "ephemeral", "enabled": true, "bind": false}, "created_at": 1702481697.2280612, "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('core__medical_claim') }}\r\n\r\n{% elif var('claims_enabled', var('tuva_marts_enabled',False)) == true -%}\r\n\r\nselect\r\n patient_id\r\n , claim_id\r\n , claim_start_date\r\n , claim_end_date\r\n , place_of_service_code\r\n , hcpcs_code\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('core__medical_claim') }}\r\n\r\n{% elif var('clinical_enabled', var('tuva_marts_enabled',False)) == true -%}\r\n\r\nselect\r\n cast(null as {{ dbt.type_string() }} ) as patient_id\r\n , cast(null as {{ dbt.type_string() }} ) as claim_id\r\n , {{ try_to_cast_date('null', 'YYYY-MM-DD') }} as claim_start_date\r\n , {{ try_to_cast_date('null', 'YYYY-MM-DD') }} as claim_end_date\r\n , cast(null as {{ dbt.type_string() }} ) as place_of_service_code\r\n , cast(null as {{ dbt.type_string() }} ) as hcpcs_code\r\n , cast(null as {{ dbt.type_timestamp() }} ) as tuva_last_run\r\nlimit 0\r\n\r\n{%- endif %}", "language": "sql", "refs": [["core__medical_claim"]], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.core__medical_claim"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\quality_measures\\staging\\quality_measures__stg_medical_claim.sql", "compiled": true, "compiled_code": "\n\nselect\n patient_id\n , claim_id\n , claim_start_date\n , claim_end_date\n , place_of_service_code\n , hcpcs_code\n , '2023-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom devforrest.core.medical_claim\n\n", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.quality_measures__stg_pharmacy_claim": {"database": "devforrest", "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": "dead3003be56341428449eff40c7a437d232d065a3c2f7c87ba26c0dda8421db"}, "config": {"enabled": true, "alias": "_stg_pharmacy_claim", "schema": "quality_measures", "database": null, "tags": ["quality_measures"], "meta": {}, "materialized": "ephemeral", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["quality_measures"], "description": "Staging pharmacy claims from the input layer. Creates an empty table if using clinical only.\n", "columns": {"patient_id": {"name": "patient_id", "description": "", "meta": {}, "data_type": null, "quote": null, "tags": []}, "dispensing_date": {"name": "dispensing_date", "description": "", "meta": {}, "data_type": null, "quote": null, "tags": []}, "ndc_code": {"name": "ndc_code", "description": "", "meta": {}, "data_type": null, "quote": null, "tags": []}, "paid_date": {"name": "paid_date", "description": "", "meta": {}, "data_type": null, "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://models\\quality_measures\\quality_measures_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "quality_measures", "alias": "_stg_pharmacy_claim", "tags": "quality_measures", "materialized": "ephemeral", "enabled": true, "bind": false}, "created_at": 1702481697.2318432, "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('core__pharmacy_claim') }}\r\n\r\n{% elif var('claims_enabled', var('tuva_marts_enabled',False)) == true -%}\r\n\r\nselect\r\n patient_id\r\n , dispensing_date\r\n , ndc_code\r\n , paid_date\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('core__pharmacy_claim') }}\r\n\r\n{% elif var('clinical_enabled', var('tuva_marts_enabled',False)) == true -%}\r\n\r\nselect\r\n cast(null as {{ dbt.type_string() }} ) as patient_id\r\n , {{ try_to_cast_date('null', 'YYYY-MM-DD') }} as dispensing_date\r\n , cast(null as {{ dbt.type_string() }} ) as ndc_code\r\n , {{ try_to_cast_date('null', 'YYYY-MM-DD') }} as paid_date\r\n , cast(null as {{ dbt.type_timestamp() }} ) as tuva_last_run\r\nlimit 0\r\n\r\n{%- endif %}", "language": "sql", "refs": [["core__pharmacy_claim"]], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.core__pharmacy_claim"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\quality_measures\\staging\\quality_measures__stg_pharmacy_claim.sql", "compiled": true, "compiled_code": "\n\nselect\n patient_id\n , dispensing_date\n , ndc_code\n , paid_date\n , '2023-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom devforrest.core.pharmacy_claim\n\n", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.readmissions__encounter": {"database": "devforrest", "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": "0f2d1e3e1d9582b5556355a24a1af384858a8a327d96f1a78e4e09fd66899d74"}, "config": {"enabled": true, "alias": "_int_encounter", "schema": "readmissions", "database": null, "tags": ["readmissions"], "meta": {}, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#161a7d"}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["readmissions"], "description": "This is a staging table for the input layer. Each row represents a unique acute inpatient encounter.", "columns": {"encounter_id": {"name": "encounter_id", "description": "The unique identifier for the encounter", "meta": {}, "data_type": null, "quote": null, "tags": []}, "patient_id": {"name": "patient_id", "description": "The unique identifier for the patient", "meta": {}, "data_type": null, "quote": null, "tags": []}, "admit_date": {"name": "admit_date", "description": "The date of admission for the inpatient visit", "meta": {}, "data_type": null, "quote": null, "tags": []}, "discharge_date": {"name": "discharge_date", "description": "The date of discharge for the inpatient visit", "meta": {}, "data_type": null, "quote": null, "tags": []}, "discharge_status_code": {"name": "discharge_status_code", "description": "The valid 2-digit discharge status for the inpatient visit", "meta": {}, "data_type": null, "quote": null, "tags": []}, "facility": {"name": "facility", "description": "A name or ID for the facility where the inpatient visit occured", "meta": {}, "data_type": null, "quote": null, "tags": []}, "ms_drg": {"name": "ms_drg", "description": "The MS-DRG associted with the inpatient visit", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": "#161a7d"}, "patch_path": "the_tuva_project://models\\readmissions\\readmissions_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "readmissions", "alias": "_int_encounter", "tags": "readmissions", "materialized": "view", "enabled": true, "bind": false, "docs": {"node_color": "#161a7d"}}, "created_at": 1702481697.3283658, "relation_name": "devforrest.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(paid_amount as numeric) as paid_amount,\r\n cast(primary_diagnosis_code as {{ dbt.type_string() }}) as primary_diagnosis_code,\r\n '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('readmissions__stg_core__encounter') }}", "language": "sql", "refs": [["readmissions__stg_core__encounter"]], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.type_string"], "nodes": ["model.the_tuva_project.readmissions__stg_core__encounter"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\readmissions\\intermediate\\readmissions__encounter.sql", "compiled": true, "compiled_code": "\n\nwith __dbt__cte__readmissions__stg_core__encounter as (\n\n\nselect\n encounter_id,\n patient_id,\n encounter_start_date,\n encounter_end_date,\n discharge_disposition_code,\n facility_npi,\n ms_drg_code,\n paid_amount,\n primary_diagnosis_code,\n '2023-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom devforrest.core.encounter\nwhere encounter_type = 'acute inpatient'\n)-- Staging model for the input layer:\n-- stg_encounter input layer model.\n-- This contains one row for every unique encounter in the dataset.\n\nselect\n cast(encounter_id as TEXT) as encounter_id,\n cast(patient_id as TEXT) as patient_id,\n cast(encounter_start_date as date) as admit_date,\n cast(encounter_end_date as date) as discharge_date,\n cast(discharge_disposition_code as TEXT) as discharge_disposition_code,\n cast(facility_npi as TEXT) as facility_npi,\n cast(ms_drg_code as TEXT) as ms_drg_code,\n cast(paid_amount as numeric) as paid_amount,\n cast(primary_diagnosis_code as TEXT) as primary_diagnosis_code,\n '2023-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom __dbt__cte__readmissions__stg_core__encounter", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.the_tuva_project.readmissions__stg_core__encounter", "sql": " __dbt__cte__readmissions__stg_core__encounter as (\n\n\nselect\n encounter_id,\n patient_id,\n encounter_start_date,\n encounter_end_date,\n discharge_disposition_code,\n facility_npi,\n ms_drg_code,\n paid_amount,\n primary_diagnosis_code,\n '2023-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom devforrest.core.encounter\nwhere encounter_type = 'acute inpatient'\n)"}]}, "model.the_tuva_project.readmissions__encounter_data_quality": {"database": "devforrest", "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": "bf55e62dea6a106dcd65e6a7b5fb19061da3680221ac795b407c6f40f1e7a683"}, "config": {"enabled": true, "alias": "_int_encounter_data_quality", "schema": "readmissions", "database": null, "tags": ["readmissions"], "meta": {}, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#161a7d"}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["readmissions"], "description": "This model has the same number of rows as the stg_encounter model. Here we have one row for every unique encounter in the stg_encounter model, and for each encounter we have a flag (disqualified_encounter_flag) to indicte if the encounter is disqualified from being useful for readmission measures. We also have other flags to indicate which specific data quality issues this encounter has that may disqualify it from being used in readmission measures.", "columns": {"encounter_id": {"name": "encounter_id", "description": "The unique identifier for the encounter", "meta": {}, "data_type": null, "quote": null, "tags": []}, "diagnosis_ccs": {"name": "diagnosis_ccs", "description": "The CCS diagnosis category associated with the primary diagnosis of this encounter", "meta": {}, "data_type": null, "quote": null, "tags": []}, "disqualified_encounter_flag": {"name": "disqualified_encounter_flag", "description": "A flag that indicates whether this encounter is disqualified from being used in readmission measures for any critical data quality problem.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "missing_admit_date_flag": {"name": "missing_admit_date_flag", "description": "A flag that indicates whether the admit date is missing from this encounter.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "missing_discharge_date_flag": {"name": "missing_discharge_date_flag", "description": "A flag that indicates whether the discharge date is missing from this encounter.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "admit_after_discharge_flag": {"name": "admit_after_discharge_flag", "description": "A flag that indicates whether the admit date for the encounter is after the discharge date for the encounter.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "missing_discharge_status_code_flag": {"name": "missing_discharge_status_code_flag", "description": "A flag that indicates whether the discharge status code is missing for the encounter.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "invalid_discharge_status_code_flag": {"name": "invalid_discharge_status_code_flag", "description": "A flag that indicates whether the discharge status code that is present for this encounter is invalid. This flag is 1 only when the discharge status code is present but invalid.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "missing_primary_diagnosis_flag": {"name": "missing_primary_diagnosis_flag", "description": "A flag that indicates whether there is no primary diagnosis associated with the encounter.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "multiple_primary_diagnosis": {"name": "multiple_primary_diagnosis", "description": "A flag that indicates whether there are multiple primary diagnoses associated with the encounter.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "invalid_primary_diagnosis_code": {"name": "invalid_primary_diagnosis_code", "description": "A flag that indicates whether the primary diagnosis present for this encounter is invalid, i.e. a non existing ICD-10-CM code. This flag indicates that a primary diagnosis code is indeed present for the encounter, but it is not a valid ICD-10-CM code.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "no_diagnosis_ccs_flag": {"name": "no_diagnosis_ccs_flag", "description": "A flag that indicates whether there is no CCS diagnosis category associated with the primary ICD-10-CM diagnosis code for the encounter. This flag indicates that there is a valid primary ICD-10-CM diagnosis code associated with the encounter, but there is no CCS diagnosis category associated with that ICD-10-CM code.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "overlaps_with_another_encounter_flag": {"name": "overlaps_with_another_encounter_flag", "description": "A flag that indicates whether this encounter's dates overlap with those of another encounter in the dataset", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": "#161a7d"}, "patch_path": "the_tuva_project://models\\readmissions\\readmissions_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "readmissions", "alias": "_int_encounter_data_quality", "tags": "readmissions", "materialized": "view", "enabled": true, "bind": false, "docs": {"node_color": "#161a7d"}}, "created_at": 1702481697.2789505, "relation_name": "devforrest.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 (bb.discharge_disposition_code is null) then 1\r\n\telse 0\r\n end as invalid_discharge_disposition_code_flag,\r\n case\r\n when aa.primary_diagnosis_code is null then 1\r\n else 0\r\n end as missing_primary_diagnosis_flag,\r\n case\r\n when aa.valid_primary_diagnosis_code_flag = 0 then 1\r\n\telse 0\r\n end as invalid_primary_diagnosis_code_flag,\r\n case\r\n when aa.ccs_diagnosis_category is null then 1\r\n\telse 0\r\n end as no_diagnosis_ccs_flag,\r\n aa.ccs_diagnosis_category as diagnosis_ccs,\r\n case\r\n when aa.encounter_id in (select distinct encounter_id_A\r\n\t from {{ ref('readmissions__encounter_overlap') }} )\r\n\t or\r\n\t aa.encounter_id in (select distinct encounter_id_B\r\n\t from {{ ref('readmissions__encounter_overlap') }} )\r\n\tthen 1\r\n\telse 0\r\n end as overlaps_with_another_encounter_flag,\r\n case\r\n when aa.ms_drg_code is null then 1\r\n\telse 0\r\n end as missing_ms_drg_flag,\r\n case\r\n when cc.ms_drg_code is null then 1\r\n\telse 0\r\n end as invalid_ms_drg_flag\r\n\r\nfrom {{ ref('readmissions__encounter_with_ccs') }} aa\r\n left join {{ ref('terminology__discharge_disposition') }} bb\r\n on aa.discharge_disposition_code = bb.discharge_disposition_code\r\n left join {{ ref('terminology__ms_drg') }} cc\r\n on aa.ms_drg_code = cc.ms_drg_code\r\n),\r\n\r\n\r\n-- Here we add a disqualified_encounter_flag.\r\n-- This disqualified_encounter_flag = 1\r\n-- when any of the critical data quality flags\r\n-- from the above CTE are equal to 1.\r\nall_data_quality_flags as (\r\nselect\r\n encounter_id,\r\n diagnosis_ccs,\r\n case\r\n when\r\n\t (missing_admit_date_flag = 1)\r\n\t or\r\n\t (missing_discharge_date_flag = 1)\r\n\t or\r\n\t (admit_after_discharge_flag = 1)\r\n\t or\r\n\t (missing_discharge_disposition_code_flag = 1)\r\n\t or\r\n\t (invalid_discharge_disposition_code_flag = 1)\r\n\t or\r\n\t (missing_primary_diagnosis_flag = 1)\r\n\t or\r\n\t (invalid_primary_diagnosis_code_flag = 1)\r\n\t or\r\n\t (no_diagnosis_ccs_flag = 1)\r\n\t or\r\n\t (overlaps_with_another_encounter_flag = 1)\r\n\t or\r\n\t (missing_ms_drg_flag = 1)\r\n\t or\r\n\t (invalid_ms_drg_flag = 1)\r\n\t then 1\r\n\telse 0\r\n end as disqualified_encounter_flag,\r\n missing_admit_date_flag,\r\n missing_discharge_date_flag,\r\n admit_after_discharge_flag,\r\n missing_discharge_disposition_code_flag,\r\n invalid_discharge_disposition_code_flag,\r\n missing_primary_diagnosis_flag,\r\n invalid_primary_diagnosis_code_flag,\r\n no_diagnosis_ccs_flag,\r\n overlaps_with_another_encounter_flag,\r\n missing_ms_drg_flag,\r\n invalid_ms_drg_flag\r\nfrom encounter_data_quality_issues\r\n) \r\n\r\n\r\n\r\nselect *, '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom all_data_quality_flags", "language": "sql", "refs": [["readmissions__encounter_overlap"], ["readmissions__encounter_overlap"], ["readmissions__encounter_with_ccs"], ["terminology__discharge_disposition"], ["terminology__ms_drg"]], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.readmissions__encounter_overlap", "model.the_tuva_project.readmissions__encounter_overlap", "model.the_tuva_project.readmissions__encounter_with_ccs", "seed.the_tuva_project.terminology__discharge_disposition", "seed.the_tuva_project.terminology__ms_drg"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\readmissions\\intermediate\\readmissions__encounter_data_quality.sql", "compiled": true, "compiled_code": "\n\n-- Here we list all encounters from the stg_encounter table\n-- with data quality flags that may disqualify them from\n-- being used for readmission measures \n\n\n-- Flag several potential data quality issues\n-- with all encounters.\n-- Every encounter_id from the stg_encounter model\n-- will be here. This CTE should have the same\n-- number of rows as the stg_encounter model, i.e.,\n-- there is a one to one correspondence between the\n-- rows in stg_encounter and this CTE.\nwith encounter_data_quality_issues as (\nselect\n aa.encounter_id,\n case\n when aa.admit_date is null then 1\n\telse 0\n end as missing_admit_date_flag,\n case\n when aa.discharge_date is null then 1\n\telse 0\n end as missing_discharge_date_flag,\n case\n when aa.admit_date > aa.discharge_date then 1\n\telse 0\n end as admit_after_discharge_flag,\n case\n when aa.discharge_disposition_code is null then 1\n\telse 0\n end as missing_discharge_disposition_code_flag,\n case\n when\n\t (aa.discharge_disposition_code is not null)\n\t and\n\t (bb.discharge_disposition_code is null) then 1\n\telse 0\n end as invalid_discharge_disposition_code_flag,\n case\n when aa.primary_diagnosis_code is null then 1\n else 0\n end as missing_primary_diagnosis_flag,\n case\n when aa.valid_primary_diagnosis_code_flag = 0 then 1\n\telse 0\n end as invalid_primary_diagnosis_code_flag,\n case\n when aa.ccs_diagnosis_category is null then 1\n\telse 0\n end as no_diagnosis_ccs_flag,\n aa.ccs_diagnosis_category as diagnosis_ccs,\n case\n when aa.encounter_id in (select distinct encounter_id_A\n\t from devforrest.readmissions._int_encounter_overlap )\n\t or\n\t aa.encounter_id in (select distinct encounter_id_B\n\t from devforrest.readmissions._int_encounter_overlap )\n\tthen 1\n\telse 0\n end as overlaps_with_another_encounter_flag,\n case\n when aa.ms_drg_code is null then 1\n\telse 0\n end as missing_ms_drg_flag,\n case\n when cc.ms_drg_code is null then 1\n\telse 0\n end as invalid_ms_drg_flag\n\nfrom devforrest.readmissions._int_encounter_with_ccs aa\n left join devforrest.terminology.discharge_disposition bb\n on aa.discharge_disposition_code = bb.discharge_disposition_code\n left join devforrest.terminology.ms_drg cc\n on aa.ms_drg_code = cc.ms_drg_code\n),\n\n\n-- Here we add a disqualified_encounter_flag.\n-- This disqualified_encounter_flag = 1\n-- when any of the critical data quality flags\n-- from the above CTE are equal to 1.\nall_data_quality_flags as (\nselect\n encounter_id,\n diagnosis_ccs,\n case\n when\n\t (missing_admit_date_flag = 1)\n\t or\n\t (missing_discharge_date_flag = 1)\n\t or\n\t (admit_after_discharge_flag = 1)\n\t or\n\t (missing_discharge_disposition_code_flag = 1)\n\t or\n\t (invalid_discharge_disposition_code_flag = 1)\n\t or\n\t (missing_primary_diagnosis_flag = 1)\n\t or\n\t (invalid_primary_diagnosis_code_flag = 1)\n\t or\n\t (no_diagnosis_ccs_flag = 1)\n\t or\n\t (overlaps_with_another_encounter_flag = 1)\n\t or\n\t (missing_ms_drg_flag = 1)\n\t or\n\t (invalid_ms_drg_flag = 1)\n\t then 1\n\telse 0\n end as disqualified_encounter_flag,\n missing_admit_date_flag,\n missing_discharge_date_flag,\n admit_after_discharge_flag,\n missing_discharge_disposition_code_flag,\n invalid_discharge_disposition_code_flag,\n missing_primary_diagnosis_flag,\n invalid_primary_diagnosis_code_flag,\n no_diagnosis_ccs_flag,\n overlaps_with_another_encounter_flag,\n missing_ms_drg_flag,\n invalid_ms_drg_flag\nfrom encounter_data_quality_issues\n) \n\n\n\nselect *, '2023-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom all_data_quality_flags", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.readmissions__encounter_overlap": {"database": "devforrest", "schema": "readmissions", "name": "readmissions__encounter_overlap", "resource_type": "model", "package_name": "the_tuva_project", "path": "readmissions\\intermediate\\readmissions__encounter_overlap.sql", "original_file_path": "models\\readmissions\\intermediate\\readmissions__encounter_overlap.sql", "unique_id": "model.the_tuva_project.readmissions__encounter_overlap", "fqn": ["the_tuva_project", "readmissions", "intermediate", "readmissions__encounter_overlap"], "alias": "_int_encounter_overlap", "checksum": {"name": "sha256", "checksum": "b84bceb51ad086d73b05fb665e30acab90f60dc47f5061ebaf0fcae37d304ae8"}, "config": {"enabled": true, "alias": "_int_encounter_overlap", "schema": "readmissions", "database": null, "tags": ["readmissions"], "meta": {}, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#161a7d"}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["readmissions"], "description": "This model lists all pairs of encounters that have some date overlap.", "columns": {"patient_id": {"name": "patient_id", "description": "The unique identifier for the patient", "meta": {}, "data_type": null, "quote": null, "tags": []}, "encounter_id_A": {"name": "encounter_id_A", "description": "Unique identifier for one of the overlapping encounters", "meta": {}, "data_type": null, "quote": null, "tags": []}, "encounter_id_B": {"name": "encounter_id_B", "description": "Unique identifier for the other overlapping encounter", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": "#161a7d"}, "patch_path": "the_tuva_project://models\\readmissions\\readmissions_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "readmissions", "alias": "_int_encounter_overlap", "tags": "readmissions", "materialized": "view", "enabled": true, "bind": false, "docs": {"node_color": "#161a7d"}}, "created_at": 1702481697.2945776, "relation_name": "devforrest.readmissions._int_encounter_overlap", "raw_code": "{{ config(\r\n enabled = var('readmissions_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r\n )\r\n}}\r\n\r\n-- Here we give a list of all pairs of encounters\r\n-- that have some date overlap.\r\n\r\n\r\nwith encounters_with_row_num as (\r\nselect\r\n encounter_id,\r\n patient_id,\r\n admit_date,\r\n discharge_date,\r\n row_number() over (\r\n partition by patient_id order by encounter_id\r\n\t) as row_num\r\nfrom {{ ref('readmissions__encounter') }}\r\n),\r\n\r\n\r\ncartesian as (\r\nselect\r\n aa.encounter_id as encounter_id_A,\r\n bb.encounter_id as encounter_id_B,\r\n aa.patient_id,\r\n aa.admit_date as Ai,\r\n aa.discharge_date as Af,\r\n bb.admit_date as Bi,\r\n bb.discharge_date as Bf,\r\n case\r\n when (aa.admit_date between bb.admit_date and bb.discharge_date) or (aa.discharge_date between bb.admit_date and bb.discharge_date) or\r\n (bb.admit_date between aa.admit_date and aa.discharge_date) or (bb.discharge_date between aa.admit_date and aa.discharge_date)\r\n then 1\r\n else 0\r\n end as overlap\r\n from encounters_with_row_num aa\r\n left join encounters_with_row_num bb\r\n on aa.patient_id = bb.patient_id and aa.row_num < bb.row_num\r\n),\r\n\r\n\r\noverlapping_pairs\r\nas\r\n(\r\n select\r\n patient_id,\r\n encounter_id_A,\r\n\tencounter_id_B\r\n from cartesian\r\n where overlap = 1\r\n)\r\n\r\n\r\n\r\nselect *, '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom overlapping_pairs", "language": "sql", "refs": [["readmissions__encounter"]], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.readmissions__encounter"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\readmissions\\intermediate\\readmissions__encounter_overlap.sql", "compiled": true, "compiled_code": "\n\n-- Here we give a list of all pairs of encounters\n-- that have some date overlap.\n\n\nwith encounters_with_row_num as (\nselect\n encounter_id,\n patient_id,\n admit_date,\n discharge_date,\n row_number() over (\n partition by patient_id order by encounter_id\n\t) as row_num\nfrom devforrest.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-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom overlapping_pairs", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.readmissions__encounter_specialty_cohort": {"database": "devforrest", "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": "682042994eb5fb149f1541460734e6d1c490766b03435ab50b1ccdd53d368887"}, "config": {"enabled": true, "alias": "_int_encounter_specialty_cohort", "schema": "readmissions", "database": null, "tags": ["readmissions"], "meta": {}, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#161a7d"}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["readmissions"], "description": "This model lists the specialty cohort associated with each inpatient encounter. All encounters in the stg_encounter model are present here, and each gets a specialty cohort assigned from the following list of 5 options: Surgery/Gynecology, Medicine, Cardiorespiratory, Cardiovascular, Neurology. Encounters that don't have a specialty cohort get 'Medicine' assigned by default.", "columns": {"encounter_id": {"name": "encounter_id", "description": "The unique identifier for the encounter", "meta": {}, "data_type": null, "quote": null, "tags": []}, "specialty_cohort": {"name": "specialty_cohort", "description": "The specialty cohort associated with the encounter", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": "#161a7d"}, "patch_path": "the_tuva_project://models\\readmissions\\readmissions_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "readmissions", "alias": "_int_encounter_specialty_cohort", "tags": "readmissions", "materialized": "view", "enabled": true, "bind": false, "docs": {"node_color": "#161a7d"}}, "created_at": 1702481697.2945776, "relation_name": "devforrest.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__encounter_with_ccs') }} diag\r\n inner join {{ ref('readmissions__specialty_cohort') }} sc\r\n on diag.ccs_diagnosis_category = sc.ccs and sc.procedure_or_diagnosis = 'Diagnosis'\r\n inner join cohort_ranks\r\n on sc.specialty_cohort = cohort_ranks.cohort\r\n)\r\n\r\n\r\n-- getting one cohort per encounter\r\n, main_encounter_cohort as (\r\n select encounter_id, min(c_rank) as main_c_rank\r\n from all_encounter_cohorts\r\n group by encounter_id\r\n\r\n)\r\n\r\n\r\n--getting all encounters, with labeled cohorts, if no cohort cohort is \"medicine\"\r\nselect enc.encounter_id, coalesce(cohort_ranks.cohort, 'Medicine') as specialty_cohort, '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('readmissions__encounter') }} enc\r\nleft join main_encounter_cohort mec\r\n on enc.encounter_id = mec.encounter_id\r\nleft join cohort_ranks\r\n on mec.main_c_rank = cohort_ranks.c_rank", "language": "sql", "refs": [["readmissions__procedure_ccs"], ["readmissions__surgery_gynecology_cohort"], ["readmissions__specialty_cohort"], ["readmissions__encounter_with_ccs"], ["readmissions__specialty_cohort"], ["readmissions__encounter"]], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.readmissions__procedure_ccs", "seed.the_tuva_project.readmissions__surgery_gynecology_cohort", "seed.the_tuva_project.readmissions__specialty_cohort", "model.the_tuva_project.readmissions__encounter_with_ccs", "seed.the_tuva_project.readmissions__specialty_cohort", "model.the_tuva_project.readmissions__encounter"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\readmissions\\intermediate\\readmissions__encounter_specialty_cohort.sql", "compiled": true, "compiled_code": "\n\n-- Here we list the specialty cohort for each encounter that has\n-- an associated specialty cohort.\n-- There are 5 possible specialty cohorts:\n-- [1] Medicine\n-- [2] Surgery/Gynecology\n-- [3] Cardiology\n-- [4] Cardiovascular\n-- [5] Neurology\n-- An encounter that has an ICD-10-PCS procedure code or a\n-- CCS procedure category that corresponds to the\n-- 'Surgery/Gynecology' cohort will always be in that cohort.\n-- For encounters that are not in the 'Surgery/Gynecology' cohort,\n-- we then check to see if they are in one of the other 4 cohorts.\n\n--ranking to eventually assign a cohort to encounters in multiple cohorts\nwith cohort_ranks as (\n select 'Surgery/Gynecology' as cohort, 1 as c_rank\n union all\n select 'Cardiorespiratory' as cohort, 2 as c_rank\n union all\n select 'Cardiovascular' as cohort, 3 as c_rank\n union all\n select 'Neurology' as cohort, 4 as c_rank\n union all\n select 'Medicine' as cohort, 5 as c_rank\n)\n\n\n--get all encounter ids in any procedure or diagnosis based cohorts\n, all_encounter_cohorts as (\n\n --encounter ids in procedure based cohorts\n select proc.encounter_id, 1 as c_rank\n from devforrest.readmissions._int_procedure_ccs proc\n left join devforrest.readmissions._value_set_surgery_gynecology_cohort sgc\n on proc.procedure_code = sgc.icd_10_pcs\n left join devforrest.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 devforrest.readmissions._int_encounter_with_ccs diag\n inner join devforrest.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-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom devforrest.readmissions._int_encounter enc\nleft join main_encounter_cohort mec\n on enc.encounter_id = mec.encounter_id\nleft join cohort_ranks\n on mec.main_c_rank = cohort_ranks.c_rank", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.readmissions__encounter_with_ccs": {"database": "devforrest", "schema": "readmissions", "name": "readmissions__encounter_with_ccs", "resource_type": "model", "package_name": "the_tuva_project", "path": "readmissions\\intermediate\\readmissions__encounter_with_ccs.sql", "original_file_path": "models\\readmissions\\intermediate\\readmissions__encounter_with_ccs.sql", "unique_id": "model.the_tuva_project.readmissions__encounter_with_ccs", "fqn": ["the_tuva_project", "readmissions", "intermediate", "readmissions__encounter_with_ccs"], "alias": "_int_encounter_with_ccs", "checksum": {"name": "sha256", "checksum": "816c6b5e899f4756589ae070878b56c18ee203f07fcd75929ada57b2a580f9d1"}, "config": {"enabled": true, "alias": "_int_encounter_with_ccs", "schema": "readmissions", "database": null, "tags": ["readmissions"], "meta": {}, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#161a7d"}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["readmissions"], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#161a7d"}, "patch_path": "the_tuva_project://models\\readmissions\\readmissions_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "readmissions", "alias": "_int_encounter_with_ccs", "tags": "readmissions", "materialized": "view", "enabled": true, "bind": false, "docs": {"node_color": "#161a7d"}}, "created_at": 1702481697.2945776, "relation_name": "devforrest.readmissions._int_encounter_with_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 add a CCS diagnosis category to\r\n-- every encounter that we can add a CCS diagnosis category to.\r\n-- The CCS diagnosis category is found using\r\n-- the encounter's primary diagnosis code.\r\n\r\n\r\nselect\r\n aa.encounter_id,\r\n aa.patient_id,\r\n aa.admit_date,\r\n aa.discharge_date,\r\n aa.discharge_disposition_code,\r\n aa.facility_npi,\r\n aa.ms_drg_code,\r\n aa.paid_amount,\r\n aa.primary_diagnosis_code,\r\n\r\n case\r\n when bb.icd_10_cm is not null then 1\r\n else 0\r\n end as valid_primary_diagnosis_code_flag,\r\n\r\n cc.ccs_diagnosis_category,\r\n\r\n '{{ var('tuva_last_run')}}' as tuva_last_run\r\n\r\nfrom\r\n {{ ref('readmissions__encounter') }} aa\r\n left join {{ ref('terminology__icd_10_cm') }} bb\r\n on aa.primary_diagnosis_code = bb.icd_10_cm\r\n left join {{ ref('readmissions__icd_10_cm_to_ccs') }} cc\r\n on aa.primary_diagnosis_code = cc.icd_10_cm", "language": "sql", "refs": [["readmissions__encounter"], ["terminology__icd_10_cm"], ["readmissions__icd_10_cm_to_ccs"]], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.readmissions__encounter", "seed.the_tuva_project.terminology__icd_10_cm", "seed.the_tuva_project.readmissions__icd_10_cm_to_ccs"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\readmissions\\intermediate\\readmissions__encounter_with_ccs.sql", "compiled": true, "compiled_code": "\n\n-- Here we add a CCS diagnosis category to\n-- every encounter that we can add a CCS diagnosis category to.\n-- The CCS diagnosis category is found using\n-- the encounter's primary diagnosis code.\n\n\nselect\n aa.encounter_id,\n aa.patient_id,\n aa.admit_date,\n aa.discharge_date,\n aa.discharge_disposition_code,\n aa.facility_npi,\n aa.ms_drg_code,\n aa.paid_amount,\n aa.primary_diagnosis_code,\n\n case\n when bb.icd_10_cm is not null then 1\n else 0\n end as valid_primary_diagnosis_code_flag,\n\n cc.ccs_diagnosis_category,\n\n '2023-12-13 23:31:59.089856+00:00' as tuva_last_run\n\nfrom\n devforrest.readmissions._int_encounter aa\n left join devforrest.terminology.icd_10_cm bb\n on aa.primary_diagnosis_code = bb.icd_10_cm\n left join devforrest.readmissions._value_set_icd_10_cm_to_ccs cc\n on aa.primary_diagnosis_code = cc.icd_10_cm", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.readmissions__exclusion": {"database": "devforrest", "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": "bb4fbef9aef2600301b44324565cc5deff65117786573329700dd051add3c170"}, "config": {"enabled": true, "alias": "_int_exclusion", "schema": "readmissions", "database": null, "tags": ["readmissions"], "meta": {}, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#161a7d"}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["readmissions"], "description": "This model lists all encounters that are excluded from being index admissions because they belong to one of the exclusion categories.", "columns": {"encounter_id": {"name": "encounter_id", "description": "The unique identifier for the encounter", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": "#161a7d"}, "patch_path": "the_tuva_project://models\\readmissions\\readmissions_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "readmissions", "alias": "_int_exclusion", "tags": "readmissions", "materialized": "view", "enabled": true, "bind": false, "docs": {"node_color": "#161a7d"}}, "created_at": 1702481697.2945776, "relation_name": "devforrest.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__encounter_with_ccs') }}\r\nwhere\r\n(ccs_diagnosis_category is not null)\r\nand\r\n(\r\nccs_diagnosis_category in\r\n (select distinct ccs_diagnosis_category\r\n from {{ ref('readmissions__exclusion_ccs_diagnosis_category') }} )\r\n)\r\n)\r\n\r\n\r\nselect *, '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom exclusions", "language": "sql", "refs": [["readmissions__encounter_with_ccs"], ["readmissions__exclusion_ccs_diagnosis_category"]], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.readmissions__encounter_with_ccs", "seed.the_tuva_project.readmissions__exclusion_ccs_diagnosis_category"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\readmissions\\intermediate\\readmissions__exclusion.sql", "compiled": true, "compiled_code": "\n\n-- Here we list encounter_ids that are excluded\n-- from being index admissions because they\n-- belong to one of these categories:\n-- [1] Medical Treatment of Cancer\n-- [2] Rehabilitation\n-- [3] Psychiatric\n\n\n-- encounter_ids for encounters that should be\n-- excluded because they belong to one of the\n-- exclusion categories\nwith exclusions as (\nselect distinct encounter_id\nfrom devforrest.readmissions._int_encounter_with_ccs\nwhere\n(ccs_diagnosis_category is not null)\nand\n(\nccs_diagnosis_category in\n (select distinct ccs_diagnosis_category\n from devforrest.readmissions._value_set_exclusion_ccs_diagnosis_category )\n)\n)\n\n\nselect *, '2023-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom exclusions", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.readmissions__index_admission": {"database": "devforrest", "schema": "readmissions", "name": "readmissions__index_admission", "resource_type": "model", "package_name": "the_tuva_project", "path": "readmissions\\intermediate\\readmissions__index_admission.sql", "original_file_path": "models\\readmissions\\intermediate\\readmissions__index_admission.sql", "unique_id": "model.the_tuva_project.readmissions__index_admission", "fqn": ["the_tuva_project", "readmissions", "intermediate", "readmissions__index_admission"], "alias": "_int_index_admission", "checksum": {"name": "sha256", "checksum": "2d34ec9441371c8651597177e538b27be84fcfd5cf5742a65e64811197a4adda"}, "config": {"enabled": true, "alias": "_int_index_admission", "schema": "readmissions", "database": null, "tags": ["readmissions"], "meta": {}, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#161a7d"}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["readmissions"], "description": "This model lists all index admissions for the hospital wide readmissions measure. These represent encounter_ids that meet the requirements to be an index admission for the HWR measure.", "columns": {"encounter_id": {"name": "encounter_id", "description": "The unique identifier for the encounter", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": "#161a7d"}, "patch_path": "the_tuva_project://models\\readmissions\\readmissions_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "readmissions", "alias": "_int_index_admission", "tags": "readmissions", "materialized": "view", "enabled": true, "bind": false, "docs": {"node_color": "#161a7d"}}, "created_at": 1702481697.2945776, "relation_name": "devforrest.readmissions._int_index_admission", "raw_code": "{{ config(\r\n enabled = var('readmissions_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r\n )\r\n}}\r\n\r\n-- Here we list all index admissions for the hospital wide readmissions\r\n-- measure.\r\n-- These represent encounter_ids that meet the requirements to be an\r\n-- index admission for the HWR measure.\r\n-- These are the requirements for a hospitalization to be an index admission\r\n-- for the HWR measure:\r\n--\r\n-- Time Requirement: The discharge data must be at least 30 days\r\n-- earlier than the last dischareg date available\r\n-- in the dataset.\r\n-- \r\n-- Discharge Requirements: The patient must not be discharged to another\r\n-- acute care hospital; the patient must not have\r\n-- left against medical advice; and the patient\r\n-- must be alive at discharge.\r\n--\r\n-- Diagnosis Requirements: Exclude encounters where based on the CCS\r\n-- (exclusions) diagnosis category we know the encounter was\r\n-- for medical treatment of cancer, rehabilitation,\r\n-- or psychiatric reasons.\r\n\r\n\r\n\r\nselect distinct a.encounter_id, '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('readmissions__encounter') }} a\r\ninner join {{ ref('readmissions__index_time_requirement') }} b\r\n on a.encounter_id = b.encounter_id\r\ninner join {{ ref('readmissions__index_discharge_requirement') }} c\r\n on a.encounter_id = c.encounter_id\r\nleft join {{ ref('readmissions__exclusion') }} d\r\n on a.encounter_id = d.encounter_id\r\nwhere d.encounter_id is null", "language": "sql", "refs": [["readmissions__encounter"], ["readmissions__index_time_requirement"], ["readmissions__index_discharge_requirement"], ["readmissions__exclusion"]], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.readmissions__encounter", "model.the_tuva_project.readmissions__index_time_requirement", "model.the_tuva_project.readmissions__index_discharge_requirement", "model.the_tuva_project.readmissions__exclusion"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\readmissions\\intermediate\\readmissions__index_admission.sql", "compiled": true, "compiled_code": "\n\n-- Here we list all index admissions for the hospital wide readmissions\n-- measure.\n-- These represent encounter_ids that meet the requirements to be an\n-- index admission for the HWR measure.\n-- These are the requirements for a hospitalization to be an index admission\n-- for the HWR measure:\n--\n-- Time Requirement: The discharge data must be at least 30 days\n-- earlier than the last dischareg date available\n-- in the dataset.\n-- \n-- Discharge Requirements: The patient must not be discharged to another\n-- acute care hospital; the patient must not have\n-- left against medical advice; and the patient\n-- must be alive at discharge.\n--\n-- Diagnosis Requirements: Exclude encounters where based on the CCS\n-- (exclusions) diagnosis category we know the encounter was\n-- for medical treatment of cancer, rehabilitation,\n-- or psychiatric reasons.\n\n\n\nselect distinct a.encounter_id, '2023-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom devforrest.readmissions._int_encounter a\ninner join devforrest.readmissions._int_index_time_requirement b\n on a.encounter_id = b.encounter_id\ninner join devforrest.readmissions._int_index_discharge_requirement c\n on a.encounter_id = c.encounter_id\nleft join devforrest.readmissions._int_exclusion d\n on a.encounter_id = d.encounter_id\nwhere d.encounter_id is null", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.readmissions__index_discharge_requirement": {"database": "devforrest", "schema": "readmissions", "name": "readmissions__index_discharge_requirement", "resource_type": "model", "package_name": "the_tuva_project", "path": "readmissions\\intermediate\\readmissions__index_discharge_requirement.sql", "original_file_path": "models\\readmissions\\intermediate\\readmissions__index_discharge_requirement.sql", "unique_id": "model.the_tuva_project.readmissions__index_discharge_requirement", "fqn": ["the_tuva_project", "readmissions", "intermediate", "readmissions__index_discharge_requirement"], "alias": "_int_index_discharge_requirement", "checksum": {"name": "sha256", "checksum": "800e7d266ced014025155d3c9d584849fc5132e54382aa7572e7b1fb863f6f23"}, "config": {"enabled": true, "alias": "_int_index_discharge_requirement", "schema": "readmissions", "database": null, "tags": ["readmissions"], "meta": {}, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#161a7d"}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["readmissions"], "description": "This model lists all encounters that meet the discharge disposition requirement to be an index admission.", "columns": {"encounter_id": {"name": "encounter_id", "description": "The unique identifier for the encounter", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": "#161a7d"}, "patch_path": "the_tuva_project://models\\readmissions\\readmissions_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "readmissions", "alias": "_int_index_discharge_requirement", "tags": "readmissions", "materialized": "view", "enabled": true, "bind": false, "docs": {"node_color": "#161a7d"}}, "created_at": 1702481697.3101997, "relation_name": "devforrest.readmissions._int_index_discharge_requirement", "raw_code": "{{ config(\r\n enabled = var('readmissions_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r\n )\r\n}}\r\n\r\n-- Here we list encounter_ids that meet\r\n-- the discharge_disposition_code requirements to be an\r\n-- index admission:\r\n-- *** Must NOT be discharged to another acute care hospital\r\n-- *** Must NOT have left against medical advice\r\n-- *** Patient must be alive at discharge\r\n\r\n\r\n\r\nwith all_invalid_discharges as (\r\nselect encounter_id\r\nfrom {{ ref('readmissions__encounter') }}\r\nwhere discharge_disposition_code in (\r\n '02' -- Patient discharged/transferred to other short term general hospital for inpatient care.\r\n ,'07' -- Patient left against medical advice\r\n ,'20' -- Patient died\r\n )\r\n)\r\n\r\n-- All discharges that meet the discharge_disposition_code\r\n-- requirements to be an index admission\r\nselect a.encounter_id, '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('readmissions__encounter') }} a\r\nleft join all_invalid_discharges b\r\n on a.encounter_id = b.encounter_id\r\nwhere b.encounter_id is null", "language": "sql", "refs": [["readmissions__encounter"], ["readmissions__encounter"]], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.readmissions__encounter", "model.the_tuva_project.readmissions__encounter"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\readmissions\\intermediate\\readmissions__index_discharge_requirement.sql", "compiled": true, "compiled_code": "\n\n-- Here we list encounter_ids that meet\n-- the discharge_disposition_code requirements to be an\n-- index admission:\n-- *** Must NOT be discharged to another acute care hospital\n-- *** Must NOT have left against medical advice\n-- *** Patient must be alive at discharge\n\n\n\nwith all_invalid_discharges as (\nselect encounter_id\nfrom devforrest.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-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom devforrest.readmissions._int_encounter a\nleft join all_invalid_discharges b\n on a.encounter_id = b.encounter_id\nwhere b.encounter_id is null", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.readmissions__index_time_requirement": {"database": "devforrest", "schema": "readmissions", "name": "readmissions__index_time_requirement", "resource_type": "model", "package_name": "the_tuva_project", "path": "readmissions\\intermediate\\readmissions__index_time_requirement.sql", "original_file_path": "models\\readmissions\\intermediate\\readmissions__index_time_requirement.sql", "unique_id": "model.the_tuva_project.readmissions__index_time_requirement", "fqn": ["the_tuva_project", "readmissions", "intermediate", "readmissions__index_time_requirement"], "alias": "_int_index_time_requirement", "checksum": {"name": "sha256", "checksum": "f85ec812e7ed57b593ad387b55dae487f29c2c9f9dbb340944f965d134e4b147"}, "config": {"enabled": true, "alias": "_int_index_time_requirement", "schema": "readmissions", "database": null, "tags": ["readmissions"], "meta": {}, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#161a7d"}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["readmissions"], "description": "This model lists all encounters that meet the time requirement to be an index admission.", "columns": {"encounter_id": {"name": "encounter_id", "description": "The unique identifier for the encounter", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": "#161a7d"}, "patch_path": "the_tuva_project://models\\readmissions\\readmissions_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "readmissions", "alias": "_int_index_time_requirement", "tags": "readmissions", "materialized": "view", "enabled": true, "bind": false, "docs": {"node_color": "#161a7d"}}, "created_at": 1702481697.3101997, "relation_name": "devforrest.readmissions._int_index_time_requirement", "raw_code": "{{ config(\r\n enabled = var('readmissions_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r\n )\r\n}}\r\n\r\n-- Here we list encounter_ids that meet\r\n-- the time requirement to be an index admission:\r\n-- The discharge date must be at least 30 days\r\n-- earlier than the last discharge date available\r\n-- in the dataset.\r\n\r\n\r\n\r\nselect encounter_id, '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('readmissions__encounter') }}\r\nwhere discharge_date <= (select max(discharge_date)\r\n from {{ ref('readmissions__encounter') }} ) - 30", "language": "sql", "refs": [["readmissions__encounter"], ["readmissions__encounter"]], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.readmissions__encounter", "model.the_tuva_project.readmissions__encounter"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\readmissions\\intermediate\\readmissions__index_time_requirement.sql", "compiled": true, "compiled_code": "\n\n-- Here we list encounter_ids that meet\n-- the time requirement to be an index admission:\n-- The discharge date must be at least 30 days\n-- earlier than the last discharge date available\n-- in the dataset.\n\n\n\nselect encounter_id, '2023-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom devforrest.readmissions._int_encounter\nwhere discharge_date <= (select max(discharge_date)\n from devforrest.readmissions._int_encounter ) - 30", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.readmissions__planned_encounter": {"database": "devforrest", "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": "48da23ba254a17dd93920fc9b5ae552bb3ba88d4918a22deff1c3ee489ef1089"}, "config": {"enabled": true, "alias": "_int_planned_encounter", "schema": "readmissions", "database": null, "tags": ["readmissions"], "meta": {}, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#161a7d"}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["readmissions"], "description": "This model gives a list of all encounter_ids that were planned encounters.", "columns": {"encounter_id": {"name": "encounter_id", "description": "The unique identifier for the encounter", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": "#161a7d"}, "patch_path": "the_tuva_project://models\\readmissions\\readmissions_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "readmissions", "alias": "_int_planned_encounter", "tags": "readmissions", "materialized": "view", "enabled": true, "bind": false, "docs": {"node_color": "#161a7d"}}, "created_at": 1702481697.3101997, "relation_name": "devforrest.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__encounter_with_ccs') }} dccs\r\ninner join {{ ref('readmissions__always_planned_ccs_diagnosis_category') }} apd\r\n on dccs.ccs_diagnosis_category = apd.ccs_diagnosis_category\r\n),\r\n\r\n\r\n-- encounter_ids for encounters that are potentially planned\r\n-- based on one of their CCS procedure categories.\r\n-- For these encounters to actually be planned, we must further\r\n-- require that they are NOT acute encounters\r\npotentially_planned_px_ccs as (\r\nselect distinct encounter_id\r\nfrom {{ ref('readmissions__procedure_ccs') }} pccs\r\ninner join {{ ref('readmissions__potentially_planned_ccs_procedure_category') }} pcs\r\n on pccs.ccs_procedure_category = pcs.ccs_procedure_category\r\n),\r\n\r\n\r\n-- encounter_ids for encounters that are potentially planned\r\n-- based on their ICD-10-PCS procedure codes.\r\n-- For these encounters to actually be planned, we must further\r\n-- require that they are NOT acute encounters\r\npotentially_planned_px_icd_10_pcs as (\r\nselect distinct encounter_id\r\nfrom {{ ref('readmissions__procedure_ccs') }} pcs\r\ninner join {{ ref('readmissions__potentially_planned_icd_10_pcs') }} pps\r\n on pcs.procedure_code = pps.icd_10_pcs\r\n),\r\n\r\n\r\n-- encounter_ids for encounters that are acute based\r\n-- on their primary diagnosis code or their CCS diagnosis category\r\nacute_encounters as (\r\nselect distinct encounter_id\r\nfrom {{ ref('readmissions__encounter_with_ccs') }} dccs\r\nleft join {{ ref('readmissions__acute_diagnosis_icd_10_cm') }} adi\r\n on dccs.primary_diagnosis_code = adi.icd_10_cm\r\nleft join {{ ref('readmissions__acute_diagnosis_ccs') }} adc\r\n on dccs.ccs_diagnosis_category = adc.ccs_diagnosis_category\r\nwhere adi.icd_10_cm is not null or adc.ccs_diagnosis_category is not null\r\n),\r\n\r\n\r\n-- encounter_ids for encounters that are:\r\n-- [1] potentially planned, based on one of\r\n-- their CCS procedure categories or\r\n-- their ICD-10-PCS procedure codes\r\n-- [2] not acute, based on their primary diagnosis code\r\n-- or their CCS diagnosis category\r\n-- These encounters are therefore confirmed to be planned\r\npotentially_planned_that_are_actually_planned as (\r\nselect distinct ppp.encounter_id\r\nfrom (\r\n select * from potentially_planned_px_ccs\r\n union all\r\n select * from potentially_planned_px_icd_10_pcs) ppp\r\nleft join acute_encounters\r\n on ppp.encounter_id = acute_encounters.encounter_id\r\nwhere acute_encounters.encounter_id is null\r\n\r\n)\r\n\r\n\r\n-- Aggregate of all encounter_ids for planned encounters\r\n\r\nselect * , '{{ var('tuva_last_run')}}' as tuva_last_run from always_planned_px\r\nunion distinct\r\nselect *, '{{ var('tuva_last_run')}}' as tuva_last_run from always_planned_dx\r\nunion distinct\r\nselect *, '{{ var('tuva_last_run')}}' as tuva_last_run from potentially_planned_that_are_actually_planned", "language": "sql", "refs": [["readmissions__procedure_ccs"], ["readmissions__always_planned_ccs_procedure_category"], ["readmissions__encounter_with_ccs"], ["readmissions__always_planned_ccs_diagnosis_category"], ["readmissions__procedure_ccs"], ["readmissions__potentially_planned_ccs_procedure_category"], ["readmissions__procedure_ccs"], ["readmissions__potentially_planned_icd_10_pcs"], ["readmissions__encounter_with_ccs"], ["readmissions__acute_diagnosis_icd_10_cm"], ["readmissions__acute_diagnosis_ccs"]], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.readmissions__procedure_ccs", "seed.the_tuva_project.readmissions__always_planned_ccs_procedure_category", "model.the_tuva_project.readmissions__encounter_with_ccs", "seed.the_tuva_project.readmissions__always_planned_ccs_diagnosis_category", "model.the_tuva_project.readmissions__procedure_ccs", "seed.the_tuva_project.readmissions__potentially_planned_ccs_procedure_category", "model.the_tuva_project.readmissions__procedure_ccs", "seed.the_tuva_project.readmissions__potentially_planned_icd_10_pcs", "model.the_tuva_project.readmissions__encounter_with_ccs", "seed.the_tuva_project.readmissions__acute_diagnosis_icd_10_cm", "seed.the_tuva_project.readmissions__acute_diagnosis_ccs"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\readmissions\\intermediate\\readmissions__planned_encounter.sql", "compiled": true, "compiled_code": "\n\n-- Here we list encounter_ids for all encounters\n-- that are planned.\n\n\n-- encounter_ids for encounters that we know\n-- are planned because they had a procedure category\n-- that is only present for planned encounters \nwith always_planned_px as (\nselect distinct pccs.encounter_id\nfrom devforrest.readmissions._int_procedure_ccs pccs\ninner join devforrest.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 devforrest.readmissions._int_encounter_with_ccs dccs\ninner join devforrest.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 devforrest.readmissions._int_procedure_ccs pccs\ninner join devforrest.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 devforrest.readmissions._int_procedure_ccs pcs\ninner join devforrest.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 devforrest.readmissions._int_encounter_with_ccs dccs\nleft join devforrest.readmissions._value_set_acute_diagnosis_icd_10_cm adi\n on dccs.primary_diagnosis_code = adi.icd_10_cm\nleft join devforrest.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-12-13 23:31:59.089856+00:00' as tuva_last_run from always_planned_px\nunion distinct\nselect *, '2023-12-13 23:31:59.089856+00:00' as tuva_last_run from always_planned_dx\nunion distinct\nselect *, '2023-12-13 23:31:59.089856+00:00' as tuva_last_run from potentially_planned_that_are_actually_planned", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.readmissions__procedure_ccs": {"database": "devforrest", "schema": "readmissions", "name": "readmissions__procedure_ccs", "resource_type": "model", "package_name": "the_tuva_project", "path": "readmissions\\intermediate\\readmissions__procedure_ccs.sql", "original_file_path": "models\\readmissions\\intermediate\\readmissions__procedure_ccs.sql", "unique_id": "model.the_tuva_project.readmissions__procedure_ccs", "fqn": ["the_tuva_project", "readmissions", "intermediate", "readmissions__procedure_ccs"], "alias": "_int_procedure_ccs", "checksum": {"name": "sha256", "checksum": "84584613e857ed1c5b88902cab3635d8ebcd675344e78c6df5c75f3fa5eb4770"}, "config": {"enabled": true, "alias": "_int_procedure_ccs", "schema": "readmissions", "database": null, "tags": ["readmissions"], "meta": {}, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#161a7d"}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["readmissions"], "description": "This model includes all procedures from the stg_procedure model and adds a valid_icd_10_pcs_flag to indicate if the ICD-10-PCS code for this procedure is valid. We also add the CCS procedure category associated with the procedure", "columns": {"encounter_id": {"name": "encounter_id", "description": "The unique identifier for the encounter", "meta": {}, "data_type": null, "quote": null, "tags": []}, "procedure_code": {"name": "procedure_code", "description": "An ICD-10-PCS code associated with this encounter_id", "meta": {}, "data_type": null, "quote": null, "tags": []}, "valid_icd_10_pcs_flag": {"name": "valid_icd_10_pcs_flag", "description": "A flag indicating if the ICD-10-PCS procedure code given is valid", "meta": {}, "data_type": null, "quote": null, "tags": []}, "ccs_procedure_category": {"name": "ccs_procedure_category", "description": "The CCS code associated with the given ICD-10-PCS procedure", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": "#161a7d"}, "patch_path": "the_tuva_project://models\\readmissions\\readmissions_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "readmissions", "alias": "_int_procedure_ccs", "tags": "readmissions", "materialized": "view", "enabled": true, "bind": false, "docs": {"node_color": "#161a7d"}}, "created_at": 1702481697.3101997, "relation_name": "devforrest.readmissions._int_procedure_ccs", "raw_code": "{{ config(\r\n enabled = var('readmissions_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r\n )\r\n}}\r\n\r\n-- Here we map every procedure code to its corresponding\r\n-- CCS procedure category.\r\n-- This model may list more than one CCS procedure category\r\n-- per encounter_id because different procedures associated with the\r\n-- encounter (different rows on the stg_procedure model) may have\r\n-- different associated CCS procedure categories.\r\n\r\n\r\n\r\nselect\r\n aa.encounter_id,\r\n aa.normalized_code as procedure_code,\r\n case\r\n when bb.icd_10_pcs is null then 0\r\n\telse 1\r\n end as valid_icd_10_pcs_flag,\r\n cc.ccs_procedure_category,\r\n '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom\r\n {{ ref('readmissions__stg_core__procedure') }} aa\r\n left join {{ ref('terminology__icd_10_pcs') }} bb\r\n on aa.normalized_code = bb.icd_10_pcs\r\n left join {{ ref('readmissions__icd_10_pcs_to_ccs') }} cc\r\n on aa.normalized_code = cc.icd_10_pcs\r\nwhere aa.normalized_code_type = 'icd-10-pcs'", "language": "sql", "refs": [["readmissions__stg_core__procedure"], ["terminology__icd_10_pcs"], ["readmissions__icd_10_pcs_to_ccs"]], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.readmissions__stg_core__procedure", "seed.the_tuva_project.terminology__icd_10_pcs", "seed.the_tuva_project.readmissions__icd_10_pcs_to_ccs"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\readmissions\\intermediate\\readmissions__procedure_ccs.sql", "compiled": true, "compiled_code": "\n\nwith __dbt__cte__readmissions__stg_core__procedure as (\n\n\nselect\n encounter_id\n, normalized_code\n, normalized_code_type\n, '2023-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom devforrest.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-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom\n __dbt__cte__readmissions__stg_core__procedure aa\n left join devforrest.terminology.icd_10_pcs bb\n on aa.normalized_code = bb.icd_10_pcs\n left join devforrest.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-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom devforrest.core.procedure\n)"}]}, "model.the_tuva_project.readmissions__readmission_crude": {"database": "devforrest", "schema": "readmissions", "name": "readmissions__readmission_crude", "resource_type": "model", "package_name": "the_tuva_project", "path": "readmissions\\intermediate\\readmissions__readmission_crude.sql", "original_file_path": "models\\readmissions\\intermediate\\readmissions__readmission_crude.sql", "unique_id": "model.the_tuva_project.readmissions__readmission_crude", "fqn": ["the_tuva_project", "readmissions", "intermediate", "readmissions__readmission_crude"], "alias": "_int_readmission_crude", "checksum": {"name": "sha256", "checksum": "ac2709cae4a94c2e2e39a9e89d09dc4276c15c3e2cc2f4813115339c7baf2179"}, "config": {"enabled": true, "alias": "_int_readmission_crude", "schema": "readmissions", "database": null, "tags": ["readmissions"], "meta": {}, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#161a7d"}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["readmissions"], "description": "This model lists all encounters and whether they had a 'crude' readmission, meaning that the encounter had a hospitalization after discharge, without regard to all CMS readmission logic.", "columns": {"encounter_id": {"name": "encounter_id", "description": "The unique identifier for the encounter", "meta": {}, "data_type": null, "quote": null, "tags": []}, "patient_id": {"name": "patient_id", "description": "The unique identifier for the patient", "meta": {}, "data_type": null, "quote": null, "tags": []}, "admit_date": {"name": "admit_date", "description": "The date of admission for the inpatient visit", "meta": {}, "data_type": null, "quote": null, "tags": []}, "discharge_date": {"name": "discharge_date", "description": "", "meta": {}, "data_type": null, "quote": null, "tags": []}, "had_readmission_flag": {"name": "had_readmission_flag", "description": "A flag to indicate whether the encounter had a readmission any number of days after discharge", "meta": {}, "data_type": null, "quote": null, "tags": []}, "days_to_readmit": {"name": "days_to_readmit", "description": "An integer to indicate the number of days to readmission", "meta": {}, "data_type": null, "quote": null, "tags": []}, "readmit_30_flag": {"name": "readmit_30_flag", "description": "A flag to indicate whether the encounter had a 30-day readmission", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": "#161a7d"}, "patch_path": "the_tuva_project://models\\readmissions\\readmissions_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "readmissions", "alias": "_int_readmission_crude", "tags": "readmissions", "materialized": "view", "enabled": true, "bind": false, "docs": {"node_color": "#161a7d"}}, "created_at": 1702481697.325831, "relation_name": "devforrest.readmissions._int_readmission_crude", "raw_code": "{{ config(\r\n enabled = var('readmissions_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r\n )\r\n}}\r\n\r\n-- Here we calculate readmissions using all encounters\r\n-- that have valid admit and discharge dates and no overlap.\r\n-- This is meant to give a crude sense of the readmission\r\n-- rate without taking into account all the CMS HWR logic.\r\n\r\n\r\nwith encounter_info as (\r\nselect\r\n enc.encounter_id,\r\n enc.patient_id,\r\n enc.admit_date,\r\n enc.discharge_date\r\nfrom {{ ref('readmissions__encounter') }} enc\r\nleft join {{ ref('readmissions__encounter_overlap') }} over_a\r\n on enc.encounter_id = over_a.encounter_id_A\r\nleft join {{ ref('readmissions__encounter_overlap') }} over_b\r\n on enc.encounter_id = over_b.encounter_id_B\r\nwhere\r\n admit_date is not null\r\n and\r\n discharge_date is not null\r\n and\r\n admit_date <= discharge_date\r\nand over_a.encounter_id_A is null and over_b.encounter_id_B is null\r\n ),\r\n\r\n\r\nencounter_sequence as (\r\nselect\r\n encounter_id,\r\n patient_id,\r\n admit_date,\r\n discharge_date,\r\n row_number() over(\r\n partition by patient_id order by admit_date, discharge_date\r\n ) as encounter_seq\r\nfrom encounter_info\r\n),\r\n\r\n\r\nreadmission_calc as (\r\nselect\r\n aa.encounter_id,\r\n aa.patient_id,\r\n aa.admit_date,\r\n aa.discharge_date,\r\n case\r\n when bb.encounter_id is not null then 1\r\n\telse 0\r\n end as had_readmission_flag,\r\n bb.admit_date - aa.discharge_date as days_to_readmit,\r\n case\r\n when ({{ dbt.datediff(\"bb.admit_date\", \"aa.discharge_date\", \"day\") }}) <= 30 then 1\r\n\telse 0\r\n end as readmit_30_flag\r\nfrom encounter_sequence aa left join encounter_sequence bb\r\n on aa.patient_id = bb.patient_id\r\n and aa.encounter_seq + 1 = bb.encounter_seq\r\n)\r\n\r\n\r\n\r\nselect *, '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom readmission_calc", "language": "sql", "refs": [["readmissions__encounter"], ["readmissions__encounter_overlap"], ["readmissions__encounter_overlap"]], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.datediff"], "nodes": ["model.the_tuva_project.readmissions__encounter", "model.the_tuva_project.readmissions__encounter_overlap", "model.the_tuva_project.readmissions__encounter_overlap"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\readmissions\\intermediate\\readmissions__readmission_crude.sql", "compiled": true, "compiled_code": "\n\n-- Here we calculate readmissions using all encounters\n-- that have valid admit and discharge dates and no overlap.\n-- This is meant to give a crude sense of the readmission\n-- rate without taking into account all the CMS HWR logic.\n\n\nwith encounter_info as (\nselect\n enc.encounter_id,\n enc.patient_id,\n enc.admit_date,\n enc.discharge_date\nfrom devforrest.readmissions._int_encounter enc\nleft join devforrest.readmissions._int_encounter_overlap over_a\n on enc.encounter_id = over_a.encounter_id_A\nleft join devforrest.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-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom readmission_calc", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.readmissions__stg_core__condition": {"database": "devforrest", "schema": "dbt_forrest", "name": "readmissions__stg_core__condition", "resource_type": "model", "package_name": "the_tuva_project", "path": "readmissions\\staging\\readmissions__stg_core__condition.sql", "original_file_path": "models\\readmissions\\staging\\readmissions__stg_core__condition.sql", "unique_id": "model.the_tuva_project.readmissions__stg_core__condition", "fqn": ["the_tuva_project", "readmissions", "staging", "readmissions__stg_core__condition"], "alias": "readmissions__stg_core__condition", "checksum": {"name": "sha256", "checksum": "c4705cc9d628122f8458f631a8ab9c76cec94cc2786a756fa9b3750eec3ab2b1"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["readmissions"], "meta": {}, "materialized": "ephemeral", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#161a7d"}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["readmissions"], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#161a7d"}, "patch_path": "the_tuva_project://models\\readmissions\\readmissions_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"tags": "readmissions", "materialized": "ephemeral", "enabled": true, "bind": false, "docs": {"node_color": "#161a7d"}}, "created_at": 1702481697.3283658, "relation_name": null, "raw_code": "{{ config(\r\n enabled = var('readmissions_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r\n )\r\n}}\r\n\r\nselect\r\n encounter_id\r\n, normalized_code\r\n, condition_rank\r\n, normalized_code_type\r\n, claim_id\r\n, '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('core__condition') }}", "language": "sql", "refs": [["core__condition"]], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.core__condition"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\readmissions\\staging\\readmissions__stg_core__condition.sql", "compiled": true, "compiled_code": "\n\nselect\n encounter_id\n, normalized_code\n, condition_rank\n, normalized_code_type\n, claim_id\n, '2023-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom devforrest.core.condition", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.readmissions__stg_core__encounter": {"database": "devforrest", "schema": "dbt_forrest", "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": "d3de68a0f6577ae3235e681da1b61e4d3f8a8b43b8031ebfd87e123b72c1f06c"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["readmissions"], "meta": {}, "materialized": "ephemeral", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#161a7d"}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["readmissions"], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#161a7d"}, "patch_path": "the_tuva_project://models\\readmissions\\readmissions_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"tags": "readmissions", "materialized": "ephemeral", "enabled": true, "bind": false, "docs": {"node_color": "#161a7d"}}, "created_at": 1702481697.3283658, "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,\r\n primary_diagnosis_code,\r\n '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('core__encounter') }}\r\nwhere encounter_type = 'acute inpatient'", "language": "sql", "refs": [["core__encounter"]], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.core__encounter"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\readmissions\\staging\\readmissions__stg_core__encounter.sql", "compiled": true, "compiled_code": "\n\nselect\n encounter_id,\n patient_id,\n encounter_start_date,\n encounter_end_date,\n discharge_disposition_code,\n facility_npi,\n ms_drg_code,\n paid_amount,\n primary_diagnosis_code,\n '2023-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom devforrest.core.encounter\nwhere encounter_type = 'acute inpatient'", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.readmissions__stg_core__medical_claim": {"database": "devforrest", "schema": "dbt_forrest", "name": "readmissions__stg_core__medical_claim", "resource_type": "model", "package_name": "the_tuva_project", "path": "readmissions\\staging\\readmissions__stg_core__medical_claim.sql", "original_file_path": "models\\readmissions\\staging\\readmissions__stg_core__medical_claim.sql", "unique_id": "model.the_tuva_project.readmissions__stg_core__medical_claim", "fqn": ["the_tuva_project", "readmissions", "staging", "readmissions__stg_core__medical_claim"], "alias": "readmissions__stg_core__medical_claim", "checksum": {"name": "sha256", "checksum": "6a5a89e6c24a55d72a531de9174a952f3ef9174b321ef6edd85dd5dee5df1858"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["readmissions"], "meta": {}, "materialized": "ephemeral", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#161a7d"}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["readmissions"], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#161a7d"}, "patch_path": "the_tuva_project://models\\readmissions\\readmissions_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"tags": "readmissions", "materialized": "ephemeral", "enabled": true, "bind": false, "docs": {"node_color": "#161a7d"}}, "created_at": 1702481697.3283658, "relation_name": null, "raw_code": "{{ config(\r\n enabled = var('readmissions_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r\n )\r\n}}\r\n\r\n\r\nSELECT\r\n claim_id\r\n, claim_type\r\n, encounter_id\r\n, encounter_type\r\n, '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('core__medical_claim') }}", "language": "sql", "refs": [["core__medical_claim"]], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.core__medical_claim"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\readmissions\\staging\\readmissions__stg_core__medical_claim.sql", "compiled": true, "compiled_code": "\n\n\nSELECT\n claim_id\n, claim_type\n, encounter_id\n, encounter_type\n, '2023-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom devforrest.core.medical_claim", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.readmissions__stg_core__procedure": {"database": "devforrest", "schema": "dbt_forrest", "name": "readmissions__stg_core__procedure", "resource_type": "model", "package_name": "the_tuva_project", "path": "readmissions\\staging\\readmissions__stg_core__procedure.sql", "original_file_path": "models\\readmissions\\staging\\readmissions__stg_core__procedure.sql", "unique_id": "model.the_tuva_project.readmissions__stg_core__procedure", "fqn": ["the_tuva_project", "readmissions", "staging", "readmissions__stg_core__procedure"], "alias": "readmissions__stg_core__procedure", "checksum": {"name": "sha256", "checksum": "d0ef7f22c43c889710e61c50fecd24d9b9e18a212bfeb6bfc755ee6cc96f3eb4"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["readmissions"], "meta": {}, "materialized": "ephemeral", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#161a7d"}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["readmissions"], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#161a7d"}, "patch_path": "the_tuva_project://models\\readmissions\\readmissions_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"tags": "readmissions", "materialized": "ephemeral", "enabled": true, "bind": false, "docs": {"node_color": "#161a7d"}}, "created_at": 1702481697.3283658, "relation_name": null, "raw_code": "{{ config(\r\n enabled = var('readmissions_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r\n )\r\n}}\r\n\r\nselect\r\n encounter_id\r\n, normalized_code\r\n, normalized_code_type\r\n, '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('core__procedure') }}", "language": "sql", "refs": [["core__procedure"]], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.core__procedure"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\readmissions\\staging\\readmissions__stg_core__procedure.sql", "compiled": true, "compiled_code": "\n\nselect\n encounter_id\n, normalized_code\n, normalized_code_type\n, '2023-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom devforrest.core.procedure", "extra_ctes_injected": true, "extra_ctes": []}, "seed.the_tuva_project.terminology__admit_source": {"database": "devforrest", "schema": "terminology", "name": "terminology__admit_source", "resource_type": "seed", "package_name": "the_tuva_project", "path": "terminology\\terminology__admit_source.csv", "original_file_path": "seeds\\terminology\\terminology__admit_source.csv", "unique_id": "seed.the_tuva_project.terminology__admit_source", "fqn": ["the_tuva_project", "terminology", "terminology__admit_source"], "alias": "admit_source", "checksum": {"name": "sha256", "checksum": "52cfafd223b8a134e28057eafb78f93e53f119156fa9ef6603ca372266a6e4c5"}, "config": {"enabled": true, "alias": "admit_source", "schema": "terminology", "database": null, "tags": ["terminology", "claims_preprocessing", "data_profiling"], "meta": {}, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"admit_source_code": "varchar", "admit_source_description": "varchar", "newborn_description": "varchar"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#460d4f"}, "quote_columns": null, "post-hook": [], "pre-hook": []}, "tags": ["terminology", "claims_preprocessing", "data_profiling"], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#460d4f"}, "patch_path": "the_tuva_project://seeds\\terminology\\terminology_seeds.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "terminology", "alias": "admit_source", "tags": ["terminology", "claims_preprocessing", "data_profiling"], "column_types": {"admit_source_code": "varchar", "admit_source_description": "varchar", "newborn_description": "varchar"}, "docs": {"node_color": "#460d4f"}}, "created_at": 1702481697.3473303, "relation_name": "devforrest.terminology.admit_source", "raw_code": "", "root_path": "C:\\Users\\forre\\PycharmProjects\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": []}}, "seed.the_tuva_project.terminology__admit_type": {"database": "devforrest", "schema": "terminology", "name": "terminology__admit_type", "resource_type": "seed", "package_name": "the_tuva_project", "path": "terminology\\terminology__admit_type.csv", "original_file_path": "seeds\\terminology\\terminology__admit_type.csv", "unique_id": "seed.the_tuva_project.terminology__admit_type", "fqn": ["the_tuva_project", "terminology", "terminology__admit_type"], "alias": "admit_type", "checksum": {"name": "sha256", "checksum": "3346cb56b5216d56f0a7f4260e1e85f9fb83697e5020cbcfc198da65edaeb449"}, "config": {"enabled": true, "alias": "admit_type", "schema": "terminology", "database": null, "tags": ["terminology", "claims_preprocessing", "data_profiling"], "meta": {}, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"admit_type_code": "varchar", "admit_type_description": "varchar"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#460d4f"}, "quote_columns": null, "post-hook": [], "pre-hook": []}, "tags": ["terminology", "claims_preprocessing", "data_profiling"], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#460d4f"}, "patch_path": "the_tuva_project://seeds\\terminology\\terminology_seeds.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "terminology", "alias": "admit_type", "tags": ["terminology", "claims_preprocessing", "data_profiling"], "column_types": {"admit_type_code": "varchar", "admit_type_description": "varchar"}, "docs": {"node_color": "#460d4f"}}, "created_at": 1702481697.3528473, "relation_name": "devforrest.terminology.admit_type", "raw_code": "", "root_path": "C:\\Users\\forre\\PycharmProjects\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": []}}, "seed.the_tuva_project.terminology__ansi_fips_state": {"database": "devforrest", "schema": "terminology", "name": "terminology__ansi_fips_state", "resource_type": "seed", "package_name": "the_tuva_project", "path": "terminology\\terminology__ansi_fips_state.csv", "original_file_path": "seeds\\terminology\\terminology__ansi_fips_state.csv", "unique_id": "seed.the_tuva_project.terminology__ansi_fips_state", "fqn": ["the_tuva_project", "terminology", "terminology__ansi_fips_state"], "alias": "ansi_fips_state", "checksum": {"name": "sha256", "checksum": "e4137e40ea8d3ff1bdfb3c661f898d05f0b71f7b5f46ef7ad38ad176e2d306a0"}, "config": {"enabled": true, "alias": "ansi_fips_state", "schema": "terminology", "database": null, "tags": ["terminology", "medicare_cclf_connector"], "meta": {}, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"ansi_fips_state_code": "varchar", "ansi_fips_state_abbreviation": "varchar", "ansi_fips_state_name": "varchar"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#460d4f"}, "quote_columns": null, "post-hook": [], "pre-hook": []}, "tags": ["terminology", "medicare_cclf_connector"], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#460d4f"}, "patch_path": "the_tuva_project://seeds\\terminology\\terminology_seeds.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "terminology", "alias": "ansi_fips_state", "tags": ["terminology", "medicare_cclf_connector"], "column_types": {"ansi_fips_state_code": "varchar", "ansi_fips_state_abbreviation": "varchar", "ansi_fips_state_name": "varchar"}, "docs": {"node_color": "#460d4f"}}, "created_at": 1702481697.3993003, "relation_name": "devforrest.terminology.ansi_fips_state", "raw_code": "", "root_path": "C:\\Users\\forre\\PycharmProjects\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": []}}, "seed.the_tuva_project.terminology__apr_drg": {"database": "devforrest", "schema": "terminology", "name": "terminology__apr_drg", "resource_type": "seed", "package_name": "the_tuva_project", "path": "terminology\\terminology__apr_drg.csv", "original_file_path": "seeds\\terminology\\terminology__apr_drg.csv", "unique_id": "seed.the_tuva_project.terminology__apr_drg", "fqn": ["the_tuva_project", "terminology", "terminology__apr_drg"], "alias": "apr_drg", "checksum": {"name": "sha256", "checksum": "7644458580dcc94c2982457f23b2510997e68249783c1bd9132d9c748066e8bc"}, "config": {"enabled": true, "alias": "apr_drg", "schema": "terminology", "database": null, "tags": ["terminology", "data_profiling"], "meta": {}, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"apr_drg_code": "varchar", "severity": "varchar", "apr_drg_description": "varchar"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#460d4f"}, "quote_columns": null, "post-hook": [], "pre-hook": []}, "tags": ["terminology", "data_profiling"], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#460d4f"}, "patch_path": "the_tuva_project://seeds\\terminology\\terminology_seeds.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "terminology", "alias": "apr_drg", "tags": ["terminology", "data_profiling"], "column_types": {"apr_drg_code": "varchar", "severity": "varchar", "apr_drg_description": "varchar"}, "docs": {"node_color": "#460d4f"}}, "created_at": 1702481697.5504577, "relation_name": "devforrest.terminology.apr_drg", "raw_code": "", "root_path": "C:\\Users\\forre\\PycharmProjects\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": []}}, "seed.the_tuva_project.terminology__bill_type": {"database": "devforrest", "schema": "terminology", "name": "terminology__bill_type", "resource_type": "seed", "package_name": "the_tuva_project", "path": "terminology\\terminology__bill_type.csv", "original_file_path": "seeds\\terminology\\terminology__bill_type.csv", "unique_id": "seed.the_tuva_project.terminology__bill_type", "fqn": ["the_tuva_project", "terminology", "terminology__bill_type"], "alias": "bill_type", "checksum": {"name": "sha256", "checksum": "df4c7c4855d7aeb9f06f1595d00b58a26292a667c2394924c41b791982f575e5"}, "config": {"enabled": true, "alias": "bill_type", "schema": "terminology", "database": null, "tags": ["terminology", "data_profiling"], "meta": {}, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"bill_type_code": "varchar", "bill_type_description": "varchar", "deprecated": "integer", "deprecated_date": "date"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#460d4f"}, "quote_columns": null, "post-hook": [], "pre-hook": []}, "tags": ["terminology", "data_profiling"], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#460d4f"}, "patch_path": "the_tuva_project://seeds\\terminology\\terminology_seeds.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "terminology", "alias": "bill_type", "tags": ["terminology", "data_profiling"], "column_types": {"bill_type_code": "varchar", "bill_type_description": "varchar", "deprecated": "integer", "deprecated_date": "date"}, "docs": {"node_color": "#460d4f"}}, "created_at": 1702481697.3568475, "relation_name": "devforrest.terminology.bill_type", "raw_code": "", "root_path": "C:\\Users\\forre\\PycharmProjects\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": []}}, "seed.the_tuva_project.terminology__calendar": {"database": "devforrest", "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": "97187148958052f93ff3df90642dbc59ba95f2818d1dabd0eee3ad40d5e796b6"}, "config": {"enabled": true, "alias": "calendar", "schema": "terminology", "database": null, "tags": ["terminology", "pmpm"], "meta": {}, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"full_date": "date", "year": "integer", "month": "integer", "day": "integer", "month_name": "varchar", "day_of_week_number": "integer", "day_of_week_name": "varchar", "week_of_year": "integer", "day_of_year": "integer", "year_month": "varchar", "first_day_of_month": "date", "last_day_of_month": "date"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#460d4f"}, "quote_columns": null, "post-hook": [{"sql": "{{ load_seed('tuva-public-resources/terminology','calendar.csv',compression=true,null_marker=true) }}", "transaction": true, "index": null}], "pre-hook": []}, "tags": ["terminology", "pmpm"], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#460d4f"}, "patch_path": "the_tuva_project://seeds\\terminology\\terminology_seeds.yml", "build_path": null, "deferred": false, "unrendered_config": {"post-hook": "{{ load_seed('tuva-public-resources/terminology','calendar.csv',compression=true,null_marker=true) }}", "schema": "terminology", "alias": "calendar", "tags": ["terminology", "pmpm"], "column_types": {"full_date": "date", "year": "integer", "month": "integer", "day": "integer", "month_name": "varchar", "day_of_week_number": "integer", "day_of_week_name": "varchar", "week_of_year": "integer", "day_of_year": "integer", "year_month": "varchar", "first_day_of_month": "date", "last_day_of_month": "date"}, "docs": {"node_color": "#460d4f"}}, "created_at": 1702481697.3680305, "relation_name": "devforrest.terminology.calendar", "raw_code": "", "root_path": "C:\\Users\\forre\\PycharmProjects\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": ["macro.the_tuva_project.load_seed"]}}, "seed.the_tuva_project.terminology__claim_type": {"database": "devforrest", "schema": "terminology", "name": "terminology__claim_type", "resource_type": "seed", "package_name": "the_tuva_project", "path": "terminology\\terminology__claim_type.csv", "original_file_path": "seeds\\terminology\\terminology__claim_type.csv", "unique_id": "seed.the_tuva_project.terminology__claim_type", "fqn": ["the_tuva_project", "terminology", "terminology__claim_type"], "alias": "claim_type", "checksum": {"name": "sha256", "checksum": "bce5496f01c098e7707ae90a5d30e622ede0cc119b80898881b79217a6e36ba1"}, "config": {"enabled": true, "alias": "claim_type", "schema": "terminology", "database": null, "tags": ["terminology", "data_profiling"], "meta": {}, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"claim_type_code": "varchar", "claim_type_description": "varchar"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#460d4f"}, "quote_columns": null, "post-hook": [], "pre-hook": []}, "tags": ["terminology", "data_profiling"], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#460d4f"}, "patch_path": "the_tuva_project://seeds\\terminology\\terminology_seeds.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "terminology", "alias": "claim_type", "tags": ["terminology", "data_profiling"], "column_types": {"claim_type_code": "varchar", "claim_type_description": "varchar"}, "docs": {"node_color": "#460d4f"}}, "created_at": 1702481697.3730307, "relation_name": "devforrest.terminology.claim_type", "raw_code": "", "root_path": "C:\\Users\\forre\\PycharmProjects\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": []}}, "seed.the_tuva_project.terminology__code_type": {"database": "devforrest", "schema": "terminology", "name": "terminology__code_type", "resource_type": "seed", "package_name": "the_tuva_project", "path": "terminology\\terminology__code_type.csv", "original_file_path": "seeds\\terminology\\terminology__code_type.csv", "unique_id": "seed.the_tuva_project.terminology__code_type", "fqn": ["the_tuva_project", "terminology", "terminology__code_type"], "alias": "code_type", "checksum": {"name": "sha256", "checksum": "d99b5d1f18b130e99e1c1f80f9fe83a7f7e09f311e19327d07ba840941a983cb"}, "config": {"enabled": true, "alias": "code_type", "schema": "terminology", "database": null, "tags": ["terminology", "data_profiling"], "meta": {}, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"description": "varchar"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#460d4f"}, "quote_columns": null, "post-hook": [], "pre-hook": []}, "tags": ["terminology", "data_profiling"], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#460d4f"}, "patch_path": "the_tuva_project://seeds\\terminology\\terminology_seeds.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "terminology", "alias": "code_type", "tags": ["terminology", "data_profiling"], "column_types": {"description": "varchar"}, "docs": {"node_color": "#460d4f"}}, "created_at": 1702481697.3760307, "relation_name": "devforrest.terminology.code_type", "raw_code": "", "root_path": "C:\\Users\\forre\\PycharmProjects\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": []}}, "seed.the_tuva_project.terminology__discharge_disposition": {"database": "devforrest", "schema": "terminology", "name": "terminology__discharge_disposition", "resource_type": "seed", "package_name": "the_tuva_project", "path": "terminology\\terminology__discharge_disposition.csv", "original_file_path": "seeds\\terminology\\terminology__discharge_disposition.csv", "unique_id": "seed.the_tuva_project.terminology__discharge_disposition", "fqn": ["the_tuva_project", "terminology", "terminology__discharge_disposition"], "alias": "discharge_disposition", "checksum": {"name": "sha256", "checksum": "102f68b0e0d114d517f8896164e534ec4623b500519bcb427952573b721e374e"}, "config": {"enabled": true, "alias": "discharge_disposition", "schema": "terminology", "database": null, "tags": [], "meta": {}, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"discharge_disposition_code": "varchar", "discharge_disposition_description": "varchar"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#460d4f"}, "quote_columns": null, "post-hook": [], "pre-hook": []}, "tags": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#460d4f"}, "patch_path": "the_tuva_project://seeds\\terminology\\terminology_seeds.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "terminology", "alias": "discharge_disposition", "column_types": {"discharge_disposition_code": "varchar", "discharge_disposition_description": "varchar"}, "docs": {"node_color": "#460d4f"}}, "created_at": 1702481697.3807251, "relation_name": "devforrest.terminology.discharge_disposition", "raw_code": "", "root_path": "C:\\Users\\forre\\PycharmProjects\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": []}}, "seed.the_tuva_project.terminology__encounter_type": {"database": "devforrest", "schema": "terminology", "name": "terminology__encounter_type", "resource_type": "seed", "package_name": "the_tuva_project", "path": "terminology\\terminology__encounter_type.csv", "original_file_path": "seeds\\terminology\\terminology__encounter_type.csv", "unique_id": "seed.the_tuva_project.terminology__encounter_type", "fqn": ["the_tuva_project", "terminology", "terminology__encounter_type"], "alias": "encounter_type", "checksum": {"name": "sha256", "checksum": "b823346a3c0ff0288107da5f53bee8064bc61bbff3a44a0642574a9cc1cd47ea"}, "config": {"enabled": true, "alias": "encounter_type", "schema": "terminology", "database": null, "tags": ["terminology", "claims_preprocessing"], "meta": {}, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"description": "varchar"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#460d4f"}, "quote_columns": null, "post-hook": [], "pre-hook": []}, "tags": ["terminology", "claims_preprocessing"], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#460d4f"}, "patch_path": "the_tuva_project://seeds\\terminology\\terminology_seeds.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "terminology", "alias": "encounter_type", "tags": ["terminology", "claims_preprocessing"], "column_types": {"description": "varchar"}, "docs": {"node_color": "#460d4f"}}, "created_at": 1702481697.3847246, "relation_name": "devforrest.terminology.encounter_type", "raw_code": "", "root_path": "C:\\Users\\forre\\PycharmProjects\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": []}}, "seed.the_tuva_project.terminology__ethnicity": {"database": "devforrest", "schema": "terminology", "name": "terminology__ethnicity", "resource_type": "seed", "package_name": "the_tuva_project", "path": "terminology\\terminology__ethnicity.csv", "original_file_path": "seeds\\terminology\\terminology__ethnicity.csv", "unique_id": "seed.the_tuva_project.terminology__ethnicity", "fqn": ["the_tuva_project", "terminology", "terminology__ethnicity"], "alias": "ethnicity", "checksum": {"name": "sha256", "checksum": "2756d8fc5cb0632232b61ec93564639f42b79cc58080e58802defdc2f08beb49"}, "config": {"enabled": true, "alias": "ethnicity", "schema": "terminology", "database": null, "tags": ["terminology"], "meta": {}, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"code": "varchar", "description": "varchar"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#460d4f"}, "quote_columns": null, "post-hook": [], "pre-hook": []}, "tags": ["terminology"], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#460d4f"}, "patch_path": "the_tuva_project://seeds\\terminology\\terminology_seeds.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "terminology", "alias": "ethnicity", "tags": "terminology", "column_types": {"code": "varchar", "description": "varchar"}, "docs": {"node_color": "#460d4f"}}, "created_at": 1702481697.3897233, "relation_name": "devforrest.terminology.ethnicity", "raw_code": "", "root_path": "C:\\Users\\forre\\PycharmProjects\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": []}}, "seed.the_tuva_project.terminology__fips_county": {"database": "devforrest", "schema": "terminology", "name": "terminology__fips_county", "resource_type": "seed", "package_name": "the_tuva_project", "path": "terminology\\terminology__fips_county.csv", "original_file_path": "seeds\\terminology\\terminology__fips_county.csv", "unique_id": "seed.the_tuva_project.terminology__fips_county", "fqn": ["the_tuva_project", "terminology", "terminology__fips_county"], "alias": "fips_county", "checksum": {"name": "sha256", "checksum": "39792877b3b9ef63bd80b51db7f7afc5758ce61266837e5fcf60eac5d902b97b"}, "config": {"enabled": true, "alias": "fips_county", "schema": "terminology", "database": null, "tags": ["terminology"], "meta": {}, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"fips_code": "varchar", "county": "varchar", "state": "varchar"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#460d4f"}, "quote_columns": null, "post-hook": [], "pre-hook": []}, "tags": ["terminology"], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#460d4f"}, "patch_path": "the_tuva_project://seeds\\terminology\\terminology_seeds.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "terminology", "alias": "fips_county", "tags": "terminology", "column_types": {"fips_code": "varchar", "county": "varchar", "state": "varchar"}, "docs": {"node_color": "#460d4f"}}, "created_at": 1702481697.3947234, "relation_name": "devforrest.terminology.fips_county", "raw_code": "", "root_path": "C:\\Users\\forre\\PycharmProjects\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": []}}, "seed.the_tuva_project.terminology__gender": {"database": "devforrest", "schema": "terminology", "name": "terminology__gender", "resource_type": "seed", "package_name": "the_tuva_project", "path": "terminology\\terminology__gender.csv", "original_file_path": "seeds\\terminology\\terminology__gender.csv", "unique_id": "seed.the_tuva_project.terminology__gender", "fqn": ["the_tuva_project", "terminology", "terminology__gender"], "alias": "gender", "checksum": {"name": "sha256", "checksum": "643b3aba4aed1f3d91f07e343e90360ba91f3ac33994fe2fbe3c7681510cdcbb"}, "config": {"enabled": true, "alias": "gender", "schema": "terminology", "database": null, "tags": ["terminology", "data_profiling"], "meta": {}, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"description": "varchar"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#460d4f"}, "quote_columns": null, "post-hook": [], "pre-hook": []}, "tags": ["terminology", "data_profiling"], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#460d4f"}, "patch_path": "the_tuva_project://seeds\\terminology\\terminology_seeds.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "terminology", "alias": "gender", "tags": ["terminology", "data_profiling"], "column_types": {"description": "varchar"}, "docs": {"node_color": "#460d4f"}}, "created_at": 1702481697.4033003, "relation_name": "devforrest.terminology.gender", "raw_code": "", "root_path": "C:\\Users\\forre\\PycharmProjects\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": []}}, "seed.the_tuva_project.terminology__hcpcs_level_2": {"database": "devforrest", "schema": "terminology", "name": "terminology__hcpcs_level_2", "resource_type": "seed", "package_name": "the_tuva_project", "path": "terminology\\terminology__hcpcs_level_2.csv", "original_file_path": "seeds\\terminology\\terminology__hcpcs_level_2.csv", "unique_id": "seed.the_tuva_project.terminology__hcpcs_level_2", "fqn": ["the_tuva_project", "terminology", "terminology__hcpcs_level_2"], "alias": "hcpcs_level_2", "checksum": {"name": "path", "checksum": "seeds\\terminology\\terminology__hcpcs_level_2.csv"}, "config": {"enabled": true, "alias": "hcpcs_level_2", "schema": "terminology", "database": null, "tags": ["terminology"], "meta": {}, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"hcpcs": "varchar", "seqnum": "varchar", "recid": "varchar", "long_description": "varchar(2000)", "short_description": "varchar"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#460d4f"}, "quote_columns": null, "post-hook": [], "pre-hook": []}, "tags": ["terminology"], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#460d4f"}, "patch_path": "the_tuva_project://seeds\\terminology\\terminology_seeds.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "terminology", "alias": "hcpcs_level_2", "tags": "terminology", "column_types": {"hcpcs": "varchar", "seqnum": "varchar", "recid": "varchar", "long_description": "varchar(2000)", "short_description": "varchar"}, "docs": {"node_color": "#460d4f"}}, "created_at": 1702481697.4093003, "relation_name": "devforrest.terminology.hcpcs_level_2", "raw_code": "", "root_path": "C:\\Users\\forre\\PycharmProjects\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": []}}, "seed.the_tuva_project.terminology__icd_10_cm": {"database": "devforrest", "schema": "terminology", "name": "terminology__icd_10_cm", "resource_type": "seed", "package_name": "the_tuva_project", "path": "terminology\\terminology__icd_10_cm.csv", "original_file_path": "seeds\\terminology\\terminology__icd_10_cm.csv", "unique_id": "seed.the_tuva_project.terminology__icd_10_cm", "fqn": ["the_tuva_project", "terminology", "terminology__icd_10_cm"], "alias": "icd_10_cm", "checksum": {"name": "sha256", "checksum": "08903dd5b951cfdd2dc1e2d92406571ab08c2fa401c2f951a6190b38af1dbf61"}, "config": {"enabled": true, "alias": "icd_10_cm", "schema": "terminology", "database": null, "tags": ["terminology", "claims_preprocessing", "readmissions", "data_profiling"], "meta": {}, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"icd_10_cm": "varchar", "description": "varchar"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#460d4f"}, "quote_columns": null, "post-hook": [{"sql": "{{ load_seed('tuva-public-resources/terminology','icd_10_cm.csv',compression=true,null_marker=true) }}", "transaction": true, "index": null}], "pre-hook": []}, "tags": ["terminology", "claims_preprocessing", "readmissions", "data_profiling"], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#460d4f"}, "patch_path": "the_tuva_project://seeds\\terminology\\terminology_seeds.yml", "build_path": null, "deferred": false, "unrendered_config": {"post-hook": "{{ load_seed('tuva-public-resources/terminology','icd_10_cm.csv',compression=true,null_marker=true) }}", "schema": "terminology", "alias": "icd_10_cm", "tags": ["terminology", "claims_preprocessing", "readmissions", "data_profiling"], "column_types": {"icd_10_cm": "varchar", "description": "varchar"}, "docs": {"node_color": "#460d4f"}}, "created_at": 1702481697.4124472, "relation_name": "devforrest.terminology.icd_10_cm", "raw_code": "", "root_path": "C:\\Users\\forre\\PycharmProjects\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": ["macro.the_tuva_project.load_seed"]}}, "seed.the_tuva_project.terminology__icd_10_pcs": {"database": "devforrest", "schema": "terminology", "name": "terminology__icd_10_pcs", "resource_type": "seed", "package_name": "the_tuva_project", "path": "terminology\\terminology__icd_10_pcs.csv", "original_file_path": "seeds\\terminology\\terminology__icd_10_pcs.csv", "unique_id": "seed.the_tuva_project.terminology__icd_10_pcs", "fqn": ["the_tuva_project", "terminology", "terminology__icd_10_pcs"], "alias": "icd_10_pcs", "checksum": {"name": "sha256", "checksum": "f17eb0d946b77499e0fb9196e1993dc4e6212b8932f0b7bea054be5ba13ce50e"}, "config": {"enabled": true, "alias": "icd_10_pcs", "schema": "terminology", "database": null, "tags": ["terminology", "claims_preprocessing", "readmissions"], "meta": {}, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"icd_10_pcs": "varchar", "description": "varchar"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#460d4f"}, "quote_columns": null, "post-hook": [{"sql": "{{ load_seed('tuva-public-resources/terminology','icd_10_pcs.csv',compression=true,null_marker=true) }}", "transaction": true, "index": null}], "pre-hook": []}, "tags": ["terminology", "claims_preprocessing", "readmissions"], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#460d4f"}, "patch_path": "the_tuva_project://seeds\\terminology\\terminology_seeds.yml", "build_path": null, "deferred": false, "unrendered_config": {"post-hook": "{{ load_seed('tuva-public-resources/terminology','icd_10_pcs.csv',compression=true,null_marker=true) }}", "schema": "terminology", "alias": "icd_10_pcs", "tags": ["terminology", "claims_preprocessing", "readmissions"], "column_types": {"icd_10_pcs": "varchar", "description": "varchar"}, "docs": {"node_color": "#460d4f"}}, "created_at": 1702481697.4124472, "relation_name": "devforrest.terminology.icd_10_pcs", "raw_code": "", "root_path": "C:\\Users\\forre\\PycharmProjects\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": ["macro.the_tuva_project.load_seed"]}}, "seed.the_tuva_project.terminology__icd_9_cm": {"database": "devforrest", "schema": "terminology", "name": "terminology__icd_9_cm", "resource_type": "seed", "package_name": "the_tuva_project", "path": "terminology\\terminology__icd_9_cm.csv", "original_file_path": "seeds\\terminology\\terminology__icd_9_cm.csv", "unique_id": "seed.the_tuva_project.terminology__icd_9_cm", "fqn": ["the_tuva_project", "terminology", "terminology__icd_9_cm"], "alias": "icd_9_cm", "checksum": {"name": "path", "checksum": "seeds\\terminology\\terminology__icd_9_cm.csv"}, "config": {"enabled": true, "alias": "icd_9_cm", "schema": "terminology", "database": null, "tags": ["terminology", "claims_preprocessing", "readmissions", "data_profiling"], "meta": {}, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"icd_9_cm": "varchar", "long_description": "varchar", "short_description": "varchar"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#460d4f"}, "quote_columns": null, "post-hook": [], "pre-hook": []}, "tags": ["terminology", "claims_preprocessing", "readmissions", "data_profiling"], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#460d4f"}, "patch_path": "the_tuva_project://seeds\\terminology\\terminology_seeds.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "terminology", "alias": "icd_9_cm", "tags": ["terminology", "claims_preprocessing", "readmissions", "data_profiling"], "column_types": {"icd_9_cm": "varchar", "long_description": "varchar", "short_description": "varchar"}, "docs": {"node_color": "#460d4f"}}, "created_at": 1702481697.4280791, "relation_name": "devforrest.terminology.icd_9_cm", "raw_code": "", "root_path": "C:\\Users\\forre\\PycharmProjects\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": []}}, "seed.the_tuva_project.terminology__icd_9_pcs": {"database": "devforrest", "schema": "terminology", "name": "terminology__icd_9_pcs", "resource_type": "seed", "package_name": "the_tuva_project", "path": "terminology\\terminology__icd_9_pcs.csv", "original_file_path": "seeds\\terminology\\terminology__icd_9_pcs.csv", "unique_id": "seed.the_tuva_project.terminology__icd_9_pcs", "fqn": ["the_tuva_project", "terminology", "terminology__icd_9_pcs"], "alias": "icd_9_pcs", "checksum": {"name": "sha256", "checksum": "dc97df38ffbff5dddcd6e0160d41f76c3d29b7d740b583faaac1a5de86698fab"}, "config": {"enabled": true, "alias": "icd_9_pcs", "schema": "terminology", "database": null, "tags": ["terminology", "claims_preprocessing", "readmissions", "data_profiling"], "meta": {}, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"icd_9_pcs": "varchar", "long_description": "varchar", "short_description": "varchar"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#460d4f"}, "quote_columns": null, "post-hook": [], "pre-hook": []}, "tags": ["terminology", "claims_preprocessing", "readmissions", "data_profiling"], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#460d4f"}, "patch_path": "the_tuva_project://seeds\\terminology\\terminology_seeds.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "terminology", "alias": "icd_9_pcs", "tags": ["terminology", "claims_preprocessing", "readmissions", "data_profiling"], "column_types": {"icd_9_pcs": "varchar", "long_description": "varchar", "short_description": "varchar"}, "docs": {"node_color": "#460d4f"}}, "created_at": 1702481697.4280791, "relation_name": "devforrest.terminology.icd_9_pcs", "raw_code": "", "root_path": "C:\\Users\\forre\\PycharmProjects\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": []}}, "seed.the_tuva_project.terminology__loinc": {"database": "devforrest", "schema": "terminology", "name": "terminology__loinc", "resource_type": "seed", "package_name": "the_tuva_project", "path": "terminology\\terminology__loinc.csv", "original_file_path": "seeds\\terminology\\terminology__loinc.csv", "unique_id": "seed.the_tuva_project.terminology__loinc", "fqn": ["the_tuva_project", "terminology", "terminology__loinc"], "alias": "loinc", "checksum": {"name": "sha256", "checksum": "374101e8b4e4fd5038c5bcae0dca2e5fcf2992883068619e2cbadad7ea3a8e7b"}, "config": {"enabled": true, "alias": "loinc", "schema": "terminology", "database": null, "tags": ["terminology"], "meta": {}, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"loinc": "varchar", "short_name": "varchar", "long_common_name": "varchar", "component": "varchar", "property": "varchar", "time_aspect": "varchar", "system": "varchar", "scale_type": "varchar", "method_type": "varchar", "class_code": "varchar", "class_description": "varchar", "class_type_code": "varchar", "class_type_description": "varchar", "external_copyright_notice": "varchar(3000)", "status": "varchar", "version_first_released": "varchar", "version_last_changed": "varchar"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#460d4f"}, "quote_columns": null, "columns": [{"name": "loinc", "description": "The LOINC code"}, {"name": "short_name", "description": "If exists, the short human readable version of the LOINC description"}, {"name": "long_common_name", "description": "Clinician-friendly full loinc description"}, {"name": "component", "description": "The substance or entity being measured or observed. Also called the Analyte. The first of six loinc parts."}, {"name": "property", "description": "The characteristic or attribute of the analyte. The second of six loinc parts."}, {"name": "time_aspect", "description": "The interval of time over which an observation was made. The third of six loinc parts."}, {"name": "system", "description": "The thing upon which the observation was made. Also called specimen for laboratory tests. The fourth of six loinc parts."}, {"name": "scale_type", "description": "How the observation value is quantified or expressed (e.g. quantitative, ordinal, nominal, etc). The fifth of six loinc parts."}, {"name": "method_type", "description": "A high-level classification of how the observation was made. Optional; only needed when the technique affects the clinical interpretation of the results. The sixth of six loinc parts."}, {"name": "class_code", "description": "A code representing the general category of the loinc term"}, {"name": "class_description", "description": "The general category of the LOINC term"}, {"name": "class_type_code", "description": "A code representing the top level category for the test"}, {"name": "class_type_description", "description": "The top level category for the test; Laboratory, Clincal, Claims attachments, or Surveys"}, {"name": "external_copyright_notice", "description": "External copyright holders copyright notice for this LOINC code"}, {"name": "status", "description": "The status of the LOINC code concept. Active, Trial (experimental), Discouraged (not recommended), or Deprecated (should not be used)"}, {"name": "version_first_released", "description": "The first release version of LOINC that included this code"}, {"name": "version_last_changed", "description": "The last LOINC version in which this record was changed"}], "post-hook": [{"sql": "{{ load_seed('tuva-public-resources/terminology','loinc.csv',compression=true,null_marker=true) }}", "transaction": true, "index": null}], "pre-hook": []}, "tags": ["terminology"], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#460d4f"}, "patch_path": "the_tuva_project://seeds\\terminology\\terminology_seeds.yml", "build_path": null, "deferred": false, "unrendered_config": {"post-hook": "{{ load_seed('tuva-public-resources/terminology','loinc.csv',compression=true,null_marker=true) }}", "schema": "terminology", "alias": "loinc", "tags": ["terminology"], "columns": [{"name": "loinc", "description": "The LOINC code"}, {"name": "short_name", "description": "If exists, the short human readable version of the LOINC description"}, {"name": "long_common_name", "description": "Clinician-friendly full loinc description"}, {"name": "component", "description": "The substance or entity being measured or observed. Also called the Analyte. The first of six loinc parts."}, {"name": "property", "description": "The characteristic or attribute of the analyte. The second of six loinc parts."}, {"name": "time_aspect", "description": "The interval of time over which an observation was made. The third of six loinc parts."}, {"name": "system", "description": "The thing upon which the observation was made. Also called specimen for laboratory tests. The fourth of six loinc parts."}, {"name": "scale_type", "description": "How the observation value is quantified or expressed (e.g. quantitative, ordinal, nominal, etc). The fifth of six loinc parts."}, {"name": "method_type", "description": "A high-level classification of how the observation was made. Optional; only needed when the technique affects the clinical interpretation of the results. The sixth of six loinc parts."}, {"name": "class_code", "description": "A code representing the general category of the loinc term"}, {"name": "class_description", "description": "The general category of the LOINC term"}, {"name": "class_type_code", "description": "A code representing the top level category for the test"}, {"name": "class_type_description", "description": "The top level category for the test; Laboratory, Clincal, Claims attachments, or Surveys"}, {"name": "external_copyright_notice", "description": "External copyright holders copyright notice for this LOINC code"}, {"name": "status", "description": "The status of the LOINC code concept. Active, Trial (experimental), Discouraged (not recommended), or Deprecated (should not be used)"}, {"name": "version_first_released", "description": "The first release version of LOINC that included this code"}, {"name": "version_last_changed", "description": "The last LOINC version in which this record was changed"}], "column_types": {"loinc": "varchar", "short_name": "varchar", "long_common_name": "varchar", "component": "varchar", "property": "varchar", "time_aspect": "varchar", "system": "varchar", "scale_type": "varchar", "method_type": "varchar", "class_code": "varchar", "class_description": "varchar", "class_type_code": "varchar", "class_type_description": "varchar", "external_copyright_notice": "varchar(3000)", "status": "varchar", "version_first_released": "varchar", "version_last_changed": "varchar"}, "docs": {"node_color": "#460d4f"}}, "created_at": 1702481697.451717, "relation_name": "devforrest.terminology.loinc", "raw_code": "", "root_path": "C:\\Users\\forre\\PycharmProjects\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": ["macro.the_tuva_project.load_seed"]}}, "seed.the_tuva_project.terminology__loinc_deprecated_mapping": {"database": "devforrest", "schema": "terminology", "name": "terminology__loinc_deprecated_mapping", "resource_type": "seed", "package_name": "the_tuva_project", "path": "terminology\\terminology__loinc_deprecated_mapping.csv", "original_file_path": "seeds\\terminology\\terminology__loinc_deprecated_mapping.csv", "unique_id": "seed.the_tuva_project.terminology__loinc_deprecated_mapping", "fqn": ["the_tuva_project", "terminology", "terminology__loinc_deprecated_mapping"], "alias": "loinc_deprecated_mapping", "checksum": {"name": "sha256", "checksum": "eecd52c3944bc1abd373c557a286ee386438733c6daf2fbb844e86623f7af119"}, "config": {"enabled": true, "alias": "loinc_deprecated_mapping", "schema": "terminology", "database": null, "tags": ["terminology"], "meta": {}, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"loinc": "varchar", "map_to": "varchar", "comment": "varchar", "final_map_to": "varchar", "all_comments": "varchar", "depth": "varchar"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#460d4f"}, "quote_columns": null, "columns": [{"name": "loinc", "description": "The deprecated term to which the replacement term(s) apply."}, {"name": "map_to", "description": "A replacement term that is to be used in place of the deprecated or discouraged term."}, {"name": "comment", "description": "Narrative text that explains the rational for using the recommended replacement term."}, {"name": "final_map_to", "description": "If there are multiple steps of deprecated codes, this is the final (active) code"}, {"name": "all_comments", "description": "An aggregation of comments for any mapping steps between the deprecated code and the active code"}, {"name": "depth", "description": "How many steps this mapping is to the active code"}], "post-hook": [{"sql": "{{ load_seed('tuva-public-resources/terminology','loinc_deprecated_mapping.csv',compression=true,null_marker=true) }}", "transaction": true, "index": null}], "pre-hook": []}, "tags": ["terminology"], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#460d4f"}, "patch_path": "the_tuva_project://seeds\\terminology\\terminology_seeds.yml", "build_path": null, "deferred": false, "unrendered_config": {"post-hook": "{{ load_seed('tuva-public-resources/terminology','loinc_deprecated_mapping.csv',compression=true,null_marker=true) }}", "schema": "terminology", "alias": "loinc_deprecated_mapping", "tags": ["terminology"], "columns": [{"name": "loinc", "description": "The deprecated term to which the replacement term(s) apply."}, {"name": "map_to", "description": "A replacement term that is to be used in place of the deprecated or discouraged term."}, {"name": "comment", "description": "Narrative text that explains the rational for using the recommended replacement term."}, {"name": "final_map_to", "description": "If there are multiple steps of deprecated codes, this is the final (active) code"}, {"name": "all_comments", "description": "An aggregation of comments for any mapping steps between the deprecated code and the active code"}, {"name": "depth", "description": "How many steps this mapping is to the active code"}], "column_types": {"loinc": "varchar", "map_to": "varchar", "comment": "varchar", "final_map_to": "varchar", "all_comments": "varchar", "depth": "varchar"}, "docs": {"node_color": "#460d4f"}}, "created_at": 1702481697.4597263, "relation_name": "devforrest.terminology.loinc_deprecated_mapping", "raw_code": "", "root_path": "C:\\Users\\forre\\PycharmProjects\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": ["macro.the_tuva_project.load_seed"]}}, "seed.the_tuva_project.terminology__mdc": {"database": "devforrest", "schema": "terminology", "name": "terminology__mdc", "resource_type": "seed", "package_name": "the_tuva_project", "path": "terminology\\terminology__mdc.csv", "original_file_path": "seeds\\terminology\\terminology__mdc.csv", "unique_id": "seed.the_tuva_project.terminology__mdc", "fqn": ["the_tuva_project", "terminology", "terminology__mdc"], "alias": "mdc", "checksum": {"name": "sha256", "checksum": "478273d43b2a5da8f36fb12d6b89a8e64e90fb85a44b8c34e4f607b1bb78dfe5"}, "config": {"enabled": true, "alias": "mdc", "schema": "terminology", "database": null, "tags": ["terminology"], "meta": {}, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"mdc_code": "varchar", "mcd_description": "varchar"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#460d4f"}, "quote_columns": null, "post-hook": [], "pre-hook": []}, "tags": ["terminology"], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#460d4f"}, "patch_path": "the_tuva_project://seeds\\terminology\\terminology_seeds.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "terminology", "alias": "mdc", "tags": "terminology", "column_types": {"mdc_code": "varchar", "mcd_description": "varchar"}, "docs": {"node_color": "#460d4f"}}, "created_at": 1702481697.4597263, "relation_name": "devforrest.terminology.mdc", "raw_code": "", "root_path": "C:\\Users\\forre\\PycharmProjects\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": []}}, "seed.the_tuva_project.terminology__medicare_dual_eligibility": {"database": "devforrest", "schema": "terminology", "name": "terminology__medicare_dual_eligibility", "resource_type": "seed", "package_name": "the_tuva_project", "path": "terminology\\terminology__medicare_dual_eligibility.csv", "original_file_path": "seeds\\terminology\\terminology__medicare_dual_eligibility.csv", "unique_id": "seed.the_tuva_project.terminology__medicare_dual_eligibility", "fqn": ["the_tuva_project", "terminology", "terminology__medicare_dual_eligibility"], "alias": "medicare_dual_eligibility", "checksum": {"name": "sha256", "checksum": "0129d0377cfb0a7510cd8e0270f9f835a5ade1bca963479a86076cd1828de709"}, "config": {"enabled": true, "alias": "medicare_dual_eligibility", "schema": "terminology", "database": null, "tags": ["terminology", "claims_preprocessing", "data_profiling"], "meta": {}, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"dual_status_code": "varchar", "dual_status_description": "varchar"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#460d4f"}, "quote_columns": null, "post-hook": [], "pre-hook": []}, "tags": ["terminology", "claims_preprocessing", "data_profiling"], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#460d4f"}, "patch_path": "the_tuva_project://seeds\\terminology\\terminology_seeds.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "terminology", "alias": "medicare_dual_eligibility", "tags": ["terminology", "claims_preprocessing", "data_profiling"], "column_types": {"dual_status_code": "varchar", "dual_status_description": "varchar"}, "docs": {"node_color": "#460d4f"}}, "created_at": 1702481697.4753652, "relation_name": "devforrest.terminology.medicare_dual_eligibility", "raw_code": "", "root_path": "C:\\Users\\forre\\PycharmProjects\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": []}}, "seed.the_tuva_project.terminology__medicare_orec": {"database": "devforrest", "schema": "terminology", "name": "terminology__medicare_orec", "resource_type": "seed", "package_name": "the_tuva_project", "path": "terminology\\terminology__medicare_orec.csv", "original_file_path": "seeds\\terminology\\terminology__medicare_orec.csv", "unique_id": "seed.the_tuva_project.terminology__medicare_orec", "fqn": ["the_tuva_project", "terminology", "terminology__medicare_orec"], "alias": "medicare_orec", "checksum": {"name": "sha256", "checksum": "b069eab88cca54592bfe060210114a70028c6134e64333dbabdffea325b1dd45"}, "config": {"enabled": true, "alias": "medicare_orec", "schema": "terminology", "database": null, "tags": ["terminology", "claims_preprocessing", "data_profiling"], "meta": {}, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"original_reason_entitlement_code": "varchar", "original_reason_entitlement_description": "varchar"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#460d4f"}, "quote_columns": null, "post-hook": [], "pre-hook": []}, "tags": ["terminology", "claims_preprocessing", "data_profiling"], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#460d4f"}, "patch_path": "the_tuva_project://seeds\\terminology\\terminology_seeds.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "terminology", "alias": "medicare_orec", "tags": ["terminology", "claims_preprocessing", "data_profiling"], "column_types": {"original_reason_entitlement_code": "varchar", "original_reason_entitlement_description": "varchar"}, "docs": {"node_color": "#460d4f"}}, "created_at": 1702481697.4753652, "relation_name": "devforrest.terminology.medicare_orec", "raw_code": "", "root_path": "C:\\Users\\forre\\PycharmProjects\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": []}}, "seed.the_tuva_project.terminology__medicare_status": {"database": "devforrest", "schema": "terminology", "name": "terminology__medicare_status", "resource_type": "seed", "package_name": "the_tuva_project", "path": "terminology\\terminology__medicare_status.csv", "original_file_path": "seeds\\terminology\\terminology__medicare_status.csv", "unique_id": "seed.the_tuva_project.terminology__medicare_status", "fqn": ["the_tuva_project", "terminology", "terminology__medicare_status"], "alias": "medicare_status", "checksum": {"name": "sha256", "checksum": "a303d26035b0a620409823260cf237836aebda917c5f80706a4f84c6664ef151"}, "config": {"enabled": true, "alias": "medicare_status", "schema": "terminology", "database": null, "tags": ["terminology", "claims_preprocessing", "data_profiling"], "meta": {}, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"medicare_status_code": "varchar", "medicare_status_description": "varchar"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#460d4f"}, "quote_columns": null, "post-hook": [], "pre-hook": []}, "tags": ["terminology", "claims_preprocessing", "data_profiling"], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#460d4f"}, "patch_path": "the_tuva_project://seeds\\terminology\\terminology_seeds.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "terminology", "alias": "medicare_status", "tags": ["terminology", "claims_preprocessing", "data_profiling"], "column_types": {"medicare_status_code": "varchar", "medicare_status_description": "varchar"}, "docs": {"node_color": "#460d4f"}}, "created_at": 1702481697.491078, "relation_name": "devforrest.terminology.medicare_status", "raw_code": "", "root_path": "C:\\Users\\forre\\PycharmProjects\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": []}}, "seed.the_tuva_project.terminology__ms_drg": {"database": "devforrest", "schema": "terminology", "name": "terminology__ms_drg", "resource_type": "seed", "package_name": "the_tuva_project", "path": "terminology\\terminology__ms_drg.csv", "original_file_path": "seeds\\terminology\\terminology__ms_drg.csv", "unique_id": "seed.the_tuva_project.terminology__ms_drg", "fqn": ["the_tuva_project", "terminology", "terminology__ms_drg"], "alias": "ms_drg", "checksum": {"name": "sha256", "checksum": "e5b574ab858ae97a820046cf42c3068c45e25457ab3ddcbdbc7e22281a386941"}, "config": {"enabled": true, "alias": "ms_drg", "schema": "terminology", "database": null, "tags": ["terminology", "readmissions", "data_profiling", "claims_preprocessing"], "meta": {}, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"ms_drg_code": "varchar", "mdc_code": "varchar", "medical_surgical": "varchar", "ms_drg_description": "varchar", "deprecated": "integer", "deprecated_date": "date"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#460d4f"}, "quote_columns": null, "post-hook": [], "pre-hook": []}, "tags": ["terminology", "readmissions", "data_profiling", "claims_preprocessing"], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#460d4f"}, "patch_path": "the_tuva_project://seeds\\terminology\\terminology_seeds.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "terminology", "alias": "ms_drg", "tags": ["terminology", "readmissions", "data_profiling", "claims_preprocessing"], "column_types": {"ms_drg_code": "varchar", "mdc_code": "varchar", "medical_surgical": "varchar", "ms_drg_description": "varchar", "deprecated": "integer", "deprecated_date": "date"}, "docs": {"node_color": "#460d4f"}}, "created_at": 1702481697.491078, "relation_name": "devforrest.terminology.ms_drg", "raw_code": "", "root_path": "C:\\Users\\forre\\PycharmProjects\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": []}}, "seed.the_tuva_project.terminology__other_provider_taxonomy": {"database": "devforrest", "schema": "terminology", "name": "terminology__other_provider_taxonomy", "resource_type": "seed", "package_name": "the_tuva_project", "path": "terminology\\terminology__other_provider_taxonomy.csv", "original_file_path": "seeds\\terminology\\terminology__other_provider_taxonomy.csv", "unique_id": "seed.the_tuva_project.terminology__other_provider_taxonomy", "fqn": ["the_tuva_project", "terminology", "terminology__other_provider_taxonomy"], "alias": "other_provider_taxonomy", "checksum": {"name": "sha256", "checksum": "ea344ae188db60f0f75e52a39114af49b7828fe050d3f761db03d4d07039cccf"}, "config": {"enabled": true, "alias": "other_provider_taxonomy", "schema": "terminology", "database": null, "tags": ["terminology", "claims_preprocessing"], "meta": {}, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"npi": "varchar(35)", "taxonomy_code": "varchar(35)", "medicare_specialty_code": "varchar(173)", "description": "varchar(101)", "primary_flag": "integer"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#460d4f"}, "quote_columns": null, "post-hook": [{"sql": "{{ load_seed('tuva-public-resources/provider_data','other_provider_taxonomy.csv',compression=true,null_marker=true) }}", "transaction": true, "index": null}], "pre-hook": []}, "tags": ["terminology", "claims_preprocessing"], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#460d4f"}, "patch_path": "the_tuva_project://seeds\\terminology\\terminology_seeds.yml", "build_path": null, "deferred": false, "unrendered_config": {"post-hook": "{{ load_seed('tuva-public-resources/provider_data','other_provider_taxonomy.csv',compression=true,null_marker=true) }}", "schema": "terminology", "tags": ["terminology", "claims_preprocessing"], "alias": "other_provider_taxonomy", "column_types": {"npi": "varchar(35)", "taxonomy_code": "varchar(35)", "medicare_specialty_code": "varchar(173)", "description": "varchar(101)", "primary_flag": "integer"}, "docs": {"node_color": "#460d4f"}}, "created_at": 1702481697.506706, "relation_name": "devforrest.terminology.other_provider_taxonomy", "raw_code": "", "root_path": "C:\\Users\\forre\\PycharmProjects\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": ["macro.the_tuva_project.load_seed"]}}, "seed.the_tuva_project.terminology__payer_type": {"database": "devforrest", "schema": "terminology", "name": "terminology__payer_type", "resource_type": "seed", "package_name": "the_tuva_project", "path": "terminology\\terminology__payer_type.csv", "original_file_path": "seeds\\terminology\\terminology__payer_type.csv", "unique_id": "seed.the_tuva_project.terminology__payer_type", "fqn": ["the_tuva_project", "terminology", "terminology__payer_type"], "alias": "payer_type", "checksum": {"name": "sha256", "checksum": "84ad06d9900eba3d6ccf8e462df196e9d2499fe0cb08882eb5f67323dc8ba33a"}, "config": {"enabled": true, "alias": "payer_type", "schema": "terminology", "database": null, "tags": ["terminology", "data_profiling"], "meta": {}, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"payer_type": "varchar"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#460d4f"}, "quote_columns": null, "post-hook": [], "pre-hook": []}, "tags": ["terminology", "data_profiling"], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#460d4f"}, "patch_path": "the_tuva_project://seeds\\terminology\\terminology_seeds.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "terminology", "alias": "payer_type", "tags": ["terminology", "data_profiling"], "column_types": {"payer_type": "varchar"}, "docs": {"node_color": "#460d4f"}}, "created_at": 1702481697.506706, "relation_name": "devforrest.terminology.payer_type", "raw_code": "", "root_path": "C:\\Users\\forre\\PycharmProjects\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": []}}, "seed.the_tuva_project.terminology__place_of_service": {"database": "devforrest", "schema": "terminology", "name": "terminology__place_of_service", "resource_type": "seed", "package_name": "the_tuva_project", "path": "terminology\\terminology__place_of_service.csv", "original_file_path": "seeds\\terminology\\terminology__place_of_service.csv", "unique_id": "seed.the_tuva_project.terminology__place_of_service", "fqn": ["the_tuva_project", "terminology", "terminology__place_of_service"], "alias": "place_of_service", "checksum": {"name": "sha256", "checksum": "7ac7b69c217edab985ea2e1a59113093fe90fc6890af052d71b5a4cfd12ce180"}, "config": {"enabled": true, "alias": "place_of_service", "schema": "terminology", "database": null, "tags": ["terminology", "claims_preprocessing", "data_profiling"], "meta": {}, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"place_of_service_code": "varchar", "place_of_service_description": "varchar"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#460d4f"}, "quote_columns": null, "post-hook": [], "pre-hook": []}, "tags": ["terminology", "claims_preprocessing", "data_profiling"], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#460d4f"}, "patch_path": "the_tuva_project://seeds\\terminology\\terminology_seeds.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "terminology", "alias": "place_of_service", "tags": ["terminology", "claims_preprocessing", "data_profiling"], "column_types": {"place_of_service_code": "varchar", "place_of_service_description": "varchar"}, "docs": {"node_color": "#460d4f"}}, "created_at": 1702481697.506706, "relation_name": "devforrest.terminology.place_of_service", "raw_code": "", "root_path": "C:\\Users\\forre\\PycharmProjects\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": []}}, "seed.the_tuva_project.terminology__present_on_admission": {"database": "devforrest", "schema": "terminology", "name": "terminology__present_on_admission", "resource_type": "seed", "package_name": "the_tuva_project", "path": "terminology\\terminology__present_on_admission.csv", "original_file_path": "seeds\\terminology\\terminology__present_on_admission.csv", "unique_id": "seed.the_tuva_project.terminology__present_on_admission", "fqn": ["the_tuva_project", "terminology", "terminology__present_on_admission"], "alias": "present_on_admission", "checksum": {"name": "sha256", "checksum": "58c7c47c9822c23c7a0518bcef0d10794e5c29d0cf3d98f141e70fd7a73f480d"}, "config": {"enabled": true, "alias": "present_on_admission", "schema": "terminology", "database": null, "tags": ["terminology", "data_profiling", "claims_preprocessing"], "meta": {}, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"present_on_admit_code": "varchar", "description": "varchar"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#460d4f"}, "quote_columns": null, "post-hook": [], "pre-hook": []}, "tags": ["terminology", "data_profiling", "claims_preprocessing"], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#460d4f"}, "patch_path": "the_tuva_project://seeds\\terminology\\terminology_seeds.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "terminology", "alias": "present_on_admission", "tags": ["terminology", "data_profiling", "claims_preprocessing"], "column_types": {"present_on_admit_code": "varchar", "description": "varchar"}, "docs": {"node_color": "#460d4f"}}, "created_at": 1702481697.506706, "relation_name": "devforrest.terminology.present_on_admission", "raw_code": "", "root_path": "C:\\Users\\forre\\PycharmProjects\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": []}}, "seed.the_tuva_project.terminology__provider": {"database": "devforrest", "schema": "terminology", "name": "terminology__provider", "resource_type": "seed", "package_name": "the_tuva_project", "path": "terminology\\terminology__provider.csv", "original_file_path": "seeds\\terminology\\terminology__provider.csv", "unique_id": "seed.the_tuva_project.terminology__provider", "fqn": ["the_tuva_project", "terminology", "terminology__provider"], "alias": "provider", "checksum": {"name": "sha256", "checksum": "f88950a046cf237eda0f4b60cd8284961c4b9c59742960a8e63f7305fe89ed05"}, "config": {"enabled": true, "alias": "provider", "schema": "terminology", "database": null, "tags": ["terminology", "claims_preprocessing"], "meta": {}, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"npi": "varchar(35)", "entity_type_code": "varchar(26)", "entity_type_description": "varchar(37)", "primary_taxonomy_code": "varchar(35)", "primary_specialty_description": "varchar(173)", "provider_first_name": "varchar(95)", "provider_last_name": "varchar(95)", "provider_organization_name": "varchar(95)", "parent_organization_name": "varchar(95)", "practice_address_line_1": "varchar(80)", "practice_address_line_2": "varchar(80)", "practice_city": "varchar(65)", "practice_state": "varchar(65)", "practice_zip_code": "varchar(42)", "last_updated": "date", "deactivation_date": "date", "deactivation_flag": "varchar(80)"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#460d4f"}, "quote_columns": null, "post-hook": [{"sql": "{{ load_seed('tuva-public-resources/provider_data','provider.csv',compression=true,null_marker=true) }}", "transaction": true, "index": null}], "pre-hook": []}, "tags": ["terminology", "claims_preprocessing"], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#460d4f"}, "patch_path": "the_tuva_project://seeds\\terminology\\terminology_seeds.yml", "build_path": null, "deferred": false, "unrendered_config": {"post-hook": "{{ load_seed('tuva-public-resources/provider_data','provider.csv',compression=true,null_marker=true) }}", "schema": "terminology", "tags": ["terminology", "claims_preprocessing"], "alias": "provider", "column_types": {"npi": "varchar(35)", "entity_type_code": "varchar(26)", "entity_type_description": "varchar(37)", "primary_taxonomy_code": "varchar(35)", "primary_specialty_description": "varchar(173)", "provider_first_name": "varchar(95)", "provider_last_name": "varchar(95)", "provider_organization_name": "varchar(95)", "parent_organization_name": "varchar(95)", "practice_address_line_1": "varchar(80)", "practice_address_line_2": "varchar(80)", "practice_city": "varchar(65)", "practice_state": "varchar(65)", "practice_zip_code": "varchar(42)", "last_updated": "date", "deactivation_date": "date", "deactivation_flag": "varchar(80)"}, "docs": {"node_color": "#460d4f"}}, "created_at": 1702481697.537945, "relation_name": "devforrest.terminology.provider", "raw_code": "", "root_path": "C:\\Users\\forre\\PycharmProjects\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": ["macro.the_tuva_project.load_seed"]}}, "seed.the_tuva_project.terminology__race": {"database": "devforrest", "schema": "terminology", "name": "terminology__race", "resource_type": "seed", "package_name": "the_tuva_project", "path": "terminology\\terminology__race.csv", "original_file_path": "seeds\\terminology\\terminology__race.csv", "unique_id": "seed.the_tuva_project.terminology__race", "fqn": ["the_tuva_project", "terminology", "terminology__race"], "alias": "race", "checksum": {"name": "sha256", "checksum": "cd381b8fbf1fdedfdbb3f28f961c5eb763d3f4bb9088d4426c91f93f60e4dd34"}, "config": {"enabled": true, "alias": "race", "schema": "terminology", "database": null, "tags": ["terminology", "data_profiling"], "meta": {}, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"race_code": "varchar", "race_description": "varchar"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#460d4f"}, "quote_columns": null, "post-hook": [], "pre-hook": []}, "tags": ["terminology", "data_profiling"], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#460d4f"}, "patch_path": "the_tuva_project://seeds\\terminology\\terminology_seeds.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "terminology", "alias": "race", "tags": ["terminology", "data_profiling"], "column_types": {"race_code": "varchar", "race_description": "varchar"}, "docs": {"node_color": "#460d4f"}}, "created_at": 1702481697.54136, "relation_name": "devforrest.terminology.race", "raw_code": "", "root_path": "C:\\Users\\forre\\PycharmProjects\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": []}}, "seed.the_tuva_project.terminology__revenue_center": {"database": "devforrest", "schema": "terminology", "name": "terminology__revenue_center", "resource_type": "seed", "package_name": "the_tuva_project", "path": "terminology\\terminology__revenue_center.csv", "original_file_path": "seeds\\terminology\\terminology__revenue_center.csv", "unique_id": "seed.the_tuva_project.terminology__revenue_center", "fqn": ["the_tuva_project", "terminology", "terminology__revenue_center"], "alias": "revenue_center", "checksum": {"name": "sha256", "checksum": "3c650ef496d7ec010eec2543da454ad31dba96452753b48981252de68d72ba65"}, "config": {"enabled": true, "alias": "revenue_center", "schema": "terminology", "database": null, "tags": ["terminology", "claims_preprocessing", "data_profiling"], "meta": {}, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"revenue_center_code": "varchar", "revenue_center_description": "varchar"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#460d4f"}, "quote_columns": null, "post-hook": [], "pre-hook": []}, "tags": ["terminology", "claims_preprocessing", "data_profiling"], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#460d4f"}, "patch_path": "the_tuva_project://seeds\\terminology\\terminology_seeds.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "terminology", "alias": "revenue_center", "tags": ["terminology", "claims_preprocessing", "data_profiling"], "column_types": {"revenue_center_code": "varchar", "revenue_center_description": "varchar"}, "docs": {"node_color": "#460d4f"}}, "created_at": 1702481697.5464437, "relation_name": "devforrest.terminology.revenue_center", "raw_code": "", "root_path": "C:\\Users\\forre\\PycharmProjects\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": []}}, "seed.the_tuva_project.terminology__ssa_fips_state": {"database": "devforrest", "schema": "terminology", "name": "terminology__ssa_fips_state", "resource_type": "seed", "package_name": "the_tuva_project", "path": "terminology\\terminology__ssa_fips_state.csv", "original_file_path": "seeds\\terminology\\terminology__ssa_fips_state.csv", "unique_id": "seed.the_tuva_project.terminology__ssa_fips_state", "fqn": ["the_tuva_project", "terminology", "terminology__ssa_fips_state"], "alias": "ssa_fips_state", "checksum": {"name": "sha256", "checksum": "39debce4523ac23a14548c046752a7d7b70b7877f8bce5ec94a07de1a6788286"}, "config": {"enabled": true, "alias": "ssa_fips_state", "schema": "terminology", "database": null, "tags": ["terminology"], "meta": {}, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"ssa_fips_state_code": "varchar", "ssa_fips_state_name": "varchar"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#460d4f"}, "quote_columns": null, "post-hook": [], "pre-hook": []}, "tags": ["terminology"], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#460d4f"}, "patch_path": "the_tuva_project://seeds\\terminology\\terminology_seeds.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "terminology", "alias": "ssa_fips_state", "tags": "terminology", "column_types": {"ssa_fips_state_code": "varchar", "ssa_fips_state_name": "varchar"}, "docs": {"node_color": "#460d4f"}}, "created_at": 1702481697.4753652, "relation_name": "devforrest.terminology.ssa_fips_state", "raw_code": "", "root_path": "C:\\Users\\forre\\PycharmProjects\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": []}}, "seed.the_tuva_project.ccsr__dxccsr_v2023_1_body_systems": {"database": "devforrest", "schema": "ccsr", "name": "ccsr__dxccsr_v2023_1_body_systems", "resource_type": "seed", "package_name": "the_tuva_project", "path": "value_sets\\ccsr\\ccsr__dxccsr_v2023_1_body_systems.csv", "original_file_path": "seeds\\value_sets\\ccsr\\ccsr__dxccsr_v2023_1_body_systems.csv", "unique_id": "seed.the_tuva_project.ccsr__dxccsr_v2023_1_body_systems", "fqn": ["the_tuva_project", "value_sets", "ccsr", "ccsr__dxccsr_v2023_1_body_systems"], "alias": "_value_set_dxccsr_v2023_1_body_systems", "checksum": {"name": "sha256", "checksum": "dd8b64d00c38d7a99174fa8d2b6b82f2eae2b039e7ef0cd00da36d3233d6b326"}, "config": {"enabled": true, "alias": "_value_set_dxccsr_v2023_1_body_systems", "schema": "ccsr", "database": null, "tags": ["ccsr"], "meta": {}, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "quote_columns": null, "post-hook": [], "pre-hook": []}, "tags": ["ccsr"], "description": "A table containing descriptions of the top level categories used in the CCSR condition mapper.\nThis was manually exctracted from the User Guide PDF included with the DXCCSR SAS program.\n", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://seeds\\value_sets\\ccsr\\ccsr_seeds.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "ccsr", "alias": "_value_set_dxccsr_v2023_1_body_systems", "tags": ["ccsr"], "enabled": true}, "created_at": 1702481697.572298, "relation_name": "devforrest.ccsr._value_set_dxccsr_v2023_1_body_systems", "raw_code": "", "root_path": "C:\\Users\\forre\\PycharmProjects\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": []}}, "seed.the_tuva_project.ccsr__dxccsr_v2023_1_cleaned_map": {"database": "devforrest", "schema": "ccsr", "name": "ccsr__dxccsr_v2023_1_cleaned_map", "resource_type": "seed", "package_name": "the_tuva_project", "path": "value_sets\\ccsr\\ccsr__dxccsr_v2023_1_cleaned_map.csv", "original_file_path": "seeds\\value_sets\\ccsr\\ccsr__dxccsr_v2023_1_cleaned_map.csv", "unique_id": "seed.the_tuva_project.ccsr__dxccsr_v2023_1_cleaned_map", "fqn": ["the_tuva_project", "value_sets", "ccsr", "ccsr__dxccsr_v2023_1_cleaned_map"], "alias": "_value_set_dxccsr_v2023_1_cleaned_map", "checksum": {"name": "sha256", "checksum": "cce1c4661615e89299e601fb26d3e3060b140864507858e5d0e8b61ea9b70c12"}, "config": {"enabled": true, "alias": "_value_set_dxccsr_v2023_1_cleaned_map", "schema": "ccsr", "database": null, "tags": ["ccsr"], "meta": {}, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"icd_10_cm_code": "varchar", "icd_10_cm_code_description": "varchar", "default_ccsr_category_ip": "varchar", "default_ccsr_category_description_ip": "varchar", "default_ccsr_category_op": "varchar", "default_ccsr_category_description_op": "varchar", "ccsr_category_1": "varchar", "ccsr_category_1_description": "varchar", "ccsr_category_2": "varchar", "ccsr_category_2_description": "varchar", "ccsr_category_3": "varchar", "ccsr_category_3_description": "varchar", "ccsr_category_4": "varchar", "ccsr_category_4_description": "varchar", "ccsr_category_5": "varchar", "ccsr_category_5_description": "varchar", "ccsr_category_6": "varchar", "ccsr_category_6_description": "varchar"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "quote_columns": null, "post-hook": [{"sql": "{{ load_seed('tuva-public-resources/value-sets','dxccsr_v2023_1_cleaned_map.csv',compression=true,null_marker=true) }}", "transaction": true, "index": null}], "pre-hook": []}, "tags": ["ccsr"], "description": "A table containing the CSV mapping file included with the DXCCSR SAS program. The original CSV was not natively seedable, and the file was transformed with the coded included in the README. For each ICD-10-CM code, the table contains up to six CCSR category codes and a default CCSR category code.", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://seeds\\value_sets\\ccsr\\ccsr_seeds.yml", "build_path": null, "deferred": false, "unrendered_config": {"post-hook": "{{ load_seed('tuva-public-resources/value-sets','dxccsr_v2023_1_cleaned_map.csv',compression=true,null_marker=true) }}", "schema": "ccsr", "alias": "_value_set_dxccsr_v2023_1_cleaned_map", "tags": ["ccsr"], "enabled": true, "column_types": {"icd_10_cm_code": "varchar", "icd_10_cm_code_description": "varchar", "default_ccsr_category_ip": "varchar", "default_ccsr_category_description_ip": "varchar", "default_ccsr_category_op": "varchar", "default_ccsr_category_description_op": "varchar", "ccsr_category_1": "varchar", "ccsr_category_1_description": "varchar", "ccsr_category_2": "varchar", "ccsr_category_2_description": "varchar", "ccsr_category_3": "varchar", "ccsr_category_3_description": "varchar", "ccsr_category_4": "varchar", "ccsr_category_4_description": "varchar", "ccsr_category_5": "varchar", "ccsr_category_5_description": "varchar", "ccsr_category_6": "varchar", "ccsr_category_6_description": "varchar"}}, "created_at": 1702481697.5692823, "relation_name": "devforrest.ccsr._value_set_dxccsr_v2023_1_cleaned_map", "raw_code": "", "root_path": "C:\\Users\\forre\\PycharmProjects\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": ["macro.the_tuva_project.load_seed"]}}, "seed.the_tuva_project.ccsr__prccsr_v2023_1_cleaned_map": {"database": "devforrest", "schema": "ccsr", "name": "ccsr__prccsr_v2023_1_cleaned_map", "resource_type": "seed", "package_name": "the_tuva_project", "path": "value_sets\\ccsr\\ccsr__prccsr_v2023_1_cleaned_map.csv", "original_file_path": "seeds\\value_sets\\ccsr\\ccsr__prccsr_v2023_1_cleaned_map.csv", "unique_id": "seed.the_tuva_project.ccsr__prccsr_v2023_1_cleaned_map", "fqn": ["the_tuva_project", "value_sets", "ccsr", "ccsr__prccsr_v2023_1_cleaned_map"], "alias": "_value_set_prccsr_v2023_1_cleaned_map", "checksum": {"name": "sha256", "checksum": "e26501963b41e323fcebadca74e051da890db7c264e0c0bbdc906862bc600a84"}, "config": {"enabled": true, "alias": "_value_set_prccsr_v2023_1_cleaned_map", "schema": "ccsr", "database": null, "tags": ["ccsr"], "meta": {}, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"icd_10_pcs": "varchar", "icd_10_pcs_description": "varchar", "prccsr": "varchar", "prccsr_description": "varchar", "clinical_domain": "varchar"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "quote_columns": null, "post-hook": [{"sql": "{{ load_seed('tuva-public-resources/value-sets','prccsr_v2023_1_cleaned_map.csv',compression=true,null_marker=true) }}", "transaction": true, "index": null}], "pre-hook": []}, "tags": ["ccsr"], "description": "A table containing the CSV mapping file included with the PRCCSR SAS program. The original CSV was not natively seedable, and the file was transformed with the coded included in the README.", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://seeds\\value_sets\\ccsr\\ccsr_seeds.yml", "build_path": null, "deferred": false, "unrendered_config": {"post-hook": "{{ load_seed('tuva-public-resources/value-sets','prccsr_v2023_1_cleaned_map.csv',compression=true,null_marker=true) }}", "schema": "ccsr", "alias": "_value_set_prccsr_v2023_1_cleaned_map", "tags": ["ccsr"], "enabled": true, "column_types": {"icd_10_pcs": "varchar", "icd_10_pcs_description": "varchar", "prccsr": "varchar", "prccsr_description": "varchar", "clinical_domain": "varchar"}}, "created_at": 1702481697.572298, "relation_name": "devforrest.ccsr._value_set_prccsr_v2023_1_cleaned_map", "raw_code": "", "root_path": "C:\\Users\\forre\\PycharmProjects\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": ["macro.the_tuva_project.load_seed"]}}, "seed.the_tuva_project.chronic_conditions__cms_chronic_conditions_hierarchy": {"database": "devforrest", "schema": "chronic_conditions", "name": "chronic_conditions__cms_chronic_conditions_hierarchy", "resource_type": "seed", "package_name": "the_tuva_project", "path": "value_sets\\chronic_conditions\\chronic_conditions__cms_chronic_conditions_hierarchy.csv", "original_file_path": "seeds\\value_sets\\chronic_conditions\\chronic_conditions__cms_chronic_conditions_hierarchy.csv", "unique_id": "seed.the_tuva_project.chronic_conditions__cms_chronic_conditions_hierarchy", "fqn": ["the_tuva_project", "value_sets", "chronic_conditions", "chronic_conditions__cms_chronic_conditions_hierarchy"], "alias": "_value_set_cms_chronic_conditions_hierarchy", "checksum": {"name": "path", "checksum": "seeds\\value_sets\\chronic_conditions\\chronic_conditions__cms_chronic_conditions_hierarchy.csv"}, "config": {"enabled": true, "alias": "_value_set_cms_chronic_conditions_hierarchy", "schema": "chronic_conditions", "database": null, "tags": ["cms_chronic_conditions", "chronic_conditions"], "meta": {}, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#804912"}, "quote_columns": null, "post-hook": [], "pre-hook": []}, "tags": ["cms_chronic_conditions", "chronic_conditions"], "description": "CMS generated grouping of ICD 10 codes into chronic conditions groups", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#804912"}, "patch_path": "the_tuva_project://seeds\\value_sets\\chronic_conditions\\cms_chronic_conditions_seeds.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "chronic_conditions", "alias": "_value_set_cms_chronic_conditions_hierarchy", "tags": ["cms_chronic_conditions", "chronic_conditions"], "enabled": true, "docs": {"node_color": "#804912"}}, "created_at": 1702481697.572298, "relation_name": "devforrest.chronic_conditions._value_set_cms_chronic_conditions_hierarchy", "raw_code": "", "root_path": "C:\\Users\\forre\\PycharmProjects\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": []}}, "seed.the_tuva_project.chronic_conditions__tuva_chronic_conditions_hierarchy": {"database": "devforrest", "schema": "chronic_conditions", "name": "chronic_conditions__tuva_chronic_conditions_hierarchy", "resource_type": "seed", "package_name": "the_tuva_project", "path": "value_sets\\chronic_conditions\\chronic_conditions__tuva_chronic_conditions_hierarchy.csv", "original_file_path": "seeds\\value_sets\\chronic_conditions\\chronic_conditions__tuva_chronic_conditions_hierarchy.csv", "unique_id": "seed.the_tuva_project.chronic_conditions__tuva_chronic_conditions_hierarchy", "fqn": ["the_tuva_project", "value_sets", "chronic_conditions", "chronic_conditions__tuva_chronic_conditions_hierarchy"], "alias": "_value_set_tuva_chronic_conditions_hierarchy", "checksum": {"name": "sha256", "checksum": "15ce75a34050c084ac8f8cfa265f100db069114a3dd0f9a55c8db01150733453"}, "config": {"enabled": true, "alias": "_value_set_tuva_chronic_conditions_hierarchy", "schema": "chronic_conditions", "database": null, "tags": ["tuva_chronic_conditions", "chronic_conditions"], "meta": {}, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#804912"}, "quote_columns": null, "post-hook": [], "pre-hook": []}, "tags": ["tuva_chronic_conditions", "chronic_conditions"], "description": "A list of the diagnoses codes and their long and short names along with grouping logic classifying each code into a condition group and a condition family group.", "columns": {"condition_family": {"name": "condition_family", "description": "A higher level rollup grouping of conditions from the condition column", "meta": {}, "data_type": null, "quote": null, "tags": []}, "condition": {"name": "condition", "description": "The name of the condition that each diagnosis code rolls up into", "meta": {}, "data_type": null, "quote": null, "tags": []}, "icd_10_cm_code": {"name": "icd_10_cm_code", "description": "The icd10 code", "meta": {}, "data_type": null, "quote": null, "tags": []}, "icd_10_cm_description": {"name": "icd_10_cm_description", "description": "The description for the icd10 code", "meta": {}, "data_type": null, "quote": null, "tags": []}, "condition_column_name": {"name": "condition_column_name", "description": "The name of the column as it will appear in chronic_conditions_wide", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": "#804912"}, "patch_path": "the_tuva_project://seeds\\value_sets\\chronic_conditions\\tuva_chronic_conditions_seeds.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "chronic_conditions", "alias": "_value_set_tuva_chronic_conditions_hierarchy", "tags": ["tuva_chronic_conditions", "chronic_conditions"], "enabled": true, "docs": {"node_color": "#804912"}}, "created_at": 1702481697.588038, "relation_name": "devforrest.chronic_conditions._value_set_tuva_chronic_conditions_hierarchy", "raw_code": "", "root_path": "C:\\Users\\forre\\PycharmProjects\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": []}}, "seed.the_tuva_project.cms_hcc__adjustment_rates": {"database": "devforrest", "schema": "cms_hcc", "name": "cms_hcc__adjustment_rates", "resource_type": "seed", "package_name": "the_tuva_project", "path": "value_sets\\cms_hcc\\cms_hcc__adjustment_rates.csv", "original_file_path": "seeds\\value_sets\\cms_hcc\\cms_hcc__adjustment_rates.csv", "unique_id": "seed.the_tuva_project.cms_hcc__adjustment_rates", "fqn": ["the_tuva_project", "value_sets", "cms_hcc", "cms_hcc__adjustment_rates"], "alias": "_value_set_adjustment_rates", "checksum": {"name": "sha256", "checksum": "8cb085133b926383e2030fd987d3023588b57a90f8b8e87a20e6a289ca58f0ac"}, "config": {"enabled": true, "alias": "_value_set_adjustment_rates", "schema": "cms_hcc", "database": null, "tags": ["cms_hcc"], "meta": {}, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"coefficient": "float"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "quote_columns": null, "post-hook": [], "pre-hook": []}, "tags": ["cms_hcc"], "description": "Adjustment rates by payment year. Extracted from rate announcement documents on cms.gov.\n", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://seeds\\value_sets\\cms_hcc\\cms_hcc_seeds.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "cms_hcc", "alias": "_value_set_adjustment_rates", "tags": "cms_hcc", "enabled": true, "column_types": {"coefficient": "float"}}, "created_at": 1702481697.588038, "relation_name": "devforrest.cms_hcc._value_set_adjustment_rates", "raw_code": "", "root_path": "C:\\Users\\forre\\PycharmProjects\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": []}}, "seed.the_tuva_project.cms_hcc__cpt_hcpcs": {"database": "devforrest", "schema": "cms_hcc", "name": "cms_hcc__cpt_hcpcs", "resource_type": "seed", "package_name": "the_tuva_project", "path": "value_sets\\cms_hcc\\cms_hcc__cpt_hcpcs.csv", "original_file_path": "seeds\\value_sets\\cms_hcc\\cms_hcc__cpt_hcpcs.csv", "unique_id": "seed.the_tuva_project.cms_hcc__cpt_hcpcs", "fqn": ["the_tuva_project", "value_sets", "cms_hcc", "cms_hcc__cpt_hcpcs"], "alias": "_value_set_cpt_hcpcs", "checksum": {"name": "sha256", "checksum": "4734b5b9047622e7d95f6b220e392afb8b80d53aa9b8be52785d050cd2adb835"}, "config": {"enabled": true, "alias": "_value_set_cpt_hcpcs", "schema": "cms_hcc", "database": null, "tags": ["cms_hcc"], "meta": {}, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"payment_year": "integer", "hcpcs_cpt_code": "varchar", "included_flag": "varchar"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "quote_columns": null, "post-hook": [], "pre-hook": []}, "tags": ["cms_hcc"], "description": "CPT/HCPCS encounter filtering included list by payment year. Combined and cleaned version of code files on cms.gov.\n", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://seeds\\value_sets\\cms_hcc\\cms_hcc_seeds.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "cms_hcc", "alias": "_value_set_cpt_hcpcs", "tags": "cms_hcc", "enabled": true, "column_types": {"payment_year": "integer", "hcpcs_cpt_code": "varchar", "included_flag": "varchar"}}, "created_at": 1702481697.588038, "relation_name": "devforrest.cms_hcc._value_set_cpt_hcpcs", "raw_code": "", "root_path": "C:\\Users\\forre\\PycharmProjects\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": []}}, "seed.the_tuva_project.cms_hcc__demographic_factors": {"database": "devforrest", "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": "e4e14ffe8d1c4d85f55f542ced5e188728a38713311bfa7d19a40e7793bd8072"}, "config": {"enabled": true, "alias": "_value_set_demographic_factors", "schema": "cms_hcc", "database": null, "tags": ["cms_hcc"], "meta": {}, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"coefficient": "float"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "quote_columns": null, "post-hook": [], "pre-hook": []}, "tags": ["cms_hcc"], "description": "Demographic factors by model version and risk segment. Extracted from rate announcement documents on cms.gov.\n", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://seeds\\value_sets\\cms_hcc\\cms_hcc_seeds.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "cms_hcc", "alias": "_value_set_demographic_factors", "tags": "cms_hcc", "enabled": true, "column_types": {"coefficient": "float"}}, "created_at": 1702481697.588038, "relation_name": "devforrest.cms_hcc._value_set_demographic_factors", "raw_code": "", "root_path": "C:\\Users\\forre\\PycharmProjects\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": []}}, "seed.the_tuva_project.cms_hcc__disabled_interaction_factors": {"database": "devforrest", "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": "bbf3c0d9a088205198ccf41383f186e6f740561d8403a282d82279f969e7b548"}, "config": {"enabled": true, "alias": "_value_set_disabled_interaction_factors", "schema": "cms_hcc", "database": null, "tags": ["cms_hcc"], "meta": {}, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"hcc_code": "varchar", "coefficient": "float"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "quote_columns": null, "post-hook": [], "pre-hook": []}, "tags": ["cms_hcc"], "description": "Disease and disabled interaction factors by model version and risk segment. Extracted from rate announcement documents on cms.gov.\n", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://seeds\\value_sets\\cms_hcc\\cms_hcc_seeds.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "cms_hcc", "alias": "_value_set_disabled_interaction_factors", "tags": "cms_hcc", "enabled": true, "column_types": {"hcc_code": "varchar", "coefficient": "float"}}, "created_at": 1702481697.6036682, "relation_name": "devforrest.cms_hcc._value_set_disabled_interaction_factors", "raw_code": "", "root_path": "C:\\Users\\forre\\PycharmProjects\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": []}}, "seed.the_tuva_project.cms_hcc__disease_factors": {"database": "devforrest", "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": "edc9e656681e48ea92d8e784a7e59b11d99136ee2f805bca99b86245b2fffce0"}, "config": {"enabled": true, "alias": "_value_set_disease_factors", "schema": "cms_hcc", "database": null, "tags": ["cms_hcc"], "meta": {}, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"hcc_code": "varchar", "coefficient": "float"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "quote_columns": null, "post-hook": [], "pre-hook": []}, "tags": ["cms_hcc"], "description": "Disease factors by model version and risk segment. Extracted from rate announcement documents on cms.gov.\n", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://seeds\\value_sets\\cms_hcc\\cms_hcc_seeds.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "cms_hcc", "alias": "_value_set_disease_factors", "tags": "cms_hcc", "enabled": true, "column_types": {"hcc_code": "varchar", "coefficient": "float"}}, "created_at": 1702481697.6036682, "relation_name": "devforrest.cms_hcc._value_set_disease_factors", "raw_code": "", "root_path": "C:\\Users\\forre\\PycharmProjects\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": []}}, "seed.the_tuva_project.cms_hcc__disease_hierarchy": {"database": "devforrest", "schema": "cms_hcc", "name": "cms_hcc__disease_hierarchy", "resource_type": "seed", "package_name": "the_tuva_project", "path": "value_sets\\cms_hcc\\cms_hcc__disease_hierarchy.csv", "original_file_path": "seeds\\value_sets\\cms_hcc\\cms_hcc__disease_hierarchy.csv", "unique_id": "seed.the_tuva_project.cms_hcc__disease_hierarchy", "fqn": ["the_tuva_project", "value_sets", "cms_hcc", "cms_hcc__disease_hierarchy"], "alias": "_value_set_disease_hierarchy", "checksum": {"name": "sha256", "checksum": "0c8832760b5a65fcd7dbb31550cc6ade98bfd4293427911cb13ac7960c541734"}, "config": {"enabled": true, "alias": "_value_set_disease_hierarchy", "schema": "cms_hcc", "database": null, "tags": ["cms_hcc"], "meta": {}, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"hcc_code": "varchar", "hccs_to_exclude": "varchar"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "quote_columns": null, "post-hook": [], "pre-hook": []}, "tags": ["cms_hcc"], "description": "Disease hierarchies by model version. Extracted from rate announcement documents on cms.gov.\n", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://seeds\\value_sets\\cms_hcc\\cms_hcc_seeds.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "cms_hcc", "alias": "_value_set_disease_hierarchy", "tags": "cms_hcc", "enabled": true, "column_types": {"hcc_code": "varchar", "hccs_to_exclude": "varchar"}}, "created_at": 1702481697.6036682, "relation_name": "devforrest.cms_hcc._value_set_disease_hierarchy", "raw_code": "", "root_path": "C:\\Users\\forre\\PycharmProjects\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": []}}, "seed.the_tuva_project.cms_hcc__disease_interaction_factors": {"database": "devforrest", "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": "fed1f5cb993f7d4ed0c6510975091ad36d5f9d58a01b2c5c063d4098e63b6262"}, "config": {"enabled": true, "alias": "_value_set_disease_interaction_factors", "schema": "cms_hcc", "database": null, "tags": ["cms_hcc"], "meta": {}, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"hcc_code_1": "varchar", "hcc_code_2": "varchar", "coefficient": "float"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "quote_columns": null, "post-hook": [], "pre-hook": []}, "tags": ["cms_hcc"], "description": "Disease interaction factors by model version and risk segment. Extracted from rate announcement documents on cms.gov.\n", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://seeds\\value_sets\\cms_hcc\\cms_hcc_seeds.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "cms_hcc", "alias": "_value_set_disease_interaction_factors", "tags": "cms_hcc", "enabled": true, "column_types": {"hcc_code_1": "varchar", "hcc_code_2": "varchar", "coefficient": "float"}}, "created_at": 1702481697.619286, "relation_name": "devforrest.cms_hcc._value_set_disease_interaction_factors", "raw_code": "", "root_path": "C:\\Users\\forre\\PycharmProjects\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": []}}, "seed.the_tuva_project.cms_hcc__enrollment_interaction_factors": {"database": "devforrest", "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": "4215452bccba012300b13dbf919ce1095b54b31ddcb0d799ff64761ad33730fd"}, "config": {"enabled": true, "alias": "_value_set_enrollment_interaction_factors", "schema": "cms_hcc", "database": null, "tags": ["cms_hcc"], "meta": {}, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"coefficient": "float"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "quote_columns": null, "post-hook": [], "pre-hook": []}, "tags": ["cms_hcc"], "description": "Enrollment interaction factors by model version and risk segment. Extracted from rate announcement documents on cms.gov.\n", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://seeds\\value_sets\\cms_hcc\\cms_hcc_seeds.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "cms_hcc", "alias": "_value_set_enrollment_interaction_factors", "tags": "cms_hcc", "enabled": true, "column_types": {"coefficient": "float"}}, "created_at": 1702481697.619286, "relation_name": "devforrest.cms_hcc._value_set_enrollment_interaction_factors", "raw_code": "", "root_path": "C:\\Users\\forre\\PycharmProjects\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": []}}, "seed.the_tuva_project.cms_hcc__icd_10_cm_mappings": {"database": "devforrest", "schema": "cms_hcc", "name": "cms_hcc__icd_10_cm_mappings", "resource_type": "seed", "package_name": "the_tuva_project", "path": "value_sets\\cms_hcc\\cms_hcc__icd_10_cm_mappings.csv", "original_file_path": "seeds\\value_sets\\cms_hcc\\cms_hcc__icd_10_cm_mappings.csv", "unique_id": "seed.the_tuva_project.cms_hcc__icd_10_cm_mappings", "fqn": ["the_tuva_project", "value_sets", "cms_hcc", "cms_hcc__icd_10_cm_mappings"], "alias": "_value_set_icd_10_cm_mappings", "checksum": {"name": "path", "checksum": "seeds\\value_sets\\cms_hcc\\cms_hcc__icd_10_cm_mappings.csv"}, "config": {"enabled": true, "alias": "_value_set_icd_10_cm_mappings", "schema": "cms_hcc", "database": null, "tags": ["cms_hcc"], "meta": {}, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"payment_year": "integer", "diagnosis_code": "varchar", "cms_hcc_v24": "varchar", "cms_hcc_v24_flag": "varchar"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "quote_columns": null, "post-hook": [], "pre-hook": []}, "tags": ["cms_hcc"], "description": "ICD-10 to HCC mapping by payment year and model version. Combined and cleaned version of code files on cms.gov.\n", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://seeds\\value_sets\\cms_hcc\\cms_hcc_seeds.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "cms_hcc", "alias": "_value_set_icd_10_cm_mappings", "tags": "cms_hcc", "enabled": true, "column_types": {"payment_year": "integer", "diagnosis_code": "varchar", "cms_hcc_v24": "varchar", "cms_hcc_v24_flag": "varchar"}}, "created_at": 1702481697.619286, "relation_name": "devforrest.cms_hcc._value_set_icd_10_cm_mappings", "raw_code": "", "root_path": "C:\\Users\\forre\\PycharmProjects\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": []}}, "seed.the_tuva_project.cms_hcc__payment_hcc_count_factors": {"database": "devforrest", "schema": "cms_hcc", "name": "cms_hcc__payment_hcc_count_factors", "resource_type": "seed", "package_name": "the_tuva_project", "path": "value_sets\\cms_hcc\\cms_hcc__payment_hcc_count_factors.csv", "original_file_path": "seeds\\value_sets\\cms_hcc\\cms_hcc__payment_hcc_count_factors.csv", "unique_id": "seed.the_tuva_project.cms_hcc__payment_hcc_count_factors", "fqn": ["the_tuva_project", "value_sets", "cms_hcc", "cms_hcc__payment_hcc_count_factors"], "alias": "_value_set_payment_hcc_count_factors", "checksum": {"name": "sha256", "checksum": "37d33e7a0bb8ad97f5bd24132f2e8a5af2deb11b1ce0acf07bc1bab822ecd98c"}, "config": {"enabled": true, "alias": "_value_set_payment_hcc_count_factors", "schema": "cms_hcc", "database": null, "tags": ["cms_hcc"], "meta": {}, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"coefficient": "float"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "quote_columns": null, "post-hook": [], "pre-hook": []}, "tags": ["cms_hcc"], "description": "Payment HCC count factors by model version and risk segment. Extracted from rate announcement documents on cms.gov.\n", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://seeds\\value_sets\\cms_hcc\\cms_hcc_seeds.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "cms_hcc", "alias": "_value_set_payment_hcc_count_factors", "tags": "cms_hcc", "enabled": true, "column_types": {"coefficient": "float"}}, "created_at": 1702481697.619286, "relation_name": "devforrest.cms_hcc._value_set_payment_hcc_count_factors", "raw_code": "", "root_path": "C:\\Users\\forre\\PycharmProjects\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": []}}, "seed.the_tuva_project.data_profiling__test_catalog": {"database": "devforrest", "schema": "claims_preprocessing", "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": "claims_preprocessing", "database": null, "tags": ["data_profiling", "claims_preprocessing"], "meta": {}, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"source_table": "varchar", "test_category": "varchar", "test_name": "varchar", "medical_claim_type": "varchar"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#141161"}, "quote_columns": null, "post-hook": [], "pre-hook": []}, "tags": ["data_profiling", "claims_preprocessing"], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#141161"}, "patch_path": "the_tuva_project://seeds\\value_sets\\data_profiling\\data_profiling__seeds.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_value_set_test_catalog", "tags": ["data_profiling", "claims_preprocessing"], "enabled": true, "column_types": {"source_table": "varchar", "test_category": "varchar", "test_name": "varchar", "medical_claim_type": "varchar"}, "docs": {"node_color": "#141161"}}, "created_at": 1702481697.6406498, "relation_name": "devforrest.claims_preprocessing._value_set_test_catalog", "raw_code": "", "root_path": "C:\\Users\\forre\\PycharmProjects\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": []}}, "seed.the_tuva_project.ed_classification__categories": {"database": "devforrest", "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": "990c64805aee2366f6a4e2d3bb1af132c3fa53eece9ccd24994e169345516168"}, "config": {"enabled": true, "alias": "_value_set_categories", "schema": "ed_classification", "database": null, "tags": ["ed_classification"], "meta": {}, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "quote_columns": null, "post-hook": [], "pre-hook": []}, "tags": ["ed_classification"], "description": "A mapping of ED Classifications to human readable names", "columns": {"classification": {"name": "classification", "description": "code for classification", "meta": {}, "data_type": null, "quote": null, "tags": []}, "classification_name": {"name": "classification_name", "description": "human readable name for classification", "meta": {}, "data_type": null, "quote": null, "tags": []}, "classification_order": {"name": "classification_order", "description": "Sortable column that organizes the ED classes", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "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": 1702481697.6456687, "relation_name": "devforrest.ed_classification._value_set_categories", "raw_code": "", "root_path": "C:\\Users\\forre\\PycharmProjects\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": []}}, "seed.the_tuva_project.ed_classification__icd_10_cm_to_ccs": {"database": "devforrest", "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": "2179b7310d7d12968dab5eed9efabf25e3a272c2e444e772e6c225b520c24236"}, "config": {"enabled": true, "alias": "_value_set_icd_10_cm_to_ccs", "schema": "ed_classification", "database": null, "tags": ["ed_classification"], "meta": {}, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"icd_10_cm": "varchar", "description": "varchar", "ccs_diagnosis_category": "varchar", "ccs_description": "varchar"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "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": ["ed_classification"], "description": "", "columns": {}, "meta": {}, "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": {"post-hook": "{{ load_seed('tuva-public-resources/value-sets','icd_10_cm_to_ccs.csv',compression=true,null_marker=true) }}", "schema": "ed_classification", "alias": "_value_set_icd_10_cm_to_ccs", "tags": "ed_classification", "column_types": {"icd_10_cm": "varchar", "description": "varchar", "ccs_diagnosis_category": "varchar", "ccs_description": "varchar"}, "enabled": true}, "created_at": 1702481697.6544156, "relation_name": "devforrest.ed_classification._value_set_icd_10_cm_to_ccs", "raw_code": "", "root_path": "C:\\Users\\forre\\PycharmProjects\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": ["macro.the_tuva_project.load_seed"]}}, "seed.the_tuva_project.ed_classification__johnston_icd10": {"database": "devforrest", "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": {}, "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}, "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, "quote": null, "tags": []}, "edcnnpa": {"name": "edcnnpa", "description": "", "meta": {}, "data_type": null, "quote": null, "tags": []}, "edcnpa": {"name": "edcnpa", "description": "", "meta": {}, "data_type": null, "quote": null, "tags": []}, "epct": {"name": "epct", "description": "", "meta": {}, "data_type": null, "quote": null, "tags": []}, "noner": {"name": "noner", "description": "", "meta": {}, "data_type": null, "quote": null, "tags": []}, "injury": {"name": "injury", "description": "", "meta": {}, "data_type": null, "quote": null, "tags": []}, "psych": {"name": "psych", "description": "", "meta": {}, "data_type": null, "quote": null, "tags": []}, "alcohol": {"name": "alcohol", "description": "", "meta": {}, "data_type": null, "quote": null, "tags": []}, "drug": {"name": "drug", "description": "", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "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": 1702481697.6685033, "relation_name": "devforrest.ed_classification._value_set_johnston_icd10", "raw_code": "", "root_path": "C:\\Users\\forre\\PycharmProjects\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": []}}, "seed.the_tuva_project.ed_classification__johnston_icd9": {"database": "devforrest", "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": "69cc9d56165415a17be6f34a2cb4bd7c16268ae47f5245467c86b8419728fa46"}, "config": {"enabled": true, "alias": "_value_set_johnston_icd9", "schema": "ed_classification", "database": null, "tags": ["ed_classification"], "meta": {}, "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}, "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, "quote": null, "tags": []}, "edcnnpa": {"name": "edcnnpa", "description": "", "meta": {}, "data_type": null, "quote": null, "tags": []}, "edcnpa": {"name": "edcnpa", "description": "", "meta": {}, "data_type": null, "quote": null, "tags": []}, "epct": {"name": "epct", "description": "", "meta": {}, "data_type": null, "quote": null, "tags": []}, "noner": {"name": "noner", "description": "", "meta": {}, "data_type": null, "quote": null, "tags": []}, "injury": {"name": "injury", "description": "", "meta": {}, "data_type": null, "quote": null, "tags": []}, "psych": {"name": "psych", "description": "", "meta": {}, "data_type": null, "quote": null, "tags": []}, "alcohol": {"name": "alcohol", "description": "", "meta": {}, "data_type": null, "quote": null, "tags": []}, "drug": {"name": "drug", "description": "", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "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": 1702481697.661509, "relation_name": "devforrest.ed_classification._value_set_johnston_icd9", "raw_code": "", "root_path": "C:\\Users\\forre\\PycharmProjects\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": []}}, "seed.the_tuva_project.quality_measures__concepts": {"database": "devforrest", "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": "b389a30f9c9084ca613274172b3131f37778b238630a3eb4a550c8cf0ce00085"}, "config": {"enabled": true, "alias": "_value_set_concepts", "schema": "quality_measures", "database": null, "tags": ["quality_measures"], "meta": {}, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "quote_columns": null, "post-hook": [], "pre-hook": []}, "tags": ["quality_measures"], "description": "Measures to concepts crosswalk. List of concepts used in each reporting measure.", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://seeds\\value_sets\\quality_measures\\quality_measures_seeds.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "quality_measures", "alias": "_value_set_concepts", "tags": "quality_measures", "enabled": true}, "created_at": 1702481697.6815035, "relation_name": "devforrest.quality_measures._value_set_concepts", "raw_code": "", "root_path": "C:\\Users\\forre\\PycharmProjects\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": []}}, "seed.the_tuva_project.quality_measures__measures": {"database": "devforrest", "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": "b60778ef98697d7e25ff6638447d1cb5fd23c93a6d392b4881d2e80efdadad41"}, "config": {"enabled": true, "alias": "_value_set_measures", "schema": "quality_measures", "database": null, "tags": ["quality_measures"], "meta": {}, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "quote_columns": null, "post-hook": [], "pre-hook": []}, "tags": ["quality_measures"], "description": "Overview of reporting measures.", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://seeds\\value_sets\\quality_measures\\quality_measures_seeds.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "quality_measures", "alias": "_value_set_measures", "tags": "quality_measures", "enabled": true}, "created_at": 1702481697.6775715, "relation_name": "devforrest.quality_measures._value_set_measures", "raw_code": "", "root_path": "C:\\Users\\forre\\PycharmProjects\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": []}}, "seed.the_tuva_project.quality_measures__value_sets": {"database": "devforrest", "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": "3d46a19f9d1e4e4cdc74634971bc03e1161a6b1bca88c0bd2f1429fbdbe5da51"}, "config": {"enabled": true, "alias": "_value_set_codes", "schema": "quality_measures", "database": null, "tags": ["quality_measures"], "meta": {}, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"code": "varchar"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "quote_columns": null, "post-hook": [], "pre-hook": []}, "tags": ["quality_measures"], "description": "Concepts to value sets crosswalk. List of codes in each concept.", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://seeds\\value_sets\\quality_measures\\quality_measures_seeds.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "quality_measures", "alias": "_value_set_codes", "tags": "quality_measures", "enabled": true, "column_types": {"code": "varchar"}}, "created_at": 1702481697.685501, "relation_name": "devforrest.quality_measures._value_set_codes", "raw_code": "", "root_path": "C:\\Users\\forre\\PycharmProjects\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": []}}, "seed.the_tuva_project.readmissions__acute_diagnosis_ccs": {"database": "devforrest", "schema": "readmissions", "name": "readmissions__acute_diagnosis_ccs", "resource_type": "seed", "package_name": "the_tuva_project", "path": "value_sets\\readmissions\\readmissions__acute_diagnosis_ccs.csv", "original_file_path": "seeds\\value_sets\\readmissions\\readmissions__acute_diagnosis_ccs.csv", "unique_id": "seed.the_tuva_project.readmissions__acute_diagnosis_ccs", "fqn": ["the_tuva_project", "value_sets", "readmissions", "readmissions__acute_diagnosis_ccs"], "alias": "_value_set_acute_diagnosis_ccs", "checksum": {"name": "sha256", "checksum": "25a6477a528bc5ca29fd8153e9ed5e2d57e51ea0083d9d7b4ee288094b53ddfc"}, "config": {"enabled": true, "alias": "_value_set_acute_diagnosis_ccs", "schema": "readmissions", "database": null, "tags": ["readmissions"], "meta": {}, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"ccs_diagnosis_category": "varchar", "description": "varchar"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#161a7d"}, "quote_columns": null, "post-hook": [], "pre-hook": []}, "tags": ["readmissions"], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#161a7d"}, "patch_path": "the_tuva_project://seeds\\value_sets\\readmissions\\readmissions_seeds.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "readmissions", "alias": "_value_set_acute_diagnosis_ccs", "tags": "readmissions", "column_types": {"ccs_diagnosis_category": "varchar", "description": "varchar"}, "enabled": true, "docs": {"node_color": "#161a7d"}}, "created_at": 1702481697.6904294, "relation_name": "devforrest.readmissions._value_set_acute_diagnosis_ccs", "raw_code": "", "root_path": "C:\\Users\\forre\\PycharmProjects\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": []}}, "seed.the_tuva_project.readmissions__acute_diagnosis_icd_10_cm": {"database": "devforrest", "schema": "readmissions", "name": "readmissions__acute_diagnosis_icd_10_cm", "resource_type": "seed", "package_name": "the_tuva_project", "path": "value_sets\\readmissions\\readmissions__acute_diagnosis_icd_10_cm.csv", "original_file_path": "seeds\\value_sets\\readmissions\\readmissions__acute_diagnosis_icd_10_cm.csv", "unique_id": "seed.the_tuva_project.readmissions__acute_diagnosis_icd_10_cm", "fqn": ["the_tuva_project", "value_sets", "readmissions", "readmissions__acute_diagnosis_icd_10_cm"], "alias": "_value_set_acute_diagnosis_icd_10_cm", "checksum": {"name": "path", "checksum": "seeds\\value_sets\\readmissions\\readmissions__acute_diagnosis_icd_10_cm.csv"}, "config": {"enabled": true, "alias": "_value_set_acute_diagnosis_icd_10_cm", "schema": "readmissions", "database": null, "tags": ["readmissions"], "meta": {}, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"icd_10_cm": "varchar", "description": "varchar"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#161a7d"}, "quote_columns": null, "post-hook": [], "pre-hook": []}, "tags": ["readmissions"], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#161a7d"}, "patch_path": "the_tuva_project://seeds\\value_sets\\readmissions\\readmissions_seeds.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "readmissions", "alias": "_value_set_acute_diagnosis_icd_10_cm", "tags": "readmissions", "column_types": {"icd_10_cm": "varchar", "description": "varchar"}, "enabled": true, "docs": {"node_color": "#161a7d"}}, "created_at": 1702481697.695431, "relation_name": "devforrest.readmissions._value_set_acute_diagnosis_icd_10_cm", "raw_code": "", "root_path": "C:\\Users\\forre\\PycharmProjects\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": []}}, "seed.the_tuva_project.readmissions__always_planned_ccs_diagnosis_category": {"database": "devforrest", "schema": "readmissions", "name": "readmissions__always_planned_ccs_diagnosis_category", "resource_type": "seed", "package_name": "the_tuva_project", "path": "value_sets\\readmissions\\readmissions__always_planned_ccs_diagnosis_category.csv", "original_file_path": "seeds\\value_sets\\readmissions\\readmissions__always_planned_ccs_diagnosis_category.csv", "unique_id": "seed.the_tuva_project.readmissions__always_planned_ccs_diagnosis_category", "fqn": ["the_tuva_project", "value_sets", "readmissions", "readmissions__always_planned_ccs_diagnosis_category"], "alias": "_value_set_always_planned_ccs_diagnosis_category", "checksum": {"name": "sha256", "checksum": "dae8093b0f00521519e1b68d90c82a63057d563a32bbd432372ee21757332298"}, "config": {"enabled": true, "alias": "_value_set_always_planned_ccs_diagnosis_category", "schema": "readmissions", "database": null, "tags": ["readmissions"], "meta": {}, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"ccs_diagnosis_category": "varchar", "description": "varchar"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#161a7d"}, "quote_columns": null, "post-hook": [], "pre-hook": []}, "tags": ["readmissions"], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#161a7d"}, "patch_path": "the_tuva_project://seeds\\value_sets\\readmissions\\readmissions_seeds.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "readmissions", "alias": "_value_set_always_planned_ccs_diagnosis_category", "tags": "readmissions", "column_types": {"ccs_diagnosis_category": "varchar", "description": "varchar"}, "enabled": true, "docs": {"node_color": "#161a7d"}}, "created_at": 1702481697.6994467, "relation_name": "devforrest.readmissions._value_set_always_planned_ccs_diagnosis_category", "raw_code": "", "root_path": "C:\\Users\\forre\\PycharmProjects\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": []}}, "seed.the_tuva_project.readmissions__always_planned_ccs_procedure_category": {"database": "devforrest", "schema": "readmissions", "name": "readmissions__always_planned_ccs_procedure_category", "resource_type": "seed", "package_name": "the_tuva_project", "path": "value_sets\\readmissions\\readmissions__always_planned_ccs_procedure_category.csv", "original_file_path": "seeds\\value_sets\\readmissions\\readmissions__always_planned_ccs_procedure_category.csv", "unique_id": "seed.the_tuva_project.readmissions__always_planned_ccs_procedure_category", "fqn": ["the_tuva_project", "value_sets", "readmissions", "readmissions__always_planned_ccs_procedure_category"], "alias": "_value_set_always_planned_ccs_procedure_category", "checksum": {"name": "sha256", "checksum": "d4489c038d0c6f13f3d555b5341190a9cc1f517bd3f8e6be1dd2a9798c1be68f"}, "config": {"enabled": true, "alias": "_value_set_always_planned_ccs_procedure_category", "schema": "readmissions", "database": null, "tags": ["readmissions"], "meta": {}, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"ccs_procedure_category": "varchar", "description": "varchar"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#161a7d"}, "quote_columns": null, "post-hook": [], "pre-hook": []}, "tags": ["readmissions"], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#161a7d"}, "patch_path": "the_tuva_project://seeds\\value_sets\\readmissions\\readmissions_seeds.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "readmissions", "alias": "_value_set_always_planned_ccs_procedure_category", "tags": "readmissions", "column_types": {"ccs_procedure_category": "varchar", "description": "varchar"}, "enabled": true, "docs": {"node_color": "#161a7d"}}, "created_at": 1702481697.7044144, "relation_name": "devforrest.readmissions._value_set_always_planned_ccs_procedure_category", "raw_code": "", "root_path": "C:\\Users\\forre\\PycharmProjects\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": []}}, "seed.the_tuva_project.readmissions__exclusion_ccs_diagnosis_category": {"database": "devforrest", "schema": "readmissions", "name": "readmissions__exclusion_ccs_diagnosis_category", "resource_type": "seed", "package_name": "the_tuva_project", "path": "value_sets\\readmissions\\readmissions__exclusion_ccs_diagnosis_category.csv", "original_file_path": "seeds\\value_sets\\readmissions\\readmissions__exclusion_ccs_diagnosis_category.csv", "unique_id": "seed.the_tuva_project.readmissions__exclusion_ccs_diagnosis_category", "fqn": ["the_tuva_project", "value_sets", "readmissions", "readmissions__exclusion_ccs_diagnosis_category"], "alias": "_value_set_exclusion_ccs_diagnosis_category", "checksum": {"name": "sha256", "checksum": "3ae458aa6c04a94f0a242e2a95300ff1a7836b6b195c484c446d5d1d91006e42"}, "config": {"enabled": true, "alias": "_value_set_exclusion_ccs_diagnosis_category", "schema": "readmissions", "database": null, "tags": ["readmissions"], "meta": {}, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"ccs_diagnosis_category": "varchar", "description": "varchar", "exclusion_category": "varchar"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#161a7d"}, "quote_columns": null, "post-hook": [], "pre-hook": []}, "tags": ["readmissions"], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#161a7d"}, "patch_path": "the_tuva_project://seeds\\value_sets\\readmissions\\readmissions_seeds.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "readmissions", "alias": "_value_set_exclusion_ccs_diagnosis_category", "tags": "readmissions", "column_types": {"ccs_diagnosis_category": "varchar", "description": "varchar", "exclusion_category": "varchar"}, "enabled": true, "docs": {"node_color": "#161a7d"}}, "created_at": 1702481697.705598, "relation_name": "devforrest.readmissions._value_set_exclusion_ccs_diagnosis_category", "raw_code": "", "root_path": "C:\\Users\\forre\\PycharmProjects\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": []}}, "seed.the_tuva_project.readmissions__icd_10_cm_to_ccs": {"database": "devforrest", "schema": "readmissions", "name": "readmissions__icd_10_cm_to_ccs", "resource_type": "seed", "package_name": "the_tuva_project", "path": "value_sets\\readmissions\\readmissions__icd_10_cm_to_ccs.csv", "original_file_path": "seeds\\value_sets\\readmissions\\readmissions__icd_10_cm_to_ccs.csv", "unique_id": "seed.the_tuva_project.readmissions__icd_10_cm_to_ccs", "fqn": ["the_tuva_project", "value_sets", "readmissions", "readmissions__icd_10_cm_to_ccs"], "alias": "_value_set_icd_10_cm_to_ccs", "checksum": {"name": "sha256", "checksum": "2179b7310d7d12968dab5eed9efabf25e3a272c2e444e772e6c225b520c24236"}, "config": {"enabled": true, "alias": "_value_set_icd_10_cm_to_ccs", "schema": "readmissions", "database": null, "tags": ["readmissions"], "meta": {}, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"icd_10_cm": "varchar", "description": "varchar", "ccs_diagnosis_category": "varchar", "ccs_description": "varchar"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#161a7d"}, "quote_columns": null, "post-hook": [{"sql": "{{ load_seed('tuva-public-resources/value-sets','icd_10_cm_to_ccs.csv',compression=true,null_marker=true) }}", "transaction": true, "index": null}], "pre-hook": []}, "tags": ["readmissions"], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#161a7d"}, "patch_path": "the_tuva_project://seeds\\value_sets\\readmissions\\readmissions_seeds.yml", "build_path": null, "deferred": false, "unrendered_config": {"post-hook": "{{ load_seed('tuva-public-resources/value-sets','icd_10_cm_to_ccs.csv',compression=true,null_marker=true) }}", "schema": "readmissions", "alias": "_value_set_icd_10_cm_to_ccs", "tags": "readmissions", "column_types": {"icd_10_cm": "varchar", "description": "varchar", "ccs_diagnosis_category": "varchar", "ccs_description": "varchar"}, "enabled": true, "docs": {"node_color": "#161a7d"}}, "created_at": 1702481697.705598, "relation_name": "devforrest.readmissions._value_set_icd_10_cm_to_ccs", "raw_code": "", "root_path": "C:\\Users\\forre\\PycharmProjects\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": ["macro.the_tuva_project.load_seed"]}}, "seed.the_tuva_project.readmissions__icd_10_pcs_to_ccs": {"database": "devforrest", "schema": "readmissions", "name": "readmissions__icd_10_pcs_to_ccs", "resource_type": "seed", "package_name": "the_tuva_project", "path": "value_sets\\readmissions\\readmissions__icd_10_pcs_to_ccs.csv", "original_file_path": "seeds\\value_sets\\readmissions\\readmissions__icd_10_pcs_to_ccs.csv", "unique_id": "seed.the_tuva_project.readmissions__icd_10_pcs_to_ccs", "fqn": ["the_tuva_project", "value_sets", "readmissions", "readmissions__icd_10_pcs_to_ccs"], "alias": "_value_set_icd_10_pcs_to_ccs", "checksum": {"name": "sha256", "checksum": "b152259e1a13057a37cf15ae765f61c7c9559340b5469fa93909ad910929fd0e"}, "config": {"enabled": true, "alias": "_value_set_icd_10_pcs_to_ccs", "schema": "readmissions", "database": null, "tags": ["readmissions"], "meta": {}, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"icd_10_pcs": "varchar", "description": "varchar", "ccs_procedure_category": "varchar", "ccs_description": "varchar"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#161a7d"}, "quote_columns": null, "post-hook": [{"sql": "{{ load_seed('tuva-public-resources/value-sets','icd_10_pcs_to_ccs.csv',compression=true,null_marker=true) }}", "transaction": true, "index": null}], "pre-hook": []}, "tags": ["readmissions"], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#161a7d"}, "patch_path": "the_tuva_project://seeds\\value_sets\\readmissions\\readmissions_seeds.yml", "build_path": null, "deferred": false, "unrendered_config": {"post-hook": "{{ load_seed('tuva-public-resources/value-sets','icd_10_pcs_to_ccs.csv',compression=true,null_marker=true) }}", "schema": "readmissions", "alias": "_value_set_icd_10_pcs_to_ccs", "tags": "readmissions", "column_types": {"icd_10_pcs": "varchar", "description": "varchar", "ccs_procedure_category": "varchar", "ccs_description": "varchar"}, "enabled": true, "docs": {"node_color": "#161a7d"}}, "created_at": 1702481697.721312, "relation_name": "devforrest.readmissions._value_set_icd_10_pcs_to_ccs", "raw_code": "", "root_path": "C:\\Users\\forre\\PycharmProjects\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": ["macro.the_tuva_project.load_seed"]}}, "seed.the_tuva_project.readmissions__potentially_planned_ccs_procedure_category": {"database": "devforrest", "schema": "readmissions", "name": "readmissions__potentially_planned_ccs_procedure_category", "resource_type": "seed", "package_name": "the_tuva_project", "path": "value_sets\\readmissions\\readmissions__potentially_planned_ccs_procedure_category.csv", "original_file_path": "seeds\\value_sets\\readmissions\\readmissions__potentially_planned_ccs_procedure_category.csv", "unique_id": "seed.the_tuva_project.readmissions__potentially_planned_ccs_procedure_category", "fqn": ["the_tuva_project", "value_sets", "readmissions", "readmissions__potentially_planned_ccs_procedure_category"], "alias": "_value_set_potentially_planned_ccs_procedure_category", "checksum": {"name": "sha256", "checksum": "05ebf37f0e71131e482e21ca079a59dbefe226bb90bec20ff623947ff29e63fe"}, "config": {"enabled": true, "alias": "_value_set_potentially_planned_ccs_procedure_category", "schema": "readmissions", "database": null, "tags": ["readmissions"], "meta": {}, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"ccs_procedure_category": "varchar", "description": "varchar"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#161a7d"}, "quote_columns": null, "post-hook": [], "pre-hook": []}, "tags": ["readmissions"], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#161a7d"}, "patch_path": "the_tuva_project://seeds\\value_sets\\readmissions\\readmissions_seeds.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "readmissions", "alias": "_value_set_potentially_planned_ccs_procedure_category", "tags": "readmissions", "column_types": {"ccs_procedure_category": "varchar", "description": "varchar"}, "enabled": true, "docs": {"node_color": "#161a7d"}}, "created_at": 1702481697.721312, "relation_name": "devforrest.readmissions._value_set_potentially_planned_ccs_procedure_category", "raw_code": "", "root_path": "C:\\Users\\forre\\PycharmProjects\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": []}}, "seed.the_tuva_project.readmissions__potentially_planned_icd_10_pcs": {"database": "devforrest", "schema": "readmissions", "name": "readmissions__potentially_planned_icd_10_pcs", "resource_type": "seed", "package_name": "the_tuva_project", "path": "value_sets\\readmissions\\readmissions__potentially_planned_icd_10_pcs.csv", "original_file_path": "seeds\\value_sets\\readmissions\\readmissions__potentially_planned_icd_10_pcs.csv", "unique_id": "seed.the_tuva_project.readmissions__potentially_planned_icd_10_pcs", "fqn": ["the_tuva_project", "value_sets", "readmissions", "readmissions__potentially_planned_icd_10_pcs"], "alias": "_value_set_potentially_planned_icd_10_pcs", "checksum": {"name": "sha256", "checksum": "43261c6967146c62f4d8e9a98b6a00e136601da9027728dd2feba3dad3222ddd"}, "config": {"enabled": true, "alias": "_value_set_potentially_planned_icd_10_pcs", "schema": "readmissions", "database": null, "tags": ["readmissions"], "meta": {}, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"icd_10_pcs": "varchar", "description": "varchar"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#161a7d"}, "quote_columns": null, "post-hook": [], "pre-hook": []}, "tags": ["readmissions"], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#161a7d"}, "patch_path": "the_tuva_project://seeds\\value_sets\\readmissions\\readmissions_seeds.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "readmissions", "alias": "_value_set_potentially_planned_icd_10_pcs", "tags": "readmissions", "column_types": {"icd_10_pcs": "varchar", "description": "varchar"}, "enabled": true, "docs": {"node_color": "#161a7d"}}, "created_at": 1702481697.7368593, "relation_name": "devforrest.readmissions._value_set_potentially_planned_icd_10_pcs", "raw_code": "", "root_path": "C:\\Users\\forre\\PycharmProjects\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": []}}, "seed.the_tuva_project.readmissions__specialty_cohort": {"database": "devforrest", "schema": "readmissions", "name": "readmissions__specialty_cohort", "resource_type": "seed", "package_name": "the_tuva_project", "path": "value_sets\\readmissions\\readmissions__specialty_cohort.csv", "original_file_path": "seeds\\value_sets\\readmissions\\readmissions__specialty_cohort.csv", "unique_id": "seed.the_tuva_project.readmissions__specialty_cohort", "fqn": ["the_tuva_project", "value_sets", "readmissions", "readmissions__specialty_cohort"], "alias": "_value_set_specialty_cohort", "checksum": {"name": "sha256", "checksum": "22f4176d10237dcdd38294fc1e02cf0f17e8b9af193b91309b23949304f78608"}, "config": {"enabled": true, "alias": "_value_set_specialty_cohort", "schema": "readmissions", "database": null, "tags": ["readmissions"], "meta": {}, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"ccs": "varchar", "description": "varchar", "specialty_cohort": "varchar", "procedure_or_diagnosis": "varchar"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#161a7d"}, "quote_columns": null, "post-hook": [], "pre-hook": []}, "tags": ["readmissions"], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#161a7d"}, "patch_path": "the_tuva_project://seeds\\value_sets\\readmissions\\readmissions_seeds.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "readmissions", "alias": "_value_set_specialty_cohort", "tags": "readmissions", "column_types": {"ccs": "varchar", "description": "varchar", "specialty_cohort": "varchar", "procedure_or_diagnosis": "varchar"}, "enabled": true, "docs": {"node_color": "#161a7d"}}, "created_at": 1702481697.7368593, "relation_name": "devforrest.readmissions._value_set_specialty_cohort", "raw_code": "", "root_path": "C:\\Users\\forre\\PycharmProjects\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": []}}, "seed.the_tuva_project.readmissions__surgery_gynecology_cohort": {"database": "devforrest", "schema": "readmissions", "name": "readmissions__surgery_gynecology_cohort", "resource_type": "seed", "package_name": "the_tuva_project", "path": "value_sets\\readmissions\\readmissions__surgery_gynecology_cohort.csv", "original_file_path": "seeds\\value_sets\\readmissions\\readmissions__surgery_gynecology_cohort.csv", "unique_id": "seed.the_tuva_project.readmissions__surgery_gynecology_cohort", "fqn": ["the_tuva_project", "value_sets", "readmissions", "readmissions__surgery_gynecology_cohort"], "alias": "_value_set_surgery_gynecology_cohort", "checksum": {"name": "sha256", "checksum": "b897008e5e7dc4d4f2c62272fb8ecaed11cbe56203c8eb8bf5e1c11b40a16d77"}, "config": {"enabled": true, "alias": "_value_set_surgery_gynecology_cohort", "schema": "readmissions", "database": null, "tags": ["readmissions"], "meta": {}, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {"icd_10_pcs": "varchar", "description": "varchar", "ccs_code_and_description": "varchar", "specialty_cohort": "varchar"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#161a7d"}, "quote_columns": null, "post-hook": [], "pre-hook": []}, "tags": ["readmissions"], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": "#161a7d"}, "patch_path": "the_tuva_project://seeds\\value_sets\\readmissions\\readmissions_seeds.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "readmissions", "alias": "_value_set_surgery_gynecology_cohort", "tags": "readmissions", "column_types": {"icd_10_pcs": "varchar", "description": "varchar", "ccs_code_and_description": "varchar", "specialty_cohort": "varchar"}, "enabled": true, "docs": {"node_color": "#161a7d"}}, "created_at": 1702481697.7368593, "relation_name": "devforrest.readmissions._value_set_surgery_gynecology_cohort", "raw_code": "", "root_path": "C:\\Users\\forre\\PycharmProjects\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": []}}, "seed.the_tuva_project.service_category__service_categories": {"database": "devforrest", "schema": "claims_preprocessing", "name": "service_category__service_categories", "resource_type": "seed", "package_name": "the_tuva_project", "path": "value_sets\\service_categories\\service_category__service_categories.csv", "original_file_path": "seeds\\value_sets\\service_categories\\service_category__service_categories.csv", "unique_id": "seed.the_tuva_project.service_category__service_categories", "fqn": ["the_tuva_project", "value_sets", "service_categories", "service_category__service_categories"], "alias": "_value_set_service_categories", "checksum": {"name": "sha256", "checksum": "2af0fe00d26862e0401ebc814585359c65d298f36bdb6dbe14a4e700219da627"}, "config": {"enabled": true, "alias": "_value_set_service_categories", "schema": "claims_preprocessing", "database": null, "tags": ["service_category", "claims_preprocessing"], "meta": {}, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "quote_columns": null, "post-hook": [], "pre-hook": []}, "tags": ["service_category", "claims_preprocessing"], "description": "List of service categories and sub-categories", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://seeds\\value_sets\\service_categories\\service_categories_seeds.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "_value_set_service_categories", "tags": ["service_category", "claims_preprocessing"], "enabled": true}, "created_at": 1702481697.752374, "relation_name": "devforrest.claims_preprocessing._value_set_service_categories", "raw_code": "", "root_path": "C:\\Users\\forre\\PycharmProjects\\the_tuva_project\\integration_tests\\dbt_packages\\the_tuva_project", "depends_on": {"macros": []}}, "test.the_tuva_project.not_null_ccsr__singular_condition_category_claim_id.41e0e51ac8": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "claim_id", "model": "{{ get_where_subquery(ref('ccsr__singular_condition_category')) }}"}, "namespace": null}, "database": "devforrest", "schema": "dbt_test__audit", "name": "not_null_ccsr__singular_condition_category_claim_id", "resource_type": "test", "package_name": "the_tuva_project", "path": "not_null_ccsr__singular_condition_category_claim_id.sql", "original_file_path": "models\\ccsr\\ccsr_models.yml", "unique_id": "test.the_tuva_project.not_null_ccsr__singular_condition_category_claim_id.41e0e51ac8", "fqn": ["the_tuva_project", "ccsr", "not_null_ccsr__singular_condition_category_claim_id"], "alias": "not_null_ccsr__singular_condition_category_claim_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "WARN", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"severity": "WARN"}, "created_at": 1702481696.1724558, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(severity=\"warn\") }}", "language": "sql", "refs": [["ccsr__singular_condition_category"]], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.the_tuva_project.ccsr__singular_condition_category"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\ccsr\\ccsr_models.yml\\not_null_ccsr__singular_condition_category_claim_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect claim_id\nfrom devforrest.ccsr.singular_condition_category\nwhere claim_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "column_name": "claim_id", "file_key_name": "models.ccsr__singular_condition_category"}, "test.the_tuva_project.unique_ccsr__singular_condition_category_claim_id.21b76e504b": {"test_metadata": {"name": "unique", "kwargs": {"column_name": "claim_id", "model": "{{ get_where_subquery(ref('ccsr__singular_condition_category')) }}"}, "namespace": null}, "database": "devforrest", "schema": "dbt_test__audit", "name": "unique_ccsr__singular_condition_category_claim_id", "resource_type": "test", "package_name": "the_tuva_project", "path": "unique_ccsr__singular_condition_category_claim_id.sql", "original_file_path": "models\\ccsr\\ccsr_models.yml", "unique_id": "test.the_tuva_project.unique_ccsr__singular_condition_category_claim_id.21b76e504b", "fqn": ["the_tuva_project", "ccsr", "unique_ccsr__singular_condition_category_claim_id"], "alias": "unique_ccsr__singular_condition_category_claim_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "WARN", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"severity": "WARN"}, "created_at": 1702481696.1744804, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}{{ config(severity=\"warn\") }}", "language": "sql", "refs": [["ccsr__singular_condition_category"]], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.the_tuva_project.ccsr__singular_condition_category"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\ccsr\\ccsr_models.yml\\unique_ccsr__singular_condition_category_claim_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n claim_id as unique_field,\n count(*) as n_records\n\nfrom devforrest.ccsr.singular_condition_category\nwhere claim_id is not null\ngroup by claim_id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "column_name": "claim_id", "file_key_name": "models.ccsr__singular_condition_category"}, "test.the_tuva_project.unique_chronic_conditions__cms_chronic_conditions_wide_patient_id.60c2d9a586": {"test_metadata": {"name": "unique", "kwargs": {"column_name": "patient_id", "model": "{{ get_where_subquery(ref('chronic_conditions__cms_chronic_conditions_wide')) }}"}, "namespace": null}, "database": "devforrest", "schema": "dbt_test__audit", "name": "unique_chronic_conditions__cms_chronic_conditions_wide_patient_id", "resource_type": "test", "package_name": "the_tuva_project", "path": "unique_chronic_conditions__cms_dd279730922ed20d9a6785adad24b5e2.sql", "original_file_path": "models\\chronic_conditions\\cms_chronic_conditions_models.yml", "unique_id": "test.the_tuva_project.unique_chronic_conditions__cms_chronic_conditions_wide_patient_id.60c2d9a586", "fqn": ["the_tuva_project", "chronic_conditions", "unique_chronic_conditions__cms_chronic_conditions_wide_patient_id"], "alias": "unique_chronic_conditions__cms_dd279730922ed20d9a6785adad24b5e2", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "unique_chronic_conditions__cms_dd279730922ed20d9a6785adad24b5e2", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"alias": "unique_chronic_conditions__cms_dd279730922ed20d9a6785adad24b5e2"}, "created_at": 1702481696.2371247, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}{{ config(alias=\"unique_chronic_conditions__cms_dd279730922ed20d9a6785adad24b5e2\") }}", "language": "sql", "refs": [["chronic_conditions__cms_chronic_conditions_wide"]], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.the_tuva_project.chronic_conditions__cms_chronic_conditions_wide"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\chronic_conditions\\cms_chronic_conditions_models.yml\\unique_chronic_conditions__cms_dd279730922ed20d9a6785adad24b5e2.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n patient_id as unique_field,\n count(*) as n_records\n\nfrom devforrest.chronic_conditions.cms_chronic_conditions_wide\nwhere patient_id is not null\ngroup by patient_id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "column_name": "patient_id", "file_key_name": "models.chronic_conditions__cms_chronic_conditions_wide"}, "test.the_tuva_project.not_null_chronic_conditions__cms_chronic_conditions_wide_patient_id.5c2c8ae105": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "patient_id", "model": "{{ get_where_subquery(ref('chronic_conditions__cms_chronic_conditions_wide')) }}"}, "namespace": null}, "database": "devforrest", "schema": "dbt_test__audit", "name": "not_null_chronic_conditions__cms_chronic_conditions_wide_patient_id", "resource_type": "test", "package_name": "the_tuva_project", "path": "not_null_chronic_conditions__c_acd55fa202206ca2dac1594f14fc377c.sql", "original_file_path": "models\\chronic_conditions\\cms_chronic_conditions_models.yml", "unique_id": "test.the_tuva_project.not_null_chronic_conditions__cms_chronic_conditions_wide_patient_id.5c2c8ae105", "fqn": ["the_tuva_project", "chronic_conditions", "not_null_chronic_conditions__cms_chronic_conditions_wide_patient_id"], "alias": "not_null_chronic_conditions__c_acd55fa202206ca2dac1594f14fc377c", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "not_null_chronic_conditions__c_acd55fa202206ca2dac1594f14fc377c", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"alias": "not_null_chronic_conditions__c_acd55fa202206ca2dac1594f14fc377c"}, "created_at": 1702481696.2371247, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"not_null_chronic_conditions__c_acd55fa202206ca2dac1594f14fc377c\") }}", "language": "sql", "refs": [["chronic_conditions__cms_chronic_conditions_wide"]], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.the_tuva_project.chronic_conditions__cms_chronic_conditions_wide"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\chronic_conditions\\cms_chronic_conditions_models.yml\\not_null_chronic_conditions__c_acd55fa202206ca2dac1594f14fc377c.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect patient_id\nfrom devforrest.chronic_conditions.cms_chronic_conditions_wide\nwhere patient_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "column_name": "patient_id", "file_key_name": "models.chronic_conditions__cms_chronic_conditions_wide"}, "test.the_tuva_project.not_null_chronic_conditions__cms_chronic_conditions_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": "devforrest", "schema": "dbt_test__audit", "name": "not_null_chronic_conditions__cms_chronic_conditions_all_patient_id", "resource_type": "test", "package_name": "the_tuva_project", "path": "not_null_chronic_conditions__c_409ab6a82d1b97c996f87af7f330605c.sql", "original_file_path": "models\\chronic_conditions\\cms_chronic_conditions_models.yml", "unique_id": "test.the_tuva_project.not_null_chronic_conditions__cms_chronic_conditions_all_patient_id.95fc066008", "fqn": ["the_tuva_project", "chronic_conditions", "not_null_chronic_conditions__cms_chronic_conditions_all_patient_id"], "alias": "not_null_chronic_conditions__c_409ab6a82d1b97c996f87af7f330605c", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "not_null_chronic_conditions__c_409ab6a82d1b97c996f87af7f330605c", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"alias": "not_null_chronic_conditions__c_409ab6a82d1b97c996f87af7f330605c"}, "created_at": 1702481696.2492402, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"not_null_chronic_conditions__c_409ab6a82d1b97c996f87af7f330605c\") }}", "language": "sql", "refs": [["chronic_conditions__cms_chronic_conditions_all"]], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.the_tuva_project.chronic_conditions__cms_chronic_conditions_all"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\chronic_conditions\\cms_chronic_conditions_models.yml\\not_null_chronic_conditions__c_409ab6a82d1b97c996f87af7f330605c.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect patient_id\nfrom devforrest.chronic_conditions._int_cms_chronic_condition_all\nwhere patient_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "column_name": "patient_id", "file_key_name": "models.chronic_conditions__cms_chronic_conditions_all"}, "test.the_tuva_project.not_null_chronic_conditions__cms_chronic_conditions_all_claim_id.84015aec48": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "claim_id", "model": "{{ get_where_subquery(ref('chronic_conditions__cms_chronic_conditions_all')) }}"}, "namespace": null}, "database": "devforrest", "schema": "dbt_test__audit", "name": "not_null_chronic_conditions__cms_chronic_conditions_all_claim_id", "resource_type": "test", "package_name": "the_tuva_project", "path": "not_null_chronic_conditions__c_b541fb9d33a4f06d5fea55b9a24aa3a9.sql", "original_file_path": "models\\chronic_conditions\\cms_chronic_conditions_models.yml", "unique_id": "test.the_tuva_project.not_null_chronic_conditions__cms_chronic_conditions_all_claim_id.84015aec48", "fqn": ["the_tuva_project", "chronic_conditions", "not_null_chronic_conditions__cms_chronic_conditions_all_claim_id"], "alias": "not_null_chronic_conditions__c_b541fb9d33a4f06d5fea55b9a24aa3a9", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "not_null_chronic_conditions__c_b541fb9d33a4f06d5fea55b9a24aa3a9", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"alias": "not_null_chronic_conditions__c_b541fb9d33a4f06d5fea55b9a24aa3a9"}, "created_at": 1702481696.254067, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"not_null_chronic_conditions__c_b541fb9d33a4f06d5fea55b9a24aa3a9\") }}", "language": "sql", "refs": [["chronic_conditions__cms_chronic_conditions_all"]], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.the_tuva_project.chronic_conditions__cms_chronic_conditions_all"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\chronic_conditions\\cms_chronic_conditions_models.yml\\not_null_chronic_conditions__c_b541fb9d33a4f06d5fea55b9a24aa3a9.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect claim_id\nfrom devforrest.chronic_conditions._int_cms_chronic_condition_all\nwhere claim_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "column_name": "claim_id", "file_key_name": "models.chronic_conditions__cms_chronic_conditions_all"}, "test.the_tuva_project.not_null_chronic_conditions__cms_chronic_conditions_all_condition.bb780b4840": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "condition", "model": "{{ get_where_subquery(ref('chronic_conditions__cms_chronic_conditions_all')) }}"}, "namespace": null}, "database": "devforrest", "schema": "dbt_test__audit", "name": "not_null_chronic_conditions__cms_chronic_conditions_all_condition", "resource_type": "test", "package_name": "the_tuva_project", "path": "not_null_chronic_conditions__c_c4a0f280255574fa8bab0a3d8629b09c.sql", "original_file_path": "models\\chronic_conditions\\cms_chronic_conditions_models.yml", "unique_id": "test.the_tuva_project.not_null_chronic_conditions__cms_chronic_conditions_all_condition.bb780b4840", "fqn": ["the_tuva_project", "chronic_conditions", "not_null_chronic_conditions__cms_chronic_conditions_all_condition"], "alias": "not_null_chronic_conditions__c_c4a0f280255574fa8bab0a3d8629b09c", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "not_null_chronic_conditions__c_c4a0f280255574fa8bab0a3d8629b09c", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"alias": "not_null_chronic_conditions__c_c4a0f280255574fa8bab0a3d8629b09c"}, "created_at": 1702481696.254067, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"not_null_chronic_conditions__c_c4a0f280255574fa8bab0a3d8629b09c\") }}", "language": "sql", "refs": [["chronic_conditions__cms_chronic_conditions_all"]], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.the_tuva_project.chronic_conditions__cms_chronic_conditions_all"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\chronic_conditions\\cms_chronic_conditions_models.yml\\not_null_chronic_conditions__c_c4a0f280255574fa8bab0a3d8629b09c.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect condition\nfrom devforrest.chronic_conditions._int_cms_chronic_condition_all\nwhere condition is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "column_name": "condition", "file_key_name": "models.chronic_conditions__cms_chronic_conditions_all"}, "test.the_tuva_project.not_null_chronic_conditions__cms_chronic_conditions_hiv_aids_patient_id.b6c58add4b": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "patient_id", "model": "{{ get_where_subquery(ref('chronic_conditions__cms_chronic_conditions_hiv_aids')) }}"}, "namespace": null}, "database": "devforrest", "schema": "dbt_test__audit", "name": "not_null_chronic_conditions__cms_chronic_conditions_hiv_aids_patient_id", "resource_type": "test", "package_name": "the_tuva_project", "path": "not_null_chronic_conditions__c_6da0dbac3eab9746301bed2ab3f2d52d.sql", "original_file_path": "models\\chronic_conditions\\cms_chronic_conditions_models.yml", "unique_id": "test.the_tuva_project.not_null_chronic_conditions__cms_chronic_conditions_hiv_aids_patient_id.b6c58add4b", "fqn": ["the_tuva_project", "chronic_conditions", "not_null_chronic_conditions__cms_chronic_conditions_hiv_aids_patient_id"], "alias": "not_null_chronic_conditions__c_6da0dbac3eab9746301bed2ab3f2d52d", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "not_null_chronic_conditions__c_6da0dbac3eab9746301bed2ab3f2d52d", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"alias": "not_null_chronic_conditions__c_6da0dbac3eab9746301bed2ab3f2d52d"}, "created_at": 1702481696.254067, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"not_null_chronic_conditions__c_6da0dbac3eab9746301bed2ab3f2d52d\") }}", "language": "sql", "refs": [["chronic_conditions__cms_chronic_conditions_hiv_aids"]], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.the_tuva_project.chronic_conditions__cms_chronic_conditions_hiv_aids"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\chronic_conditions\\cms_chronic_conditions_models.yml\\not_null_chronic_conditions__c_6da0dbac3eab9746301bed2ab3f2d52d.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect patient_id\nfrom devforrest.chronic_conditions._int_cms_chronic_condition_hiv_aids\nwhere patient_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "column_name": "patient_id", "file_key_name": "models.chronic_conditions__cms_chronic_conditions_hiv_aids"}, "test.the_tuva_project.not_null_chronic_conditions__cms_chronic_conditions_hiv_aids_claim_id.9baa48027d": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "claim_id", "model": "{{ get_where_subquery(ref('chronic_conditions__cms_chronic_conditions_hiv_aids')) }}"}, "namespace": null}, "database": "devforrest", "schema": "dbt_test__audit", "name": "not_null_chronic_conditions__cms_chronic_conditions_hiv_aids_claim_id", "resource_type": "test", "package_name": "the_tuva_project", "path": "not_null_chronic_conditions__c_075c29078cdfc99a6fe124f31746e827.sql", "original_file_path": "models\\chronic_conditions\\cms_chronic_conditions_models.yml", "unique_id": "test.the_tuva_project.not_null_chronic_conditions__cms_chronic_conditions_hiv_aids_claim_id.9baa48027d", "fqn": ["the_tuva_project", "chronic_conditions", "not_null_chronic_conditions__cms_chronic_conditions_hiv_aids_claim_id"], "alias": "not_null_chronic_conditions__c_075c29078cdfc99a6fe124f31746e827", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "not_null_chronic_conditions__c_075c29078cdfc99a6fe124f31746e827", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"alias": "not_null_chronic_conditions__c_075c29078cdfc99a6fe124f31746e827"}, "created_at": 1702481696.254067, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"not_null_chronic_conditions__c_075c29078cdfc99a6fe124f31746e827\") }}", "language": "sql", "refs": [["chronic_conditions__cms_chronic_conditions_hiv_aids"]], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.the_tuva_project.chronic_conditions__cms_chronic_conditions_hiv_aids"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\chronic_conditions\\cms_chronic_conditions_models.yml\\not_null_chronic_conditions__c_075c29078cdfc99a6fe124f31746e827.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect claim_id\nfrom devforrest.chronic_conditions._int_cms_chronic_condition_hiv_aids\nwhere claim_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "column_name": "claim_id", "file_key_name": "models.chronic_conditions__cms_chronic_conditions_hiv_aids"}, "test.the_tuva_project.not_null_chronic_conditions__cms_chronic_conditions_hiv_aids_condition.da32954f00": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "condition", "model": "{{ get_where_subquery(ref('chronic_conditions__cms_chronic_conditions_hiv_aids')) }}"}, "namespace": null}, "database": "devforrest", "schema": "dbt_test__audit", "name": "not_null_chronic_conditions__cms_chronic_conditions_hiv_aids_condition", "resource_type": "test", "package_name": "the_tuva_project", "path": "not_null_chronic_conditions__c_52f5eb486d06b1bc6c4a979fe5d64785.sql", "original_file_path": "models\\chronic_conditions\\cms_chronic_conditions_models.yml", "unique_id": "test.the_tuva_project.not_null_chronic_conditions__cms_chronic_conditions_hiv_aids_condition.da32954f00", "fqn": ["the_tuva_project", "chronic_conditions", "not_null_chronic_conditions__cms_chronic_conditions_hiv_aids_condition"], "alias": "not_null_chronic_conditions__c_52f5eb486d06b1bc6c4a979fe5d64785", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "not_null_chronic_conditions__c_52f5eb486d06b1bc6c4a979fe5d64785", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"alias": "not_null_chronic_conditions__c_52f5eb486d06b1bc6c4a979fe5d64785"}, "created_at": 1702481696.254067, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"not_null_chronic_conditions__c_52f5eb486d06b1bc6c4a979fe5d64785\") }}", "language": "sql", "refs": [["chronic_conditions__cms_chronic_conditions_hiv_aids"]], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.the_tuva_project.chronic_conditions__cms_chronic_conditions_hiv_aids"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\chronic_conditions\\cms_chronic_conditions_models.yml\\not_null_chronic_conditions__c_52f5eb486d06b1bc6c4a979fe5d64785.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect condition\nfrom devforrest.chronic_conditions._int_cms_chronic_condition_hiv_aids\nwhere condition is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "column_name": "condition", "file_key_name": "models.chronic_conditions__cms_chronic_conditions_hiv_aids"}, "test.the_tuva_project.accepted_values_chronic_conditions__cms_chronic_conditions_hiv_aids_condition__Human_Immunodeficiency_Virus_and_or_Acquired_Immunodeficiency_Syndrome_HIV_AIDS_.c54d45a2c6": {"test_metadata": {"name": "accepted_values", "kwargs": {"values": ["Human Immunodeficiency Virus and/or Acquired Immunodeficiency Syndrome (HIV/AIDS)"], "column_name": "condition", "model": "{{ get_where_subquery(ref('chronic_conditions__cms_chronic_conditions_hiv_aids')) }}"}, "namespace": null}, "database": "devforrest", "schema": "dbt_test__audit", "name": "accepted_values_chronic_conditions__cms_chronic_conditions_hiv_aids_condition__Human_Immunodeficiency_Virus_and_or_Acquired_Immunodeficiency_Syndrome_HIV_AIDS_", "resource_type": "test", "package_name": "the_tuva_project", "path": "accepted_values_chronic_condit_dac30732a31f8623801cc82d686e9e8f.sql", "original_file_path": "models\\chronic_conditions\\cms_chronic_conditions_models.yml", "unique_id": "test.the_tuva_project.accepted_values_chronic_conditions__cms_chronic_conditions_hiv_aids_condition__Human_Immunodeficiency_Virus_and_or_Acquired_Immunodeficiency_Syndrome_HIV_AIDS_.c54d45a2c6", "fqn": ["the_tuva_project", "chronic_conditions", "accepted_values_chronic_conditions__cms_chronic_conditions_hiv_aids_condition__Human_Immunodeficiency_Virus_and_or_Acquired_Immunodeficiency_Syndrome_HIV_AIDS_"], "alias": "accepted_values_chronic_condit_dac30732a31f8623801cc82d686e9e8f", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "accepted_values_chronic_condit_dac30732a31f8623801cc82d686e9e8f", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"alias": "accepted_values_chronic_condit_dac30732a31f8623801cc82d686e9e8f"}, "created_at": 1702481696.254067, "relation_name": null, "raw_code": "{{ test_accepted_values(**_dbt_generic_test_kwargs) }}{{ config(alias=\"accepted_values_chronic_condit_dac30732a31f8623801cc82d686e9e8f\") }}", "language": "sql", "refs": [["chronic_conditions__cms_chronic_conditions_hiv_aids"]], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_accepted_values", "macro.dbt.get_where_subquery"], "nodes": ["model.the_tuva_project.chronic_conditions__cms_chronic_conditions_hiv_aids"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\chronic_conditions\\cms_chronic_conditions_models.yml\\accepted_values_chronic_condit_dac30732a31f8623801cc82d686e9e8f.sql", "compiled": true, "compiled_code": "\n \n \n\nwith all_values as (\n\n select\n condition as value_field,\n count(*) as n_records\n\n from devforrest.chronic_conditions._int_cms_chronic_condition_hiv_aids\n group by condition\n\n)\n\nselect *\nfrom all_values\nwhere value_field not in (\n 'Human Immunodeficiency Virus and/or Acquired Immunodeficiency Syndrome (HIV/AIDS)'\n)\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "column_name": "condition", "file_key_name": "models.chronic_conditions__cms_chronic_conditions_hiv_aids"}, "test.the_tuva_project.not_null_chronic_conditions__cms_chronic_conditions_oud_patient_id.382354e0d0": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "patient_id", "model": "{{ get_where_subquery(ref('chronic_conditions__cms_chronic_conditions_oud')) }}"}, "namespace": null}, "database": "devforrest", "schema": "dbt_test__audit", "name": "not_null_chronic_conditions__cms_chronic_conditions_oud_patient_id", "resource_type": "test", "package_name": "the_tuva_project", "path": "not_null_chronic_conditions__c_9bc0b8199dada8f26dfa51bc604f3741.sql", "original_file_path": "models\\chronic_conditions\\cms_chronic_conditions_models.yml", "unique_id": "test.the_tuva_project.not_null_chronic_conditions__cms_chronic_conditions_oud_patient_id.382354e0d0", "fqn": ["the_tuva_project", "chronic_conditions", "not_null_chronic_conditions__cms_chronic_conditions_oud_patient_id"], "alias": "not_null_chronic_conditions__c_9bc0b8199dada8f26dfa51bc604f3741", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "not_null_chronic_conditions__c_9bc0b8199dada8f26dfa51bc604f3741", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"alias": "not_null_chronic_conditions__c_9bc0b8199dada8f26dfa51bc604f3741"}, "created_at": 1702481696.2691693, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"not_null_chronic_conditions__c_9bc0b8199dada8f26dfa51bc604f3741\") }}", "language": "sql", "refs": [["chronic_conditions__cms_chronic_conditions_oud"]], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.the_tuva_project.chronic_conditions__cms_chronic_conditions_oud"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\chronic_conditions\\cms_chronic_conditions_models.yml\\not_null_chronic_conditions__c_9bc0b8199dada8f26dfa51bc604f3741.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect patient_id\nfrom devforrest.chronic_conditions._int_cms_chronic_condition_oud\nwhere patient_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "column_name": "patient_id", "file_key_name": "models.chronic_conditions__cms_chronic_conditions_oud"}, "test.the_tuva_project.not_null_chronic_conditions__cms_chronic_conditions_oud_claim_id.7ee5fe28fe": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "claim_id", "model": "{{ get_where_subquery(ref('chronic_conditions__cms_chronic_conditions_oud')) }}"}, "namespace": null}, "database": "devforrest", "schema": "dbt_test__audit", "name": "not_null_chronic_conditions__cms_chronic_conditions_oud_claim_id", "resource_type": "test", "package_name": "the_tuva_project", "path": "not_null_chronic_conditions__c_e8858b22e3298bb06dc366c69d72845e.sql", "original_file_path": "models\\chronic_conditions\\cms_chronic_conditions_models.yml", "unique_id": "test.the_tuva_project.not_null_chronic_conditions__cms_chronic_conditions_oud_claim_id.7ee5fe28fe", "fqn": ["the_tuva_project", "chronic_conditions", "not_null_chronic_conditions__cms_chronic_conditions_oud_claim_id"], "alias": "not_null_chronic_conditions__c_e8858b22e3298bb06dc366c69d72845e", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "not_null_chronic_conditions__c_e8858b22e3298bb06dc366c69d72845e", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"alias": "not_null_chronic_conditions__c_e8858b22e3298bb06dc366c69d72845e"}, "created_at": 1702481696.2691693, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"not_null_chronic_conditions__c_e8858b22e3298bb06dc366c69d72845e\") }}", "language": "sql", "refs": [["chronic_conditions__cms_chronic_conditions_oud"]], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.the_tuva_project.chronic_conditions__cms_chronic_conditions_oud"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\chronic_conditions\\cms_chronic_conditions_models.yml\\not_null_chronic_conditions__c_e8858b22e3298bb06dc366c69d72845e.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect claim_id\nfrom devforrest.chronic_conditions._int_cms_chronic_condition_oud\nwhere claim_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "column_name": "claim_id", "file_key_name": "models.chronic_conditions__cms_chronic_conditions_oud"}, "test.the_tuva_project.not_null_chronic_conditions__cms_chronic_conditions_oud_condition.6800b245ea": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "condition", "model": "{{ get_where_subquery(ref('chronic_conditions__cms_chronic_conditions_oud')) }}"}, "namespace": null}, "database": "devforrest", "schema": "dbt_test__audit", "name": "not_null_chronic_conditions__cms_chronic_conditions_oud_condition", "resource_type": "test", "package_name": "the_tuva_project", "path": "not_null_chronic_conditions__c_e1503323470a6f1632ee17ce36ebfdf4.sql", "original_file_path": "models\\chronic_conditions\\cms_chronic_conditions_models.yml", "unique_id": "test.the_tuva_project.not_null_chronic_conditions__cms_chronic_conditions_oud_condition.6800b245ea", "fqn": ["the_tuva_project", "chronic_conditions", "not_null_chronic_conditions__cms_chronic_conditions_oud_condition"], "alias": "not_null_chronic_conditions__c_e1503323470a6f1632ee17ce36ebfdf4", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "not_null_chronic_conditions__c_e1503323470a6f1632ee17ce36ebfdf4", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"alias": "not_null_chronic_conditions__c_e1503323470a6f1632ee17ce36ebfdf4"}, "created_at": 1702481696.2691693, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"not_null_chronic_conditions__c_e1503323470a6f1632ee17ce36ebfdf4\") }}", "language": "sql", "refs": [["chronic_conditions__cms_chronic_conditions_oud"]], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.the_tuva_project.chronic_conditions__cms_chronic_conditions_oud"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\chronic_conditions\\cms_chronic_conditions_models.yml\\not_null_chronic_conditions__c_e1503323470a6f1632ee17ce36ebfdf4.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect condition\nfrom devforrest.chronic_conditions._int_cms_chronic_condition_oud\nwhere condition is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "column_name": "condition", "file_key_name": "models.chronic_conditions__cms_chronic_conditions_oud"}, "test.the_tuva_project.accepted_values_chronic_conditions__cms_chronic_conditions_oud_condition__Opioid_Use_Disorder_OUD_.f44489eec5": {"test_metadata": {"name": "accepted_values", "kwargs": {"values": ["Opioid Use Disorder (OUD)"], "column_name": "condition", "model": "{{ get_where_subquery(ref('chronic_conditions__cms_chronic_conditions_oud')) }}"}, "namespace": null}, "database": "devforrest", "schema": "dbt_test__audit", "name": "accepted_values_chronic_conditions__cms_chronic_conditions_oud_condition__Opioid_Use_Disorder_OUD_", "resource_type": "test", "package_name": "the_tuva_project", "path": "accepted_values_chronic_condit_e9f47fcdb123676b8c14e66963fb2f9e.sql", "original_file_path": "models\\chronic_conditions\\cms_chronic_conditions_models.yml", "unique_id": "test.the_tuva_project.accepted_values_chronic_conditions__cms_chronic_conditions_oud_condition__Opioid_Use_Disorder_OUD_.f44489eec5", "fqn": ["the_tuva_project", "chronic_conditions", "accepted_values_chronic_conditions__cms_chronic_conditions_oud_condition__Opioid_Use_Disorder_OUD_"], "alias": "accepted_values_chronic_condit_e9f47fcdb123676b8c14e66963fb2f9e", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "accepted_values_chronic_condit_e9f47fcdb123676b8c14e66963fb2f9e", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"alias": "accepted_values_chronic_condit_e9f47fcdb123676b8c14e66963fb2f9e"}, "created_at": 1702481696.2691693, "relation_name": null, "raw_code": "{{ test_accepted_values(**_dbt_generic_test_kwargs) }}{{ config(alias=\"accepted_values_chronic_condit_e9f47fcdb123676b8c14e66963fb2f9e\") }}", "language": "sql", "refs": [["chronic_conditions__cms_chronic_conditions_oud"]], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_accepted_values", "macro.dbt.get_where_subquery"], "nodes": ["model.the_tuva_project.chronic_conditions__cms_chronic_conditions_oud"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\chronic_conditions\\cms_chronic_conditions_models.yml\\accepted_values_chronic_condit_e9f47fcdb123676b8c14e66963fb2f9e.sql", "compiled": true, "compiled_code": "\n \n \n\nwith all_values as (\n\n select\n condition as value_field,\n count(*) as n_records\n\n from devforrest.chronic_conditions._int_cms_chronic_condition_oud\n group by condition\n\n)\n\nselect *\nfrom all_values\nwhere value_field not in (\n 'Opioid Use Disorder (OUD)'\n)\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "column_name": "condition", "file_key_name": "models.chronic_conditions__cms_chronic_conditions_oud"}, "test.the_tuva_project.unique_chronic_conditions__tuva_chronic_conditions_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": "devforrest", "schema": "dbt_test__audit", "name": "unique_chronic_conditions__tuva_chronic_conditions_wide_patient_id", "resource_type": "test", "package_name": "the_tuva_project", "path": "unique_chronic_conditions__tuv_f6c9876f5d8c62c8b1b037d28f2c9550.sql", "original_file_path": "models\\chronic_conditions\\tuva_chronic_conditions_models.yml", "unique_id": "test.the_tuva_project.unique_chronic_conditions__tuva_chronic_conditions_wide_patient_id.02386b9158", "fqn": ["the_tuva_project", "chronic_conditions", "unique_chronic_conditions__tuva_chronic_conditions_wide_patient_id"], "alias": "unique_chronic_conditions__tuv_f6c9876f5d8c62c8b1b037d28f2c9550", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "unique_chronic_conditions__tuv_f6c9876f5d8c62c8b1b037d28f2c9550", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"alias": "unique_chronic_conditions__tuv_f6c9876f5d8c62c8b1b037d28f2c9550"}, "created_at": 1702481696.3122447, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}{{ config(alias=\"unique_chronic_conditions__tuv_f6c9876f5d8c62c8b1b037d28f2c9550\") }}", "language": "sql", "refs": [["chronic_conditions__tuva_chronic_conditions_wide"]], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_wide"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\chronic_conditions\\tuva_chronic_conditions_models.yml\\unique_chronic_conditions__tuv_f6c9876f5d8c62c8b1b037d28f2c9550.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n patient_id as unique_field,\n count(*) as n_records\n\nfrom devforrest.chronic_conditions.tuva_chronic_conditions_wide\nwhere patient_id is not null\ngroup by patient_id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "column_name": null, "file_key_name": "models.chronic_conditions__tuva_chronic_conditions_wide"}, "test.the_tuva_project.not_null_chronic_conditions__tuva_chronic_conditions_wide_patient_id.705b1ca561": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "patient_id", "model": "{{ get_where_subquery(ref('chronic_conditions__tuva_chronic_conditions_wide')) }}"}, "namespace": null}, "database": "devforrest", "schema": "dbt_test__audit", "name": "not_null_chronic_conditions__tuva_chronic_conditions_wide_patient_id", "resource_type": "test", "package_name": "the_tuva_project", "path": "not_null_chronic_conditions__t_85a7e6e4e3c122035b615b501d74cac4.sql", "original_file_path": "models\\chronic_conditions\\tuva_chronic_conditions_models.yml", "unique_id": "test.the_tuva_project.not_null_chronic_conditions__tuva_chronic_conditions_wide_patient_id.705b1ca561", "fqn": ["the_tuva_project", "chronic_conditions", "not_null_chronic_conditions__tuva_chronic_conditions_wide_patient_id"], "alias": "not_null_chronic_conditions__t_85a7e6e4e3c122035b615b501d74cac4", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "not_null_chronic_conditions__t_85a7e6e4e3c122035b615b501d74cac4", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"alias": "not_null_chronic_conditions__t_85a7e6e4e3c122035b615b501d74cac4"}, "created_at": 1702481696.314249, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"not_null_chronic_conditions__t_85a7e6e4e3c122035b615b501d74cac4\") }}", "language": "sql", "refs": [["chronic_conditions__tuva_chronic_conditions_wide"]], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_wide"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\chronic_conditions\\tuva_chronic_conditions_models.yml\\not_null_chronic_conditions__t_85a7e6e4e3c122035b615b501d74cac4.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect patient_id\nfrom devforrest.chronic_conditions.tuva_chronic_conditions_wide\nwhere patient_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "column_name": null, "file_key_name": "models.chronic_conditions__tuva_chronic_conditions_wide"}, "test.the_tuva_project.unique_cms_hcc__patient_risk_scores_patient_id.05b154e126": {"test_metadata": {"name": "unique", "kwargs": {"column_name": "patient_id", "model": "{{ get_where_subquery(ref('cms_hcc__patient_risk_scores')) }}"}, "namespace": null}, "database": "devforrest", "schema": "dbt_test__audit", "name": "unique_cms_hcc__patient_risk_scores_patient_id", "resource_type": "test", "package_name": "the_tuva_project", "path": "unique_cms_hcc__patient_risk_scores_patient_id.sql", "original_file_path": "models\\cms_hcc\\cms_hcc_models.yml", "unique_id": "test.the_tuva_project.unique_cms_hcc__patient_risk_scores_patient_id.05b154e126", "fqn": ["the_tuva_project", "cms_hcc", "unique_cms_hcc__patient_risk_scores_patient_id"], "alias": "unique_cms_hcc__patient_risk_scores_patient_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1702481696.7222478, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [["cms_hcc__patient_risk_scores"]], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.the_tuva_project.cms_hcc__patient_risk_scores"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\cms_hcc\\cms_hcc_models.yml\\unique_cms_hcc__patient_risk_scores_patient_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n patient_id as unique_field,\n count(*) as n_records\n\nfrom devforrest.cms_hcc.patient_risk_scores\nwhere patient_id is not null\ngroup by patient_id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "column_name": "patient_id", "file_key_name": "models.cms_hcc__patient_risk_scores"}, "test.the_tuva_project.unique_cms_hcc__int_demographic_factors_patient_id.1e7ac0d681": {"test_metadata": {"name": "unique", "kwargs": {"column_name": "patient_id", "model": "{{ get_where_subquery(ref('cms_hcc__int_demographic_factors')) }}"}, "namespace": null}, "database": "devforrest", "schema": "dbt_test__audit", "name": "unique_cms_hcc__int_demographic_factors_patient_id", "resource_type": "test", "package_name": "the_tuva_project", "path": "unique_cms_hcc__int_demographic_factors_patient_id.sql", "original_file_path": "models\\cms_hcc\\cms_hcc_models.yml", "unique_id": "test.the_tuva_project.unique_cms_hcc__int_demographic_factors_patient_id.1e7ac0d681", "fqn": ["the_tuva_project", "cms_hcc", "unique_cms_hcc__int_demographic_factors_patient_id"], "alias": "unique_cms_hcc__int_demographic_factors_patient_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1702481696.7222478, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [["cms_hcc__int_demographic_factors"]], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.the_tuva_project.cms_hcc__int_demographic_factors"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\cms_hcc\\cms_hcc_models.yml\\unique_cms_hcc__int_demographic_factors_patient_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n patient_id as unique_field,\n count(*) as n_records\n\nfrom devforrest.cms_hcc._int_demographic_factors\nwhere patient_id is not null\ngroup by patient_id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "column_name": "patient_id", "file_key_name": "models.cms_hcc__int_demographic_factors"}, "test.the_tuva_project.not_null_cms_hcc__int_eligible_conditions_condition_code.e811a078bc": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "condition_code", "model": "{{ get_where_subquery(ref('cms_hcc__int_eligible_conditions')) }}"}, "namespace": null}, "database": "devforrest", "schema": "dbt_test__audit", "name": "not_null_cms_hcc__int_eligible_conditions_condition_code", "resource_type": "test", "package_name": "the_tuva_project", "path": "not_null_cms_hcc__int_eligible_conditions_condition_code.sql", "original_file_path": "models\\cms_hcc\\cms_hcc_models.yml", "unique_id": "test.the_tuva_project.not_null_cms_hcc__int_eligible_conditions_condition_code.e811a078bc", "fqn": ["the_tuva_project", "cms_hcc", "not_null_cms_hcc__int_eligible_conditions_condition_code"], "alias": "not_null_cms_hcc__int_eligible_conditions_condition_code", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1702481696.7222478, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [["cms_hcc__int_eligible_conditions"]], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.the_tuva_project.cms_hcc__int_eligible_conditions"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\cms_hcc\\cms_hcc_models.yml\\not_null_cms_hcc__int_eligible_conditions_condition_code.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect condition_code\nfrom devforrest.cms_hcc._int_eligible_conditions\nwhere condition_code is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "column_name": "condition_code", "file_key_name": "models.cms_hcc__int_eligible_conditions"}, "test.the_tuva_project.not_null_cms_hcc__int_members_patient_id.75e528329b": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "patient_id", "model": "{{ get_where_subquery(ref('cms_hcc__int_members')) }}"}, "namespace": null}, "database": "devforrest", "schema": "dbt_test__audit", "name": "not_null_cms_hcc__int_members_patient_id", "resource_type": "test", "package_name": "the_tuva_project", "path": "not_null_cms_hcc__int_members_patient_id.sql", "original_file_path": "models\\cms_hcc\\cms_hcc_models.yml", "unique_id": "test.the_tuva_project.not_null_cms_hcc__int_members_patient_id.75e528329b", "fqn": ["the_tuva_project", "cms_hcc", "not_null_cms_hcc__int_members_patient_id"], "alias": "not_null_cms_hcc__int_members_patient_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1702481696.7222478, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [["cms_hcc__int_members"]], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.the_tuva_project.cms_hcc__int_members"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\cms_hcc\\cms_hcc_models.yml\\not_null_cms_hcc__int_members_patient_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect patient_id\nfrom devforrest.cms_hcc._int_members\nwhere patient_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "column_name": "patient_id", "file_key_name": "models.cms_hcc__int_members"}, "test.the_tuva_project.unique_cms_hcc__int_members_patient_id.4d202f2bbb": {"test_metadata": {"name": "unique", "kwargs": {"column_name": "patient_id", "model": "{{ get_where_subquery(ref('cms_hcc__int_members')) }}"}, "namespace": null}, "database": "devforrest", "schema": "dbt_test__audit", "name": "unique_cms_hcc__int_members_patient_id", "resource_type": "test", "package_name": "the_tuva_project", "path": "unique_cms_hcc__int_members_patient_id.sql", "original_file_path": "models\\cms_hcc\\cms_hcc_models.yml", "unique_id": "test.the_tuva_project.unique_cms_hcc__int_members_patient_id.4d202f2bbb", "fqn": ["the_tuva_project", "cms_hcc", "unique_cms_hcc__int_members_patient_id"], "alias": "unique_cms_hcc__int_members_patient_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1702481696.7222478, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [["cms_hcc__int_members"]], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.the_tuva_project.cms_hcc__int_members"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\cms_hcc\\cms_hcc_models.yml\\unique_cms_hcc__int_members_patient_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n patient_id as unique_field,\n count(*) as n_records\n\nfrom devforrest.cms_hcc._int_members\nwhere patient_id is not null\ngroup by patient_id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "column_name": "patient_id", "file_key_name": "models.cms_hcc__int_members"}, "test.the_tuva_project.unique_financial_pmpm__pmpm_prep__patient_id___year_month___plan_.b941ddaf9e": {"test_metadata": {"name": "unique", "kwargs": {"column_name": "(patient_id || '_' || year_month || '_' || plan)", "model": "{{ get_where_subquery(ref('financial_pmpm__pmpm_prep')) }}"}, "namespace": null}, "database": "devforrest", "schema": "dbt_test__audit", "name": "unique_financial_pmpm__pmpm_prep__patient_id___year_month___plan_", "resource_type": "test", "package_name": "the_tuva_project", "path": "unique_financial_pmpm__pmpm_pr_c36fcd8dfb24026167eeab878c3dd5cf.sql", "original_file_path": "models\\financial_pmpm\\financial_pmpm_models.yml", "unique_id": "test.the_tuva_project.unique_financial_pmpm__pmpm_prep__patient_id___year_month___plan_.b941ddaf9e", "fqn": ["the_tuva_project", "financial_pmpm", "unique_financial_pmpm__pmpm_prep__patient_id___year_month___plan_"], "alias": "unique_financial_pmpm__pmpm_pr_c36fcd8dfb24026167eeab878c3dd5cf", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "unique_financial_pmpm__pmpm_pr_c36fcd8dfb24026167eeab878c3dd5cf", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"alias": "unique_financial_pmpm__pmpm_pr_c36fcd8dfb24026167eeab878c3dd5cf"}, "created_at": 1702481696.9731543, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}{{ config(alias=\"unique_financial_pmpm__pmpm_pr_c36fcd8dfb24026167eeab878c3dd5cf\") }}", "language": "sql", "refs": [["financial_pmpm__pmpm_prep"]], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.the_tuva_project.financial_pmpm__pmpm_prep"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\financial_pmpm\\financial_pmpm_models.yml\\unique_financial_pmpm__pmpm_pr_c36fcd8dfb24026167eeab878c3dd5cf.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n (patient_id || '_' || year_month || '_' || plan) as unique_field,\n count(*) as n_records\n\nfrom devforrest.financial_pmpm.pmpm_prep\nwhere (patient_id || '_' || year_month || '_' || plan) is not null\ngroup by (patient_id || '_' || year_month || '_' || plan)\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "column_name": null, "file_key_name": "models.financial_pmpm__pmpm_prep"}, "test.the_tuva_project.not_null_quality_measures__stg_core__condition_patient_id.1f1222e348": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "patient_id", "model": "{{ get_where_subquery(ref('quality_measures__stg_core__condition')) }}"}, "namespace": null}, "database": "devforrest", "schema": "dbt_test__audit", "name": "not_null_quality_measures__stg_core__condition_patient_id", "resource_type": "test", "package_name": "the_tuva_project", "path": "not_null_quality_measures__stg_core__condition_patient_id.sql", "original_file_path": "models\\quality_measures\\quality_measures_models.yml", "unique_id": "test.the_tuva_project.not_null_quality_measures__stg_core__condition_patient_id.1f1222e348", "fqn": ["the_tuva_project", "quality_measures", "not_null_quality_measures__stg_core__condition_patient_id"], "alias": "not_null_quality_measures__stg_core__condition_patient_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "WARN", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"severity": "WARN"}, "created_at": 1702481697.2379375, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(severity=\"warn\") }}", "language": "sql", "refs": [["quality_measures__stg_core__condition"]], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.the_tuva_project.quality_measures__stg_core__condition"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\quality_measures\\quality_measures_models.yml\\not_null_quality_measures__stg_core__condition_patient_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nwith __dbt__cte__quality_measures__stg_core__condition as (\n\nselect\n patient_id\n , claim_id\n , recorded_date\n , source_code_type\n , source_code\n , normalized_code_type\n , normalized_code\n , '2023-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom devforrest.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-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom devforrest.core.condition\n)"}], "column_name": "patient_id", "file_key_name": "models.quality_measures__stg_core__condition"}, "test.the_tuva_project.not_null_quality_measures__stg_core__encounter_patient_id.a0d82e2159": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "patient_id", "model": "{{ get_where_subquery(ref('quality_measures__stg_core__encounter')) }}"}, "namespace": null}, "database": "devforrest", "schema": "dbt_test__audit", "name": "not_null_quality_measures__stg_core__encounter_patient_id", "resource_type": "test", "package_name": "the_tuva_project", "path": "not_null_quality_measures__stg_core__encounter_patient_id.sql", "original_file_path": "models\\quality_measures\\quality_measures_models.yml", "unique_id": "test.the_tuva_project.not_null_quality_measures__stg_core__encounter_patient_id.a0d82e2159", "fqn": ["the_tuva_project", "quality_measures", "not_null_quality_measures__stg_core__encounter_patient_id"], "alias": "not_null_quality_measures__stg_core__encounter_patient_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "WARN", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"severity": "WARN"}, "created_at": 1702481697.2389417, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(severity=\"warn\") }}", "language": "sql", "refs": [["quality_measures__stg_core__encounter"]], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.the_tuva_project.quality_measures__stg_core__encounter"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\quality_measures\\quality_measures_models.yml\\not_null_quality_measures__stg_core__encounter_patient_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nwith __dbt__cte__quality_measures__stg_core__encounter as (\n\n\nselect\n patient_id\n , encounter_type\n , encounter_start_date\n , encounter_end_date\n , '2023-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom devforrest.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-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom devforrest.core.encounter\n\n\n)"}], "column_name": "patient_id", "file_key_name": "models.quality_measures__stg_core__encounter"}, "test.the_tuva_project.not_null_quality_measures__stg_core__medication_patient_id.0aaf3a0652": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "patient_id", "model": "{{ get_where_subquery(ref('quality_measures__stg_core__medication')) }}"}, "namespace": null}, "database": "devforrest", "schema": "dbt_test__audit", "name": "not_null_quality_measures__stg_core__medication_patient_id", "resource_type": "test", "package_name": "the_tuva_project", "path": "not_null_quality_measures__stg_core__medication_patient_id.sql", "original_file_path": "models\\quality_measures\\quality_measures_models.yml", "unique_id": "test.the_tuva_project.not_null_quality_measures__stg_core__medication_patient_id.0aaf3a0652", "fqn": ["the_tuva_project", "quality_measures", "not_null_quality_measures__stg_core__medication_patient_id"], "alias": "not_null_quality_measures__stg_core__medication_patient_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "WARN", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"severity": "WARN"}, "created_at": 1702481697.24095, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(severity=\"warn\") }}", "language": "sql", "refs": [["quality_measures__stg_core__medication"]], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.the_tuva_project.quality_measures__stg_core__medication"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\quality_measures\\quality_measures_models.yml\\not_null_quality_measures__stg_core__medication_patient_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nwith __dbt__cte__quality_measures__stg_core__medication as (\n\n\nselect\n patient_id\n , dispensing_date\n , source_code_type\n , source_code\n , ndc_code\n , rxnorm_code\n , '2023-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom devforrest.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-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom devforrest.core.medication\n\n\n)"}], "column_name": "patient_id", "file_key_name": "models.quality_measures__stg_core__medication"}, "test.the_tuva_project.not_null_quality_measures__stg_core__observation_patient_id.31e33f2d7e": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "patient_id", "model": "{{ get_where_subquery(ref('quality_measures__stg_core__observation')) }}"}, "namespace": null}, "database": "devforrest", "schema": "dbt_test__audit", "name": "not_null_quality_measures__stg_core__observation_patient_id", "resource_type": "test", "package_name": "the_tuva_project", "path": "not_null_quality_measures__stg_core__observation_patient_id.sql", "original_file_path": "models\\quality_measures\\quality_measures_models.yml", "unique_id": "test.the_tuva_project.not_null_quality_measures__stg_core__observation_patient_id.31e33f2d7e", "fqn": ["the_tuva_project", "quality_measures", "not_null_quality_measures__stg_core__observation_patient_id"], "alias": "not_null_quality_measures__stg_core__observation_patient_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "WARN", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"severity": "WARN"}, "created_at": 1702481697.242964, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(severity=\"warn\") }}", "language": "sql", "refs": [["quality_measures__stg_core__observation"]], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.the_tuva_project.quality_measures__stg_core__observation"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\quality_measures\\quality_measures_models.yml\\not_null_quality_measures__stg_core__observation_patient_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nwith __dbt__cte__quality_measures__stg_core__observation as (\n\n\nselect\n patient_id\n , observation_date\n , source_code_type\n , source_code\n , normalized_code_type\n , normalized_code\n , '2023-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom devforrest.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-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom devforrest.core.observation\n\n\n)"}], "column_name": "patient_id", "file_key_name": "models.quality_measures__stg_core__observation"}, "test.the_tuva_project.not_null_quality_measures__stg_core__patient_patient_id.5510e1a0fd": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "patient_id", "model": "{{ get_where_subquery(ref('quality_measures__stg_core__patient')) }}"}, "namespace": null}, "database": "devforrest", "schema": "dbt_test__audit", "name": "not_null_quality_measures__stg_core__patient_patient_id", "resource_type": "test", "package_name": "the_tuva_project", "path": "not_null_quality_measures__stg_core__patient_patient_id.sql", "original_file_path": "models\\quality_measures\\quality_measures_models.yml", "unique_id": "test.the_tuva_project.not_null_quality_measures__stg_core__patient_patient_id.5510e1a0fd", "fqn": ["the_tuva_project", "quality_measures", "not_null_quality_measures__stg_core__patient_patient_id"], "alias": "not_null_quality_measures__stg_core__patient_patient_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "WARN", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"severity": "WARN"}, "created_at": 1702481697.2452261, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(severity=\"warn\") }}", "language": "sql", "refs": [["quality_measures__stg_core__patient"]], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.the_tuva_project.quality_measures__stg_core__patient"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\quality_measures\\quality_measures_models.yml\\not_null_quality_measures__stg_core__patient_patient_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nwith __dbt__cte__quality_measures__stg_core__patient as (\n\nselect\n patient_id\n , sex\n , birth_date\n , death_date\n , '2023-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom devforrest.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-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom devforrest.core.patient\n)"}], "column_name": "patient_id", "file_key_name": "models.quality_measures__stg_core__patient"}, "test.the_tuva_project.not_null_quality_measures__stg_core__patient_sex.e2f34cab69": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "sex", "model": "{{ get_where_subquery(ref('quality_measures__stg_core__patient')) }}"}, "namespace": null}, "database": "devforrest", "schema": "dbt_test__audit", "name": "not_null_quality_measures__stg_core__patient_sex", "resource_type": "test", "package_name": "the_tuva_project", "path": "not_null_quality_measures__stg_core__patient_sex.sql", "original_file_path": "models\\quality_measures\\quality_measures_models.yml", "unique_id": "test.the_tuva_project.not_null_quality_measures__stg_core__patient_sex.e2f34cab69", "fqn": ["the_tuva_project", "quality_measures", "not_null_quality_measures__stg_core__patient_sex"], "alias": "not_null_quality_measures__stg_core__patient_sex", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "WARN", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"severity": "WARN"}, "created_at": 1702481697.2463577, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(severity=\"warn\") }}", "language": "sql", "refs": [["quality_measures__stg_core__patient"]], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.the_tuva_project.quality_measures__stg_core__patient"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\quality_measures\\quality_measures_models.yml\\not_null_quality_measures__stg_core__patient_sex.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nwith __dbt__cte__quality_measures__stg_core__patient as (\n\nselect\n patient_id\n , sex\n , birth_date\n , death_date\n , '2023-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom devforrest.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-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom devforrest.core.patient\n)"}], "column_name": "sex", "file_key_name": "models.quality_measures__stg_core__patient"}, "test.the_tuva_project.accepted_values_quality_measures__stg_core__patient_sex__female__male.47cbdf864b": {"test_metadata": {"name": "accepted_values", "kwargs": {"values": ["female", "male"], "column_name": "sex", "model": "{{ get_where_subquery(ref('quality_measures__stg_core__patient')) }}"}, "namespace": null}, "database": "devforrest", "schema": "dbt_test__audit", "name": "accepted_values_quality_measures__stg_core__patient_sex__female__male", "resource_type": "test", "package_name": "the_tuva_project", "path": "accepted_values_quality_measur_12782dbc4c931575c089a8978147a897.sql", "original_file_path": "models\\quality_measures\\quality_measures_models.yml", "unique_id": "test.the_tuva_project.accepted_values_quality_measures__stg_core__patient_sex__female__male.47cbdf864b", "fqn": ["the_tuva_project", "quality_measures", "accepted_values_quality_measures__stg_core__patient_sex__female__male"], "alias": "accepted_values_quality_measur_12782dbc4c931575c089a8978147a897", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "accepted_values_quality_measur_12782dbc4c931575c089a8978147a897", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "warn", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"severity": "warn", "alias": "accepted_values_quality_measur_12782dbc4c931575c089a8978147a897"}, "created_at": 1702481697.2483609, "relation_name": null, "raw_code": "{{ test_accepted_values(**_dbt_generic_test_kwargs) }}{{ config(severity=\"warn\",alias=\"accepted_values_quality_measur_12782dbc4c931575c089a8978147a897\") }}", "language": "sql", "refs": [["quality_measures__stg_core__patient"]], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_accepted_values", "macro.dbt.get_where_subquery"], "nodes": ["model.the_tuva_project.quality_measures__stg_core__patient"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\quality_measures\\quality_measures_models.yml\\accepted_values_quality_measur_12782dbc4c931575c089a8978147a897.sql", "compiled": true, "compiled_code": "\n \n \n\nwith __dbt__cte__quality_measures__stg_core__patient as (\n\nselect\n patient_id\n , sex\n , birth_date\n , death_date\n , '2023-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom devforrest.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-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom devforrest.core.patient\n)"}], "column_name": "sex", "file_key_name": "models.quality_measures__stg_core__patient"}, "test.the_tuva_project.not_null_quality_measures__stg_core__patient_birth_date.4b3a2e74e6": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "birth_date", "model": "{{ get_where_subquery(ref('quality_measures__stg_core__patient')) }}"}, "namespace": null}, "database": "devforrest", "schema": "dbt_test__audit", "name": "not_null_quality_measures__stg_core__patient_birth_date", "resource_type": "test", "package_name": "the_tuva_project", "path": "not_null_quality_measures__stg_core__patient_birth_date.sql", "original_file_path": "models\\quality_measures\\quality_measures_models.yml", "unique_id": "test.the_tuva_project.not_null_quality_measures__stg_core__patient_birth_date.4b3a2e74e6", "fqn": ["the_tuva_project", "quality_measures", "not_null_quality_measures__stg_core__patient_birth_date"], "alias": "not_null_quality_measures__stg_core__patient_birth_date", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "WARN", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"severity": "WARN"}, "created_at": 1702481697.2519581, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(severity=\"warn\") }}", "language": "sql", "refs": [["quality_measures__stg_core__patient"]], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.the_tuva_project.quality_measures__stg_core__patient"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\quality_measures\\quality_measures_models.yml\\not_null_quality_measures__stg_core__patient_birth_date.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nwith __dbt__cte__quality_measures__stg_core__patient as (\n\nselect\n patient_id\n , sex\n , birth_date\n , death_date\n , '2023-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom devforrest.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-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom devforrest.core.patient\n)"}], "column_name": "birth_date", "file_key_name": "models.quality_measures__stg_core__patient"}, "test.the_tuva_project.not_null_quality_measures__stg_core__procedure_patient_id.0b52ff75d9": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "patient_id", "model": "{{ get_where_subquery(ref('quality_measures__stg_core__procedure')) }}"}, "namespace": null}, "database": "devforrest", "schema": "dbt_test__audit", "name": "not_null_quality_measures__stg_core__procedure_patient_id", "resource_type": "test", "package_name": "the_tuva_project", "path": "not_null_quality_measures__stg_core__procedure_patient_id.sql", "original_file_path": "models\\quality_measures\\quality_measures_models.yml", "unique_id": "test.the_tuva_project.not_null_quality_measures__stg_core__procedure_patient_id.0b52ff75d9", "fqn": ["the_tuva_project", "quality_measures", "not_null_quality_measures__stg_core__procedure_patient_id"], "alias": "not_null_quality_measures__stg_core__procedure_patient_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "WARN", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"severity": "WARN"}, "created_at": 1702481697.2540598, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(severity=\"warn\") }}", "language": "sql", "refs": [["quality_measures__stg_core__procedure"]], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.the_tuva_project.quality_measures__stg_core__procedure"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\quality_measures\\quality_measures_models.yml\\not_null_quality_measures__stg_core__procedure_patient_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nwith __dbt__cte__quality_measures__stg_core__procedure as (\n\nselect\n patient_id\n , procedure_date\n , source_code_type\n , source_code\n , normalized_code_type\n , normalized_code\n , '2023-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom devforrest.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-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom devforrest.core.procedure\n)"}], "column_name": "patient_id", "file_key_name": "models.quality_measures__stg_core__procedure"}, "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": "devforrest", "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": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1702481697.6685033, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [["ed_classification__johnston_icd9"]], "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 devforrest.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": [], "column_name": "icd9", "file_key_name": "seeds.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": "devforrest", "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": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1702481697.6705062, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [["ed_classification__johnston_icd9"]], "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 devforrest.ed_classification._value_set_johnston_icd9\nwhere icd9 is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "column_name": "icd9", "file_key_name": "seeds.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": "devforrest", "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": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1702481697.671453, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [["ed_classification__johnston_icd10"]], "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 devforrest.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": [], "column_name": "icd10", "file_key_name": "seeds.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": "devforrest", "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": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1702481697.6734955, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [["ed_classification__johnston_icd10"]], "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 devforrest.ed_classification._value_set_johnston_icd10\nwhere icd10 is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "column_name": "icd10", "file_key_name": "seeds.ed_classification__johnston_icd10"}, "model.the_tuva_project.core__patient": {"database": "devforrest", "schema": "core", "name": "core__patient", "resource_type": "model", "package_name": "the_tuva_project", "path": "core\\final\\core__patient.sql", "original_file_path": "models\\core\\final\\core__patient.sql", "unique_id": "model.the_tuva_project.core__patient", "fqn": ["the_tuva_project", "core", "final", "core__patient"], "alias": "patient", "checksum": {"name": "sha256", "checksum": "b61f67fdabee3aa43bcbc17b1deb9f655a317e812c6571a11caf3f26b22e2ed8"}, "config": {"enabled": true, "alias": "patient", "schema": "core", "database": null, "tags": ["core"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#0f3d0b"}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["core"], "description": "The patient table contains demographic and geographic information on patients.\n", "columns": {"patient_id": {"name": "patient_id", "description": "Unique identifier for each person across all datasets.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "sex": {"name": "sex", "description": "The gender of the patient.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__gender.csv"}, "data_type": null, "quote": null, "tags": []}, "race": {"name": "race", "description": "The race of the patient.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__race.csv"}, "data_type": null, "quote": null, "tags": []}, "birth_date": {"name": "birth_date", "description": "The birth date of the patient.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "death_date": {"name": "death_date", "description": "The death date of the patient if there is one.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "death_flag": {"name": "death_flag", "description": "A flag indicating if the patient has died.", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "first_name": {"name": "first_name", "description": "The first name of the patient.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "last_name": {"name": "last_name", "description": "The last name of the patient.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "address": {"name": "address", "description": "The address of the patient.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "city": {"name": "city", "description": "The city where the patient lives.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "state": {"name": "state", "description": "The state where the patient lives.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "zip_code": {"name": "zip_code", "description": "The zip code for the patient.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "county": {"name": "county", "description": "The county for the patient.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "latitude": {"name": "latitude", "description": "The latitude for the patient.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "longitude": {"name": "longitude", "description": "The longitude for the patient.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "phone": {"name": "phone", "description": "The phone number for the patient.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "data_source": {"name": "data_source", "description": "User-configured field that indicates the data source (e.g. typically named after the payer and state \"BCBS Tennessee\").\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The last time the data was refreshed. Generated by `dbt_utils.pretty_time` as the local time of the `dbt run` environment. Timezone is configurable via the `tuva_last_run` var.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": "#0f3d0b"}, "patch_path": "the_tuva_project://models\\core\\core_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "core", "alias": "patient", "tags": "core", "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#0f3d0b"}}, "created_at": 1702483306.8262298, "relation_name": "devforrest.core.patient", "raw_code": "{{ config(\r\n enabled = var('claims_enabled',var('clinical_enabled',var('tuva_marts_enabled',False)))\r\n )\r\n}}\r\n\r\n{% if var('clinical_enabled', var('tuva_marts_enabled',False)) == true and var('claims_enabled', var('tuva_marts_enabled',False)) == true -%}\r\n\r\nselect * from {{ ref('core__stg_claims_patient') }}\r\nunion all\r\nselect * from {{ ref('core__stg_clinical_patient') }}\r\n\r\n{% elif var('clinical_enabled', var('tuva_marts_enabled',False)) == true -%}\r\n\r\nselect * from {{ ref('core__stg_clinical_patient') }}\r\n\r\n{% elif var('claims_enabled', var('tuva_marts_enabled',False)) == true -%}\r\n\r\nselect * from {{ ref('core__stg_claims_patient') }}\r\n\r\n{%- endif %}", "language": "sql", "refs": [["core__stg_claims_patient"], ["core__stg_clinical_patient"]], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.core__stg_claims_patient", "model.the_tuva_project.core__stg_clinical_patient"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\core\\final\\core__patient.sql", "compiled": true, "compiled_code": "\n\nselect * from devforrest.core._stg_claims_patient\nunion all\nselect * from devforrest.core._stg_clinical_patient\n\n", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.core__practitioner": {"database": "devforrest", "schema": "core", "name": "core__practitioner", "resource_type": "model", "package_name": "the_tuva_project", "path": "core\\final\\core__practitioner.sql", "original_file_path": "models\\core\\final\\core__practitioner.sql", "unique_id": "model.the_tuva_project.core__practitioner", "fqn": ["the_tuva_project", "core", "final", "core__practitioner"], "alias": "practitioner", "checksum": {"name": "sha256", "checksum": "775c1a9019c7dad8bd26cdb669cfa8f56e61ced3adcb492b805165d42f20eacf"}, "config": {"enabled": true, "alias": "practitioner", "schema": "core", "database": null, "tags": ["core"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#0f3d0b"}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["core"], "description": "The practitioner table contains information on the providers in the dataset e.g. physicians, physicians assistants, etc.\n", "columns": {"practitioner_id": {"name": "practitioner_id", "description": "Unique ID for the provider.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "npi": {"name": "npi", "description": "NPI for the provider.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__provider.csv", "terminology_note": "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters."}, "data_type": null, "quote": null, "tags": []}, "provider_first_name": {"name": "provider_first_name", "description": "First name of the provider.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "provider_last_name": {"name": "provider_last_name", "description": "Last name of the provider.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "practice_affiliation": {"name": "practice_affiliation", "description": "Practice affiliation of the provider.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "specialty": {"name": "specialty", "description": "Specialty of the provider.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "sub_specialty": {"name": "sub_specialty", "description": "Sub specialty of the provider.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "data_source": {"name": "data_source", "description": "User-configured field that indicates the data source (e.g. typically named after the payer and state \"BCBS Tennessee\").\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The last time the data was refreshed. Generated by `dbt_utils.pretty_time` as the local time of the `dbt run` environment. Timezone is configurable via the `tuva_last_run` var.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": "#0f3d0b"}, "patch_path": "the_tuva_project://models\\core\\core_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "core", "alias": "practitioner", "tags": "core", "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#0f3d0b"}}, "created_at": 1702491754.5411782, "relation_name": "devforrest.core.practitioner", "raw_code": "{{ config(\r\n enabled = var('claims_enabled',var('clinical_enabled',var('tuva_marts_enabled',False)))\r\n )\r\n}}\r\n\r\n{% if var('clinical_enabled', var('tuva_marts_enabled',False)) == true and var('claims_enabled', var('tuva_marts_enabled',False)) == true-%}\r\n\r\nselect * from {{ ref('core__stg_claims_practitioner') }}\r\nunion all\r\nselect * from {{ ref('core__stg_clinical_practitioner') }}\r\n\r\n{% elif var('clinical_enabled', var('tuva_marts_enabled',False)) == true -%}\r\n\r\nselect * from {{ ref('core__stg_clinical_practitioner') }}\r\n\r\n{% elif var('claims_enabled', var('tuva_marts_enabled',False)) == true -%}\r\n\r\nselect * from {{ ref('core__stg_claims_practitioner') }}\r\n\r\n{%- endif %}", "language": "sql", "refs": [["core__stg_claims_practitioner"], ["core__stg_clinical_practitioner"]], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.core__stg_claims_practitioner", "model.the_tuva_project.core__stg_clinical_practitioner"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\core\\final\\core__practitioner.sql", "compiled": true, "compiled_code": "\n\nselect * from devforrest.core._stg_claims_practitioner\nunion all\nselect * from devforrest.core._stg_clinical_practitioner\n\n", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.core__medical_claim": {"database": "devforrest", "schema": "core", "name": "core__medical_claim", "resource_type": "model", "package_name": "the_tuva_project", "path": "core\\final\\core__medical_claim.sql", "original_file_path": "models\\core\\final\\core__medical_claim.sql", "unique_id": "model.the_tuva_project.core__medical_claim", "fqn": ["the_tuva_project", "core", "final", "core__medical_claim"], "alias": "medical_claim", "checksum": {"name": "sha256", "checksum": "b126bbc3a07a5f93f701d0199e8fde6ef13a7fd9ac7ad71619de948a8d49fdc1"}, "config": {"enabled": true, "alias": "medical_claim", "schema": "core", "database": null, "tags": ["core"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#0f3d0b"}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["core"], "description": "The medical claim table contains information on services rendered to patients and billed by the provider to the insurer as claims.\n", "columns": {"claim_id": {"name": "claim_id", "description": "Unique identifier for each claim.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "claim_line_number": {"name": "claim_line_number", "description": "Indicates the line number for the particular line of the claim.\n", "meta": {}, "data_type": "integer", "quote": null, "tags": []}, "claim_type": {"name": "claim_type", "description": "Indicates whether the claim is professional (CMS-1500), institutional (UB-04), dental, or vision.\n", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__claim_type.csv"}, "data_type": null, "quote": null, "tags": []}, "patient_id": {"name": "patient_id", "description": "Unique identifier for each patient in the dataset.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "member_id": {"name": "member_id", "description": "Identifier that links a patient to a particular insurance product or health plan. A patient can have more than one member_id because they can have more than one insurance product/plan.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "payer": {"name": "payer", "description": "Name of the payer", "meta": {}, "data_type": null, "quote": null, "tags": []}, "plan": {"name": "plan", "description": "Name of the plan", "meta": {}, "data_type": null, "quote": null, "tags": []}, "claim_start_date": {"name": "claim_start_date", "description": "Start date for the claim.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "claim_end_date": {"name": "claim_end_date", "description": "End date for the claim.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "claim_line_start_date": {"name": "claim_line_start_date", "description": "Start date for the claim line.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "claim_line_end_date": {"name": "claim_line_end_date", "description": "End date for the claim line.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "admission_date": {"name": "admission_date", "description": "Admission date for the claim (inpatient claims only).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "discharge_date": {"name": "discharge_date", "description": "Discharge date for the claim (inpatient claims only).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "admit_source_code": {"name": "admit_source_code", "description": "Indicates where the patient was before the healthcare encounter (inpatient claims only).\n", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__admit_source.csv"}, "data_type": null, "quote": null, "tags": []}, "admit_type_code": {"name": "admit_type_code", "description": "Indicates the type of admission (inpatient claims only).", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__admit_type.csv"}, "data_type": null, "quote": null, "tags": []}, "discharge_disposition_code": {"name": "discharge_disposition_code", "description": "Indicates the type of setting the patient was discharged to (institutional inpatient claims only).\n", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__discharge_disposition.csv"}, "data_type": null, "quote": null, "tags": []}, "place_of_service_code": {"name": "place_of_service_code", "description": "Place of service for the claim (professional claims only).", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__place_of_service.csv"}, "data_type": null, "quote": null, "tags": []}, "bill_type_code": {"name": "bill_type_code", "description": "Bill type code for the claim (institutional claims only).", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__bill_type.csv"}, "data_type": null, "quote": null, "tags": []}, "ms_drg_code": {"name": "ms_drg_code", "description": "MS-DRG for the claim (inpatient claims only).", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__ms_drg.csv"}, "data_type": null, "quote": null, "tags": []}, "apr_drg_code": {"name": "apr_drg_code", "description": "APR-DRG for the claim (inpatient claims only).", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__apr_drg.csv"}, "data_type": null, "quote": null, "tags": []}, "revenue_center_code": {"name": "revenue_center_code", "description": "Revenue center code for the claim line (institutional only and typically multiple codes per claim).\n", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__revenue_center.csv"}, "data_type": null, "quote": null, "tags": []}, "service_unit_quantity": {"name": "service_unit_quantity", "description": "The number of units for the particular revenue center code.", "meta": {}, "data_type": "integer", "quote": null, "tags": []}, "hcpcs_code": {"name": "hcpcs_code", "description": "HCPCS level 1 or level 2 code for the claim line.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__hcpcs_level_2.csv"}, "data_type": null, "quote": null, "tags": []}, "hcpcs_modifier_1": {"name": "hcpcs_modifier_1", "description": "1st modifier for HCPCS code.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__hcpcs_level_2.csv"}, "data_type": null, "quote": null, "tags": []}, "hcpcs_modifier_2": {"name": "hcpcs_modifier_2", "description": "2nd modifier for HCPCS code.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__hcpcs_level_2.csv"}, "data_type": null, "quote": null, "tags": []}, "hcpcs_modifier_3": {"name": "hcpcs_modifier_3", "description": "3rd modifier for HCPCS code.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__hcpcs_level_2.csv"}, "data_type": null, "quote": null, "tags": []}, "hcpcs_modifier_4": {"name": "hcpcs_modifier_4", "description": "4th modifier for HCPCS code.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__hcpcs_level_2.csv"}, "data_type": null, "quote": null, "tags": []}, "hcpcs_modifier_5": {"name": "hcpcs_modifier_5", "description": "5th modifier for HCPCS code.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__hcpcs_level_2.csv"}, "data_type": null, "quote": null, "tags": []}, "rendering_npi": {"name": "rendering_npi", "description": "Rendering NPI for the claim (typically represents the physician or entity providing services).\n", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__provider.csv", "terminology_note": "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters."}, "data_type": null, "quote": null, "tags": []}, "billing_npi": {"name": "billing_npi", "description": "Billing NPI for the claim (typically represents organization billing the claim).\n", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__provider.csv", "terminology_note": "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters."}, "data_type": null, "quote": null, "tags": []}, "facility_npi": {"name": "facility_npi", "description": "Facility NPI for the claim (typically represents the facility where services were performed).\n", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__provider.csv", "terminology_note": "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters."}, "data_type": null, "quote": null, "tags": []}, "paid_date": {"name": "paid_date", "description": "The date the claim was paid.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "paid_amount": {"name": "paid_amount", "description": "The total amount paid on the claim by the insurer.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "allowed_amount": {"name": "allowed_amount", "description": "The total amount allowed (includes amount paid by the insurer and patient) on the claim.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "charge_amount": {"name": "charge_amount", "description": "The total amount charged on the claim by the provider.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "coinsurance_amount": {"name": "coinsurance_amount", "description": "The total coinsurance charged on the claim by the provider.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "copayment_amount": {"name": "copayment_amount", "description": "The total copayment charged on the claim by the provider.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "deductible_amount": {"name": "deductible_amount", "description": "The total amount charged on the claim by the provider.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "total_cost_amount": {"name": "total_cost_amount", "description": "The total amount paid on the claim by different parties.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "encounter_type": {"name": "encounter_type", "description": "The type of encounter this claim belongs to.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "encounter_id": {"name": "encounter_id", "description": "The encounter_id for the encounter that this claims belongs to.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "service_category_1": {"name": "service_category_1", "description": "The broader service category this claim belongs to.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/value_sets/service_categories/service_category__service_categories.csv"}, "data_type": null, "quote": null, "tags": []}, "service_category_2": {"name": "service_category_2", "description": "The more specific service category this claim belongs to.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/value_sets/service_categories/service_category__service_categories.csv"}, "data_type": null, "quote": null, "tags": []}, "data_source": {"name": "data_source", "description": "User-configured field that indicates the data source (e.g. typically named after the payer and state \"BCBS Tennessee\").\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The last time the data was refreshed. Generated by `dbt_utils.pretty_time` as the local time of the `dbt run` environment. Timezone is configurable via the `tuva_last_run` var.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": "#0f3d0b"}, "patch_path": "the_tuva_project://models\\core\\core_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "core", "alias": "medical_claim", "tags": "core", "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#0f3d0b"}}, "created_at": 1702491754.5661478, "relation_name": "devforrest.core.medical_claim", "raw_code": "{{ config(\r\n enabled = var('claims_enabled',var('tuva_marts_enabled',False))\r\n )\r\n}}\r\n\r\n\r\nselect * from {{ ref('core__stg_claims_medical_claim')}}", "language": "sql", "refs": [["core__stg_claims_medical_claim"]], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.core__stg_claims_medical_claim"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\core\\final\\core__medical_claim.sql", "compiled": true, "compiled_code": "\n\n\nselect * from devforrest.core._stg_claims_medical_claim", "extra_ctes_injected": true, "extra_ctes": []}, "test.the_tuva_project.unique_core__medical_claim__claim_id_claim_line_number_.b9ab42f1f0": {"test_metadata": {"name": "unique", "kwargs": {"column_name": "(claim_id||'-'||claim_line_number)", "model": "{{ get_where_subquery(ref('core__medical_claim')) }}"}, "namespace": null}, "database": "devforrest", "schema": "dbt_test__audit", "name": "unique_core__medical_claim__claim_id_claim_line_number_", "resource_type": "test", "package_name": "the_tuva_project", "path": "unique_core__medical_claim__claim_id_claim_line_number_.sql", "original_file_path": "models\\core\\core_models.yml", "unique_id": "test.the_tuva_project.unique_core__medical_claim__claim_id_claim_line_number_.b9ab42f1f0", "fqn": ["the_tuva_project", "core", "unique_core__medical_claim__claim_id_claim_line_number_"], "alias": "unique_core__medical_claim__claim_id_claim_line_number_", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1702491754.597927, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [["core__medical_claim"]], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.the_tuva_project.core__medical_claim"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\core\\core_models.yml\\unique_core__medical_claim__claim_id_claim_line_number_.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n (claim_id||'-'||claim_line_number) as unique_field,\n count(*) as n_records\n\nfrom devforrest.core.medical_claim\nwhere (claim_id||'-'||claim_line_number) is not null\ngroup by (claim_id||'-'||claim_line_number)\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "column_name": null, "file_key_name": "models.core__medical_claim"}, "model.the_tuva_project.acute_inpatient__summary": {"database": "devforrest", "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": "675f1e51a6cba04549e2109213f78b88ba5a226ac90a0d395a3fdef8310a414f"}, "config": {"enabled": true, "alias": "acute_inpatient_summary", "schema": "claims_preprocessing", "database": null, "tags": ["acute_inpatient", "claims_preprocessing"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#0f3d0b"}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["acute_inpatient", "claims_preprocessing"], "description": "This table pulls together all the data needed to perform acute inpatient analytics into a single table.", "columns": {"encounter_id": {"name": "encounter_id", "description": "Unique identifier for the acute inpatient encounter.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "encounter_start_date": {"name": "encounter_start_date", "description": "Date when the patient was admitted.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "encounter_end_date": {"name": "encounter_end_date", "description": "Date when the patient was discharged.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "patient_id": {"name": "patient_id", "description": "Unique identifier for each patient in the dataset.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "admit_age": {"name": "admit_age", "description": "The age of the patient as of their admission date.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "gender": {"name": "gender", "description": "The gender of the patient.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__gender.csv"}, "data_type": null, "quote": null, "tags": []}, "race": {"name": "race", "description": "The race of the patient.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__race.csv"}, "data_type": null, "quote": null, "tags": []}, "facility_npi": {"name": "facility_npi", "description": "The NPI for the facility where the encounter occurred.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "provider_first_name": {"name": "provider_first_name", "description": "The first name of the provider.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "provider_last_name": {"name": "provider_last_name", "description": "The last name of the provider.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "ms_drg_code": {"name": "ms_drg_code", "description": "The MS-DRG code associted with the inpatient visit", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__ms_drg.csv"}, "data_type": null, "quote": null, "tags": []}, "ms_drg_description": {"name": "ms_drg_description", "description": "The MS-DRG description associted with the inpatient visit", "meta": {}, "data_type": null, "quote": null, "tags": []}, "medical_surgical": {"name": "medical_surgical", "description": "Indicates whether the MS-DRG is medical or surgical in nature.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__ms_drg.csv"}, "data_type": null, "quote": null, "tags": []}, "apr_drg_code": {"name": "apr_drg_code", "description": "The APR-DRG code associted with the inpatient visit", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__apr_drg.csv"}, "data_type": null, "quote": null, "tags": []}, "apr_drg_description": {"name": "apr_drg_description", "description": "The APR-DRG description associted with the inpatient visit", "meta": {}, "data_type": null, "quote": null, "tags": []}, "admit_source_code": {"name": "admit_source_code", "description": "Admission source code for the encounter.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__admit_source.csv"}, "data_type": null, "quote": null, "tags": []}, "admit_source_description": {"name": "admit_source_description", "description": "Admission source description for the encounter.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "admit_type_code": {"name": "admit_type_code", "description": "Admission type code for the encounter.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__admit_type.csv"}, "data_type": null, "quote": null, "tags": []}, "admit_type_description": {"name": "admit_type_description", "description": "Admission type description for the encounter.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "discharge_disposition_code": {"name": "discharge_disposition_code", "description": "Discharge disposition code for the encounter.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__discharge_disposition.csv"}, "data_type": null, "quote": null, "tags": []}, "discharge_disposition_description": {"name": "discharge_disposition_description", "description": "Discharge disposition description for the encounter.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "total_paid_amount": {"name": "total_paid_amount", "description": "The total paid amount across all claims for the encounter.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "total_allowed_amount": {"name": "total_allowed_amount", "description": "The total allowed amount across all claims for the encounter.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "total_charge_amount": {"name": "total_charge_amount", "description": "The total charge amount across all claims for the encounter.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "length_of_stay": {"name": "length_of_stay", "description": "The length of stay for the encounter.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "mortality_flag": {"name": "mortality_flag", "description": "1 if a patient died during the encounter, 0 otherwise.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "data_source": {"name": "data_source", "description": "User-configured field that indicates the data source (e.g. typically named after the payer and state \"BCBS Tennessee\").", "meta": {}, "data_type": null, "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The time at with the model was materialized. Generated by `dbt_utils.pretty_time` as the local time of the `dbt run` environment. Timezone is configurable via the `tuva_last_run` var.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": "#0f3d0b"}, "patch_path": "the_tuva_project://models\\claims_preprocessing\\claims_preprocessing_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "claims_preprocessing", "alias": "acute_inpatient_summary", "tags": ["acute_inpatient", "claims_preprocessing"], "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#0f3d0b"}}, "created_at": 1702498384.8975372, "relation_name": "devforrest.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\n select distinct\r\n a.encounter_id\r\n , a.patient_id\r\n , b.encounter_start_date\r\n , b.encounter_end_date\r\nfrom {{ ref('acute_inpatient__encounter_id') }} a\r\ninner join {{ ref('acute_inpatient__encounter_start_and_end_dates') }} b\r\n on a.encounter_id = b.encounter_id\r\n)\r\n\r\n, institutional_claim_details as (\r\n select\r\n b.encounter_id\r\n , first.diagnosis_code_1\r\n , first.diagnosis_code_type\r\n , first.facility_npi as facility_npi\r\n , first.ms_drg_code as ms_drg_code\r\n , first.apr_drg_code as apr_drg_code\r\n , first.admit_source_code as admit_source_code\r\n , first.admit_type_code as admit_type_code\r\n , last.discharge_disposition_code as discharge_disposition_code\r\n , sum(paid_amount) as inst_paid_amount\r\n , sum(allowed_amount) as inst_allowed_amount\r\n , sum(charge_amount) as inst_charge_amount\r\n , max(data_source) as data_source\r\n from {{ ref('medical_claim') }} a\r\n inner join {{ ref('acute_inpatient__encounter_id') }} b\r\n on a.claim_id = b.claim_id\r\n and a.claim_line_number = b.claim_line_number\r\n and a.claim_type = 'institutional'\r\n inner join {{ ref('acute_inpatient__first_claim_values') }} first\r\n on b.encounter_id = first.encounter_id\r\n and first.claim_row = 1\r\n inner join {{ ref('acute_inpatient__last_claim_values') }} last\r\n on b.encounter_id = last.encounter_id\r\n and last.claim_row = 1\r\n group by\r\n b.encounter_id\r\n , first.diagnosis_code_1\r\n , first.diagnosis_code_type\r\n , first.facility_npi\r\n , first.ms_drg_code\r\n , first.apr_drg_code\r\n , first.admit_source_code\r\n , first.admit_type_code\r\n , last.discharge_disposition_code\r\n)\r\n\r\n, professional_claim_details as (\r\n select\r\n b.encounter_id\r\n , sum(paid_amount) as prof_paid_amount\r\n , sum(allowed_amount) as prof_allowed_amount\r\n , sum(charge_amount) as prof_charge_amount\r\n from {{ ref('acute_inpatient__stg_medical_claim') }} a\r\n inner join {{ ref('acute_inpatient__encounter_id') }} b\r\n on a.claim_id = b.claim_id\r\n and a.claim_line_number = b.claim_line_number\r\n and a.claim_type = 'professional'\r\ngroup by 1\r\n)\r\n\r\n, patient as (\r\n select distinct\r\n patient_id\r\n , birth_date\r\n , gender\r\n , race\r\n from {{ ref('acute_inpatient__stg_eligibility') }}\r\n )\r\n\r\n, provider as (\r\n select\r\n a.encounter_id\r\n , max(a.facility_npi) as facility_npi\r\n , b.provider_first_name\r\n , b.provider_last_name\r\n , count(distinct facility_npi) as npi_count\r\n from {{ ref('acute_inpatient__institutional_encounter_id') }} a\r\n left join {{ ref('terminology__provider') }} b\r\n on a.facility_npi = b.npi\r\n group by 1,3,4\r\n)\r\n\r\nselect\r\n a.encounter_id\r\n, a.encounter_start_date\r\n, a.encounter_end_date\r\n, a.patient_id\r\n, {{ dbt.datediff(\"birth_date\",\"encounter_end_date\",\"day\")}}/365 as admit_age\r\n, e.gender\r\n, e.race\r\n, c.diagnosis_code_type as primary_diagnosis_code_type\r\n, c.diagnosis_code_1 as primary_diagnosis_code\r\n, coalesce(icd10cm.description, icd9cm.long_description) as primary_diagnosis_description\r\n, f.facility_npi\r\n, f.provider_first_name\r\n, f.provider_last_name\r\n, c.ms_drg_code\r\n, j.ms_drg_description\r\n, j.medical_surgical\r\n, c.apr_drg_code\r\n, k.apr_drg_description\r\n, c.admit_source_code\r\n, h.admit_source_description\r\n, c.admit_type_code\r\n, i.admit_type_description\r\n, c.discharge_disposition_code\r\n, g.discharge_disposition_description\r\n, c.inst_paid_amount + coalesce(d.prof_paid_amount,0) as total_paid_amount\r\n, c.inst_allowed_amount + coalesce(d.prof_allowed_amount,0) as total_allowed_amount\r\n, c.inst_charge_amount + coalesce(d.prof_charge_amount,0) as total_charge_amount\r\n, {{ dbt.datediff(\"a.encounter_start_date\",\"a.encounter_end_date\",\"day\") }} as length_of_stay\r\n, case\r\n when c.discharge_disposition_code = '20' then 1\r\n else 0\r\n end mortality_flag\r\n, data_source\r\n, '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom distinct_encounters a\r\nleft join institutional_claim_details c\r\n on a.encounter_id = c.encounter_id\r\nleft join professional_claim_details d\r\n on a.encounter_id = d.encounter_id\r\nleft join patient e\r\n on a.patient_id = e.patient_id\r\nleft join provider f\r\n on a.encounter_id = f.encounter_id\r\nleft join {{ ref('terminology__discharge_disposition') }} g\r\n on c.discharge_disposition_code = g.discharge_disposition_code\r\nleft join {{ ref('terminology__admit_source') }} h\r\n on c.admit_source_code = h.admit_source_code\r\nleft join {{ ref('terminology__admit_type') }} i\r\n on c.admit_type_code = i.admit_type_code\r\nleft join {{ ref('terminology__ms_drg') }} j\r\n on c.ms_drg_code = j.ms_drg_code\r\nleft join {{ ref('terminology__apr_drg') }} k\r\n on c.apr_drg_code = k.apr_drg_code\r\nleft join {{ ref('terminology__icd_10_cm')}} icd10cm\r\n on c.diagnosis_code_1 = icd10cm.icd_10_cm\r\n and c.diagnosis_code_type = 'icd-10-cm'\r\nleft join {{ ref('terminology__icd_9_cm')}} icd9cm\r\n on c.diagnosis_code_1 = icd9cm.icd_9_cm\r\n and c.diagnosis_code_type = 'icd-9-cm'", "language": "sql", "refs": [["acute_inpatient__encounter_id"], ["acute_inpatient__encounter_start_and_end_dates"], ["medical_claim"], ["acute_inpatient__encounter_id"], ["acute_inpatient__first_claim_values"], ["acute_inpatient__last_claim_values"], ["acute_inpatient__stg_medical_claim"], ["acute_inpatient__encounter_id"], ["acute_inpatient__stg_eligibility"], ["acute_inpatient__institutional_encounter_id"], ["terminology__provider"], ["terminology__discharge_disposition"], ["terminology__admit_source"], ["terminology__admit_type"], ["terminology__ms_drg"], ["terminology__apr_drg"], ["terminology__icd_10_cm"], ["terminology__icd_9_cm"]], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.datediff"], "nodes": ["model.the_tuva_project.acute_inpatient__encounter_id", "model.the_tuva_project.acute_inpatient__encounter_start_and_end_dates", "model.input_layer.medical_claim", "model.the_tuva_project.acute_inpatient__encounter_id", "model.the_tuva_project.acute_inpatient__first_claim_values", "model.the_tuva_project.acute_inpatient__last_claim_values", "model.the_tuva_project.acute_inpatient__stg_medical_claim", "model.the_tuva_project.acute_inpatient__encounter_id", "model.the_tuva_project.acute_inpatient__stg_eligibility", "model.the_tuva_project.acute_inpatient__institutional_encounter_id", "seed.the_tuva_project.terminology__provider", "seed.the_tuva_project.terminology__discharge_disposition", "seed.the_tuva_project.terminology__admit_source", "seed.the_tuva_project.terminology__admit_type", "seed.the_tuva_project.terminology__ms_drg", "seed.the_tuva_project.terminology__apr_drg", "seed.the_tuva_project.terminology__icd_10_cm", "seed.the_tuva_project.terminology__icd_9_cm"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\claims_preprocessing\\acute_inpatient\\final\\acute_inpatient__summary.sql", "compiled": true, "compiled_code": "\n\nwith __dbt__cte__acute_inpatient__stg_medical_claim as (\n\n\nselect \n claim_id\n, claim_line_number\n, patient_id\n, claim_type\n, claim_start_date\n, claim_end_date\n, admission_date\n, discharge_date\n, facility_npi\n, ms_drg_code\n, apr_drg_code\n, admit_source_code\n, admit_type_code\n, discharge_disposition_code\n, paid_amount\n, allowed_amount\n, charge_amount\n, data_source\n, '2023-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom tuva.input_layer.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-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom tuva.input_layer.eligibility\n),distinct_encounters as (\n select distinct\n a.encounter_id\n , a.patient_id\n , b.encounter_start_date\n , b.encounter_end_date\nfrom devforrest.claims_preprocessing._int_acute_inpatient_encounter_id a\ninner join devforrest.claims_preprocessing._int_acute_inpatient_encounter_start_and_end_dates b\n on a.encounter_id = b.encounter_id\n)\n\n, institutional_claim_details as (\n select\n b.encounter_id\n , first.diagnosis_code_1\n , first.diagnosis_code_type\n , first.facility_npi as facility_npi\n , first.ms_drg_code as ms_drg_code\n , first.apr_drg_code as apr_drg_code\n , first.admit_source_code as admit_source_code\n , first.admit_type_code as admit_type_code\n , last.discharge_disposition_code as discharge_disposition_code\n , sum(paid_amount) as inst_paid_amount\n , sum(allowed_amount) as inst_allowed_amount\n , sum(charge_amount) as inst_charge_amount\n , max(data_source) as data_source\n from tuva.input_layer.medical_claim a\n inner join devforrest.claims_preprocessing._int_acute_inpatient_encounter_id b\n on a.claim_id = b.claim_id\n and a.claim_line_number = b.claim_line_number\n and a.claim_type = 'institutional'\n inner join devforrest.claims_preprocessing._int_acute_inpatient_first_claim_values first\n on b.encounter_id = first.encounter_id\n and first.claim_row = 1\n inner join devforrest.claims_preprocessing._int_acute_inpatient_last_claim_values last\n on b.encounter_id = last.encounter_id\n and last.claim_row = 1\n group by\n b.encounter_id\n , first.diagnosis_code_1\n , first.diagnosis_code_type\n , first.facility_npi\n , first.ms_drg_code\n , first.apr_drg_code\n , first.admit_source_code\n , first.admit_type_code\n , last.discharge_disposition_code\n)\n\n, professional_claim_details as (\n select\n b.encounter_id\n , sum(paid_amount) as prof_paid_amount\n , sum(allowed_amount) as prof_allowed_amount\n , sum(charge_amount) as prof_charge_amount\n from __dbt__cte__acute_inpatient__stg_medical_claim a\n inner join devforrest.claims_preprocessing._int_acute_inpatient_encounter_id b\n on a.claim_id = b.claim_id\n and a.claim_line_number = b.claim_line_number\n and a.claim_type = 'professional'\ngroup by 1\n)\n\n, patient as (\n select distinct\n patient_id\n , birth_date\n , gender\n , race\n from __dbt__cte__acute_inpatient__stg_eligibility\n )\n\n, provider as (\n select\n a.encounter_id\n , max(a.facility_npi) as facility_npi\n , b.provider_first_name\n , b.provider_last_name\n , count(distinct facility_npi) as npi_count\n from devforrest.claims_preprocessing._int_acute_inpatient_institutional_encounter_id a\n left join devforrest.terminology.provider b\n on a.facility_npi = b.npi\n group by 1,3,4\n)\n\nselect\n a.encounter_id\n, a.encounter_start_date\n, a.encounter_end_date\n, a.patient_id\n, datediff(\n day,\n birth_date,\n encounter_end_date\n )/365 as admit_age\n, e.gender\n, e.race\n, c.diagnosis_code_type as primary_diagnosis_code_type\n, c.diagnosis_code_1 as primary_diagnosis_code\n, coalesce(icd10cm.description, icd9cm.long_description) as primary_diagnosis_description\n, f.facility_npi\n, f.provider_first_name\n, f.provider_last_name\n, c.ms_drg_code\n, j.ms_drg_description\n, j.medical_surgical\n, c.apr_drg_code\n, k.apr_drg_description\n, c.admit_source_code\n, h.admit_source_description\n, c.admit_type_code\n, i.admit_type_description\n, c.discharge_disposition_code\n, g.discharge_disposition_description\n, c.inst_paid_amount + coalesce(d.prof_paid_amount,0) as total_paid_amount\n, c.inst_allowed_amount + coalesce(d.prof_allowed_amount,0) as total_allowed_amount\n, c.inst_charge_amount + coalesce(d.prof_charge_amount,0) as total_charge_amount\n, datediff(\n day,\n a.encounter_start_date,\n a.encounter_end_date\n ) as length_of_stay\n, case\n when c.discharge_disposition_code = '20' then 1\n else 0\n end mortality_flag\n, data_source\n, '2023-12-13 23:31:59.089856+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 devforrest.terminology.discharge_disposition g\n on c.discharge_disposition_code = g.discharge_disposition_code\nleft join devforrest.terminology.admit_source h\n on c.admit_source_code = h.admit_source_code\nleft join devforrest.terminology.admit_type i\n on c.admit_type_code = i.admit_type_code\nleft join devforrest.terminology.ms_drg j\n on c.ms_drg_code = j.ms_drg_code\nleft join devforrest.terminology.apr_drg k\n on c.apr_drg_code = k.apr_drg_code\nleft join devforrest.terminology.icd_10_cm icd10cm\n on c.diagnosis_code_1 = icd10cm.icd_10_cm\n and c.diagnosis_code_type = 'icd-10-cm'\nleft join devforrest.terminology.icd_9_cm icd9cm\n on c.diagnosis_code_1 = icd9cm.icd_9_cm\n and c.diagnosis_code_type = 'icd-9-cm'", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.the_tuva_project.acute_inpatient__stg_medical_claim", "sql": " __dbt__cte__acute_inpatient__stg_medical_claim as (\n\n\nselect \n claim_id\n, claim_line_number\n, patient_id\n, claim_type\n, claim_start_date\n, claim_end_date\n, admission_date\n, discharge_date\n, facility_npi\n, ms_drg_code\n, apr_drg_code\n, admit_source_code\n, admit_type_code\n, discharge_disposition_code\n, paid_amount\n, allowed_amount\n, charge_amount\n, data_source\n, '2023-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom tuva.input_layer.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-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom tuva.input_layer.eligibility\n)"}]}, "model.the_tuva_project.quality_measures__summary_long": {"database": "devforrest", "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": "bdfcab3844e7245e8c268f6979d6518dea595f5f6f5c47f8a64c5040ff3ebf6a"}, "config": {"enabled": true, "alias": "summary_long", "schema": "quality_measures", "database": null, "tags": ["quality_measures"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["quality_measures"], "description": "Long view of the results for the reporting version of all measures. Each row represents the results a measure per patient. A null for the denominator indicates that the patient was not eligible for that measure.\n", "columns": {"patient_id": {"name": "patient_id", "description": "Unique patient_id for each person.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "denominator_flag": {"name": "denominator_flag", "description": "The denominator is associated with a given patient population that may be counted as eligible to meet a measure\u2019s inclusion requirements.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "numerator_flag": {"name": "numerator_flag", "description": "The numerator reflects the subset of patients in the denominator for whom a particular service has been provided or for whom a particular outcome has been achieved.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "exclusion_flag": {"name": "exclusion_flag", "description": "Specifications of those characteristics that would cause groups of individuals to be removed from the numerator and/or denominator of a measure although they experience the denominator index event.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "evidence_date": {"name": "evidence_date", "description": "Date of event or service that places patient in the numerator.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "exclusion_date": {"name": "exclusion_date", "description": "Date of event or service that excludes patient from the measure.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "exclusion_reason": {"name": "exclusion_reason", "description": "Reason (usually the value set concept name) that excludes patient from the measure.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "performance_period_begin": {"name": "performance_period_begin", "description": "Beginning date of the performance or measurement period.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "performance_period_end": {"name": "performance_period_end", "description": "Ending date of the performance or measurement period.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "measure_id": {"name": "measure_id", "description": "Unique measure identification number.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/value_sets/quality_measures/quality_measures__measures.csv"}, "data_type": null, "quote": null, "tags": []}, "measure_name": {"name": "measure_name", "description": "Name of the measure.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/value_sets/quality_measures/quality_measures__measures.csv"}, "data_type": null, "quote": null, "tags": []}, "measure_version": {"name": "measure_version", "description": "Version of the measure.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/value_sets/quality_measures/quality_measures__measures.csv"}, "data_type": null, "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The date and timestamp of the dbt run.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://models\\quality_measures\\quality_measures_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "quality_measures", "alias": "summary_long", "tags": "quality_measures", "materialized": "table", "enabled": true, "bind": false}, "created_at": 1702498384.9066517, "relation_name": "devforrest.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 union all\r\n\r\n select * from {{ ref('quality_measures__int_nqf0034_long') }}\r\n)\r\n\r\n, add_data_types as (\r\n\r\n select\r\n cast(patient_id as {{ dbt.type_string() }}) as patient_id\r\n , cast(denominator_flag as integer) as denominator_flag\r\n , cast(numerator_flag as integer) as numerator_flag\r\n , cast(exclusion_flag as integer) as exclusion_flag\r\n , cast(evidence_date as date) as evidence_date\r\n , cast(exclusion_date as date) as exclusion_date\r\n , cast(exclusion_reason as {{ dbt.type_string() }}) as exclusion_reason\r\n , cast(performance_period_begin as date) as performance_period_begin\r\n , cast(performance_period_end as date) as performance_period_end\r\n , cast(measure_id as {{ dbt.type_string() }}) as measure_id\r\n , cast(measure_name as {{ dbt.type_string() }}) as measure_name\r\n , cast(measure_version as {{ dbt.type_string() }}) as measure_version\r\n from measures_unioned\r\n\r\n)\r\n\r\nselect\r\n patient_id\r\n , denominator_flag\r\n , numerator_flag\r\n , exclusion_flag\r\n , evidence_date\r\n , exclusion_date\r\n , exclusion_reason\r\n , performance_period_begin\r\n , performance_period_end\r\n , measure_id\r\n , measure_name\r\n , measure_version\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom add_data_types", "language": "sql", "refs": [["quality_measures__int_nqf2372_long"], ["quality_measures__int_nqf0034_long"]], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.type_string"], "nodes": ["model.the_tuva_project.quality_measures__int_nqf2372_long", "model.the_tuva_project.quality_measures__int_nqf0034_long"]}, "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 devforrest.quality_measures._int_nqf2372_long\n union all\n\n select * from devforrest.quality_measures._int_nqf0034_long\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-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom add_data_types", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.quality_measures__summary_counts": {"database": "devforrest", "schema": "quality_measures", "name": "quality_measures__summary_counts", "resource_type": "model", "package_name": "the_tuva_project", "path": "quality_measures\\final\\quality_measures__summary_counts.sql", "original_file_path": "models\\quality_measures\\final\\quality_measures__summary_counts.sql", "unique_id": "model.the_tuva_project.quality_measures__summary_counts", "fqn": ["the_tuva_project", "quality_measures", "final", "quality_measures__summary_counts"], "alias": "summary_counts", "checksum": {"name": "sha256", "checksum": "44f8fc54e84999f685b0320cb9679e8fbf0afbbd68006d59b8188f732c90def4"}, "config": {"enabled": true, "alias": "summary_counts", "schema": "quality_measures", "database": null, "tags": ["quality_measures"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["quality_measures"], "description": "Reporting measure counts with performance rates.", "columns": {"measure_id": {"name": "measure_id", "description": "Unique measure identification number.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/value_sets/quality_measures/quality_measures__measures.csv"}, "data_type": null, "quote": null, "tags": []}, "measure_name": {"name": "measure_name", "description": "Name of the measure.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/value_sets/quality_measures/quality_measures__measures.csv"}, "data_type": null, "quote": null, "tags": []}, "measure_version": {"name": "measure_version", "description": "Version of the measure.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/value_sets/quality_measures/quality_measures__measures.csv"}, "data_type": null, "quote": null, "tags": []}, "performance_period_begin": {"name": "performance_period_begin", "description": "Beginning date of the performance or measurement period.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "performance_period_end": {"name": "performance_period_end", "description": "Ending date of the performance or measurement period.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "denominator_sum": {"name": "denominator_sum", "description": "The denominator is associated with a given patient population that may be counted as eligible to meet a measure\u2019s inclusion requirements.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "numerator_sum": {"name": "numerator_sum", "description": "The numerator reflects the subset of patients in the denominator for whom a particular service has been provided or for whom a particular outcome has been achieved with exclusion logic applied.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "exclusion_sum": {"name": "exclusion_sum", "description": "Specifications of those characteristics that would cause groups of individuals to be removed from the numerator and/or denominator of a measure although they experience the denominator index event.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "performance_rate": {"name": "performance_rate", "description": "Calculated performance rate. The numerator sum divided by the denominator sum after exclusion logic applied and multiplied by 100.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The date and timestamp of the dbt run.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://models\\quality_measures\\quality_measures_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "quality_measures", "alias": "summary_counts", "tags": "quality_measures", "materialized": "table", "enabled": true, "bind": false}, "created_at": 1702498384.961506, "relation_name": "devforrest.quality_measures.summary_counts", "raw_code": "{{ config(\r\n enabled = var('quality_measures_enabled',var('claims_enabled',var('clinical_enabled',var('tuva_marts_enabled',False))))\r\n )\r\n}}\r\n\r\nwith summary_long as (\r\n\r\n select\r\n measure_id\r\n , measure_name\r\n , measure_version\r\n , performance_period_begin\r\n , performance_period_end\r\n , denominator_flag\r\n , numerator_flag\r\n , exclusion_flag\r\n from {{ ref('quality_measures__summary_long') }}\r\n where measure_id is not null\r\n\r\n)\r\n\r\n, sum_flags as (\r\n\r\n select\r\n measure_id\r\n , measure_name\r\n , measure_version\r\n , performance_period_begin\r\n , performance_period_end\r\n , sum(denominator_flag) as denominator_sum\r\n , sum(numerator_flag) as numerator_sum\r\n , sum(exclusion_flag) as exclusion_sum\r\n from summary_long\r\n group by\r\n measure_id\r\n , measure_name\r\n , measure_version\r\n , performance_period_begin\r\n , performance_period_end\r\n\r\n)\r\n\r\n, calculate_performance_rate as (\r\n\r\n select\r\n measure_id\r\n , measure_name\r\n , measure_version\r\n , performance_period_begin\r\n , performance_period_end\r\n , denominator_sum\r\n , numerator_sum\r\n , exclusion_sum\r\n , (\r\n cast(numerator_sum as {{ dbt.type_numeric() }}) /\r\n (cast(denominator_sum as {{ dbt.type_numeric() }}) - cast(exclusion_sum as {{ dbt.type_numeric() }}))\r\n )*100 as performance_rate\r\n from sum_flags\r\n\r\n)\r\n\r\n, add_data_types as (\r\n\r\n select\r\n cast(measure_id as {{ dbt.type_string() }}) as measure_id\r\n , cast(measure_name as {{ dbt.type_string() }}) as measure_name\r\n , cast(measure_version as {{ dbt.type_string() }}) as measure_version\r\n , cast(performance_period_begin as date) as performance_period_begin\r\n , cast(performance_period_end as date) as performance_period_end\r\n , cast(denominator_sum as integer) as denominator_sum\r\n , cast(numerator_sum as integer) as numerator_sum\r\n , cast(exclusion_sum as integer) as exclusion_sum\r\n , round(cast(performance_rate as {{ dbt.type_numeric() }}),3) as performance_rate\r\n from calculate_performance_rate\r\n\r\n)\r\n\r\nselect\r\n measure_id\r\n , measure_name\r\n , measure_version\r\n , performance_period_begin\r\n , performance_period_end\r\n , denominator_sum\r\n , numerator_sum\r\n , exclusion_sum\r\n , performance_rate\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom add_data_types", "language": "sql", "refs": [["quality_measures__summary_long"]], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.type_numeric", "macro.dbt.type_string"], "nodes": ["model.the_tuva_project.quality_measures__summary_long"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\quality_measures\\final\\quality_measures__summary_counts.sql", "compiled": true, "compiled_code": "\n\nwith summary_long as (\n\n select\n measure_id\n , measure_name\n , measure_version\n , performance_period_begin\n , performance_period_end\n , denominator_flag\n , numerator_flag\n , exclusion_flag\n from devforrest.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-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom add_data_types", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.ed_classification__summary": {"database": "devforrest", "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": "ffa6fd38e101684e239b5e381809a815749d849a551c854dd1bbda9200b1b416"}, "config": {"enabled": true, "alias": "summary", "schema": "ed_classification", "database": null, "tags": ["ed_classification"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["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, "quote": null, "tags": []}, "claim_id": {"name": "claim_id", "description": "Unique identifier for each claim", "meta": {}, "data_type": null, "quote": null, "tags": []}, "patient_id": {"name": "patient_id", "description": "Unique identifier for each person across all datasets", "meta": {}, "data_type": null, "quote": null, "tags": []}, "recorded_date": {"name": "recorded_date", "description": "Date on which the condition was recorded", "meta": {}, "data_type": null, "quote": null, "tags": []}, "code": {"name": "code", "description": "The normalized condition code", "meta": {}, "data_type": null, "quote": null, "tags": []}, "description": {"name": "description", "description": "The normalized description of the condition code", "meta": {}, "data_type": null, "quote": null, "tags": []}, "ccs_description_with_covid": {"name": "ccs_description_with_covid", "description": "The condition category with covid", "meta": {}, "data_type": null, "quote": null, "tags": []}, "recorded_date_year": {"name": "recorded_date_year", "description": "The year of the condition recorded date", "meta": {}, "data_type": null, "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, "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, "quote": null, "tags": []}, "service_category_1": {"name": "service_category_1", "description": "The broader service category the claim belongs to", "meta": {}, "data_type": null, "quote": null, "tags": []}, "service_category_2": {"name": "service_category_2", "description": "The more specific service category the claim belongs to", "meta": {}, "data_type": null, "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, "quote": null, "tags": []}, "provider_first_name": {"name": "provider_first_name", "description": "The provider first name", "meta": {}, "data_type": null, "quote": null, "tags": []}, "provider_last_name": {"name": "provider_last_name", "description": "The provider last name", "meta": {}, "data_type": null, "quote": null, "tags": []}, "provider_organization_name": {"name": "provider_organization_name", "description": "The provider organization", "meta": {}, "data_type": null, "quote": null, "tags": []}, "provider_practice_state": {"name": "provider_practice_state", "description": "The provider practice state", "meta": {}, "data_type": null, "quote": null, "tags": []}, "provider_practice_zip_code": {"name": "provider_practice_zip_code", "description": "The provider practice zip code", "meta": {}, "data_type": null, "quote": null, "tags": []}, "patient_gender": {"name": "patient_gender", "description": "The patient gender", "meta": {}, "data_type": null, "quote": null, "tags": []}, "patient_birth_date": {"name": "patient_birth_date", "description": "The patient date of birth", "meta": {}, "data_type": null, "quote": null, "tags": []}, "patient_age": {"name": "patient_age", "description": "The patient age as of now", "meta": {}, "data_type": null, "quote": null, "tags": []}, "patient_race": {"name": "patient_race", "description": "The patient race", "meta": {}, "data_type": null, "quote": null, "tags": []}, "patient_state": {"name": "patient_state", "description": "The patient state", "meta": {}, "data_type": null, "quote": null, "tags": []}, "classification_name": {"name": "classification_name", "description": "Human readable name of the classification", "meta": {}, "data_type": null, "quote": null, "tags": []}, "classification_order": {"name": "classification_order", "description": "The order of the classification", "meta": {}, "data_type": null, "quote": null, "tags": []}, "classification_column": {"name": "classification_column", "description": "A short hand name of the classification", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "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": 1702498384.9692857, "relation_name": "devforrest.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\n\r\nselect\r\n class.encounter_id\r\n , cat.classification_name as ed_classification_description\r\n , cat.classification_order as ed_classification_order\r\n , class.patient_id\r\n , class.encounter_end_date\r\n , cast({{ date_part(\"year\", \"class.encounter_end_date\") }} as {{ dbt.type_string() }}) \r\n || right('0'||cast({{ date_part(\"month\", \"class.encounter_end_date\") }} as {{ dbt.type_string() }}),2) \r\n as year_month\r\n , class.primary_diagnosis_code\r\n , class.primary_diagnosis_description\r\n , ccsr.ccsr_category as primary_ccsr_code\r\n , ccsr.ccsr_category_description as primary_ccsr_description\r\n , class.paid_amount\r\n , class.allowed_amount\r\n , class.charge_amount\r\n , class.facility_npi\r\n , fac_prov.provider_organization_name as facility_name\r\n , practice_state as facility_state\r\n , practice_city as facility_city\r\n , practice_zip_code as facility_zip_code\r\n , null as facility_latitude\r\n , null as facility_longitude\r\n , pat.sex as patient_sex\r\n , floor({{ datediff('pat.birth_date', 'current_date', 'hour') }} / 8766.0) as patient_age\r\n , zip_code as patient_zip_code\r\n , latitude as patient_latitude\r\n , longitude as patient_longitude\r\n , race as patient_race\r\nfrom {{ ref('ed_classification__int_filter_encounter_with_classification') }} class\r\ninner join {{ ref('ed_classification__categories') }} cat\r\n using(classification)\r\nleft join {{ ref('terminology__provider') }} fac_prov \r\n on class.facility_npi = fac_prov.npi\r\nleft join {{ ref('ed_classification__stg_patient') }} pat\r\n on class.patient_id = pat.patient_id\r\nleft join {{ ref('ccsr__long_condition_category') }} ccsr\r\n on class.encounter_id = ccsr.encounter_id\r\n and class.primary_diagnosis_code = ccsr.normalized_code", "language": "sql", "refs": [["ed_classification__int_filter_encounter_with_classification"], ["ed_classification__categories"], ["terminology__provider"], ["ed_classification__stg_patient"], ["ccsr__long_condition_category"]], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.the_tuva_project.date_part", "macro.dbt.type_string", "macro.dbt.datediff"], "nodes": ["model.the_tuva_project.ed_classification__int_filter_encounter_with_classification", "seed.the_tuva_project.ed_classification__categories", "seed.the_tuva_project.terminology__provider", "model.the_tuva_project.ed_classification__stg_patient", "model.the_tuva_project.ccsr__long_condition_category"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\ed_classification\\final\\ed_classification__summary.sql", "compiled": true, "compiled_code": "\n\n\nwith __dbt__cte__ed_classification__stg_patient as (\n\n\nselect\n patient_id\n , sex\n , birth_date\n , race\n , state\n , zip_code\n , latitude\n , longitude\nfrom devforrest.core.patient\n)select\n class.encounter_id\n , cat.classification_name as ed_classification_description\n , cat.classification_order as ed_classification_order\n , class.patient_id\n , class.encounter_end_date\n , cast(date_part('year', class.encounter_end_date) as TEXT) \n || right('0'||cast(date_part('month', class.encounter_end_date) as TEXT),2) \n as year_month\n , class.primary_diagnosis_code\n , class.primary_diagnosis_description\n , ccsr.ccsr_category as primary_ccsr_code\n , ccsr.ccsr_category_description as primary_ccsr_description\n , class.paid_amount\n , class.allowed_amount\n , class.charge_amount\n , class.facility_npi\n , fac_prov.provider_organization_name as facility_name\n , practice_state as facility_state\n , practice_city as facility_city\n , practice_zip_code as facility_zip_code\n , null as facility_latitude\n , null as facility_longitude\n , pat.sex as patient_sex\n , floor(datediff(\n hour,\n pat.birth_date,\n current_date\n ) / 8766.0) as patient_age\n , zip_code as patient_zip_code\n , latitude as patient_latitude\n , longitude as patient_longitude\n , race as patient_race\nfrom devforrest.ed_classification._int_filter_encounter_with_classification class\ninner join devforrest.ed_classification._value_set_categories cat\n using(classification)\nleft join devforrest.terminology.provider fac_prov \n on class.facility_npi = fac_prov.npi\nleft join __dbt__cte__ed_classification__stg_patient pat\n on class.patient_id = pat.patient_id\nleft join devforrest.ccsr.long_condition_category ccsr\n on class.encounter_id = ccsr.encounter_id\n and class.primary_diagnosis_code = ccsr.normalized_code", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.the_tuva_project.ed_classification__stg_patient", "sql": " __dbt__cte__ed_classification__stg_patient as (\n\n\nselect\n patient_id\n , sex\n , birth_date\n , race\n , state\n , zip_code\n , latitude\n , longitude\nfrom devforrest.core.patient\n)"}]}, "model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_long": {"database": "devforrest", "schema": "chronic_conditions", "name": "chronic_conditions__tuva_chronic_conditions_long", "resource_type": "model", "package_name": "the_tuva_project", "path": "chronic_conditions\\final\\chronic_conditions__tuva_chronic_conditions_long.sql", "original_file_path": "models\\chronic_conditions\\final\\chronic_conditions__tuva_chronic_conditions_long.sql", "unique_id": "model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_long", "fqn": ["the_tuva_project", "chronic_conditions", "final", "chronic_conditions__tuva_chronic_conditions_long"], "alias": "tuva_chronic_conditions_long", "checksum": {"name": "sha256", "checksum": "32f68515d0321c809f2b8aa8d05a563409368b385ef47fcea40c3a7ac6872061"}, "config": {"enabled": true, "alias": "tuva_chronic_conditions_long", "schema": "chronic_conditions", "database": null, "tags": ["tuva_chronic_conditions", "chronic_conditions"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#2e0e0e"}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["tuva_chronic_conditions", "chronic_conditions"], "description": "This model creates one record per patient per condition using the tuva chronic conditions hierarchy as the grouper. The model pulls in the first and last date of the diagnosis that flagged the patient for this condition group.\n", "columns": {"patient_id": {"name": "patient_id", "description": "The unique identifier for a patient", "meta": {}, "data_type": null, "quote": null, "tags": []}, "condition_family": {"name": "condition_family", "description": "A higher level rollup grouping of conditions from the condition column\n", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/value_sets/chronic_conditions/chronic_conditions__tuva_chronic_conditions_hierarchy.csv"}, "data_type": null, "quote": null, "tags": []}, "condition": {"name": "condition", "description": "The name of the condition that each diagnosis code rolls up to\n", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/value_sets/chronic_conditions/chronic_conditions__tuva_chronic_conditions_hierarchy.csv"}, "data_type": null, "quote": null, "tags": []}, "first_diagnosis_date": {"name": "first_diagnosis_date", "description": "The first date when a diagnosis code that rolls up to this condition was coded to this patient\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "last_diagnosis_date": {"name": "last_diagnosis_date", "description": "The last date when a diagnosis code that rolls up to this condition was coded to this patient\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The time at with the model was materialized. Generated by `dbt_utils.pretty_time` as the local time of the `dbt run` environment. Timezone is configurable via the `tuva_last_run` var.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": "#2e0e0e"}, "patch_path": "the_tuva_project://models\\chronic_conditions\\tuva_chronic_conditions_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "chronic_conditions", "alias": "tuva_chronic_conditions_long", "tags": ["tuva_chronic_conditions", "chronic_conditions"], "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#2e0e0e"}}, "created_at": 1702498384.9692857, "relation_name": "devforrest.chronic_conditions.tuva_chronic_conditions_long", "raw_code": "{{ config(\r\n enabled = var('tuva_chronic_conditions_enabled',var('claims_enabled',var('clinical_enabled',var('tuva_marts_enabled',False))))\r\n )\r\n}}\r\n\r\nwith condition_row_number as (\r\n\r\n select \r\n patient_id\r\n , normalized_code\r\n , recorded_date\r\n , row_number() over(\r\n partition by\r\n patient_id\r\n , normalized_code\r\n order by recorded_date asc\r\n ) as rn_asc\r\n , row_number() over(\r\n partition by\r\n patient_id\r\n , normalized_code\r\n order by recorded_date desc\r\n ) as rn_desc\r\n from {{ ref('tuva_chronic_conditions__stg_core__condition') }}\r\n\r\n)\r\n\r\n, patient_conditions as (\r\n\r\n select \r\n patient_id\r\n , normalized_code as icd_10_cm\r\n , max(\r\n case\r\n when rn_asc = 1\r\n then recorded_date\r\n end\r\n ) as first_diagnosis_date\r\n , max(\r\n case\r\n when rn_desc = 1\r\n then recorded_date\r\n end\r\n ) as last_diagnosis_date\r\n from condition_row_number\r\n group by \r\n patient_id\r\n , normalized_code\r\n\r\n)\r\n\r\nselect \r\n pc.patient_id\r\n , h.condition_family\r\n , h.condition\r\n , min(first_diagnosis_date) as first_diagnosis_date\r\n , max(last_diagnosis_date) as last_diagnosis_date\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom {{ ref('chronic_conditions__tuva_chronic_conditions_hierarchy') }} h\r\n inner join patient_conditions pc\r\n on h.icd_10_cm_code = pc.icd_10_cm\r\ngroup by \r\n pc.patient_id\r\n , h.condition_family\r\n , h.condition", "language": "sql", "refs": [["tuva_chronic_conditions__stg_core__condition"], ["chronic_conditions__tuva_chronic_conditions_hierarchy"]], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.tuva_chronic_conditions__stg_core__condition", "seed.the_tuva_project.chronic_conditions__tuva_chronic_conditions_hierarchy"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\chronic_conditions\\final\\chronic_conditions__tuva_chronic_conditions_long.sql", "compiled": true, "compiled_code": "\n\nwith __dbt__cte__tuva_chronic_conditions__stg_core__condition as (\n\n\nselect \n patient_id\n , normalized_code\n , recorded_date\n , '2023-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom devforrest.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-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom devforrest.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-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom devforrest.core.condition\n)"}]}, "model.the_tuva_project.core__observation": {"database": "devforrest", "schema": "core", "name": "core__observation", "resource_type": "model", "package_name": "the_tuva_project", "path": "core\\final\\core__observation.sql", "original_file_path": "models\\core\\final\\core__observation.sql", "unique_id": "model.the_tuva_project.core__observation", "fqn": ["the_tuva_project", "core", "final", "core__observation"], "alias": "observation", "checksum": {"name": "sha256", "checksum": "8e922586d391bb227ab514044d20f47f328a489ae785158adf2d12a7f1c84d4b"}, "config": {"enabled": true, "alias": "observation", "schema": "core", "database": null, "tags": ["core"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#0f3d0b"}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["core"], "description": "The observation table contains information on measurements other than lab tests e.g. blood pressure, height, and weight.\n", "columns": {"observation_id": {"name": "observation_id", "description": "Unique identifier for each observation in the dataset.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "patient_id": {"name": "patient_id", "description": "Unique identifier for each patient in the dataset.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "encounter_id": {"name": "encounter_id", "description": "Unique identifier for each encounter in the dataset.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "panel_id": {"name": "panel_id", "description": "Unique identifier for the panel.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "observation_date": {"name": "observation_date", "description": "Date the observation was recorded.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "observation_type": {"name": "observation_type", "description": "Type of observation.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "source_code_type": {"name": "source_code_type", "description": "Source code type of the observation.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__code_type.csv"}, "data_type": null, "quote": null, "tags": []}, "source_code": {"name": "source_code", "description": "Source code of the observation.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "source_description": {"name": "source_description", "description": "Source description of the observation.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "normalized_code_type": {"name": "normalized_code_type", "description": "Normalized code type of the observation.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "normalized_code": {"name": "normalized_code", "description": "Normalized code of the observation.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "normalized_description": {"name": "normalized_description", "description": "Normalized description of the observatino.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "result": {"name": "result", "description": "The result of the observation.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "source_units": {"name": "source_units", "description": "Source units of the lab test.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "normalized_units": {"name": "normalized_units", "description": "Normalized units of the lab test.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "source_reference_range_low": {"name": "source_reference_range_low", "description": "The low end of the reference range from the source system.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "source_reference_range_high": {"name": "source_reference_range_high", "description": "The high end of the reference range from the source system.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "normalized_reference_range_low": {"name": "normalized_reference_range_low", "description": "The normalized low end of the reference range.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "normalized_reference_range_high": {"name": "normalized_reference_range_high", "description": "The normalized high end of the reference range.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "data_source": {"name": "data_source", "description": "Custom description of the source system e.g. Epic.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The last time the data was refreshed. Generated by `dbt_utils.pretty_time` as the local time of the `dbt run` environment. Timezone is configurable via the `tuva_last_run` var.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": "#0f3d0b"}, "patch_path": "the_tuva_project://models\\core\\core_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "core", "alias": "observation", "tags": "core", "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#0f3d0b"}}, "created_at": 1702498384.9822056, "relation_name": "devforrest.core.observation", "raw_code": "{{ config(\r\n enabled = var('clinical_enabled',var('tuva_marts_enabled',False))\r\n )\r\n}}\r\n\r\n\r\nselect * from {{ ref('core__stg_clinical_observation')}}", "language": "sql", "refs": [["core__stg_clinical_observation"]], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.core__stg_clinical_observation"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\core\\final\\core__observation.sql", "compiled": true, "compiled_code": "\n\n\nselect * from devforrest.core._stg_clinical_observation", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.core__location": {"database": "devforrest", "schema": "core", "name": "core__location", "resource_type": "model", "package_name": "the_tuva_project", "path": "core\\final\\core__location.sql", "original_file_path": "models\\core\\final\\core__location.sql", "unique_id": "model.the_tuva_project.core__location", "fqn": ["the_tuva_project", "core", "final", "core__location"], "alias": "location", "checksum": {"name": "sha256", "checksum": "c37dfb21d3e6de4641e1cb7413e8f44db8eab3f488ee294f7cec3f1e04518273"}, "config": {"enabled": true, "alias": "location", "schema": "core", "database": null, "tags": ["core"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#0f3d0b"}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["core"], "description": "The location table contains information on practice and facility locations where patients receive medical care.\n", "columns": {"location_id": {"name": "location_id", "description": "Unique identifier for each location.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "npi": {"name": "npi", "description": "The national provider identifier associated with the location e.g. facility_npi.\n", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__provider.csv", "terminology_note": "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters."}, "data_type": null, "quote": null, "tags": []}, "name": {"name": "name", "description": "The name of the location.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "facility_type": {"name": "facility_type", "description": "The type of facility e.g. acute care hospital.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "parent_organization": {"name": "parent_organization", "description": "The parent organization associated with the facility.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "address": {"name": "address", "description": "The street address of the location.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "city": {"name": "city", "description": "The city of the location.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "state": {"name": "state", "description": "The state of the location.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "zip_code": {"name": "zip_code", "description": "The zip code of the location.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "latitude": {"name": "latitude", "description": "The latitude of the location.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "longitude": {"name": "longitude", "description": "The longitude of the location.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "data_source": {"name": "data_source", "description": "Custom description of the source system e.g. Epic.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The last time the data was refreshed. Generated by `dbt_utils.pretty_time` as the local time of the `dbt run` environment. Timezone is configurable via the `tuva_last_run` var.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": "#0f3d0b"}, "patch_path": "the_tuva_project://models\\core\\core_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "core", "alias": "location", "tags": "core", "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#0f3d0b"}}, "created_at": 1702498384.9960058, "relation_name": "devforrest.core.location", "raw_code": "{{ config(\r\n enabled = var('claims_enabled',var('clinical_enabled',var('tuva_marts_enabled',False)))\r\n )\r\n}}\r\n\r\n{% if var('clinical_enabled', var('tuva_marts_enabled',False)) == true and var('claims_enabled', var('tuva_marts_enabled',False)) == true -%}\r\n\r\nselect * from {{ ref('core__stg_claims_location') }}\r\nunion all\r\nselect * from {{ ref('core__stg_clinical_location') }}\r\n\r\n{% elif var('clinical_enabled', var('tuva_marts_enabled',False)) == true -%}\r\n\r\nselect * from {{ ref('core__stg_clinical_location') }}\r\n\r\n{% elif var('claims_enabled', var('tuva_marts_enabled',False)) == true -%}\r\n\r\nselect * from {{ ref('core__stg_claims_location') }}\r\n\r\n{%- endif %}", "language": "sql", "refs": [["core__stg_claims_location"], ["core__stg_clinical_location"]], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.core__stg_claims_location", "model.the_tuva_project.core__stg_clinical_location"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\core\\final\\core__location.sql", "compiled": true, "compiled_code": "\n\nselect * from devforrest.core._stg_claims_location\nunion all\nselect * from devforrest.core._stg_clinical_location\n\n", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.core__medication": {"database": "devforrest", "schema": "core", "name": "core__medication", "resource_type": "model", "package_name": "the_tuva_project", "path": "core\\final\\core__medication.sql", "original_file_path": "models\\core\\final\\core__medication.sql", "unique_id": "model.the_tuva_project.core__medication", "fqn": ["the_tuva_project", "core", "final", "core__medication"], "alias": "medication", "checksum": {"name": "sha256", "checksum": "465c23d0e83d37bcd661cec2d9e6b14101d171d7dc5b1481e9ef8e0580998512"}, "config": {"enabled": true, "alias": "medication", "schema": "core", "database": null, "tags": ["core"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#0f3d0b"}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["core"], "description": "The medication table contains information on medications ordered and/or administered during a patient encounter.\n", "columns": {"medication_id": {"name": "medication_id", "description": "Unique identifier for each medication in the table.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "patient_id": {"name": "patient_id", "description": "Unique identifier for each patient in the dataset.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "encounter_id": {"name": "encounter_id", "description": "Unique identifier for each encounter in the dataset.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "dispensing_date": {"name": "dispensing_date", "description": "Date the medication was dispensed.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "prescribing_date": {"name": "prescribing_date", "description": "Date the medication was prescribed.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "source_code_type": {"name": "source_code_type", "description": "The source code type of the medication.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__code_type.csv"}, "data_type": null, "quote": null, "tags": []}, "source_code": {"name": "source_code", "description": "The source code for the medication.", "meta": {"terminology": "https://www.nlm.nih.gov/research/umls/rxnorm/index.html"}, "data_type": null, "quote": null, "tags": []}, "source_description": {"name": "source_description", "description": "The source description of the medication.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "ndc_code": {"name": "ndc_code", "description": "National drug code associated with the medication.", "meta": {"terminology": "https://www.fda.gov/drugs/drug-approvals-and-databases/national-drug-code-directory"}, "data_type": null, "quote": null, "tags": []}, "ndc_description": {"name": "ndc_description", "description": "Description for the NDC.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "rxnorm_code": {"name": "rxnorm_code", "description": "RxNorm code associated with the medication.", "meta": {"terminology": "https://www.nlm.nih.gov/research/umls/rxnorm/index.html"}, "data_type": null, "quote": null, "tags": []}, "rxnorm_description": {"name": "rxnorm_description", "description": "Description for the RxNorm code.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "atc_code": {"name": "atc_code", "description": "ATC code for the medication.", "meta": {"terminology": "https://www.who.int/tools/atc-ddd-toolkit/atc-classification"}, "data_type": null, "quote": null, "tags": []}, "atc_description": {"name": "atc_description", "description": "Description for the ATC code.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "route": {"name": "route", "description": "The route used to administer the medication.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "strength": {"name": "strength", "description": "The strength of the medication.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "quantity": {"name": "quantity", "description": "The quantity of the medication.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "quantity_unit": {"name": "quantity_unit", "description": "The units for the quantity.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "days_supply": {"name": "days_supply", "description": "The number of days supply included.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "practitioner_id": {"name": "practitioner_id", "description": "Unique identifier for the practitioner who ordered the medication.\n", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__provider.csv", "terminology_note": "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters."}, "data_type": null, "quote": null, "tags": []}, "data_source": {"name": "data_source", "description": "Custom description of the source system e.g. Epic.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The last time the data was refreshed. Generated by `dbt_utils.pretty_time` as the local time of the `dbt run` environment. Timezone is configurable via the `tuva_last_run` var.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": "#0f3d0b"}, "patch_path": "the_tuva_project://models\\core\\core_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "core", "alias": "medication", "tags": "core", "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#0f3d0b"}}, "created_at": 1702498384.9960058, "relation_name": "devforrest.core.medication", "raw_code": "{{ config(\r\n enabled = var('clinical_enabled',var('tuva_marts_enabled',False))\r\n )\r\n}}\r\n\r\n\r\nselect * from {{ ref('core__stg_clinical_medication')}}", "language": "sql", "refs": [["core__stg_clinical_medication"]], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.core__stg_clinical_medication"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\core\\final\\core__medication.sql", "compiled": true, "compiled_code": "\n\n\nselect * from devforrest.core._stg_clinical_medication", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.core__pharmacy_claim": {"database": "devforrest", "schema": "core", "name": "core__pharmacy_claim", "resource_type": "model", "package_name": "the_tuva_project", "path": "core\\final\\core__pharmacy_claim.sql", "original_file_path": "models\\core\\final\\core__pharmacy_claim.sql", "unique_id": "model.the_tuva_project.core__pharmacy_claim", "fqn": ["the_tuva_project", "core", "final", "core__pharmacy_claim"], "alias": "pharmacy_claim", "checksum": {"name": "sha256", "checksum": "d6e2bac51e9f18580249d402ed5ddc88c616d33d70781c4adf4dfd980499f836"}, "config": {"enabled": true, "alias": "pharmacy_claim", "schema": "core", "database": null, "tags": ["core"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#0f3d0b"}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["core"], "description": "The pharmacy claim table contains information on prescription drugs that were filled and billed to the insurer.\n", "columns": {"claim_id": {"name": "claim_id", "description": "Unique identifier for each claim.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "claim_line_number": {"name": "claim_line_number", "description": "Indicates the line number for the particular line of the claim.", "meta": {}, "data_type": "integer", "quote": null, "tags": []}, "patient_id": {"name": "patient_id", "description": "Unique identifier for each patient in the dataset.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "member_id": {"name": "member_id", "description": "Identifier that links a patient to a particular insurance product or health plan. A patient can have more than one member_id because they can have more than one insurance product/plan.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "payer": {"name": "payer", "description": "Name of the payer", "meta": {}, "data_type": null, "quote": null, "tags": []}, "plan": {"name": "plan", "description": "Name of the plan", "meta": {}, "data_type": null, "quote": null, "tags": []}, "prescribing_provider_npi": {"name": "prescribing_provider_npi", "description": "NPI for the provider that wrote the prescription (e.g. priamry care physician).\n", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__provider.csv", "terminology_note": "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters."}, "data_type": null, "quote": null, "tags": []}, "dispensing_provider_npi": {"name": "dispensing_provider_npi", "description": "NPI for the provider that dispensed the prescription (e.g. pharmacy).\n", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__provider.csv", "terminology_note": "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters."}, "data_type": null, "quote": null, "tags": []}, "dispensing_date": {"name": "dispensing_date", "description": "Date the prescription was filled.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "ndc_code": {"name": "ndc_code", "description": "National drug code on the claim.", "meta": {"terminology": "https://www.fda.gov/drugs/drug-approvals-and-databases/national-drug-code-directory"}, "data_type": null, "quote": null, "tags": []}, "quantity": {"name": "quantity", "description": "Number of doses.", "meta": {}, "data_type": "integer", "quote": null, "tags": []}, "days_supply": {"name": "days_supply", "description": "Number of days supply.", "meta": {}, "data_type": "integer", "quote": null, "tags": []}, "refills": {"name": "refills", "description": "Number of refills for the prescription.", "meta": {}, "data_type": "integer", "quote": null, "tags": []}, "paid_date": {"name": "paid_date", "description": "Date the claim was paid.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "paid_amount": {"name": "paid_amount", "description": "Amount paid by the health insurer for the claim.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "allowed_amount": {"name": "allowed_amount", "description": "Contractual amount allowed to be paid by the payer + patient.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "coinsurance_amount": {"name": "coinsurance_amount", "description": "The total coinsurance charged on the claim by the provider.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "copayment_amount": {"name": "copayment_amount", "description": "The total copayment charged on the claim by the provider.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "deductible_amount": {"name": "deductible_amount", "description": "The total amount charged on the claim by the provider.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "data_source": {"name": "data_source", "description": "User-configured field that indicates the data source (e.g. typically named after the payer and state \"BCBS Tennessee\").\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The last time the data was refreshed. Generated by `dbt_utils.pretty_time` as the local time of the `dbt run` environment. Timezone is configurable via the `tuva_last_run` var.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": "#0f3d0b"}, "patch_path": "the_tuva_project://models\\core\\core_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "core", "alias": "pharmacy_claim", "tags": "core", "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#0f3d0b"}}, "created_at": 1702498385.0417697, "relation_name": "devforrest.core.pharmacy_claim", "raw_code": "{{ config(\r\n enabled = var('claims_enabled',var('tuva_marts_enabled',False))\r\n )\r\n}}\r\n\r\nselect * from {{ ref('core__stg_claims_pharmacy_claim')}}", "language": "sql", "refs": [["core__stg_claims_pharmacy_claim"]], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.core__stg_claims_pharmacy_claim"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\core\\final\\core__pharmacy_claim.sql", "compiled": true, "compiled_code": "\n\nselect * from devforrest.core._stg_claims_pharmacy_claim", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.readmissions__readmission_summary": {"database": "devforrest", "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": "70cbbf429837ec2a1e87b31e28a96b6cf47ef090fd9f9fd56616b66ea6686e39"}, "config": {"enabled": true, "alias": "readmission_summary", "schema": "readmissions", "database": null, "tags": ["readmissions"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#161a7d"}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["readmissions"], "description": "This model includes all rows from the encounter_augmented model where disqualified_encounter_flag = 0 (all rows for encounters that are not disqualified for data quality issues). For each of these encounters we add fields to indicate whether it had a readmission and, when a readmission was present, to show relevant fields for the readmission.", "columns": {"encounter_id": {"name": "encounter_id", "description": "The unique identifier for the encounter", "meta": {}, "data_type": null, "quote": null, "tags": []}, "patient_id": {"name": "patient_id", "description": "The unique identifier for the patient", "meta": {}, "data_type": null, "quote": null, "tags": []}, "admit_date": {"name": "admit_date", "description": "The date of admission for the inpatient visit", "meta": {}, "data_type": null, "quote": null, "tags": []}, "discharge_date": {"name": "discharge_date", "description": "The date of discharge for the inpatient visit", "meta": {}, "data_type": null, "quote": null, "tags": []}, "discharge_disposition_code": {"name": "discharge_disposition_code", "description": "The valid 2-digit discharge status for the inpatient visit", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__discharge_disposition.csv"}, "data_type": null, "quote": null, "tags": []}, "facility_npi": {"name": "facility_npi", "description": "A name or ID for the facility where the inpatient visit occured", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__provider.csv", "terminology_note": "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters."}, "data_type": null, "quote": null, "tags": []}, "ms_drg_code": {"name": "ms_drg_code", "description": "The MS-DRG associted with the inpatient visit", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__ms_drg.csv"}, "data_type": null, "quote": null, "tags": []}, "total_paid_amount": {"name": "total_paid_amount", "description": "The amount paid for the visit", "meta": {}, "data_type": null, "quote": null, "tags": []}, "length_of_stay": {"name": "length_of_stay", "description": "Integer representing the length of stay of the inpatient visit in days", "meta": {}, "data_type": "integer", "quote": null, "tags": []}, "index_admission_flag": {"name": "index_admission_flag", "description": "Flag to indicate if the encounter is an index admission", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "planned_flag": {"name": "planned_flag", "description": "Flag to indicate if the encounter was planned", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "specialty_cohort": {"name": "specialty_cohort", "description": "Specialty cohort the encounter belongs to", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/value_sets/readmissions/readmissions__specialty_cohort.csv"}, "data_type": null, "quote": null, "tags": []}, "died_flag": {"name": "died_flag", "description": "Flag to indicate of the patient died in this encounter", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "diagnosis_ccs": {"name": "diagnosis_ccs", "description": "CCS code associated with the primary diagnosis for the encounter", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/value_sets/readmissions/readmissions__acute_diagnosis_ccs.csv"}, "data_type": null, "quote": null, "tags": []}, "had_readmission_flag": {"name": "had_readmission_flag", "description": "A flag to indicate whether the encounter had a readmission any number of days after discharge", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "days_to_readmit": {"name": "days_to_readmit", "description": "An integer to indicate the number of days to readmission", "meta": {}, "data_type": "integer", "quote": null, "tags": []}, "readmit_30_flag": {"name": "readmit_30_flag", "description": "A flag to indicate whether the encounter had a 30-day readmission", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "unplanned_readmit_30_flag": {"name": "unplanned_readmit_30_flag", "description": "A flag to indicate whether the encounter had an unplanned 30-day readmission", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "readmission_encounter_id": {"name": "readmission_encounter_id", "description": "The unique identifier for the readmission encounter", "meta": {}, "data_type": null, "quote": null, "tags": []}, "readmission_patient_id": {"name": "readmission_patient_id", "description": "The unique identifier for the patient", "meta": {}, "data_type": null, "quote": null, "tags": []}, "readmission_admit_date": {"name": "readmission_admit_date", "description": "The date of admission for the readmission inpatient visit", "meta": {}, "data_type": null, "quote": null, "tags": []}, "readmission_discharge_date": {"name": "readmission_discharge_date", "description": "The date of discharge for the readmission inpatient visit", "meta": {}, "data_type": null, "quote": null, "tags": []}, "readmission_discharge_disposition_code": {"name": "readmission_discharge_disposition_code", "description": "The valid 2-digit discharge status for the readmission inpatient visit", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__discharge_disposition.csv"}, "data_type": null, "quote": null, "tags": []}, "readmission_facility": {"name": "readmission_facility", "description": "A name or ID for the facility where the readmission inpatient visit occured", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__provider.csv", "terminology_note": "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters."}, "data_type": null, "quote": null, "tags": []}, "readmission_ms_drg": {"name": "readmission_ms_drg", "description": "The MS-DRG associted with the readmission inpatient visit", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__ms_drg.csv"}, "data_type": null, "quote": null, "tags": []}, "readmission_length_of_stay": {"name": "readmission_length_of_stay", "description": "Integer representing the length of stay of the readmission inpatient visit in days", "meta": {}, "data_type": "integer", "quote": null, "tags": []}, "readmission_index_admission_flag": {"name": "readmission_index_admission_flag", "description": "Flag to indicate if the readmission encounter is an index admission", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "readmission_planned_flag": {"name": "readmission_planned_flag", "description": "Flag to indicate if the readmission encounter was planned", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "readmission_specialty_cohort": {"name": "readmission_specialty_cohort", "description": "Specialty cohort the readmission encounter belongs to", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/value_sets/readmissions/readmissions__specialty_cohort.csv"}, "data_type": null, "quote": null, "tags": []}, "readmission_died_flag": {"name": "readmission_died_flag", "description": "Flag to indicate of the patient died in the readmission encounter", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "readmission_diagnosis_ccs": {"name": "readmission_diagnosis_ccs", "description": "CCS code associated with the primary diagnosis for the readmission encounter", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/value_sets/readmissions/readmissions__acute_diagnosis_ccs.csv"}, "data_type": null, "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The time at with the model was materialized. Generated by `dbt_utils.pretty_time` as the local time of the `dbt run` environment. Timezone is configurable via the `tuva_last_run` var.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": "#161a7d"}, "patch_path": "the_tuva_project://models\\readmissions\\readmissions_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "readmissions", "alias": "readmission_summary", "tags": "readmissions", "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#161a7d"}}, "created_at": 1702498385.0730271, "relation_name": "devforrest.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.paid_amount,\r\n aa.length_of_stay,\r\n aa.index_admission_flag,\r\n aa.planned_flag,\r\n aa.specialty_cohort,\r\n aa.died_flag,\r\n aa.diagnosis_ccs,\r\n case\r\n when bb.encounter_id is not null then 1\r\n\t else 0\r\n end as had_readmission_flag,\r\n {{ dbt.datediff(\"aa.discharge_date\", \"bb.admit_date\",\"day\") }} as days_to_readmit,\r\n case\r\n when ({{ dbt.datediff(\"aa.discharge_date\", \"bb.admit_date\",\"day\") }}) <= 30 then 1\r\n\t else 0\r\n end as readmit_30_flag,\r\n case\r\n when\r\n\t (({{ dbt.datediff(\"aa.discharge_date\", \"bb.admit_date\", \"day\") }}) <= 30) and (bb.planned_flag = 0) then 1\r\n\t else 0\r\n end as unplanned_readmit_30_flag,\r\n bb.encounter_id as readmission_encounter_id,\r\n bb.admit_date as readmission_admit_date,\r\n bb.discharge_date as readmission_discharge_date,\r\n bb.discharge_disposition_code as readmission_discharge_disposition_code,\r\n bb.facility_npi as readmission_facility,\r\n bb.ms_drg_code as readmission_ms_drg,\r\n bb.length_of_stay as readmission_length_of_stay,\r\n bb.index_admission_flag as readmission_index_admission_flag,\r\n bb.planned_flag as readmission_planned_flag,\r\n bb.specialty_cohort as readmission_specialty_cohort,\r\n bb.died_flag as readmission_died_flag,\r\n bb.diagnosis_ccs as readmission_diagnosis_ccs,\r\n '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom\r\n encounter_sequence aa\r\n left join encounter_sequence bb\r\n on aa.patient_id = bb.patient_id\r\n and aa.encounter_seq + 1 = bb.encounter_seq\r\n)\r\n\r\nselect *\r\nfrom readmission_calc", "language": "sql", "refs": [["readmissions__encounter_augmented"]], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.datediff"], "nodes": ["model.the_tuva_project.readmissions__encounter_augmented"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\readmissions\\final\\readmissions__readmission_summary.sql", "compiled": true, "compiled_code": "\n\n-- Here calculate days to readmission for encounters\n-- that had a readmission and create readmission flags\n\n\n-- We create the encounter_sequence integer count\n-- which keeps track of what number of encounter each\n-- encounter is for a given patient\nwith encounter_sequence as (\nselect\n *,\n row_number() over(\n partition by patient_id order by admit_date, discharge_date\n ) as encounter_seq\nfrom devforrest.readmissions.encounter_augmented\nwhere disqualified_encounter_flag = 0\n),\n\n\nreadmission_calc as (\nselect\n aa.encounter_id,\n aa.patient_id,\n aa.admit_date,\n aa.discharge_date,\n aa.discharge_disposition_code,\n aa.facility_npi,\n aa.ms_drg_code,\n aa.paid_amount,\n aa.length_of_stay,\n aa.index_admission_flag,\n aa.planned_flag,\n aa.specialty_cohort,\n aa.died_flag,\n aa.diagnosis_ccs,\n case\n when bb.encounter_id is not null then 1\n\t else 0\n end as had_readmission_flag,\n datediff(\n day,\n aa.discharge_date,\n bb.admit_date\n ) as days_to_readmit,\n case\n when (datediff(\n day,\n aa.discharge_date,\n bb.admit_date\n )) <= 30 then 1\n\t else 0\n end as readmit_30_flag,\n case\n when\n\t ((datediff(\n day,\n aa.discharge_date,\n bb.admit_date\n )) <= 30) and (bb.planned_flag = 0) then 1\n\t else 0\n end as unplanned_readmit_30_flag,\n bb.encounter_id as readmission_encounter_id,\n bb.admit_date as readmission_admit_date,\n bb.discharge_date as readmission_discharge_date,\n bb.discharge_disposition_code as readmission_discharge_disposition_code,\n bb.facility_npi as readmission_facility,\n bb.ms_drg_code as readmission_ms_drg,\n bb.length_of_stay as readmission_length_of_stay,\n bb.index_admission_flag as readmission_index_admission_flag,\n bb.planned_flag as readmission_planned_flag,\n bb.specialty_cohort as readmission_specialty_cohort,\n bb.died_flag as readmission_died_flag,\n bb.diagnosis_ccs as readmission_diagnosis_ccs,\n '2023-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom\n encounter_sequence aa\n left join encounter_sequence bb\n on aa.patient_id = bb.patient_id\n and aa.encounter_seq + 1 = bb.encounter_seq\n)\n\nselect *\nfrom readmission_calc", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.chronic_conditions__cms_chronic_conditions_long": {"database": "devforrest", "schema": "chronic_conditions", "name": "chronic_conditions__cms_chronic_conditions_long", "resource_type": "model", "package_name": "the_tuva_project", "path": "chronic_conditions\\final\\chronic_conditions__cms_chronic_conditions_long.sql", "original_file_path": "models\\chronic_conditions\\final\\chronic_conditions__cms_chronic_conditions_long.sql", "unique_id": "model.the_tuva_project.chronic_conditions__cms_chronic_conditions_long", "fqn": ["the_tuva_project", "chronic_conditions", "final", "chronic_conditions__cms_chronic_conditions_long"], "alias": "cms_chronic_conditions_long", "checksum": {"name": "sha256", "checksum": "b4641588f45258fe5df14e4e2e5d139d33a97d5da7a0c0a960fa43571e798a8c"}, "config": {"enabled": true, "alias": "cms_chronic_conditions_long", "schema": "chronic_conditions", "database": null, "tags": ["cms_chronic_conditions", "chronic_conditions"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#2e0e0e"}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["cms_chronic_conditions", "chronic_conditions"], "description": "This model unions condition flags from the 3 upstream stage models that calculate them.\n", "columns": {"patient_id": {"name": "patient_id", "description": "Unique ID for the patient.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "claim_id": {"name": "claim_id", "description": "Unique identifier for each claim.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "start_date": {"name": "start_date", "description": "Start date of the chronic condition derived from diagnosis, procedure, or medication.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "chronic_condition_type": {"name": "chronic_condition_type", "description": "The type of chronic condition as defined by CMS. ('Common' or 'Other chronic or potentially disabling conditions')\n", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/value_sets/chronic_conditions/chronic_conditions__cms_chronic_conditions_hierarchy.csv"}, "data_type": null, "quote": null, "tags": []}, "condition_category": {"name": "condition_category", "description": "The category of the condition (e.g. Cardiovascular Disease).\n", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/value_sets/chronic_conditions/chronic_conditions__cms_chronic_conditions_hierarchy.csv"}, "data_type": null, "quote": null, "tags": []}, "condition": {"name": "condition", "description": "The name of the chronic condition.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/value_sets/chronic_conditions/chronic_conditions__cms_chronic_conditions_hierarchy.csv"}, "data_type": null, "quote": null, "tags": []}, "data_source": {"name": "data_source", "description": "Indicates the name of the source dataset (e.g. Medicare Claims).\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The time at with the model was materialized. Generated by `dbt_utils.pretty_time` as the local time of the `dbt run` environment. Timezone is configurable via the `tuva_last_run` var.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": "#2e0e0e"}, "patch_path": "the_tuva_project://models\\chronic_conditions\\cms_chronic_conditions_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "chronic_conditions", "alias": "cms_chronic_conditions_long", "tags": ["cms_chronic_conditions", "chronic_conditions"], "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#2e0e0e"}}, "created_at": 1702498385.104276, "relation_name": "devforrest.chronic_conditions.cms_chronic_conditions_long", "raw_code": "{{ config(\r\n enabled = var('cms_chronic_conditions_enabled',var('claims_enabled',var('tuva_marts_enabled',False)))\r\n )\r\n}}\r\n\r\nwith conditions_unioned as (\r\n\r\n select * from {{ ref('chronic_conditions__cms_chronic_conditions_all') }}\r\n union distinct\r\n select * from {{ ref('chronic_conditions__cms_chronic_conditions_hiv_aids') }}\r\n union distinct\r\n select * from {{ ref('chronic_conditions__cms_chronic_conditions_oud') }}\r\n\r\n)\r\n\r\nselect\r\n patient_id\r\n , claim_id\r\n , start_date\r\n , chronic_condition_type\r\n , condition_category\r\n , condition\r\n , data_source\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom conditions_unioned", "language": "sql", "refs": [["chronic_conditions__cms_chronic_conditions_all"], ["chronic_conditions__cms_chronic_conditions_hiv_aids"], ["chronic_conditions__cms_chronic_conditions_oud"]], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.chronic_conditions__cms_chronic_conditions_all", "model.the_tuva_project.chronic_conditions__cms_chronic_conditions_hiv_aids", "model.the_tuva_project.chronic_conditions__cms_chronic_conditions_oud"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\chronic_conditions\\final\\chronic_conditions__cms_chronic_conditions_long.sql", "compiled": true, "compiled_code": "\n\nwith conditions_unioned as (\n\n select * from devforrest.chronic_conditions._int_cms_chronic_condition_all\n union distinct\n select * from devforrest.chronic_conditions._int_cms_chronic_condition_hiv_aids\n union distinct\n select * from devforrest.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-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom conditions_unioned", "extra_ctes_injected": true, "extra_ctes": []}, "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": "devforrest", "schema": "dbt_test__audit", "name": "unique_chronic_conditions__tuva_chronic_conditions_long__patient_id___condition_", "resource_type": "test", "package_name": "the_tuva_project", "path": "unique_chronic_conditions__tuv_5a5fdcf2a52369894b11527da0860423.sql", "original_file_path": "models\\chronic_conditions\\tuva_chronic_conditions_models.yml", "unique_id": "test.the_tuva_project.unique_chronic_conditions__tuva_chronic_conditions_long__patient_id___condition_.c9509bb46f", "fqn": ["the_tuva_project", "chronic_conditions", "unique_chronic_conditions__tuva_chronic_conditions_long__patient_id___condition_"], "alias": "unique_chronic_conditions__tuv_5a5fdcf2a52369894b11527da0860423", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "unique_chronic_conditions__tuv_5a5fdcf2a52369894b11527da0860423", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"alias": "unique_chronic_conditions__tuv_5a5fdcf2a52369894b11527da0860423"}, "created_at": 1702498384.9822056, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}{{ config(alias=\"unique_chronic_conditions__tuv_5a5fdcf2a52369894b11527da0860423\") }}", "language": "sql", "refs": [["chronic_conditions__tuva_chronic_conditions_long"]], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_long"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\chronic_conditions\\tuva_chronic_conditions_models.yml\\unique_chronic_conditions__tuv_5a5fdcf2a52369894b11527da0860423.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n (patient_id || '_' || condition) as unique_field,\n count(*) as n_records\n\nfrom devforrest.chronic_conditions.tuva_chronic_conditions_long\nwhere (patient_id || '_' || condition) is not null\ngroup by (patient_id || '_' || condition)\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "column_name": null, "file_key_name": "models.chronic_conditions__tuva_chronic_conditions_long"}, "test.the_tuva_project.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": "devforrest", "schema": "dbt_test__audit", "name": "not_null_chronic_conditions__cms_chronic_conditions_long_patient_id", "resource_type": "test", "package_name": "the_tuva_project", "path": "not_null_chronic_conditions__c_49a2bb666f68dc10cb37814113581b53.sql", "original_file_path": "models\\chronic_conditions\\cms_chronic_conditions_models.yml", "unique_id": "test.the_tuva_project.not_null_chronic_conditions__cms_chronic_conditions_long_patient_id.551c145c85", "fqn": ["the_tuva_project", "chronic_conditions", "not_null_chronic_conditions__cms_chronic_conditions_long_patient_id"], "alias": "not_null_chronic_conditions__c_49a2bb666f68dc10cb37814113581b53", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "not_null_chronic_conditions__c_49a2bb666f68dc10cb37814113581b53", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"alias": "not_null_chronic_conditions__c_49a2bb666f68dc10cb37814113581b53"}, "created_at": 1702498385.104276, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"not_null_chronic_conditions__c_49a2bb666f68dc10cb37814113581b53\") }}", "language": "sql", "refs": [["chronic_conditions__cms_chronic_conditions_long"]], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.the_tuva_project.chronic_conditions__cms_chronic_conditions_long"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\chronic_conditions\\cms_chronic_conditions_models.yml\\not_null_chronic_conditions__c_49a2bb666f68dc10cb37814113581b53.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect patient_id\nfrom devforrest.chronic_conditions.cms_chronic_conditions_long\nwhere patient_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "column_name": "patient_id", "file_key_name": "models.chronic_conditions__cms_chronic_conditions_long"}, "test.the_tuva_project.not_null_chronic_conditions__cms_chronic_conditions_long_claim_id.74242d2abc": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "claim_id", "model": "{{ get_where_subquery(ref('chronic_conditions__cms_chronic_conditions_long')) }}"}, "namespace": null}, "database": "devforrest", "schema": "dbt_test__audit", "name": "not_null_chronic_conditions__cms_chronic_conditions_long_claim_id", "resource_type": "test", "package_name": "the_tuva_project", "path": "not_null_chronic_conditions__c_6cb109fc60fe56040c1e9a18e4e77fd4.sql", "original_file_path": "models\\chronic_conditions\\cms_chronic_conditions_models.yml", "unique_id": "test.the_tuva_project.not_null_chronic_conditions__cms_chronic_conditions_long_claim_id.74242d2abc", "fqn": ["the_tuva_project", "chronic_conditions", "not_null_chronic_conditions__cms_chronic_conditions_long_claim_id"], "alias": "not_null_chronic_conditions__c_6cb109fc60fe56040c1e9a18e4e77fd4", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "not_null_chronic_conditions__c_6cb109fc60fe56040c1e9a18e4e77fd4", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"alias": "not_null_chronic_conditions__c_6cb109fc60fe56040c1e9a18e4e77fd4"}, "created_at": 1702498385.104276, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"not_null_chronic_conditions__c_6cb109fc60fe56040c1e9a18e4e77fd4\") }}", "language": "sql", "refs": [["chronic_conditions__cms_chronic_conditions_long"]], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.the_tuva_project.chronic_conditions__cms_chronic_conditions_long"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\chronic_conditions\\cms_chronic_conditions_models.yml\\not_null_chronic_conditions__c_6cb109fc60fe56040c1e9a18e4e77fd4.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect claim_id\nfrom devforrest.chronic_conditions.cms_chronic_conditions_long\nwhere claim_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "column_name": "claim_id", "file_key_name": "models.chronic_conditions__cms_chronic_conditions_long"}, "test.the_tuva_project.not_null_chronic_conditions__cms_chronic_conditions_long_condition.e794460ae3": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "condition", "model": "{{ get_where_subquery(ref('chronic_conditions__cms_chronic_conditions_long')) }}"}, "namespace": null}, "database": "devforrest", "schema": "dbt_test__audit", "name": "not_null_chronic_conditions__cms_chronic_conditions_long_condition", "resource_type": "test", "package_name": "the_tuva_project", "path": "not_null_chronic_conditions__c_9ae72d56fe6849d0aacc73d604c5b0cf.sql", "original_file_path": "models\\chronic_conditions\\cms_chronic_conditions_models.yml", "unique_id": "test.the_tuva_project.not_null_chronic_conditions__cms_chronic_conditions_long_condition.e794460ae3", "fqn": ["the_tuva_project", "chronic_conditions", "not_null_chronic_conditions__cms_chronic_conditions_long_condition"], "alias": "not_null_chronic_conditions__c_9ae72d56fe6849d0aacc73d604c5b0cf", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "not_null_chronic_conditions__c_9ae72d56fe6849d0aacc73d604c5b0cf", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"alias": "not_null_chronic_conditions__c_9ae72d56fe6849d0aacc73d604c5b0cf"}, "created_at": 1702498385.104276, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"not_null_chronic_conditions__c_9ae72d56fe6849d0aacc73d604c5b0cf\") }}", "language": "sql", "refs": [["chronic_conditions__cms_chronic_conditions_long"]], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.the_tuva_project.chronic_conditions__cms_chronic_conditions_long"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\chronic_conditions\\cms_chronic_conditions_models.yml\\not_null_chronic_conditions__c_9ae72d56fe6849d0aacc73d604c5b0cf.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect condition\nfrom devforrest.chronic_conditions.cms_chronic_conditions_long\nwhere condition is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "column_name": "condition", "file_key_name": "models.chronic_conditions__cms_chronic_conditions_long"}, "test.the_tuva_project.unique_chronic_conditions__cms_chronic_conditions_long__patient_id_claim_id_start_date_condition_.fba1518320": {"test_metadata": {"name": "unique", "kwargs": {"column_name": "(patient_id || claim_id || start_date || condition)", "model": "{{ get_where_subquery(ref('chronic_conditions__cms_chronic_conditions_long')) }}"}, "namespace": null}, "database": "devforrest", "schema": "dbt_test__audit", "name": "unique_chronic_conditions__cms_chronic_conditions_long__patient_id_claim_id_start_date_condition_", "resource_type": "test", "package_name": "the_tuva_project", "path": "unique_chronic_conditions__cms_a604d2d2a2cdd1e22a6855beff37d57b.sql", "original_file_path": "models\\chronic_conditions\\cms_chronic_conditions_models.yml", "unique_id": "test.the_tuva_project.unique_chronic_conditions__cms_chronic_conditions_long__patient_id_claim_id_start_date_condition_.fba1518320", "fqn": ["the_tuva_project", "chronic_conditions", "unique_chronic_conditions__cms_chronic_conditions_long__patient_id_claim_id_start_date_condition_"], "alias": "unique_chronic_conditions__cms_a604d2d2a2cdd1e22a6855beff37d57b", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "unique_chronic_conditions__cms_a604d2d2a2cdd1e22a6855beff37d57b", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"alias": "unique_chronic_conditions__cms_a604d2d2a2cdd1e22a6855beff37d57b"}, "created_at": 1702498385.104276, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}{{ config(alias=\"unique_chronic_conditions__cms_a604d2d2a2cdd1e22a6855beff37d57b\") }}", "language": "sql", "refs": [["chronic_conditions__cms_chronic_conditions_long"]], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.the_tuva_project.chronic_conditions__cms_chronic_conditions_long"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\chronic_conditions\\cms_chronic_conditions_models.yml\\unique_chronic_conditions__cms_a604d2d2a2cdd1e22a6855beff37d57b.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n (patient_id || claim_id || start_date || condition) as unique_field,\n count(*) as n_records\n\nfrom devforrest.chronic_conditions.cms_chronic_conditions_long\nwhere (patient_id || claim_id || start_date || condition) is not null\ngroup by (patient_id || claim_id || start_date || condition)\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "column_name": null, "file_key_name": "models.chronic_conditions__cms_chronic_conditions_long"}, "model.input_layer.practitioner": {"database": "tuva", "schema": "input_layer", "name": "practitioner", "resource_type": "model", "package_name": "input_layer", "path": "practitioner.sql", "original_file_path": "models\\practitioner.sql", "unique_id": "model.input_layer.practitioner", "fqn": ["input_layer", "practitioner"], "alias": "practitioner", "checksum": {"name": "sha256", "checksum": "9fe84cd99530a39b3a4dc46666835452ba3737366cdc09319eec8db1e5938446"}, "config": {"enabled": true, "alias": null, "schema": "input_layer", "database": "tuva", "tags": [], "meta": {}, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": [], "description": "The practitioner table contains information on the providers in the dataset e.g. physicians, physicians assistants, etc.\n", "columns": {"practitioner_id": {"name": "practitioner_id", "description": "Unique ID for the provider.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "npi": {"name": "npi", "description": "NPI for the provider.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__provider.csv", "terminology_note": "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters."}, "data_type": null, "quote": null, "tags": []}, "first_name": {"name": "first_name", "description": "First name of the provider.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "last_name": {"name": "last_name", "description": "Last name of the provider.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "practice_affiliation": {"name": "practice_affiliation", "description": "Practice affiliation of the provider.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "specialty": {"name": "specialty", "description": "Specialty of the provider.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "sub_specialty": {"name": "sub_specialty", "description": "Sub specialty of the provider.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "data_source": {"name": "data_source", "description": "User-configured field that indicates the data source (e.g. typically named after the payer and state \"BCBS Tennessee\").\n", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "input_layer://models\\_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"bind": false, "database": "tuva", "schema": "input_layer"}, "created_at": 1702499716.9800348, "relation_name": "tuva.input_layer.practitioner", "raw_code": "select\r\n cast(null as {{ dbt.type_string() }} ) as practitioner_id\r\n , cast(null as {{ dbt.type_string() }} ) as npi\r\n , cast(null as {{ dbt.type_string() }} ) as first_name\r\n , cast(null as {{ dbt.type_string() }} ) as last_name\r\n , cast(null as {{ dbt.type_string() }} ) as practice_affiliation\r\n , cast(null as {{ dbt.type_string() }} ) as specialty\r\n , cast(null as {{ dbt.type_string() }} ) as sub_specialty\r\n , cast(null as {{ dbt.type_string() }} ) as data_source\r\nlimit 0", "language": "sql", "refs": [], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.type_string"], "nodes": []}, "compiled_path": "../target\\compiled\\input_layer\\models\\practitioner.sql", "compiled": true, "compiled_code": "select\n cast(null as TEXT ) as practitioner_id\n , cast(null as TEXT ) as npi\n , cast(null as TEXT ) as first_name\n , cast(null as TEXT ) as last_name\n , cast(null as TEXT ) as practice_affiliation\n , cast(null as TEXT ) as specialty\n , cast(null as TEXT ) as sub_specialty\n , cast(null as TEXT ) as data_source\nlimit 0", "extra_ctes_injected": true, "extra_ctes": []}, "model.input_layer.eligibility": {"database": "tuva", "schema": "input_layer", "name": "eligibility", "resource_type": "model", "package_name": "input_layer", "path": "eligibility.sql", "original_file_path": "models\\eligibility.sql", "unique_id": "model.input_layer.eligibility", "fqn": ["input_layer", "eligibility"], "alias": "eligibility", "checksum": {"name": "sha256", "checksum": "1fc13a2194f7e5d789b89be2bd162fab9257d12288b02ddfeec33cb2c6deb2a5"}, "config": {"enabled": true, "alias": null, "schema": "input_layer", "database": "tuva", "tags": [], "meta": {}, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": [], "description": "The eligibility table includes information about a patient's health insurance coverage and demographics (note: we use the word patient as a synonym for member). Every claims dataset should include some sort of eligibility data, otherwise it's impossible to calculate member months, which are needed to calculate measures like PMPM.\n", "columns": {"patient_id": {"name": "patient_id", "description": "Unique identifier for each patient in the dataset.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "member_id": {"name": "member_id", "description": "Identifier that links a patient to a particular insurance product or health plan. A patient can have more than one member_id because they can have more than one insurance product/plan.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "gender": {"name": "gender", "description": "Biological sex of the patient.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__gender.csv"}, "data_type": null, "quote": null, "tags": []}, "race": {"name": "race", "description": "Race of the patient.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__race.csv"}, "data_type": null, "quote": null, "tags": []}, "birth_date": {"name": "birth_date", "description": "Date the patient was born.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "death_date": {"name": "death_date", "description": "Date the patient died.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "death_flag": {"name": "death_flag", "description": "Indicates whether the patient has died.", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "enrollment_start_date": {"name": "enrollment_start_date", "description": "Date the patient's insurance eligibility began.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "enrollment_end_date": {"name": "enrollment_end_date", "description": "Date the patient's insurance eligibility ended.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "payer": {"name": "payer", "description": "Name of the payer (i.e. health insurer) providing coverage.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "payer_type": {"name": "payer_type", "description": "Type of payer (e.g. commercial, medicare, medicaid, etc.).", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__payer_type.csv"}, "data_type": null, "quote": null, "tags": []}, "plan": {"name": "plan", "description": "Name of the plan (i.e. sub contract) providing coverage.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "original_reason_entitlement_code": {"name": "original_reason_entitlement_code", "description": "Original reason for Medicare entitlement code.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__medicare_orec.csv"}, "data_type": null, "quote": null, "tags": []}, "dual_status_code": {"name": "dual_status_code", "description": "Indicates whether the patient is dually eligible for Medicare and Medicaid.\n", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__medicare_dual_eligibility.csv"}, "data_type": null, "quote": null, "tags": []}, "medicare_status_code": {"name": "medicare_status_code", "description": "Indicates how the patient became eligible for Medicare.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__medicare_status.csv"}, "data_type": null, "quote": null, "tags": []}, "first_name": {"name": "first_name", "description": "Patient's first name.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "last_name": {"name": "last_name", "description": "Patient's last name.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "address": {"name": "address", "description": "Patient's street address.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "city": {"name": "city", "description": "Patient's city of address.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "state": {"name": "state", "description": "State the patient lives in (most recent known address)", "meta": {}, "data_type": null, "quote": null, "tags": []}, "zip_code": {"name": "zip_code", "description": "Zip code the patient lives in (most recent known address).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "phone": {"name": "phone", "description": "Patient's phone number.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "data_source": {"name": "data_source", "description": "User-configured field that indicates the data source (e.g. typically named after the payer and state \"BCBS Tennessee\").\n", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "input_layer://models\\_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"bind": false, "database": "tuva", "schema": "input_layer"}, "created_at": 1702499716.9963672, "relation_name": "tuva.input_layer.eligibility", "raw_code": "select\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 , plan\r\n , original_reason_entitlement_code\r\n , dual_status_code\r\n , medicare_status_code\r\n , first_name\r\n , last_name\r\n , address\r\n , city\r\n , state\r\n , zip_code\r\n , phone\r\n , data_source\r\nfrom {{ ref('eligibility_seed') }}", "language": "sql", "refs": [["eligibility_seed"]], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["seed.input_layer.eligibility_seed"]}, "compiled_path": "../target\\compiled\\input_layer\\models\\eligibility.sql", "compiled": true, "compiled_code": "select\n patient_id\n , member_id\n , gender\n , race\n , birth_date\n , death_date\n , death_flag\n , enrollment_start_date\n , enrollment_end_date\n , payer\n , payer_type\n , plan\n , original_reason_entitlement_code\n , dual_status_code\n , medicare_status_code\n , first_name\n , last_name\n , address\n , city\n , state\n , zip_code\n , phone\n , data_source\nfrom devforrest._tuva_synthetic.eligibility_seed", "extra_ctes_injected": true, "extra_ctes": []}, "model.input_layer.pharmacy_claim": {"database": "tuva", "schema": "input_layer", "name": "pharmacy_claim", "resource_type": "model", "package_name": "input_layer", "path": "pharmacy_claim.sql", "original_file_path": "models\\pharmacy_claim.sql", "unique_id": "model.input_layer.pharmacy_claim", "fqn": ["input_layer", "pharmacy_claim"], "alias": "pharmacy_claim", "checksum": {"name": "sha256", "checksum": "a9e35276505dba374dbf183f43276406c21f3ace585c9aa4953b2340abbca4ad"}, "config": {"enabled": true, "alias": null, "schema": "input_layer", "database": "tuva", "tags": [], "meta": {}, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": [], "description": "The pharmacy_claim table includes information about retail and specialty drug prescriptions that have been filled by a patient, billed by a pharmacy, and paid by an insurer.\n", "columns": {"claim_id": {"name": "claim_id", "description": "Unique identifier for each claim.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "claim_line_number": {"name": "claim_line_number", "description": "Indicates the line number for the particular line of the claim.\n", "meta": {}, "data_type": "integer", "quote": null, "tags": []}, "patient_id": {"name": "patient_id", "description": "Unique identifier for each patient in the dataset.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "member_id": {"name": "member_id", "description": "Identifier that links a patient to a particular insurance product or health plan. A patient can have more than one member_id because they can have more than one insurance product/plan.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "payer": {"name": "payer", "description": "Name of the payer (i.e. health insurer) providing coverage.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "plan": {"name": "plan", "description": "Name of the plan", "meta": {}, "data_type": null, "quote": null, "tags": []}, "prescribing_provider_npi": {"name": "prescribing_provider_npi", "description": "NPI for the provider that wrote the prescription (e.g. priamry care physician).\n", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__provider.csv", "terminology_note": "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters."}, "data_type": null, "quote": null, "tags": []}, "dispensing_provider_npi": {"name": "dispensing_provider_npi", "description": "NPI for the provider that dispensed the prescription (e.g. pharmacy).\n", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__provider.csv", "terminology_note": "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters."}, "data_type": null, "quote": null, "tags": []}, "dispensing_date": {"name": "dispensing_date", "description": "Date the prescription was filled.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "ndc_code": {"name": "ndc_code", "description": "National drug code on the claim.", "meta": {"terminology": "https://www.fda.gov/drugs/drug-approvals-and-databases/national-drug-code-directory"}, "data_type": null, "quote": null, "tags": []}, "quantity": {"name": "quantity", "description": "Number of doses.", "meta": {}, "data_type": "integer", "quote": null, "tags": []}, "days_supply": {"name": "days_supply", "description": "Number of days supply.", "meta": {}, "data_type": "integer", "quote": null, "tags": []}, "refills": {"name": "refills", "description": "Number of refills for the prescription.", "meta": {}, "data_type": "integer", "quote": null, "tags": []}, "paid_date": {"name": "paid_date", "description": "Date the claim was paid.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "paid_amount": {"name": "paid_amount", "description": "Amount paid by the health insurer for the claim.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "allowed_amount": {"name": "allowed_amount", "description": "Contractual amount allowed to be paid by the payer + patient.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "coinsurance_amount": {"name": "coinsurance_amount", "description": "The total coinsurance charged on the claim by the provider.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "copayment_amount": {"name": "copayment_amount", "description": "The total copayment charged on the claim by the provider.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "deductible_amount": {"name": "deductible_amount", "description": "The total amount charged on the claim by the provider.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "data_source": {"name": "data_source", "description": "User-configured field that indicates the data source (e.g. typically named after the payer and state \"BCBS Tennessee\").\n", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "input_layer://models\\_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"bind": false, "database": "tuva", "schema": "input_layer"}, "created_at": 1702499717.0733624, "relation_name": "tuva.input_layer.pharmacy_claim", "raw_code": "select\r\n claim_id\r\n , claim_line_number\r\n , patient_id\r\n , member_id\r\n , payer\r\n , plan\r\n , prescribing_provider_npi\r\n , dispensing_provider_npi\r\n , dispensing_date\r\n , ndc_code\r\n , quantity\r\n , days_supply\r\n , refills\r\n , paid_date\r\n , paid_amount\r\n , allowed_amount\r\n , coinsurance_amount\r\n , copayment_amount\r\n , deductible_amount\r\n , data_source\r\nfrom {{ ref('pharmacy_claim_seed') }}", "language": "sql", "refs": [["pharmacy_claim_seed"]], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["seed.input_layer.pharmacy_claim_seed"]}, "compiled_path": "../target\\compiled\\input_layer\\models\\pharmacy_claim.sql", "compiled": true, "compiled_code": "select\n claim_id\n , claim_line_number\n , patient_id\n , member_id\n , payer\n , plan\n , prescribing_provider_npi\n , dispensing_provider_npi\n , dispensing_date\n , ndc_code\n , quantity\n , days_supply\n , refills\n , paid_date\n , paid_amount\n , allowed_amount\n , coinsurance_amount\n , copayment_amount\n , deductible_amount\n , data_source\nfrom devforrest._tuva_synthetic.pharmacy_claim_seed", "extra_ctes_injected": true, "extra_ctes": []}, "model.input_layer.patient": {"database": "tuva", "schema": "input_layer", "name": "patient", "resource_type": "model", "package_name": "input_layer", "path": "patient.sql", "original_file_path": "models\\patient.sql", "unique_id": "model.input_layer.patient", "fqn": ["input_layer", "patient"], "alias": "patient", "checksum": {"name": "sha256", "checksum": "c2bcf03eb231f24c61e11a4c6af73b75f9b59ec3e1e15053ee43ca4d3cacf8e2"}, "config": {"enabled": true, "alias": null, "schema": "input_layer", "database": "tuva", "tags": [], "meta": {}, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": [], "description": "The patient table contains demographic and geographic information on patients.\n", "columns": {"patient_id": {"name": "patient_id", "description": "Unique identifier for each person across all datasets.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "first_name": {"name": "first_name", "description": "The first name of the patient.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "last_name": {"name": "last_name", "description": "The last name of the patient.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "sex": {"name": "sex", "description": "The gender of the patient.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__gender.csv"}, "data_type": null, "quote": null, "tags": []}, "race": {"name": "race", "description": "The race of the patient.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__race.csv"}, "data_type": null, "quote": null, "tags": []}, "birth_date": {"name": "birth_date", "description": "The birth date of the patient.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "death_date": {"name": "death_date", "description": "The death date of the patient if there is one.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "death_flag": {"name": "death_flag", "description": "A flag indicating if the patient has died.", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "address": {"name": "address", "description": "The address of the patient.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "city": {"name": "city", "description": "The city where the patient lives.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "state": {"name": "state", "description": "The state where the patient lives.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "zip_code": {"name": "zip_code", "description": "The zip code for the patient.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "county": {"name": "county", "description": "The county for the patient.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "latitude": {"name": "latitude", "description": "The latitude for the patient.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "longitude": {"name": "longitude", "description": "The longitude for the patient.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "data_source": {"name": "data_source", "description": "User-configured field that indicates the data source (e.g. typically named after the payer and state \"BCBS Tennessee\").\n", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "input_layer://models\\_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"bind": false, "database": "tuva", "schema": "input_layer"}, "created_at": 1702499717.089099, "relation_name": "tuva.input_layer.patient", "raw_code": "select\r\n cast(null as {{ dbt.type_string() }} ) as patient_id\r\n , cast(null as {{ dbt.type_string() }} ) as first_name\r\n , cast(null as {{ dbt.type_string() }} ) as last_name\r\n , cast(null as {{ dbt.type_string() }} ) as sex\r\n , cast(null as {{ dbt.type_string() }} ) as race\r\n , cast(null as date) as birth_date\r\n , cast(null as date) as death_date\r\n , cast(null as {{ dbt.type_int() }} ) as death_flag\r\n , cast(null as {{ dbt.type_string() }} ) as address\r\n , cast(null as {{ dbt.type_string() }} ) as city\r\n , cast(null as {{ dbt.type_string() }} ) as state\r\n , cast(null as {{ dbt.type_string() }} ) as zip_code\r\n , cast(null as {{ dbt.type_string() }} ) as county\r\n , cast(null as {{ dbt.type_float() }} ) as latitude\r\n , cast(null as {{ dbt.type_float() }} ) as longitude\r\n , cast(null as {{ dbt.type_string() }} ) as data_source\r\nlimit 0", "language": "sql", "refs": [], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.type_string", "macro.dbt.type_int", "macro.dbt.type_float"], "nodes": []}, "compiled_path": "../target\\compiled\\input_layer\\models\\patient.sql", "compiled": true, "compiled_code": "select\n cast(null as TEXT ) as patient_id\n , cast(null as TEXT ) as first_name\n , cast(null as TEXT ) as last_name\n , cast(null as TEXT ) as sex\n , cast(null as TEXT ) as race\n , cast(null as date) as birth_date\n , cast(null as date) as death_date\n , cast(null as INT ) as death_flag\n , cast(null as TEXT ) as address\n , cast(null as TEXT ) as city\n , cast(null as TEXT ) as state\n , cast(null as TEXT ) as zip_code\n , cast(null as TEXT ) as county\n , cast(null as FLOAT ) as latitude\n , cast(null as FLOAT ) as longitude\n , cast(null as TEXT ) as data_source\nlimit 0", "extra_ctes_injected": true, "extra_ctes": []}, "model.input_layer.observation": {"database": "tuva", "schema": "input_layer", "name": "observation", "resource_type": "model", "package_name": "input_layer", "path": "observation.sql", "original_file_path": "models\\observation.sql", "unique_id": "model.input_layer.observation", "fqn": ["input_layer", "observation"], "alias": "observation", "checksum": {"name": "sha256", "checksum": "8e2826bb0302d2bc2414217c29d3c5f23a0cae4a2f360b9f3da32f4cc9265b2b"}, "config": {"enabled": true, "alias": null, "schema": "input_layer", "database": "tuva", "tags": [], "meta": {}, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": [], "description": "The observation table contains information on measurements other than lab tests e.g. blood pressure, height, and weight.\n", "columns": {"observation_id": {"name": "observation_id", "description": "Unique identifier for each observation in the dataset.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "patient_id": {"name": "patient_id", "description": "Unique identifier for each patient in the dataset.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "encounter_id": {"name": "encounter_id", "description": "Unique identifier for each encounter in the dataset.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "panel_id": {"name": "panel_id", "description": "Unique identifier for the panel.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "observation_date": {"name": "observation_date", "description": "Date the observation was recorded.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "observation_type": {"name": "observation_type", "description": "Type of observation.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "source_code_type": {"name": "source_code_type", "description": "Source code type of the observation.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__code_type.csv"}, "data_type": null, "quote": null, "tags": []}, "source_code": {"name": "source_code", "description": "Source code of the observation.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "source_description": {"name": "source_description", "description": "Source description of the observation.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "normalized_code_type": {"name": "normalized_code_type", "description": "Normalized code type of the observation.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "normalized_code": {"name": "normalized_code", "description": "Normalized code of the observation.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "normalized_description": {"name": "normalized_description", "description": "Normalized description of the observatino.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "result": {"name": "result", "description": "The result of the observation.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "source_units": {"name": "source_units", "description": "Source units of the lab test.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "normalized_units": {"name": "normalized_units", "description": "Normalized units of the lab test.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "source_reference_range_low": {"name": "source_reference_range_low", "description": "The low end of the reference range from the source system.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "source_reference_range_high": {"name": "source_reference_range_high", "description": "The high end of the reference range from the source system.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "normalized_reference_range_low": {"name": "normalized_reference_range_low", "description": "The normalized low end of the reference range.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "normalized_reference_range_high": {"name": "normalized_reference_range_high", "description": "The normalized high end of the reference range.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "data_source": {"name": "data_source", "description": "Custom description of the source system e.g. Epic.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "input_layer://models\\_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"bind": false, "database": "tuva", "schema": "input_layer"}, "created_at": 1702499717.1047308, "relation_name": "tuva.input_layer.observation", "raw_code": "select\r\n cast(null as {{ dbt.type_string() }} ) as observation_id\r\n , cast(null as {{ dbt.type_string() }} ) as patient_id\r\n , cast(null as {{ dbt.type_string() }} ) as encounter_id\r\n , cast(null as {{ dbt.type_string() }} ) as panel_id\r\n , cast(null as date) as observation_date\r\n , cast(null as {{ dbt.type_string() }} ) as observation_type\r\n , cast(null as {{ dbt.type_string() }} ) as source_code_type\r\n , cast(null as {{ dbt.type_string() }} ) as source_code\r\n , cast(null as {{ dbt.type_string() }} ) as source_description\r\n , cast(null as {{ dbt.type_string() }} ) as normalized_code_type\r\n , cast(null as {{ dbt.type_string() }} ) as normalized_code\r\n , cast(null as {{ dbt.type_string() }} ) as normalized_description\r\n , cast(null as {{ dbt.type_string() }} ) as result\r\n , cast(null as {{ dbt.type_string() }} ) as source_units\r\n , cast(null as {{ dbt.type_string() }} ) as normalized_units\r\n , cast(null as {{ dbt.type_string() }} ) as source_reference_range_low\r\n , cast(null as {{ dbt.type_string() }} ) as source_reference_range_high\r\n , cast(null as {{ dbt.type_string() }} ) as normalized_reference_range_low\r\n , cast(null as {{ dbt.type_string() }} ) as normalized_reference_range_high\r\n , cast(null as {{ dbt.type_string() }} ) as data_source\r\nlimit 0", "language": "sql", "refs": [], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.type_string"], "nodes": []}, "compiled_path": "../target\\compiled\\input_layer\\models\\observation.sql", "compiled": true, "compiled_code": "select\n cast(null as TEXT ) as observation_id\n , cast(null as TEXT ) as patient_id\n , cast(null as TEXT ) as encounter_id\n , cast(null as TEXT ) as panel_id\n , cast(null as date) as observation_date\n , cast(null as TEXT ) as observation_type\n , cast(null as TEXT ) as source_code_type\n , cast(null as TEXT ) as source_code\n , cast(null as TEXT ) as source_description\n , cast(null as TEXT ) as normalized_code_type\n , cast(null as TEXT ) as normalized_code\n , cast(null as TEXT ) as normalized_description\n , cast(null as TEXT ) as result\n , cast(null as TEXT ) as source_units\n , cast(null as TEXT ) as normalized_units\n , cast(null as TEXT ) as source_reference_range_low\n , cast(null as TEXT ) as source_reference_range_high\n , cast(null as TEXT ) as normalized_reference_range_low\n , cast(null as TEXT ) as normalized_reference_range_high\n , cast(null as TEXT ) as data_source\nlimit 0", "extra_ctes_injected": true, "extra_ctes": []}, "model.input_layer.location": {"database": "tuva", "schema": "input_layer", "name": "location", "resource_type": "model", "package_name": "input_layer", "path": "location.sql", "original_file_path": "models\\location.sql", "unique_id": "model.input_layer.location", "fqn": ["input_layer", "location"], "alias": "location", "checksum": {"name": "sha256", "checksum": "a3cc89396df2108c97443fd31d5d477be676335833a32273412335cea3846d32"}, "config": {"enabled": true, "alias": null, "schema": "input_layer", "database": "tuva", "tags": [], "meta": {}, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": [], "description": "The location table contains information on practice and facility locations where patients receive medical care.\n", "columns": {"location_id": {"name": "location_id", "description": "Unique identifier for each location.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "npi": {"name": "npi", "description": "The national provider identifier associated with the location e.g. facility_npi.\n", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__provider.csv", "terminology_note": "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters."}, "data_type": null, "quote": null, "tags": []}, "name": {"name": "name", "description": "The name of the location.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "facility_type": {"name": "facility_type", "description": "The type of facility e.g. acute care hospital.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "parent_organization": {"name": "parent_organization", "description": "The parent organization associated with the facility.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "address": {"name": "address", "description": "The street address of the location.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "city": {"name": "city", "description": "The city of the location.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "state": {"name": "state", "description": "The state of the location.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "zip_code": {"name": "zip_code", "description": "The zip code of the location.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "latitude": {"name": "latitude", "description": "The latitude of the location.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "longitude": {"name": "longitude", "description": "The longitude of the location.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "data_source": {"name": "data_source", "description": "Custom description of the source system e.g. Epic.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "input_layer://models\\_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"bind": false, "database": "tuva", "schema": "input_layer"}, "created_at": 1702499717.120346, "relation_name": "tuva.input_layer.location", "raw_code": "select\r\n cast(null as {{ dbt.type_string() }} ) as location_id\r\n , cast(null as {{ dbt.type_string() }} ) as npi\r\n , cast(null as {{ dbt.type_string() }} ) as name\r\n , cast(null as {{ dbt.type_string() }} ) as facility_type\r\n , cast(null as {{ dbt.type_string() }} ) as parent_organization\r\n , cast(null as {{ dbt.type_string() }} ) as address\r\n , cast(null as {{ dbt.type_string() }} ) as city\r\n , cast(null as {{ dbt.type_string() }} ) as state\r\n , cast(null as {{ dbt.type_string() }} ) as zip_code\r\n , cast(null as {{ dbt.type_float() }} ) as latitude\r\n , cast(null as {{ dbt.type_float() }} ) as longitude\r\n , cast(null as {{ dbt.type_string() }} ) as data_source\r\nlimit 0", "language": "sql", "refs": [], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.type_string", "macro.dbt.type_float"], "nodes": []}, "compiled_path": "../target\\compiled\\input_layer\\models\\location.sql", "compiled": true, "compiled_code": "select\n cast(null as TEXT ) as location_id\n , cast(null as TEXT ) as npi\n , cast(null as TEXT ) as name\n , cast(null as TEXT ) as facility_type\n , cast(null as TEXT ) as parent_organization\n , cast(null as TEXT ) as address\n , cast(null as TEXT ) as city\n , cast(null as TEXT ) as state\n , cast(null as TEXT ) as zip_code\n , cast(null as FLOAT ) as latitude\n , cast(null as FLOAT ) as longitude\n , cast(null as TEXT ) as data_source\nlimit 0", "extra_ctes_injected": true, "extra_ctes": []}, "model.input_layer.medication": {"database": "tuva", "schema": "input_layer", "name": "medication", "resource_type": "model", "package_name": "input_layer", "path": "medication.sql", "original_file_path": "models\\medication.sql", "unique_id": "model.input_layer.medication", "fqn": ["input_layer", "medication"], "alias": "medication", "checksum": {"name": "sha256", "checksum": "edd84aa9ccae7f9dcb9b35251db51aaf59471621f9d7ddb3839cacba4e44665f"}, "config": {"enabled": true, "alias": null, "schema": "input_layer", "database": "tuva", "tags": [], "meta": {}, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": [], "description": "The medication table contains information on medications ordered and/or administered during a patient encounter.\n", "columns": {"medication_id": {"name": "medication_id", "description": "Unique identifier for each medication in the table.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "patient_id": {"name": "patient_id", "description": "Unique identifier for each patient in the dataset.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "encounter_id": {"name": "encounter_id", "description": "Unique identifier for each encounter in the dataset.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "dispensing_date": {"name": "dispensing_date", "description": "Date the medication was dispensed.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "prescribing_date": {"name": "prescribing_date", "description": "Date the medication was prescribed.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "source_code_type": {"name": "source_code_type", "description": "The source code type of the medication.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__code_type.csv"}, "data_type": null, "quote": null, "tags": []}, "source_code": {"name": "source_code", "description": "The source code for the medication.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "source_description": {"name": "source_description", "description": "The source description of the medication.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "ndc_code": {"name": "ndc_code", "description": "National drug code associated with the medication.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "ndc_description": {"name": "ndc_description", "description": "Description for the NDC.", "meta": {"terminology": "https://www.fda.gov/drugs/drug-approvals-and-databases/national-drug-code-directory"}, "data_type": null, "quote": null, "tags": []}, "rxnorm_code": {"name": "rxnorm_code", "description": "RxNorm code associated with the medication.", "meta": {"terminology": "https://www.nlm.nih.gov/research/umls/rxnorm/index.html"}, "data_type": null, "quote": null, "tags": []}, "rxnorm_description": {"name": "rxnorm_description", "description": "Description for the RxNorm code.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "atc_code": {"name": "atc_code", "description": "ATC code for the medication.", "meta": {"terminology": "https://www.who.int/tools/atc-ddd-toolkit/atc-classification"}, "data_type": null, "quote": null, "tags": []}, "atc_description": {"name": "atc_description", "description": "Description for the ATC code.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "route": {"name": "route", "description": "The route used to administer the medication.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "strength": {"name": "strength", "description": "The strength of the medication.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "quantity": {"name": "quantity", "description": "The quantity of the medication.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "quantity_unit": {"name": "quantity_unit", "description": "The units for the quantity.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "days_supply": {"name": "days_supply", "description": "The number of days supply included.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "practitioner_id": {"name": "practitioner_id", "description": "Unique identifier for the practitioner who ordered the medication.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "data_source": {"name": "data_source", "description": "Custom description of the source system e.g. Epic.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "input_layer://models\\_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"bind": false, "database": "tuva", "schema": "input_layer"}, "created_at": 1702499717.120346, "relation_name": "tuva.input_layer.medication", "raw_code": "select \r\n cast(null as {{ dbt.type_string() }} ) as medication_id\r\n , cast(null as {{ dbt.type_string() }} ) as patient_id\r\n , cast(null as {{ dbt.type_string() }} ) as encounter_id\r\n , cast(null as date) as dispensing_date\r\n , cast(null as date) as prescribing_date\r\n , cast(null as {{ dbt.type_string() }} ) as source_code_type\r\n , cast(null as {{ dbt.type_string() }} ) as source_code\r\n , cast(null as {{ dbt.type_string() }} ) as source_description\r\n , cast(null as {{ dbt.type_string() }} ) as ndc_code\r\n , cast(null as {{ dbt.type_string() }} ) as ndc_description\r\n , cast(null as {{ dbt.type_string() }} ) as rxnorm_code\r\n , cast(null as {{ dbt.type_string() }} ) as rxnorm_description\r\n , cast(null as {{ dbt.type_string() }} ) as atc_code\r\n , cast(null as {{ dbt.type_string() }} ) as atc_description\r\n , cast(null as {{ dbt.type_string() }} ) as route\r\n , cast(null as {{ dbt.type_string() }} ) as strength\r\n , cast(null as {{ dbt.type_int() }} ) as quantity\r\n , cast(null as {{ dbt.type_string() }} ) as quantity_unit\r\n , cast(null as {{ dbt.type_int() }} ) as days_supply\r\n , cast(null as {{ dbt.type_string() }} ) as practitioner_id\r\n , cast(null as {{ dbt.type_string() }} ) as data_source\r\nlimit 0", "language": "sql", "refs": [], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.type_string", "macro.dbt.type_int"], "nodes": []}, "compiled_path": "../target\\compiled\\input_layer\\models\\medication.sql", "compiled": true, "compiled_code": "select \n cast(null as TEXT ) as medication_id\n , cast(null as TEXT ) as patient_id\n , cast(null as TEXT ) as encounter_id\n , cast(null as date) as dispensing_date\n , cast(null as date) as prescribing_date\n , cast(null as TEXT ) as source_code_type\n , cast(null as TEXT ) as source_code\n , cast(null as TEXT ) as source_description\n , cast(null as TEXT ) as ndc_code\n , cast(null as TEXT ) as ndc_description\n , cast(null as TEXT ) as rxnorm_code\n , cast(null as TEXT ) as rxnorm_description\n , cast(null as TEXT ) as atc_code\n , cast(null as TEXT ) as atc_description\n , cast(null as TEXT ) as route\n , cast(null as TEXT ) as strength\n , cast(null as INT ) as quantity\n , cast(null as TEXT ) as quantity_unit\n , cast(null as INT ) as days_supply\n , cast(null as TEXT ) as practitioner_id\n , cast(null as TEXT ) as data_source\nlimit 0", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.cms_hcc__patient_hcc_history": {"database": "devforrest", "schema": "cms_hcc", "name": "cms_hcc__patient_hcc_history", "resource_type": "model", "package_name": "the_tuva_project", "path": "cms_hcc\\final\\cms_hcc__patient_hcc_history.sql", "original_file_path": "models\\cms_hcc\\final\\cms_hcc__patient_hcc_history.sql", "unique_id": "model.the_tuva_project.cms_hcc__patient_hcc_history", "fqn": ["the_tuva_project", "cms_hcc", "final", "cms_hcc__patient_hcc_history"], "alias": "patient_hcc_history", "checksum": {"name": "sha256", "checksum": "5bdfd946b2a25915e507235371d302375cd841eefa6f9457a71a0327cafd588c"}, "config": {"enabled": true, "alias": "patient_hcc_history", "schema": "cms_hcc", "database": null, "tags": ["cms_hcc"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["cms_hcc"], "description": "This final model displays the full history of a patient's recorded HCCs with a flag for recorded during the payment year.\n", "columns": {"patient_id": {"name": "patient_id", "description": "Unique ID for the patient.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "recorded_date": {"name": "recorded_date", "description": "Date in which the ICD-10-CM condition was recorded.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "condition_type": {"name": "condition_type", "description": "The type of condition.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "icd_10_cm_code": {"name": "icd_10_cm_code", "description": "The ICD-10-CM condition code.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/value_sets/cms_hcc/cms_hcc__icd_10_cm_mappings.csv"}, "data_type": null, "quote": null, "tags": []}, "hcc_code": {"name": "hcc_code", "description": "HCC code from the latest CMS HCC model available in the mart.\n", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/value_sets/cms_hcc/cms_hcc__icd_10_cm_mappings.csv"}, "data_type": null, "quote": null, "tags": []}, "hcc_description": {"name": "hcc_description", "description": "HCC description from the latest CMS HCC model available in the mart.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "first_recorded": {"name": "first_recorded", "description": "Date the HCC was first recorded in the patient's record.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "last_recorded": {"name": "last_recorded", "description": "Date the HCC was last recorded in the patient's record.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "payment_year_recorded": {"name": "payment_year_recorded", "description": "Flag indicating that the ICD-10-CM code mapped to the HCC was recorded during the payment year.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "model_version": {"name": "model_version", "description": "CMS HCC model version.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "payment_year": {"name": "payment_year", "description": "The payment year the HCC and risk scores are being calculated for.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The date the model was run.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://models\\cms_hcc\\cms_hcc_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "cms_hcc", "alias": "patient_hcc_history", "tags": "cms_hcc", "materialized": "table", "enabled": true, "bind": false}, "created_at": 1702499717.1528432, "relation_name": "devforrest.cms_hcc.patient_hcc_history", "raw_code": "{{ config(\r\n enabled = var('cms_hcc_enabled',var('claims_enabled',var('clinical_enabled',var('tuva_marts_enabled',False))))\r\n )\r\n}}\r\n\r\nwith all_conditions as (\r\n\r\n select\r\n patient_id\r\n , recorded_date\r\n , condition_type\r\n , icd_10_cm_code\r\n , hcc_code\r\n , hcc_description\r\n , model_version\r\n , payment_year\r\n from {{ ref('cms_hcc__int_all_conditions') }}\r\n\r\n)\r\n\r\n, grouped as (\r\n\r\n select\r\n patient_id\r\n , hcc_code\r\n , hcc_description\r\n , payment_year\r\n , min(recorded_date) as first_recorded\r\n , max(recorded_date) as last_recorded\r\n from all_conditions\r\n where hcc_code is not null\r\n group by\r\n patient_id\r\n , hcc_code\r\n , hcc_description\r\n , payment_year\r\n\r\n)\r\n\r\n, add_flag as (\r\n\r\n select\r\n patient_id\r\n , hcc_code\r\n , hcc_description\r\n , first_recorded\r\n , last_recorded\r\n , payment_year\r\n , case\r\n when extract(year from last_recorded) = payment_year\r\n then 1\r\n else 0\r\n end as payment_year_recorded\r\n from grouped\r\n\r\n)\r\n\r\n, all_conditions_with_flag as (\r\n\r\n select\r\n all_conditions.patient_id\r\n , all_conditions.recorded_date\r\n , all_conditions.condition_type\r\n , all_conditions.icd_10_cm_code\r\n , all_conditions.hcc_code\r\n , all_conditions.hcc_description\r\n , all_conditions.model_version\r\n , all_conditions.payment_year\r\n , add_flag.first_recorded\r\n , add_flag.last_recorded\r\n , add_flag.payment_year_recorded\r\n from all_conditions\r\n left join add_flag\r\n on all_conditions.patient_id = add_flag.patient_id\r\n and all_conditions.hcc_code = add_flag.hcc_code\r\n\r\n)\r\n\r\n, add_data_types as (\r\n\r\n select\r\n cast(patient_id as {{ dbt.type_string() }}) as patient_id\r\n , cast(recorded_date as date) as recorded_date\r\n , cast(condition_type as {{ dbt.type_string() }}) as condition_type\r\n , cast(icd_10_cm_code as {{ dbt.type_string() }}) as icd_10_cm_code\r\n , cast(hcc_code as {{ dbt.type_string() }}) as hcc_code\r\n , cast(hcc_description as {{ dbt.type_string() }}) as hcc_description\r\n , cast(first_recorded as date) as first_recorded\r\n , cast(last_recorded as date) as last_recorded\r\n , cast(payment_year_recorded as boolean) as payment_year_recorded\r\n , cast(model_version as {{ dbt.type_string() }}) as model_version\r\n , cast(payment_year as integer) as payment_year\r\n from all_conditions_with_flag\r\n\r\n)\r\n\r\nselect\r\n patient_id\r\n , recorded_date\r\n , condition_type\r\n , icd_10_cm_code\r\n , hcc_code\r\n , hcc_description\r\n , first_recorded\r\n , last_recorded\r\n , payment_year_recorded\r\n , model_version\r\n , payment_year\r\n , '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom add_data_types", "language": "sql", "refs": [["cms_hcc__int_all_conditions"]], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.type_string"], "nodes": ["model.the_tuva_project.cms_hcc__int_all_conditions"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\cms_hcc\\final\\cms_hcc__patient_hcc_history.sql", "compiled": true, "compiled_code": "\n\nwith all_conditions as (\n\n select\n patient_id\n , recorded_date\n , condition_type\n , icd_10_cm_code\n , hcc_code\n , hcc_description\n , model_version\n , payment_year\n from devforrest.cms_hcc._int_all_conditions\n\n)\n\n, grouped as (\n\n select\n patient_id\n , hcc_code\n , hcc_description\n , payment_year\n , min(recorded_date) as first_recorded\n , max(recorded_date) as last_recorded\n from all_conditions\n where hcc_code is not null\n group by\n patient_id\n , hcc_code\n , hcc_description\n , payment_year\n\n)\n\n, add_flag as (\n\n select\n patient_id\n , hcc_code\n , hcc_description\n , first_recorded\n , last_recorded\n , payment_year\n , case\n when extract(year from last_recorded) = payment_year\n then 1\n else 0\n end as payment_year_recorded\n from grouped\n\n)\n\n, all_conditions_with_flag as (\n\n select\n all_conditions.patient_id\n , all_conditions.recorded_date\n , all_conditions.condition_type\n , all_conditions.icd_10_cm_code\n , all_conditions.hcc_code\n , all_conditions.hcc_description\n , all_conditions.model_version\n , all_conditions.payment_year\n , add_flag.first_recorded\n , add_flag.last_recorded\n , add_flag.payment_year_recorded\n from all_conditions\n left join add_flag\n on all_conditions.patient_id = add_flag.patient_id\n and all_conditions.hcc_code = add_flag.hcc_code\n\n)\n\n, add_data_types as (\n\n select\n cast(patient_id as TEXT) as patient_id\n , cast(recorded_date as date) as recorded_date\n , cast(condition_type as TEXT) as condition_type\n , cast(icd_10_cm_code as TEXT) as icd_10_cm_code\n , cast(hcc_code as TEXT) as hcc_code\n , cast(hcc_description as TEXT) as hcc_description\n , cast(first_recorded as date) as first_recorded\n , cast(last_recorded as date) as last_recorded\n , cast(payment_year_recorded as boolean) as payment_year_recorded\n , cast(model_version as TEXT) as model_version\n , cast(payment_year as integer) as payment_year\n from all_conditions_with_flag\n\n)\n\nselect\n patient_id\n , recorded_date\n , condition_type\n , icd_10_cm_code\n , hcc_code\n , hcc_description\n , first_recorded\n , last_recorded\n , payment_year_recorded\n , model_version\n , payment_year\n , '2023-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom add_data_types", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.ccsr__long_condition_category": {"database": "devforrest", "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": "653a4fceb10c71e8de79b0c58c6de2a2b75ca663cbdbb956c2b10a259133f4c0"}, "config": {"enabled": true, "alias": "long_condition_category", "schema": "ccsr", "database": null, "tags": ["ccsr"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["ccsr"], "description": "This model contains a mapping of individual condition ICD-10-CM diagnosis codes to the CCSR's clinically meaningful diagnosis categories. Each row represents a mapping of an ICD-10 code to a CCSR category. As each ICD-10 code may be mapped to up to 6 categories, it's expected that this table will output as many or more rows than the TUVA condition model. The model is equivalent to the CCSR's Output Option 1 - Vertical File Output.", "columns": {"encounter_id": {"name": "encounter_id", "description": "Unique identifier for each the encounter.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "claim_id": {"name": "claim_id", "description": "Unique identifier for each claim.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "patient_id": {"name": "patient_id", "description": "Unique identifier for each patient.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "normalized_code": {"name": "normalized_code", "description": "The ICD-10-CM code for the diagnosis.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__icd_10_cm.csv", "terminology_note": "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters."}, "data_type": null, "quote": null, "tags": []}, "code_description": {"name": "code_description", "description": "The ICD-10-CM code description provided in the CCSR CSV seed file.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "condition_rank": {"name": "condition_rank", "description": "The numerical ranking of a diagnosis code in a claim.", "meta": {}, "data_type": "integer", "quote": null, "tags": []}, "body_system": {"name": "body_system", "description": "The body system to which each parent category belongs. The 22 body systems generally follow the structure of the ICD-10-CM diagnosis chapters. Note that the procedure tables don't have this column, but a conceptually related field in procedure models is `clinical_domain`.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "ccsr_parent_category": {"name": "ccsr_parent_category", "description": "The parent category code for each CCSR category. In practice, this is the three letter prefix to the category code.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "parent_category_description": {"name": "parent_category_description", "description": "A description of the parent category.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "ccsr_category": {"name": "ccsr_category", "description": "A CCSR category for the ICD-10-CM code. One ICD-10-CM code may have up 6 CCSR categories associated, ordinally ranked by the ccsr_category_rank. Will be null if a record has a `code` that isn't referenced in the CCSR seed file.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "ccsr_category_description": {"name": "ccsr_category_description", "description": "The description of the CCSR category as provided in the CCSR seed file.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "ccsr_category_rank": {"name": "ccsr_category_rank", "description": "The ordinal rank of a given CCSR category mapped to an ICD-10-CM code. The CCSR seed CSV has the order of categories assigned to each ICD-10-CM code.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "is_ip_default_category": {"name": "is_ip_default_category", "description": "For each ICD-10-CM code, this field will return true for the CCSR category that is the default value for the code if the underlying record is an inpatient encounter.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "is_op_default_category": {"name": "is_op_default_category", "description": "For each ICD-10-CM code, this field will return true for the CCSR category that is the default value for the code if the underlying record is an outpatient encounter.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "dxccsr_version": {"name": "dxccsr_version", "description": "The version number of the CCSR program from which the dbt model was derived.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The time at with the model was materialized. Generated by `dbt_utils.pretty_time` as the local time of the `dbt run` environment. Timezone is configurable via the `tuva_last_run` var.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://models\\ccsr\\ccsr_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "ccsr", "alias": "long_condition_category", "tags": ["ccsr"], "materialized": "table", "enabled": true, "bind": false}, "created_at": 1702508163.9504304, "relation_name": "devforrest.ccsr.long_condition_category", "raw_code": "{{ config(\r\n enabled = var('ccsr_enabled',var('claims_enabled',var('clinical_enabled',var('tuva_marts_enabled',False))))\r\n )\r\n}}\r\n\r\nwith ccsr__dx_vertical_pivot as (\r\n \r\n select * from {{ ref('ccsr__dx_vertical_pivot') }} \r\n\r\n), condition as (\r\n \r\n select * from {{ ref('ccsr__stg_core__condition') }}\r\n\r\n), dxccsr_body_systems as (\r\n\r\n select * from {{ ref('ccsr__dxccsr_v2023_1_body_systems') }}\r\n\r\n)\r\n\r\nselect \r\n condition.encounter_id,\r\n condition.claim_id,\r\n condition.patient_id,\r\n condition.normalized_code,\r\n ccsr__dx_vertical_pivot.code_description,\r\n condition.condition_rank,\r\n ccsr__dx_vertical_pivot.ccsr_parent_category,\r\n dxccsr_body_systems.body_system,\r\n dxccsr_body_systems.parent_category_description,\r\n ccsr__dx_vertical_pivot.ccsr_category,\r\n ccsr__dx_vertical_pivot.ccsr_category_description,\r\n ccsr__dx_vertical_pivot.ccsr_category_rank,\r\n ccsr__dx_vertical_pivot.is_ip_default_category,\r\n ccsr__dx_vertical_pivot.is_op_default_category,\r\n {{ var('dxccsr_version') }} as dxccsr_version,\r\n '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom condition\r\nleft join ccsr__dx_vertical_pivot\r\n on condition.normalized_code = ccsr__dx_vertical_pivot.code\r\nleft join dxccsr_body_systems using(ccsr_parent_category)", "language": "sql", "refs": [["ccsr__dx_vertical_pivot"], ["ccsr__stg_core__condition"], ["ccsr__dxccsr_v2023_1_body_systems"]], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.ccsr__dx_vertical_pivot", "model.the_tuva_project.ccsr__stg_core__condition", "seed.the_tuva_project.ccsr__dxccsr_v2023_1_body_systems"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\ccsr\\final\\ccsr__long_condition_category.sql", "compiled": true, "compiled_code": "\n\nwith __dbt__cte__ccsr__stg_core__condition as (\n\n\nselect *, '2023-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom devforrest.core.condition\n),ccsr__dx_vertical_pivot as (\n \n select * from devforrest.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 devforrest.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-12-13 23:31:59.089856+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-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom devforrest.core.condition\n)"}]}, "model.the_tuva_project.ccsr__long_procedure_category": {"database": "devforrest", "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": "1ebf6a8a17ca2a8e9b97bdec752ecdd026b37b305b08e7d025311bf8b3273307"}, "config": {"enabled": true, "alias": "long_procedure_category", "schema": "ccsr", "database": null, "tags": ["ccsr"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["ccsr"], "description": "This model contains a mapping of individual condition ICD-10-PCS procedure codes to the CCSR's clinically meaningful procedure categories. Each row represents a mapping of an ICD-10 code to a CCSR category. The model is equivalent to the CCSR's Output Option 1 - Vertical File Output.", "columns": {"encounter_id": {"name": "encounter_id", "description": "The encounter_id for the encounter where this procedure was performed.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "patient_id": {"name": "patient_id", "description": "Unique identifier for each patient.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "normalized_code": {"name": "normalized_code", "description": "The ICD-10-PCS code for the procedure.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__icd_10_pcs.csv", "terminology_note": "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters."}, "data_type": null, "quote": null, "tags": []}, "code_description": {"name": "code_description", "description": "The ICD-10-PCS code description provided in the CCSR CSV seed file.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "ccsr_parent_category": {"name": "ccsr_parent_category", "description": "The parent category code for each CCSR category. In practice, this is the three letter prefix to the category code.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "clinical_domain": {"name": "clinical_domain", "description": "The ICD-10-PCS Clinical Domain that the CCSR parent category belongs to. Note that the condition models don't have this column, but the `body_system` is a conceptually related column in the condition tables.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "ccsr_category_description": {"name": "ccsr_category_description", "description": "A description of the clinical domain.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "ccsr_category": {"name": "ccsr_category", "description": "The CCSR category mapped to the ICD-10-PCS code.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "prccsr_version": {"name": "prccsr_version", "description": "The version number of the CCSR program from which the dbt model was derived.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The time at with the model was materialized. Generated by `dbt_utils.pretty_time` as the local time of the `dbt run` environment. Timezone is configurable via the `tuva_last_run` var.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "the_tuva_project://models\\ccsr\\ccsr_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "ccsr", "alias": "long_procedure_category", "tags": ["ccsr"], "materialized": "table", "enabled": true, "bind": false}, "created_at": 1702508163.9504304, "relation_name": "devforrest.ccsr.long_procedure_category", "raw_code": "{{ config(\r\n enabled = var('ccsr_enabled',var('claims_enabled',var('clinical_enabled',var('tuva_marts_enabled',False))))\r\n )\r\n}}\r\n\r\nwith procedure as (\r\n \r\n select * from {{ ref('ccsr__stg_core__procedure') }}\r\n\r\n), ccsr__procedure_category_map as (\r\n\r\n select * from {{ ref ('ccsr__procedure_category_map') }}\r\n\r\n)\r\n\r\nselect distinct\r\n procedure.encounter_id,\r\n procedure.patient_id,\r\n procedure.normalized_code,\r\n ccsr__procedure_category_map.code_description,\r\n ccsr__procedure_category_map.ccsr_parent_category,\r\n ccsr__procedure_category_map.ccsr_category,\r\n ccsr__procedure_category_map.ccsr_category_description,\r\n ccsr__procedure_category_map.clinical_domain,\r\n {{ var('prccsr_version') }} as prccsr_version,\r\n '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom procedure\r\nleft join ccsr__procedure_category_map\r\n on procedure.normalized_code = ccsr__procedure_category_map.code", "language": "sql", "refs": [["ccsr__stg_core__procedure"], ["ccsr__procedure_category_map"]], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.ccsr__stg_core__procedure", "model.the_tuva_project.ccsr__procedure_category_map"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\ccsr\\final\\ccsr__long_procedure_category.sql", "compiled": true, "compiled_code": "\n\nwith __dbt__cte__ccsr__stg_core__procedure as (\n\n\nselect *, '2023-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom devforrest.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 devforrest.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-12-13 23:31:59.089856+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-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom devforrest.core.procedure\n)"}]}, "model.the_tuva_project.core__lab_result": {"database": "devforrest", "schema": "core", "name": "core__lab_result", "resource_type": "model", "package_name": "the_tuva_project", "path": "core\\final\\core__lab_result.sql", "original_file_path": "models\\core\\final\\core__lab_result.sql", "unique_id": "model.the_tuva_project.core__lab_result", "fqn": ["the_tuva_project", "core", "final", "core__lab_result"], "alias": "lab_result", "checksum": {"name": "sha256", "checksum": "f9476ba4518a0bd40ed1de34b409cd2a90558632afa56fb482ab58b016ad4ab9"}, "config": {"enabled": true, "alias": "lab_result", "schema": "core", "database": null, "tags": ["core"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#0f3d0b"}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["core"], "description": "The lab result table contains information about lab test results, including the LOINC code and description, units, reference range, and result.\n", "columns": {"lab_result_id": {"name": "lab_result_id", "description": "Unique identifier for the lab test.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "patient_id": {"name": "patient_id", "description": "Unique identifier for each patient.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "encounter_id": {"name": "encounter_id", "description": "Unique identifier for each encounter. Included in this table if the lab test can be linked to an encounter.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "accession_number": {"name": "accession_number", "description": "The lab order number from the source system.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "source_code_type": {"name": "source_code_type", "description": "The code type from the source system.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__code_type.csv"}, "data_type": null, "quote": null, "tags": []}, "source_code": {"name": "source_code", "description": "The code for the lab from the source system.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__loinc.csv", "terminology_note": "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters."}, "data_type": null, "quote": null, "tags": []}, "source_description": {"name": "source_description", "description": "The description for the lab test from the source system.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "source_component": {"name": "source_component", "description": "The description for the component of the test from the source system.\n", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__loinc.csv", "terminology_note": "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters."}, "data_type": null, "quote": null, "tags": []}, "normalized_code_type": {"name": "normalized_code_type", "description": "The normalized code type.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__code_type.csv"}, "data_type": null, "quote": null, "tags": []}, "normalized_code": {"name": "normalized_code", "description": "The normalized code e.g. LOINC.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__loinc.csv", "terminology_note": "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters."}, "data_type": null, "quote": null, "tags": []}, "normalized_description": {"name": "normalized_description", "description": "The normalized description for the code.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "normalized_component": {"name": "normalized_component", "description": "The normalized component.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__loinc.csv", "terminology_note": "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters."}, "data_type": null, "quote": null, "tags": []}, "status": {"name": "status", "description": "The status of the lab test.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "result": {"name": "result", "description": "The result of the lab test.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "result_date": {"name": "result_date", "description": "Date of the test result.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "collection_date": {"name": "collection_date", "description": "Date the test was collected.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "source_units": {"name": "source_units", "description": "Source units of the lab test.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "normalized_units": {"name": "normalized_units", "description": "Normalized units of the lab test.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "source_reference_range_low": {"name": "source_reference_range_low", "description": "The low end of the reference range from the source system.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "source_reference_range_high": {"name": "source_reference_range_high", "description": "The high end of the reference range from the source system.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "normalized_reference_range_low": {"name": "normalized_reference_range_low", "description": "The normalized low end of the reference range.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "normalized_reference_range_high": {"name": "normalized_reference_range_high", "description": "The normalized high end of the reference range.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "source_abnormal_flag": {"name": "source_abnormal_flag", "description": "Indicates whether the result is abnormal or normal.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "normalized_abnormal_flag": {"name": "normalized_abnormal_flag", "description": "Normalized abnormal flag.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "specimen": {"name": "specimen", "description": "The type of specimen e.g. blood, plasma, urine.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "ordering_practitioner_id": {"name": "ordering_practitioner_id", "description": "Unique identifier for the practitioner who ordered the lab test.\n", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__provider.csv", "terminology_note": "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters."}, "data_type": null, "quote": null, "tags": []}, "data_source": {"name": "data_source", "description": "Custom description of the source system e.g. Epic.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The last time the data was refreshed. Generated by `dbt_utils.pretty_time` as the local time of the `dbt run` environment. Timezone is configurable via the `tuva_last_run` var. \n", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": "#0f3d0b"}, "patch_path": "the_tuva_project://models\\core\\core_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "core", "alias": "lab_result", "tags": "core", "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#0f3d0b"}}, "created_at": 1702508163.966064, "relation_name": "devforrest.core.lab_result", "raw_code": "{{ config(\r\n enabled = var('clinical_enabled',var('tuva_marts_enabled',False))\r\n )\r\n}}\r\n\r\nselect * from {{ ref('core__stg_clinical_lab_result')}}", "language": "sql", "refs": [["core__stg_clinical_lab_result"]], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.core__stg_clinical_lab_result"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\core\\final\\core__lab_result.sql", "compiled": true, "compiled_code": "\n\nselect * from devforrest.core._stg_clinical_lab_result", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.core__procedure": {"database": "devforrest", "schema": "core", "name": "core__procedure", "resource_type": "model", "package_name": "the_tuva_project", "path": "core\\final\\core__procedure.sql", "original_file_path": "models\\core\\final\\core__procedure.sql", "unique_id": "model.the_tuva_project.core__procedure", "fqn": ["the_tuva_project", "core", "final", "core__procedure"], "alias": "procedure", "checksum": {"name": "sha256", "checksum": "2ec212aa41f812304773bc51f2ae8bd67767d75b2fb2f29f79ad916c04ba83d2"}, "config": {"enabled": true, "alias": "procedure", "schema": "core", "database": null, "tags": ["core"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#0f3d0b"}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["core"], "description": "The procedure table contains information on procedures that were performed on patients in the dataset.\n", "columns": {"procedure_id": {"name": "procedure_id", "description": "The unique identifier for the performed procedure.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "encounter_id": {"name": "encounter_id", "description": "The encounter_id for the encounter where this procedure was performed.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "claim_id": {"name": "claim_id", "description": "The claim on which the procedure was recorded.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "patient_id": {"name": "patient_id", "description": "Unique identifier for each person across all datasets.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "procedure_date": {"name": "procedure_date", "description": "Date when the procedure was performed.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "source_code_type": {"name": "source_code_type", "description": "Type of procedure code for the procedure in the source system.\n", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__code_type.csv"}, "data_type": null, "quote": null, "tags": []}, "source_code": {"name": "source_code", "description": "The procedure code in the source system.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__icd_10_pcs.csv", "terminology_note": "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters."}, "data_type": null, "quote": null, "tags": []}, "source_description": {"name": "source_description", "description": "Description of the procedure code.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "normalized_code_type": {"name": "normalized_code_type", "description": "Normalized type of procedure code for the procedure.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__code_type.csv"}, "data_type": null, "quote": null, "tags": []}, "normalized_code": {"name": "normalized_code", "description": "The normalized procedure code.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__icd_10_pcs.csv", "terminology_note": "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters."}, "data_type": null, "quote": null, "tags": []}, "normalized_description": {"name": "normalized_description", "description": "Description of the procedure code.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__hcpcs_level_2.csv"}, "data_type": null, "quote": null, "tags": []}, "modifier_1": {"name": "modifier_1", "description": "First modifier for the procedure code.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__hcpcs_level_2.csv"}, "data_type": null, "quote": null, "tags": []}, "modifier_2": {"name": "modifier_2", "description": "Second modifier for the procedure code.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__hcpcs_level_2.csv"}, "data_type": null, "quote": null, "tags": []}, "modifier_3": {"name": "modifier_3", "description": "Third modifier for the procedure code.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__hcpcs_level_2.csv"}, "data_type": null, "quote": null, "tags": []}, "modifier_4": {"name": "modifier_4", "description": "Fourth modifier for the procedure code.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__hcpcs_level_2.csv"}, "data_type": null, "quote": null, "tags": []}, "modifier_5": {"name": "modifier_5", "description": "Fifth modifier for the procedure code.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__hcpcs_level_2.csv"}, "data_type": null, "quote": null, "tags": []}, "practitioner_id": {"name": "practitioner_id", "description": "ID of the provider who performed the procedure.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__provider.csv", "terminology_note": "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters."}, "data_type": null, "quote": null, "tags": []}, "data_source": {"name": "data_source", "description": "User-configured field that indicates the data source (e.g. typically named after the payer and state \"BCBS Tennessee\").\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The last time the data was refreshed. Generated by `dbt_utils.pretty_time` as the local time of the `dbt run` environment. Timezone is configurable via the `tuva_last_run` var.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": "#0f3d0b"}, "patch_path": "the_tuva_project://models\\core\\core_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "core", "alias": "procedure", "tags": "core", "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#0f3d0b"}}, "created_at": 1702508163.9818676, "relation_name": "devforrest.core.procedure", "raw_code": "{{ config(\r\n enabled = var('claims_enabled',var('clinical_enabled',var('tuva_marts_enabled',False)))\r\n )\r\n}}\r\n\r\n{% if var('clinical_enabled', var('tuva_marts_enabled',False)) == true and var('claims_enabled', var('tuva_marts_enabled',False)) == true -%}\r\n\r\nselect * from {{ ref('core__stg_claims_procedure') }}\r\nunion all\r\nselect * from {{ ref('core__stg_clinical_procedure') }}\r\n\r\n{% elif var('clinical_enabled', var('tuva_marts_enabled',False)) == true -%}\r\n\r\nselect * from {{ ref('core__stg_clinical_procedure') }}\r\n\r\n{% elif var('claims_enabled', var('tuva_marts_enabled',False)) == true -%}\r\n\r\nselect * from {{ ref('core__stg_claims_procedure') }}\r\n\r\n{%- endif %}", "language": "sql", "refs": [["core__stg_claims_procedure"], ["core__stg_clinical_procedure"]], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.core__stg_claims_procedure", "model.the_tuva_project.core__stg_clinical_procedure"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\core\\final\\core__procedure.sql", "compiled": true, "compiled_code": "\n\nselect * from devforrest.core._stg_claims_procedure\nunion all\nselect * from devforrest.core._stg_clinical_procedure\n\n", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.core__encounter": {"database": "devforrest", "schema": "core", "name": "core__encounter", "resource_type": "model", "package_name": "the_tuva_project", "path": "core\\final\\core__encounter.sql", "original_file_path": "models\\core\\final\\core__encounter.sql", "unique_id": "model.the_tuva_project.core__encounter", "fqn": ["the_tuva_project", "core", "final", "core__encounter"], "alias": "encounter", "checksum": {"name": "sha256", "checksum": "2cf0a388e7ed3dbd677997974437d8ac82992cf599c035a9b3e6a66d2cfeb133"}, "config": {"enabled": true, "alias": "encounter", "schema": "core", "database": null, "tags": ["core"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#0f3d0b"}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["core"], "description": "The encounter table contains information about patients visits (i.e. encounters). This includes acute inpatient, emergency department, office visits, SNF stays, etc.\n", "columns": {"encounter_id": {"name": "encounter_id", "description": "Unique identifier for each encounter.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "patient_id": {"name": "patient_id", "description": "Unique identifier for a patient.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "encounter_type": {"name": "encounter_type", "description": "Indicates the type of encounter e.g. acute inpatient, emergency department, etc.\n", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__encounter_type.csv"}, "data_type": null, "quote": null, "tags": []}, "encounter_start_date": {"name": "encounter_start_date", "description": "Date when the encounter started.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "encounter_end_date": {"name": "encounter_end_date", "description": "Date when the encounter ended.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "length_of_stay": {"name": "length_of_stay", "description": "Length of the encounter calculated as encounter_end_date - encounter_start_date.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "admit_source_code": {"name": "admit_source_code", "description": "Admission source code for the encounter.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__admit_source.csv"}, "data_type": null, "quote": null, "tags": []}, "admit_source_description": {"name": "admit_source_description", "description": "Description of the admit_source_code for the encounter.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "admit_type_code": {"name": "admit_type_code", "description": "Admission type code for the encounter.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__admit_type.csv"}, "data_type": null, "quote": null, "tags": []}, "admit_type_description": {"name": "admit_type_description", "description": "Description of the admit_type_code for the encounter.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "discharge_disposition_code": {"name": "discharge_disposition_code", "description": "Discharge disposition code for the encounter.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__discharge_disposition.csv"}, "data_type": null, "quote": null, "tags": []}, "discharge_disposition_description": {"name": "discharge_disposition_description", "description": "Description of the discharge_disposition_code for the encounter.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "attending_provider_id": {"name": "attending_provider_id", "description": "attending provider for the encounter.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__provider.csv", "terminology_note": "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters."}, "data_type": null, "quote": null, "tags": []}, "facility_npi": {"name": "facility_npi", "description": "Facility NPI for the encounter (typically represents the facility where services were performed).\n", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__provider.csv", "terminology_note": "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters."}, "data_type": null, "quote": null, "tags": []}, "primary_diagnosis_code_type": {"name": "primary_diagnosis_code_type", "description": "The type of condition code reported in the source system e.g. ICD-10-CM.\n", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__code_type.csv"}, "data_type": null, "quote": null, "tags": []}, "primary_diagnosis_code": {"name": "primary_diagnosis_code", "description": "Primary diagnosis code for the encounter. If from claims the primary diagnosis code comes from the institutional claim.\n", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__icd_10_cm.csv", "terminology_note": "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters."}, "data_type": null, "quote": null, "tags": []}, "primary_diagnosis_description": {"name": "primary_diagnosis_description", "description": "Description of the primary diagnosis code.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "ms_drg_code": {"name": "ms_drg_code", "description": "MS-DRG code for the encounter.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__ms_drg.csv"}, "data_type": null, "quote": null, "tags": []}, "ms_drg_description": {"name": "ms_drg_description", "description": "Description of the ms_drg_code.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "apr_drg_code": {"name": "apr_drg_code", "description": "APR-DRG code for the encounter.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__apr_drg.csv"}, "data_type": null, "quote": null, "tags": []}, "apr_drg_description": {"name": "apr_drg_description", "description": "Description of the APR-DRG code.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "paid_amount": {"name": "paid_amount", "description": "The total amount paid for the encounter by the insurer.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "allowed_amount": {"name": "allowed_amount", "description": "The total amount allowed (includes amount paid by the insurer and patient) on the encounter.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "charge_amount": {"name": "charge_amount", "description": "The total amount charged on the encounter by the provider.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "data_source": {"name": "data_source", "description": "User-configured field that indicates the data source (e.g. typically named after the payer and state \"BCBS Tennessee\").\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The last time the data was refreshed. Generated by `dbt_utils.pretty_time` as the local time of the `dbt run` environment. Timezone is configurable via the `tuva_last_run` var.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": "#0f3d0b"}, "patch_path": "the_tuva_project://models\\core\\core_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "core", "alias": "encounter", "tags": "core", "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#0f3d0b"}}, "created_at": 1702508163.9975014, "relation_name": "devforrest.core.encounter", "raw_code": "{{ config(\r\n enabled = var('claims_enabled',var('clinical_enabled',var('tuva_marts_enabled',False)))\r\n )\r\n}}\r\n\r\n{% if var('clinical_enabled', false) == true and var('claims_enabled', false) == true -%}\r\n\r\nselect * from {{ ref('core__stg_claims_encounter') }}\r\nunion all\r\nselect * from {{ ref('core__stg_clinical_encounter') }}\r\n\r\n{% elif var('clinical_enabled', var('tuva_marts_enabled',False)) == true -%}\r\n\r\nselect * from {{ ref('core__stg_clinical_encounter') }}\r\n\r\n{% elif var('claims_enabled', var('tuva_marts_enabled',False)) == true -%}\r\n\r\nselect * from {{ ref('core__stg_claims_encounter') }}\r\n\r\n{%- endif %}", "language": "sql", "refs": [["core__stg_clinical_encounter"]], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.core__stg_clinical_encounter"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\core\\final\\core__encounter.sql", "compiled": true, "compiled_code": "\n\nselect * from devforrest.core._stg_clinical_encounter\n\n", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.core__condition": {"database": "devforrest", "schema": "core", "name": "core__condition", "resource_type": "model", "package_name": "the_tuva_project", "path": "core\\final\\core__condition.sql", "original_file_path": "models\\core\\final\\core__condition.sql", "unique_id": "model.the_tuva_project.core__condition", "fqn": ["the_tuva_project", "core", "final", "core__condition"], "alias": "condition", "checksum": {"name": "sha256", "checksum": "6bf20ce96592d16fd9ab798870231dc2cb5fd32632e677db4eccf028738d1a4f"}, "config": {"enabled": true, "alias": "condition", "schema": "core", "database": null, "tags": ["core"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#0f3d0b"}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["core"], "description": "The core condition table contains information related to medical conditions patients have, including problems, admitting diagnosis codes, and billable diagnosis codes.\n", "columns": {"condition_id": {"name": "condition_id", "description": "Unique identifier for each condition in the table.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "patient_id": {"name": "patient_id", "description": "Unique identifier for each patient in the dataset.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "encounter_id": {"name": "encounter_id", "description": "Unique identifier for each encounter.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "claim_id": {"name": "claim_id", "description": "Unique identifier for each claim.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "recorded_date": {"name": "recorded_date", "description": "Date when the condition was recorded.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "onset_date": {"name": "onset_date", "description": "Date when the condition first occurred.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "resolved_date": {"name": "resolved_date", "description": "Date when the condition was resolved.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "status": {"name": "status", "description": "Status of the condition.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "condition_type": {"name": "condition_type", "description": "The type of condition i.e. problem, admitting, or billing.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "source_code_type": {"name": "source_code_type", "description": "The type of condition code reported in the source system e.g. ICD-10-CM.\n", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__code_type.csv"}, "data_type": null, "quote": null, "tags": []}, "source_code": {"name": "source_code", "description": "The condition code in the source system e.g. the ICD-10 code.\n", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__icd_10_cm.csv", "terminology_note": "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters."}, "data_type": null, "quote": null, "tags": []}, "source_description": {"name": "source_description", "description": "Description of the condition code in the source system.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "normalized_code_type": {"name": "normalized_code_type", "description": "The normalized type of condition code.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__code_type.csv"}, "data_type": null, "quote": null, "tags": []}, "normalized_code": {"name": "normalized_code", "description": "The normalized condition code.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__icd_10_cm.csv", "terminology_note": "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters."}, "data_type": null, "quote": null, "tags": []}, "normalized_description": {"name": "normalized_description", "description": "Normalized description of the condition code.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "condition_rank": {"name": "condition_rank", "description": "The numerical ranking of a diagnosis code in a claim. Principle diagnosis code is given a ranking of 1. Claims data typically has a strict ranking of conditions whereas medical records will often not have this information or the information won't be accurate.\n", "meta": {}, "data_type": "integer", "quote": null, "tags": []}, "present_on_admit_code": {"name": "present_on_admit_code", "description": "The present_on_admit_code related to the condition.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__present_on_admission.csv"}, "data_type": null, "quote": null, "tags": []}, "present_on_admit_description": {"name": "present_on_admit_description", "description": "The description of the present_on_admit_code for the condition.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "data_source": {"name": "data_source", "description": "User-configured field that indicates the data source (e.g. typically named after the payer and state \"BCBS Tennessee\").\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The last time the data was refreshed. Generated by `dbt_utils.pretty_time` as the local time of the `dbt run` environment. Timezone is configurable via the `tuva_last_run` var.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": "#0f3d0b"}, "patch_path": "the_tuva_project://models\\core\\core_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "core", "alias": "condition", "tags": "core", "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#0f3d0b"}}, "created_at": 1702508163.9975014, "relation_name": "devforrest.core.condition", "raw_code": "{{ config(\r\n enabled = var('claims_enabled',var('clinical_enabled',var('tuva_marts_enabled',False)))\r\n )\r\n}}\r\n\r\n\r\n{% if var('clinical_enabled', var('tuva_marts_enabled',False)) == true and var('claims_enabled', var('tuva_marts_enabled',False)) == true -%}\r\n\r\nselect * from {{ ref('core__stg_claims_condition') }}\r\nunion all\r\nselect * from {{ ref('core__stg_clinical_condition') }}\r\n\r\n{% elif var('clinical_enabled', var('tuva_marts_enabled',False)) == true -%}\r\n\r\nselect * from {{ ref('core__stg_clinical_condition') }}\r\n\r\n{% elif var('claims_enabled', var('tuva_marts_enabled',False)) == true -%}\r\n\r\nselect * from {{ ref('core__stg_claims_condition') }}\r\n\r\n{%- endif %}", "language": "sql", "refs": [["core__stg_claims_condition"], ["core__stg_clinical_condition"]], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.the_tuva_project.core__stg_claims_condition", "model.the_tuva_project.core__stg_clinical_condition"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\core\\final\\core__condition.sql", "compiled": true, "compiled_code": "\n\n\nselect * from devforrest.core._stg_claims_condition\nunion all\nselect * from devforrest.core._stg_clinical_condition\n\n", "extra_ctes_injected": true, "extra_ctes": []}, "model.the_tuva_project.readmissions__encounter_augmented": {"database": "devforrest", "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": "599426ff7ce5d5103cd75c2839f99db0d384e9a9ff6dafb1e35ca17de851a709"}, "config": {"enabled": true, "alias": "encounter_augmented", "schema": "readmissions", "database": null, "tags": ["readmissions"], "meta": {}, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": "#161a7d"}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": ["readmissions"], "description": "This model includes all encounters from the stg_encounter model, and for each encounter_id we add fields relevant for the encounter.", "columns": {"encounter_id": {"name": "encounter_id", "description": "The unique identifier for the encounter", "meta": {}, "data_type": null, "quote": null, "tags": []}, "patient_id": {"name": "patient_id", "description": "The unique identifier for the patient", "meta": {}, "data_type": null, "quote": null, "tags": []}, "admit_date": {"name": "admit_date", "description": "The date of admission for the inpatient visit", "meta": {}, "data_type": null, "quote": null, "tags": []}, "discharge_date": {"name": "discharge_date", "description": "The date of discharge for the inpatient visit", "meta": {}, "data_type": null, "quote": null, "tags": []}, "discharge_disposition_code": {"name": "discharge_disposition_code", "description": "The valid 2-digit discharge status for the inpatient visit", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__discharge_disposition.csv"}, "data_type": null, "quote": null, "tags": []}, "facility_npi": {"name": "facility_npi", "description": "A name or ID for the facility where the inpatient visit occured", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__provider.csv", "terminology_note": "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters."}, "data_type": null, "quote": null, "tags": []}, "ms_drg_code": {"name": "ms_drg_code", "description": "The MS-DRG associted with the inpatient visit", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__ms_drg.csv"}, "data_type": null, "quote": null, "tags": []}, "paid_amount": {"name": "paid_amount", "description": "The number of dollars paid on the encounter", "meta": {}, "data_type": null, "quote": null, "tags": []}, "length_of_stay": {"name": "length_of_stay", "description": "Integer representing the length of stay of the inpatient visit in days", "meta": {}, "data_type": "integer", "quote": null, "tags": []}, "index_admission_flag": {"name": "index_admission_flag", "description": "Flag to indicate if the encounter is an index admission", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "planned_flag": {"name": "planned_flag", "description": "Flag to indicate if the encounter was planned", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "specialty_cohort": {"name": "specialty_cohort", "description": "Specialty cohort the encounter belongs to", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/value_sets/readmissions/readmissions__specialty_cohort.csv"}, "data_type": null, "quote": null, "tags": []}, "died_flag": {"name": "died_flag", "description": "Flag to indicate of the patient died in this encounter", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "diagnosis_ccs": {"name": "diagnosis_ccs", "description": "CCS code associated with the primary diagnosis for the encounter", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/value_sets/readmissions/readmissions__acute_diagnosis_ccs.csv"}, "data_type": null, "quote": null, "tags": []}, "disqualified_encounter_flag": {"name": "disqualified_encounter_flag", "description": "A flag that indicates whether this encounter is disqualified from being used in readmission measures for any critical data quality problem.", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "missing_admit_date_flag": {"name": "missing_admit_date_flag", "description": "A flag that indicates whether the admit date is missing from this encounter.", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "missing_discharge_date_flag": {"name": "missing_discharge_date_flag", "description": "A flag that indicates whether the discharge date is missing from this encounter.", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "admit_after_discharge_flag": {"name": "admit_after_discharge_flag", "description": "A flag that indicates whether the admit date for the encounter is after the discharge date for the encounter.", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "missing_discharge_disposition_code_flag": {"name": "missing_discharge_disposition_code_flag", "description": "A flag that indicates whether the discharge status code is missing for the encounter.", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "invalid_discharge_disposition_code_flag": {"name": "invalid_discharge_disposition_code_flag", "description": "A flag that indicates whether the discharge status code that is present for this encounter is invalid. This flag is 1 only when the discharge status code is present but invalid.", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "missing_primary_diagnosis_flag": {"name": "missing_primary_diagnosis_flag", "description": "A flag that indicates whether there is no primary diagnosis associated with the encounter.", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "multiple_primary_diagnoses_flag": {"name": "multiple_primary_diagnoses_flag", "description": "A flag that indicates whether there are multiple primary diagnoses associated with the encounter.", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "invalid_primary_diagnosis_code_flag": {"name": "invalid_primary_diagnosis_code_flag", "description": "A flag that indicates whether the primary diagnosis present for this encounter is invalid, i.e. a non existing ICD-10-CM code. This flag indicates that a primary diagnosis code is indeed present for the encounter, but it is not a valid ICD-10-CM code.", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "no_diagnosis_ccs_flag": {"name": "no_diagnosis_ccs_flag", "description": "A flag that indicates whether there is no CCS diagnosis category associated with the primary ICD-10-CM diagnosis code for the encounter. This flag indicates that there is a valid primary ICD-10-CM diagnosis code associated with the encounter, but there is no CCS diagnosis category associated with that ICD-10-CM code.", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "overlaps_with_another_encounter_flag": {"name": "overlaps_with_another_encounter_flag", "description": "A flag that indicates whether this encounter's dates overlap with those of another encounter in the dataset", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "missing_ms_drg_flag": {"name": "missing_ms_drg_flag", "description": "A flag that indicates whether this encounter contains a claim with a missing ms-drg code", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "invalid_ms_drg_flag": {"name": "invalid_ms_drg_flag", "description": "A flag that indicates whether this encounter contains a claim with an invalid missing ms-drg code", "meta": {}, "data_type": "boolean", "quote": null, "tags": []}, "tuva_last_run": {"name": "tuva_last_run", "description": "The time at with the model was materialized. Generated by `dbt_utils.pretty_time` as the local time of the `dbt run` environment. Timezone is configurable via the `tuva_last_run` var.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": "#161a7d"}, "patch_path": "the_tuva_project://models\\readmissions\\readmissions_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "readmissions", "alias": "encounter_augmented", "tags": "readmissions", "materialized": "table", "enabled": true, "bind": false, "docs": {"node_color": "#161a7d"}}, "created_at": 1702508432.9839554, "relation_name": "devforrest.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.paid_amount,\r\n {{ dbt.datediff(\"aa.admit_date\", \"aa.discharge_date\",\"day\") }} as length_of_stay,\r\n case\r\n when bb.encounter_id is not null then 1\r\n\t else 0\r\n end as index_admission_flag,\r\n case\r\n when cc.encounter_id is not null then 1\r\n\t else 0\r\n end as planned_flag,\r\n dd.specialty_cohort,\r\n case\r\n when aa.discharge_disposition_code = '20' then 1\r\n\t else 0\r\n end as died_flag,\r\n ee.diagnosis_ccs,\r\n ee.disqualified_encounter_flag,\r\n ee.missing_admit_date_flag,\r\n ee.missing_discharge_date_flag,\r\n ee.admit_after_discharge_flag,\r\n ee.missing_discharge_disposition_code_flag,\r\n ee.invalid_discharge_disposition_code_flag,\r\n ee.missing_primary_diagnosis_flag,\r\n ee.invalid_primary_diagnosis_code_flag,\r\n ee.no_diagnosis_ccs_flag,\r\n ee.overlaps_with_another_encounter_flag,\r\n ee.missing_ms_drg_flag,\r\n ee.invalid_ms_drg_flag,\r\n '{{ var('tuva_last_run')}}' as tuva_last_run\r\nfrom\r\n {{ ref('readmissions__encounter') }} aa\r\n left join {{ ref('readmissions__index_admission') }} bb\r\n on aa.encounter_id = bb.encounter_id\r\n left join {{ ref('readmissions__planned_encounter') }} cc\r\n on aa.encounter_id = cc.encounter_id \r\n left join {{ ref('readmissions__encounter_specialty_cohort') }} dd\r\n on aa.encounter_id = dd.encounter_id\r\n left join {{ ref('readmissions__encounter_data_quality') }} ee\r\n on aa.encounter_id = ee.encounter_id", "language": "sql", "refs": [["readmissions__encounter"], ["readmissions__index_admission"], ["readmissions__planned_encounter"], ["readmissions__encounter_specialty_cohort"], ["readmissions__encounter_data_quality"]], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.datediff"], "nodes": ["model.the_tuva_project.readmissions__encounter", "model.the_tuva_project.readmissions__index_admission", "model.the_tuva_project.readmissions__planned_encounter", "model.the_tuva_project.readmissions__encounter_specialty_cohort", "model.the_tuva_project.readmissions__encounter_data_quality"]}, "compiled_path": "../target\\compiled\\the_tuva_project\\models\\readmissions\\final\\readmissions__encounter_augmented.sql", "compiled": true, "compiled_code": "\n\n-- Here we list all encounters from the stg_encounter model\n-- and we augment them with extra fields\n-- that are relevant for readmission measures\nselect\n aa.encounter_id,\n aa.patient_id,\n aa.admit_date,\n aa.discharge_date,\n aa.discharge_disposition_code,\n aa.facility_npi,\n aa.ms_drg_code,\n aa.paid_amount,\n datediff(\n day,\n aa.admit_date,\n aa.discharge_date\n ) as length_of_stay,\n case\n when bb.encounter_id is not null then 1\n\t else 0\n end as index_admission_flag,\n case\n when cc.encounter_id is not null then 1\n\t else 0\n end as planned_flag,\n dd.specialty_cohort,\n case\n when aa.discharge_disposition_code = '20' then 1\n\t else 0\n end as died_flag,\n ee.diagnosis_ccs,\n ee.disqualified_encounter_flag,\n ee.missing_admit_date_flag,\n ee.missing_discharge_date_flag,\n ee.admit_after_discharge_flag,\n ee.missing_discharge_disposition_code_flag,\n ee.invalid_discharge_disposition_code_flag,\n ee.missing_primary_diagnosis_flag,\n ee.invalid_primary_diagnosis_code_flag,\n ee.no_diagnosis_ccs_flag,\n ee.overlaps_with_another_encounter_flag,\n ee.missing_ms_drg_flag,\n ee.invalid_ms_drg_flag,\n '2023-12-13 23:31:59.089856+00:00' as tuva_last_run\nfrom\n devforrest.readmissions._int_encounter aa\n left join devforrest.readmissions._int_index_admission bb\n on aa.encounter_id = bb.encounter_id\n left join devforrest.readmissions._int_planned_encounter cc\n on aa.encounter_id = cc.encounter_id \n left join devforrest.readmissions._int_encounter_specialty_cohort dd\n on aa.encounter_id = dd.encounter_id\n left join devforrest.readmissions._int_encounter_data_quality ee\n on aa.encounter_id = ee.encounter_id", "extra_ctes_injected": true, "extra_ctes": []}, "model.input_layer.encounter": {"database": "tuva", "schema": "input_layer", "name": "encounter", "resource_type": "model", "package_name": "input_layer", "path": "encounter.sql", "original_file_path": "models\\encounter.sql", "unique_id": "model.input_layer.encounter", "fqn": ["input_layer", "encounter"], "alias": "encounter", "checksum": {"name": "sha256", "checksum": "54f63dfde51bec68e80739b7dc257bd4de6ba5ce304c6ccb847dd5765116ee98"}, "config": {"enabled": true, "alias": null, "schema": "input_layer", "database": "tuva", "tags": [], "meta": {}, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": [], "description": "The encounter table contains information about patients visits (i.e. encounters). This includes acute inpatient, emergency department, office visits, SNF stays, etc.\n", "columns": {"encounter_id": {"name": "encounter_id", "description": "Unique identifier for each encounter.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "patient_id": {"name": "patient_id", "description": "Unique identifier for a patient.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "encounter_type": {"name": "encounter_type", "description": "Indicates the type of encounter e.g. acute inpatient, emergency department, etc.\n", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__encounter_type.csv"}, "data_type": null, "quote": null, "tags": []}, "encounter_start_date": {"name": "encounter_start_date", "description": "Date when the encounter started.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "encounter_end_date": {"name": "encounter_end_date", "description": "Date when the encounter ended.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "length_of_stay": {"name": "length_of_stay", "description": "Length of the encounter calculated as encounter_end_date - encounter_start_date.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "admit_source_code": {"name": "admit_source_code", "description": "Admission source code for the encounter.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__admit_source.csv"}, "data_type": null, "quote": null, "tags": []}, "admit_source_description": {"name": "admit_source_description", "description": "Description of the admit_source_code for the encounter.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "admit_type_code": {"name": "admit_type_code", "description": "Admission type code for the encounter.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__admit_type.csv"}, "data_type": null, "quote": null, "tags": []}, "admit_type_description": {"name": "admit_type_description", "description": "Description of the admit_type_code for the encounter.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "discharge_disposition_code": {"name": "discharge_disposition_code", "description": "Discharge disposition code for the encounter.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__discharge_disposition.csv"}, "data_type": null, "quote": null, "tags": []}, "discharge_disposition_description": {"name": "discharge_disposition_description", "description": "Description of the discharge_disposition_code for the encounter.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "attending_provider_id": {"name": "attending_provider_id", "description": "attending provider for the encounter.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__provider.csv", "terminology_note": "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters."}, "data_type": null, "quote": null, "tags": []}, "facility_npi": {"name": "facility_npi", "description": "Facility NPI for the encounter (typically represents the facility where services were performed).\n", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__provider.csv", "terminology_note": "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters."}, "data_type": null, "quote": null, "tags": []}, "primary_diagnosis_code_type": {"name": "primary_diagnosis_code_type", "description": "The type of condition code reported in the source system e.g. ICD-10-CM.\n", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__code_type.csv"}, "data_type": null, "quote": null, "tags": []}, "primary_diagnosis_code": {"name": "primary_diagnosis_code", "description": "Primary diagnosis code for the encounter. If from claims the primary diagnosis code comes from the institutional claim.\n", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__icd_10_cm.csv", "terminology_note": "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters."}, "data_type": null, "quote": null, "tags": []}, "primary_diagnosis_description": {"name": "primary_diagnosis_description", "description": "Description of the primary diagnosis code.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "ms_drg_code": {"name": "ms_drg_code", "description": "MS-DRG code for the encounter.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__ms_drg.csv"}, "data_type": null, "quote": null, "tags": []}, "ms_drg_description": {"name": "ms_drg_description", "description": "Description of the ms_drg_code.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "apr_drg_code": {"name": "apr_drg_code", "description": "APR-DRG code for the encounter.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__apr_drg.csv"}, "data_type": null, "quote": null, "tags": []}, "apr_drg_description": {"name": "apr_drg_description", "description": "Description of the APR-DRG code.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "paid_amount": {"name": "paid_amount", "description": "The total amount paid for the encounter by the insurer.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "allowed_amount": {"name": "allowed_amount", "description": "The total amount allowed (includes amount paid by the insurer and patient) on the encounter.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "charge_amount": {"name": "charge_amount", "description": "The total amount charged on the encounter by the provider.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "data_source": {"name": "data_source", "description": "User-configured field that indicates the data source (e.g. typically named after the payer and state \"BCBS Tennessee\").\n", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "input_layer://models\\_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"bind": false, "database": "tuva", "schema": "input_layer"}, "created_at": 1702510320.1761312, "relation_name": "tuva.input_layer.encounter", "raw_code": "select \r\n cast(null as {{ dbt.type_string() }} ) as encounter_id\r\n , cast(null as {{ dbt.type_string() }} ) as patient_id\r\n , cast(null as {{ dbt.type_string() }} ) as encounter_type\r\n , cast(null as date) as encounter_start_date\r\n , cast(null as date) as encounter_end_date\r\n , cast(null as {{ dbt.type_int() }} ) as length_of_stay\r\n , cast(null as {{ dbt.type_string() }} ) as admit_source_code\r\n , cast(null as {{ dbt.type_string() }} ) as admit_source_description\r\n , cast(null as {{ dbt.type_string() }} ) as admit_type_code\r\n , cast(null as {{ dbt.type_string() }} ) as admit_type_description\r\n , cast(null as {{ dbt.type_string() }} ) as discharge_disposition_code\r\n , cast(null as {{ dbt.type_string() }} ) as discharge_disposition_description\r\n , cast(null as {{ dbt.type_string() }} ) as attending_provider_id\r\n , cast(null as {{ dbt.type_string() }} ) as facility_npi\r\n , cast(null as {{ dbt.type_string() }} ) as primary_diagnosis_code_type\r\n , cast(null as {{ dbt.type_string() }} ) as primary_diagnosis_code\r\n , cast(null as {{ dbt.type_string() }} ) as primary_diagnosis_description\r\n , cast(null as {{ dbt.type_string() }} ) as ms_drg_code\r\n , cast(null as {{ dbt.type_string() }} ) as ms_drg_description\r\n , cast(null as {{ dbt.type_string() }} ) as apr_drg_code\r\n , cast(null as {{ dbt.type_string() }} ) as apr_drg_description\r\n , cast(null as {{ dbt.type_numeric() }} ) as paid_amount\r\n , cast(null as {{ dbt.type_numeric() }} ) as allowed_amount\r\n , cast(null as {{ dbt.type_numeric() }} ) as charge_amount\r\n , cast(null as {{ dbt.type_string() }} ) as data_source\r\nlimit 0", "language": "sql", "refs": [], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.type_string", "macro.dbt.type_int", "macro.dbt.type_numeric"], "nodes": []}, "compiled_path": "../target\\compiled\\input_layer\\models\\encounter.sql", "compiled": true, "compiled_code": "select \n cast(null as TEXT ) as encounter_id\n , cast(null as TEXT ) as patient_id\n , cast(null as TEXT ) as encounter_type\n , cast(null as date) as encounter_start_date\n , cast(null as date) as encounter_end_date\n , cast(null as INT ) as length_of_stay\n , cast(null as TEXT ) as admit_source_code\n , cast(null as TEXT ) as admit_source_description\n , cast(null as TEXT ) as admit_type_code\n , cast(null as TEXT ) as admit_type_description\n , cast(null as TEXT ) as discharge_disposition_code\n , cast(null as TEXT ) as discharge_disposition_description\n , cast(null as TEXT ) as attending_provider_id\n , cast(null as TEXT ) as facility_npi\n , cast(null as TEXT ) as primary_diagnosis_code_type\n , cast(null as TEXT ) as primary_diagnosis_code\n , cast(null as TEXT ) as primary_diagnosis_description\n , cast(null as TEXT ) as ms_drg_code\n , cast(null as TEXT ) as ms_drg_description\n , cast(null as TEXT ) as apr_drg_code\n , cast(null as TEXT ) as apr_drg_description\n , cast(null as numeric(28,6) ) as paid_amount\n , cast(null as numeric(28,6) ) as allowed_amount\n , cast(null as numeric(28,6) ) as charge_amount\n , cast(null as TEXT ) as data_source\nlimit 0", "extra_ctes_injected": true, "extra_ctes": []}, "model.input_layer.procedure": {"database": "tuva", "schema": "input_layer", "name": "procedure", "resource_type": "model", "package_name": "input_layer", "path": "procedure.sql", "original_file_path": "models\\procedure.sql", "unique_id": "model.input_layer.procedure", "fqn": ["input_layer", "procedure"], "alias": "procedure", "checksum": {"name": "sha256", "checksum": "e8c500fd5c02e356b37b6ceb88b3ab6709d5ed9bf878f965220f1050631630fa"}, "config": {"enabled": true, "alias": null, "schema": "input_layer", "database": "tuva", "tags": [], "meta": {}, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": [], "description": "The procedure table contains information on procedures that were performed on patients in the dataset.\n", "columns": {"procedure_id": {"name": "procedure_id", "description": "The unique identifier for the performed procedure.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "patient_id": {"name": "patient_id", "description": "Unique identifier for each person across all datasets.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "encounter_id": {"name": "encounter_id", "description": "The encounter_id for the encounter where this procedure was performed.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "claim_id": {"name": "claim_id", "description": "The claim on which the procedure was recorded.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "procedure_date": {"name": "procedure_date", "description": "Date when the procedure was performed.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "source_code_type": {"name": "source_code_type", "description": "Type of procedure code for the procedure in the source system.\n", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__code_type.csv"}, "data_type": null, "quote": null, "tags": []}, "source_code": {"name": "source_code", "description": "The procedure code in the source system.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__icd_10_pcs.csv", "terminology_note": "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters."}, "data_type": null, "quote": null, "tags": []}, "source_description": {"name": "source_description", "description": "Description of the procedure code.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "normalized_code_type": {"name": "normalized_code_type", "description": "Normalized type of procedure code for the procedure.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__code_type.csv"}, "data_type": null, "quote": null, "tags": []}, "normalized_code": {"name": "normalized_code", "description": "The normalized procedure code.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__icd_10_pcs.csv", "terminology_note": "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters."}, "data_type": null, "quote": null, "tags": []}, "normalized_description": {"name": "normalized_description", "description": "Description of the procedure code.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "modifier_1": {"name": "modifier_1", "description": "First modifier for the procedure code.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__hcpcs_level_2.csv"}, "data_type": null, "quote": null, "tags": []}, "modifier_2": {"name": "modifier_2", "description": "Second modifier for the procedure code.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__hcpcs_level_2.csv"}, "data_type": null, "quote": null, "tags": []}, "modifier_3": {"name": "modifier_3", "description": "Third modifier for the procedure code.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__hcpcs_level_2.csv"}, "data_type": null, "quote": null, "tags": []}, "modifier_4": {"name": "modifier_4", "description": "Fourth modifier for the procedure code.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__hcpcs_level_2.csv"}, "data_type": null, "quote": null, "tags": []}, "modifier_5": {"name": "modifier_5", "description": "Fifth modifier for the procedure code.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__hcpcs_level_2.csv"}, "data_type": null, "quote": null, "tags": []}, "practitioner_id": {"name": "practitioner_id", "description": "ID of the provider who performed the procedure.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__provider.csv", "terminology_note": "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters."}, "data_type": null, "quote": null, "tags": []}, "data_source": {"name": "data_source", "description": "User-configured field that indicates the data source (e.g. typically named after the payer and state \"BCBS Tennessee\").", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "input_layer://models\\_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"bind": false, "database": "tuva", "schema": "input_layer"}, "created_at": 1702510320.1761312, "relation_name": "tuva.input_layer.procedure", "raw_code": "select\r\n cast(null as {{ dbt.type_string() }} ) as procedure_id\r\n , cast(null as {{ dbt.type_string() }} ) as patient_id\r\n , cast(null as {{ dbt.type_string() }} ) as encounter_id\r\n , cast(null as {{ dbt.type_string() }} ) as claim_id\r\n , cast(null as date) as procedure_date\r\n , cast(null as {{ dbt.type_string() }} ) as source_code_type\r\n , cast(null as {{ dbt.type_string() }} ) as source_code\r\n , cast(null as {{ dbt.type_string() }} ) as source_description\r\n , cast(null as {{ dbt.type_string() }} ) as normalized_code_type\r\n , cast(null as {{ dbt.type_string() }} ) as normalized_code\r\n , cast(null as {{ dbt.type_string() }} ) as normalized_description\r\n , cast(null as {{ dbt.type_string() }} ) as modifier_1\r\n , cast(null as {{ dbt.type_string() }} ) as modifier_2\r\n , cast(null as {{ dbt.type_string() }} ) as modifier_3\r\n , cast(null as {{ dbt.type_string() }} ) as modifier_4\r\n , cast(null as {{ dbt.type_string() }} ) as modifier_5\r\n , cast(null as {{ dbt.type_string() }} ) as practitioner_id\r\n , cast(null as {{ dbt.type_string() }} ) as data_source\r\nlimit 0", "language": "sql", "refs": [], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.type_string"], "nodes": []}, "compiled_path": "../target\\compiled\\input_layer\\models\\procedure.sql", "compiled": true, "compiled_code": "select\n cast(null as TEXT ) as procedure_id\n , cast(null as TEXT ) as patient_id\n , cast(null as TEXT ) as encounter_id\n , cast(null as TEXT ) as claim_id\n , cast(null as date) as procedure_date\n , cast(null as TEXT ) as source_code_type\n , cast(null as TEXT ) as source_code\n , cast(null as TEXT ) as source_description\n , cast(null as TEXT ) as normalized_code_type\n , cast(null as TEXT ) as normalized_code\n , cast(null as TEXT ) as normalized_description\n , cast(null as TEXT ) as modifier_1\n , cast(null as TEXT ) as modifier_2\n , cast(null as TEXT ) as modifier_3\n , cast(null as TEXT ) as modifier_4\n , cast(null as TEXT ) as modifier_5\n , cast(null as TEXT ) as practitioner_id\n , cast(null as TEXT ) as data_source\nlimit 0", "extra_ctes_injected": true, "extra_ctes": []}, "model.input_layer.condition": {"database": "tuva", "schema": "input_layer", "name": "condition", "resource_type": "model", "package_name": "input_layer", "path": "condition.sql", "original_file_path": "models\\condition.sql", "unique_id": "model.input_layer.condition", "fqn": ["input_layer", "condition"], "alias": "condition", "checksum": {"name": "sha256", "checksum": "fd5a2e69238bb9f06a12484e6c46a68707468fa2fd98873a283aca3f0831b6b0"}, "config": {"enabled": true, "alias": null, "schema": "input_layer", "database": "tuva", "tags": [], "meta": {}, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": [], "description": "The condition table contains information related to medical conditions patients have, including problems, admitting diagnosis codes, and billable diagnosis codes.\n", "columns": {"condition_id": {"name": "condition_id", "description": "Unique identifier for each condition in the table.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "patient_id": {"name": "patient_id", "description": "Unique identifier for each patient in the dataset.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "encounter_id": {"name": "encounter_id", "description": "Unique identifier for each encounter.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "claim_id": {"name": "claim_id", "description": "Unique identifier for each claim.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "recorded_date": {"name": "recorded_date", "description": "Date when the condition was recorded.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "onset_date": {"name": "onset_date", "description": "Date when the condition first occurred.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "resolved_date": {"name": "resolved_date", "description": "Date when the condition was resolved.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "status": {"name": "status", "description": "Status of the condition.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "condition_type": {"name": "condition_type", "description": "The type of condition i.e. problem, admitting, or billing.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "source_code_type": {"name": "source_code_type", "description": "The type of condition code reported in the source system e.g. ICD-10-CM.\n", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__code_type.csv"}, "data_type": null, "quote": null, "tags": []}, "source_code": {"name": "source_code", "description": "The condition code in the source system e.g. the ICD-10 code.\n", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__icd_10_cm.csv", "terminology_note": "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters."}, "data_type": null, "quote": null, "tags": []}, "source_description": {"name": "source_description", "description": "Description of the condition code in the source system.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "normalized_code_type": {"name": "normalized_code_type", "description": "The normalized type of condition code.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__code_type.csv"}, "data_type": null, "quote": null, "tags": []}, "normalized_code": {"name": "normalized_code", "description": "The normalized condition code.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__icd_10_cm.csv", "terminology_note": "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters."}, "data_type": null, "quote": null, "tags": []}, "normalized_description": {"name": "normalized_description", "description": "Normalized description of the condition code.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "condition_rank": {"name": "condition_rank", "description": "The numerical ranking of a diagnosis code in a claim. Principle diagnosis code is given a ranking of 1. Claims data typically has a strict ranking of conditions whereas medical records will often not have this information or the information won't be accurate.\n", "meta": {}, "data_type": "integer", "quote": null, "tags": []}, "present_on_admit_code": {"name": "present_on_admit_code", "description": "The present_on_admit_code related to the condition.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__present_on_admission.csv"}, "data_type": null, "quote": null, "tags": []}, "present_on_admit_description": {"name": "present_on_admit_description", "description": "The description of the present_on_admit_code for the condition.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "data_source": {"name": "data_source", "description": "User-configured field that indicates the data source (e.g. typically named after the payer and state \"BCBS Tennessee\").\n", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "input_layer://models\\_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"bind": false, "database": "tuva", "schema": "input_layer"}, "created_at": 1702510320.1917686, "relation_name": "tuva.input_layer.condition", "raw_code": "select\r\n cast(null as {{ dbt.type_string() }} ) as condition_id\r\n , cast(null as {{ dbt.type_string() }} ) as patient_id\r\n , cast(null as {{ dbt.type_string() }} ) as encounter_id\r\n , cast(null as {{ dbt.type_string() }} ) as claim_id\r\n , cast(null as date) as recorded_date\r\n , cast(null as date) as onset_date\r\n , cast(null as date) as resolved_date\r\n , cast(null as {{ dbt.type_string() }} ) as status\r\n , cast(null as {{ dbt.type_string() }} ) as condition_type\r\n , cast(null as {{ dbt.type_string() }} ) as source_code_type\r\n , cast(null as {{ dbt.type_string() }} ) as source_code\r\n , cast(null as {{ dbt.type_string() }} ) as source_description\r\n , cast(null as {{ dbt.type_string() }} ) as normalized_code_type\r\n , cast(null as {{ dbt.type_string() }} ) as normalized_code\r\n , cast(null as {{ dbt.type_string() }} ) as normalized_description\r\n , cast(null as {{ dbt.type_int() }} ) as condition_rank\r\n , cast(null as {{ dbt.type_string() }} ) as present_on_admit_code\r\n , cast(null as {{ dbt.type_string() }} ) as present_on_admit_description\r\n , cast(null as {{ dbt.type_string() }} ) as data_source\r\nlimit 0", "language": "sql", "refs": [], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.type_string", "macro.dbt.type_int"], "nodes": []}, "compiled_path": "../target\\compiled\\input_layer\\models\\condition.sql", "compiled": true, "compiled_code": "select\n cast(null as TEXT ) as condition_id\n , cast(null as TEXT ) as patient_id\n , cast(null as TEXT ) as encounter_id\n , cast(null as TEXT ) as claim_id\n , cast(null as date) as recorded_date\n , cast(null as date) as onset_date\n , cast(null as date) as resolved_date\n , cast(null as TEXT ) as status\n , cast(null as TEXT ) as condition_type\n , cast(null as TEXT ) as source_code_type\n , cast(null as TEXT ) as source_code\n , cast(null as TEXT ) as source_description\n , cast(null as TEXT ) as normalized_code_type\n , cast(null as TEXT ) as normalized_code\n , cast(null as TEXT ) as normalized_description\n , cast(null as INT ) as condition_rank\n , cast(null as TEXT ) as present_on_admit_code\n , cast(null as TEXT ) as present_on_admit_description\n , cast(null as TEXT ) as data_source\nlimit 0", "extra_ctes_injected": true, "extra_ctes": []}, "model.input_layer.medical_claim": {"database": "tuva", "schema": "input_layer", "name": "medical_claim", "resource_type": "model", "package_name": "input_layer", "path": "medical_claim.sql", "original_file_path": "models\\medical_claim.sql", "unique_id": "model.input_layer.medical_claim", "fqn": ["input_layer", "medical_claim"], "alias": "medical_claim", "checksum": {"name": "sha256", "checksum": "b8acd6c51e8d818339390054e79658a5c1f43fb1c78c8315fcaafad1a6c905be"}, "config": {"enabled": true, "alias": null, "schema": "input_layer", "database": "tuva", "tags": [], "meta": {}, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": [], "description": "The medical_claim table contains information on healthcare services and supplies provided to patients, billed by providers, and paid for by health insurers. It includes information on the provider who rendered the service, the amount paid for the service by the health insurer, and the underlying reason for the service (i.e. diagnosis).\n", "columns": {"claim_id": {"name": "claim_id", "description": "Unique identifier for each claim.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "claim_line_number": {"name": "claim_line_number", "description": "Indicates the line number for the particular line of the claim.\n", "meta": {}, "data_type": "integer", "quote": null, "tags": []}, "claim_type": {"name": "claim_type", "description": "Indicates whether the claim is professional (CMS-1500), institutional (UB-04), dental, or vision.\n", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__claim_type.csv"}, "data_type": null, "quote": null, "tags": []}, "patient_id": {"name": "patient_id", "description": "Unique identifier for each patient in the dataset.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "member_id": {"name": "member_id", "description": "Identifier that links a patient to a particular insurance product or health plan. A patient can have more than one member_id because they can have more than one insurance product/plan.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "payer": {"name": "payer", "description": "Name of the payer (i.e. health insurer) providing coverage.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "plan": {"name": "plan", "description": "Name of the plan", "meta": {}, "data_type": null, "quote": null, "tags": []}, "claim_start_date": {"name": "claim_start_date", "description": "Start date for the claim.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "claim_end_date": {"name": "claim_end_date", "description": "End date for the claim.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "claim_line_start_date": {"name": "claim_line_start_date", "description": "Start date for the claim line.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "claim_line_end_date": {"name": "claim_line_end_date", "description": "End date for the claim line.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "admission_date": {"name": "admission_date", "description": "Admission date for the claim (inpatient claims only).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "discharge_date": {"name": "discharge_date", "description": "Discharge date for the claim (inpatient claims only).", "meta": {}, "data_type": null, "quote": null, "tags": []}, "admit_source_code": {"name": "admit_source_code", "description": "Indicates where the patient was before the healthcare encounter (inpatient claims only).\n", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__admit_source.csv"}, "data_type": null, "quote": null, "tags": []}, "admit_type_code": {"name": "admit_type_code", "description": "Indicates the type of admission (inpatient claims only).", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__admit_type.csv"}, "data_type": null, "quote": null, "tags": []}, "discharge_disposition_code": {"name": "discharge_disposition_code", "description": "Indicates the type of setting the patient was discharged to (institutional inpatient claims only).\n", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__discharge_disposition.csv"}, "data_type": null, "quote": null, "tags": []}, "place_of_service_code": {"name": "place_of_service_code", "description": "Place of service for the claim (professional claims only).", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__place_of_service.csv"}, "data_type": null, "quote": null, "tags": []}, "bill_type_code": {"name": "bill_type_code", "description": "Bill type code for the claim (institutional claims only).", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__bill_type.csv"}, "data_type": null, "quote": null, "tags": []}, "ms_drg_code": {"name": "ms_drg_code", "description": "MS-DRG for the claim (inpatient claims only).", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__ms_drg.csv"}, "data_type": null, "quote": null, "tags": []}, "apr_drg_code": {"name": "apr_drg_code", "description": "APR-DRG for the claim (inpatient claims only).", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__apr_drg.csv"}, "data_type": null, "quote": null, "tags": []}, "revenue_center_code": {"name": "revenue_center_code", "description": "Revenue center code for the claim line (institutional only and typically multiple codes per claim).\n", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__revenue_center.csv"}, "data_type": null, "quote": null, "tags": []}, "service_unit_quantity": {"name": "service_unit_quantity", "description": "The number of units for the particular revenue center code.", "meta": {}, "data_type": "integer", "quote": null, "tags": []}, "hcpcs_code": {"name": "hcpcs_code", "description": "HCPCS level 1 or level 2 code for the claim line.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__hcpcs_level_2.csv"}, "data_type": null, "quote": null, "tags": []}, "hcpcs_modifier_1": {"name": "hcpcs_modifier_1", "description": "1st modifier for HCPCS code.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__hcpcs_level_2.csv"}, "data_type": null, "quote": null, "tags": []}, "hcpcs_modifier_2": {"name": "hcpcs_modifier_2", "description": "2nd modifier for HCPCS code.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__hcpcs_level_2.csv"}, "data_type": null, "quote": null, "tags": []}, "hcpcs_modifier_3": {"name": "hcpcs_modifier_3", "description": "3rd modifier for HCPCS code.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__hcpcs_level_2.csv"}, "data_type": null, "quote": null, "tags": []}, "hcpcs_modifier_4": {"name": "hcpcs_modifier_4", "description": "4th modifier for HCPCS code.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__hcpcs_level_2.csv"}, "data_type": null, "quote": null, "tags": []}, "hcpcs_modifier_5": {"name": "hcpcs_modifier_5", "description": "5th modifier for HCPCS code.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__hcpcs_level_2.csv"}, "data_type": null, "quote": null, "tags": []}, "rendering_npi": {"name": "rendering_npi", "description": "Rendering NPI for the claim (typically represents the physician or entity providing services).\n", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__provider.csv", "terminology_note": "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters."}, "data_type": null, "quote": null, "tags": []}, "billing_npi": {"name": "billing_npi", "description": "Billing NPI for the claim (typically represents organization billing the claim).\n", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__provider.csv", "terminology_note": "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters."}, "data_type": null, "quote": null, "tags": []}, "facility_npi": {"name": "facility_npi", "description": "Facility NPI for the claim (typically represents the facility where services were performed).\n", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__provider.csv", "terminology_note": "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters."}, "data_type": null, "quote": null, "tags": []}, "paid_date": {"name": "paid_date", "description": "The date the claim was paid.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "paid_amount": {"name": "paid_amount", "description": "The total amount paid on the claim by the insurer.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "allowed_amount": {"name": "allowed_amount", "description": "The total amount allowed (includes amount paid by the insurer and patient) on the claim.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "charge_amount": {"name": "charge_amount", "description": "The total amount charged on the claim by the provider.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "coinsurance_amount": {"name": "coinsurance_amount", "description": "The total coinsurance charged on the claim by the provider.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "copayment_amount": {"name": "copayment_amount", "description": "The total copayment charged on the claim by the provider.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "deductible_amount": {"name": "deductible_amount", "description": "The total amount charged on the claim by the provider.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "total_cost_amount": {"name": "total_cost_amount", "description": "The total amount paid on the claim by different parties.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "diagnosis_code_type": {"name": "diagnosis_code_type", "description": "Indicates the type of diagnosis code (e.g. ICD-10-CM).", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__code_type.csv"}, "data_type": null, "quote": null, "tags": []}, "diagnosis_code_1": {"name": "diagnosis_code_1", "description": "1st ICD (9 or 10) CM diagnosis code on the claim.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__icd_10_cm.csv", "terminology_note": "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters."}, "data_type": null, "quote": null, "tags": []}, "diagnosis_code_2": {"name": "diagnosis_code_2", "description": "2nd ICD (9 or 10) CM diagnosis code on the claim.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__icd_10_cm.csv", "terminology_note": "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters."}, "data_type": null, "quote": null, "tags": []}, "diagnosis_code_3": {"name": "diagnosis_code_3", "description": "3rd ICD (9 or 10) CM diagnosis code on the claim.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__icd_10_cm.csv", "terminology_note": "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters."}, "data_type": null, "quote": null, "tags": []}, "diagnosis_code_4": {"name": "diagnosis_code_4", "description": "4th ICD (9 or 10) CM diagnosis code on the claim.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__icd_10_cm.csv", "terminology_note": "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters."}, "data_type": null, "quote": null, "tags": []}, "diagnosis_code_5": {"name": "diagnosis_code_5", "description": "5th ICD (9 or 10) CM diagnosis code on the claim.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__icd_10_cm.csv", "terminology_note": "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters."}, "data_type": null, "quote": null, "tags": []}, "diagnosis_code_6": {"name": "diagnosis_code_6", "description": "6th ICD (9 or 10) CM diagnosis code on the claim.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__icd_10_cm.csv", "terminology_note": "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters."}, "data_type": null, "quote": null, "tags": []}, "diagnosis_code_7": {"name": "diagnosis_code_7", "description": "7th ICD (9 or 10) CM diagnosis code on the claim.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__icd_10_cm.csv", "terminology_note": "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters."}, "data_type": null, "quote": null, "tags": []}, "diagnosis_code_8": {"name": "diagnosis_code_8", "description": "8th ICD (9 or 10) CM diagnosis code on the claim.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__icd_10_cm.csv", "terminology_note": "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters."}, "data_type": null, "quote": null, "tags": []}, "diagnosis_code_9": {"name": "diagnosis_code_9", "description": "9th ICD (9 or 10) CM diagnosis code on the claim.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__icd_10_cm.csv", "terminology_note": "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters."}, "data_type": null, "quote": null, "tags": []}, "diagnosis_code_10": {"name": "diagnosis_code_10", "description": "10th ICD (9 or 10) CM diagnosis code on the claim.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__icd_10_cm.csv", "terminology_note": "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters."}, "data_type": null, "quote": null, "tags": []}, "diagnosis_code_11": {"name": "diagnosis_code_11", "description": "11th ICD (9 or 10) CM diagnosis code on the claim.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__icd_10_cm.csv", "terminology_note": "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters."}, "data_type": null, "quote": null, "tags": []}, "diagnosis_code_12": {"name": "diagnosis_code_12", "description": "12th ICD (9 or 10) CM diagnosis code on the claim.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__icd_10_cm.csv", "terminology_note": "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters."}, "data_type": null, "quote": null, "tags": []}, "diagnosis_code_13": {"name": "diagnosis_code_13", "description": "13th ICD (9 or 10) CM diagnosis code on the claim.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__icd_10_cm.csv", "terminology_note": "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters."}, "data_type": null, "quote": null, "tags": []}, "diagnosis_code_14": {"name": "diagnosis_code_14", "description": "14th ICD (9 or 10) CM diagnosis code on the claim.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__icd_10_cm.csv", "terminology_note": "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters."}, "data_type": null, "quote": null, "tags": []}, "diagnosis_code_15": {"name": "diagnosis_code_15", "description": "15th ICD (9 or 10) CM diagnosis code on the claim.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__icd_10_cm.csv", "terminology_note": "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters."}, "data_type": null, "quote": null, "tags": []}, "diagnosis_code_16": {"name": "diagnosis_code_16", "description": "16th ICD (9 or 10) CM diagnosis code on the claim.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__icd_10_cm.csv", "terminology_note": "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters."}, "data_type": null, "quote": null, "tags": []}, "diagnosis_code_17": {"name": "diagnosis_code_17", "description": "17th ICD (9 or 10) CM diagnosis code on the claim.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__icd_10_cm.csv", "terminology_note": "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters."}, "data_type": null, "quote": null, "tags": []}, "diagnosis_code_18": {"name": "diagnosis_code_18", "description": "18th ICD (9 or 10) CM diagnosis code on the claim.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__icd_10_cm.csv", "terminology_note": "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters."}, "data_type": null, "quote": null, "tags": []}, "diagnosis_code_19": {"name": "diagnosis_code_19", "description": "19th ICD (9 or 10) CM diagnosis code on the claim.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__icd_10_cm.csv", "terminology_note": "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters."}, "data_type": null, "quote": null, "tags": []}, "diagnosis_code_20": {"name": "diagnosis_code_20", "description": "20th ICD (9 or 10) CM diagnosis code on the claim.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__icd_10_cm.csv", "terminology_note": "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters."}, "data_type": null, "quote": null, "tags": []}, "diagnosis_code_21": {"name": "diagnosis_code_21", "description": "21st ICD (9 or 10) CM diagnosis code on the claim.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__icd_10_cm.csv", "terminology_note": "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters."}, "data_type": null, "quote": null, "tags": []}, "diagnosis_code_22": {"name": "diagnosis_code_22", "description": "22nd ICD (9 or 10) CM diagnosis code on the claim.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__icd_10_cm.csv", "terminology_note": "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters."}, "data_type": null, "quote": null, "tags": []}, "diagnosis_code_23": {"name": "diagnosis_code_23", "description": "23rd ICD (9 or 10) CM diagnosis code on the claim.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__icd_10_cm.csv", "terminology_note": "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters."}, "data_type": null, "quote": null, "tags": []}, "diagnosis_code_24": {"name": "diagnosis_code_24", "description": "24th ICD (9 or 10) CM diagnosis code on the claim.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__icd_10_cm.csv", "terminology_note": "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters."}, "data_type": null, "quote": null, "tags": []}, "diagnosis_code_25": {"name": "diagnosis_code_25", "description": "25th ICD (9 or 10) CM diagnosis code on the claim.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__icd_10_cm.csv", "terminology_note": "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters."}, "data_type": null, "quote": null, "tags": []}, "diagnosis_poa_1": {"name": "diagnosis_poa_1", "description": "Present on admission code for the 1st diagnosis on the claim.\n", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__present_on_admission.csv"}, "data_type": null, "quote": null, "tags": []}, "diagnosis_poa_2": {"name": "diagnosis_poa_2", "description": "Present on admission code for the 2nd diagnosis on the claim.\n", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__present_on_admission.csv"}, "data_type": null, "quote": null, "tags": []}, "diagnosis_poa_3": {"name": "diagnosis_poa_3", "description": "Present on admission code for the 3rd diagnosis on the claim.\n", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__present_on_admission.csv"}, "data_type": null, "quote": null, "tags": []}, "diagnosis_poa_4": {"name": "diagnosis_poa_4", "description": "Present on admission code for the 4th diagnosis on the claim.\n", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__present_on_admission.csv"}, "data_type": null, "quote": null, "tags": []}, "diagnosis_poa_5": {"name": "diagnosis_poa_5", "description": "Present on admission code for the 5th diagnosis on the claim.\n", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__present_on_admission.csv"}, "data_type": null, "quote": null, "tags": []}, "diagnosis_poa_6": {"name": "diagnosis_poa_6", "description": "Present on admission code for the 6th diagnosis on the claim.\n", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__present_on_admission.csv"}, "data_type": null, "quote": null, "tags": []}, "diagnosis_poa_7": {"name": "diagnosis_poa_7", "description": "Present on admission code for the 7th diagnosis on the claim.\n", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__present_on_admission.csv"}, "data_type": null, "quote": null, "tags": []}, "diagnosis_poa_8": {"name": "diagnosis_poa_8", "description": "Present on admission code for the 8th diagnosis on the claim.\n", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__present_on_admission.csv"}, "data_type": null, "quote": null, "tags": []}, "diagnosis_poa_9": {"name": "diagnosis_poa_9", "description": "Present on admission code for the 9th diagnosis on the claim.\n", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__present_on_admission.csv"}, "data_type": null, "quote": null, "tags": []}, "diagnosis_poa_10": {"name": "diagnosis_poa_10", "description": "Present on admission code for the 10th diagnosis on the claim.\n", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__present_on_admission.csv"}, "data_type": null, "quote": null, "tags": []}, "diagnosis_poa_11": {"name": "diagnosis_poa_11", "description": "Present on admission code for the 11th diagnosis on the claim.\n", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__present_on_admission.csv"}, "data_type": null, "quote": null, "tags": []}, "diagnosis_poa_12": {"name": "diagnosis_poa_12", "description": "Present on admission code for the 12th diagnosis on the claim.\n", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__present_on_admission.csv"}, "data_type": null, "quote": null, "tags": []}, "diagnosis_poa_13": {"name": "diagnosis_poa_13", "description": "Present on admission code for the 13th diagnosis on the claim.\n", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__present_on_admission.csv"}, "data_type": null, "quote": null, "tags": []}, "diagnosis_poa_14": {"name": "diagnosis_poa_14", "description": "Present on admission code for the 14th diagnosis on the claim.\n", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__present_on_admission.csv"}, "data_type": null, "quote": null, "tags": []}, "diagnosis_poa_15": {"name": "diagnosis_poa_15", "description": "Present on admission code for the 15th diagnosis on the claim.\n", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__present_on_admission.csv"}, "data_type": null, "quote": null, "tags": []}, "diagnosis_poa_16": {"name": "diagnosis_poa_16", "description": "Present on admission code for the 16th diagnosis on the claim.\n", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__present_on_admission.csv"}, "data_type": null, "quote": null, "tags": []}, "diagnosis_poa_17": {"name": "diagnosis_poa_17", "description": "Present on admission code for the 17th diagnosis on the claim.\n", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__present_on_admission.csv"}, "data_type": null, "quote": null, "tags": []}, "diagnosis_poa_18": {"name": "diagnosis_poa_18", "description": "Present on admission code for the 18th diagnosis on the claim.\n", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__present_on_admission.csv"}, "data_type": null, "quote": null, "tags": []}, "diagnosis_poa_19": {"name": "diagnosis_poa_19", "description": "Present on admission code for the 19th diagnosis on the claim.\n", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__present_on_admission.csv"}, "data_type": null, "quote": null, "tags": []}, "diagnosis_poa_20": {"name": "diagnosis_poa_20", "description": "Present on admission code for the 20th diagnosis on the claim.\n", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__present_on_admission.csv"}, "data_type": null, "quote": null, "tags": []}, "diagnosis_poa_21": {"name": "diagnosis_poa_21", "description": "Present on admission code for the 21st diagnosis on the claim.\n", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__present_on_admission.csv"}, "data_type": null, "quote": null, "tags": []}, "diagnosis_poa_22": {"name": "diagnosis_poa_22", "description": "Present on admission code for the 22nd diagnosis on the claim.\n", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__present_on_admission.csv"}, "data_type": null, "quote": null, "tags": []}, "diagnosis_poa_23": {"name": "diagnosis_poa_23", "description": "Present on admission code for the 23rd diagnosis on the claim.\n", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__present_on_admission.csv"}, "data_type": null, "quote": null, "tags": []}, "diagnosis_poa_24": {"name": "diagnosis_poa_24", "description": "Present on admission code for the 24th diagnosis on the claim.\n", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__present_on_admission.csv"}, "data_type": null, "quote": null, "tags": []}, "diagnosis_poa_25": {"name": "diagnosis_poa_25", "description": "Present on admission code for the 25th diagnosis on the claim.\n", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__present_on_admission.csv"}, "data_type": null, "quote": null, "tags": []}, "procedure_code_type": {"name": "procedure_code_type", "description": "Indicates the type of procedure code (e.g. ICD-10-PCS).", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__code_type.csv"}, "data_type": null, "quote": null, "tags": []}, "procedure_code_1": {"name": "procedure_code_1", "description": "1st ICD (9 or 10) procedure code on the claim.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__icd_10_pcs.csv", "terminology_note": "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters."}, "data_type": null, "quote": null, "tags": []}, "procedure_code_2": {"name": "procedure_code_2", "description": "2nd ICD (9 or 10) procedure code on the claim.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__icd_10_pcs.csv", "terminology_note": "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters."}, "data_type": null, "quote": null, "tags": []}, "procedure_code_3": {"name": "procedure_code_3", "description": "3rd ICD (9 or 10) procedure code on the claim.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__icd_10_pcs.csv", "terminology_note": "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters."}, "data_type": null, "quote": null, "tags": []}, "procedure_code_4": {"name": "procedure_code_4", "description": "4th ICD (9 or 10) procedure code on the claim.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__icd_10_pcs.csv", "terminology_note": "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters."}, "data_type": null, "quote": null, "tags": []}, "procedure_code_5": {"name": "procedure_code_5", "description": "5th ICD (9 or 10) procedure code on the claim.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__icd_10_pcs.csv", "terminology_note": "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters."}, "data_type": null, "quote": null, "tags": []}, "procedure_code_6": {"name": "procedure_code_6", "description": "6th ICD (9 or 10) procedure code on the claim.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__icd_10_pcs.csv", "terminology_note": "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters."}, "data_type": null, "quote": null, "tags": []}, "procedure_code_7": {"name": "procedure_code_7", "description": "7th ICD (9 or 10) procedure code on the claim.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__icd_10_pcs.csv", "terminology_note": "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters."}, "data_type": null, "quote": null, "tags": []}, "procedure_code_8": {"name": "procedure_code_8", "description": "8th ICD (9 or 10) procedure code on the claim.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__icd_10_pcs.csv", "terminology_note": "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters."}, "data_type": null, "quote": null, "tags": []}, "procedure_code_9": {"name": "procedure_code_9", "description": "9th ICD (9 or 10) procedure code on the claim.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__icd_10_pcs.csv", "terminology_note": "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters."}, "data_type": null, "quote": null, "tags": []}, "procedure_code_10": {"name": "procedure_code_10", "description": "10th ICD (9 or 10) procedure code on the claim.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__icd_10_pcs.csv", "terminology_note": "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters."}, "data_type": null, "quote": null, "tags": []}, "procedure_code_11": {"name": "procedure_code_11", "description": "11th ICD (9 or 10) procedure code on the claim.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__icd_10_pcs.csv", "terminology_note": "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters."}, "data_type": null, "quote": null, "tags": []}, "procedure_code_12": {"name": "procedure_code_12", "description": "12th ICD (9 or 10) procedure code on the claim.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__icd_10_pcs.csv", "terminology_note": "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters."}, "data_type": null, "quote": null, "tags": []}, "procedure_code_13": {"name": "procedure_code_13", "description": "13th ICD (9 or 10) procedure code on the claim.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__icd_10_pcs.csv", "terminology_note": "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters."}, "data_type": null, "quote": null, "tags": []}, "procedure_code_14": {"name": "procedure_code_14", "description": "14th ICD (9 or 10) procedure code on the claim.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__icd_10_pcs.csv", "terminology_note": "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters."}, "data_type": null, "quote": null, "tags": []}, "procedure_code_15": {"name": "procedure_code_15", "description": "15th ICD (9 or 10) procedure code on the claim.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__icd_10_pcs.csv", "terminology_note": "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters."}, "data_type": null, "quote": null, "tags": []}, "procedure_code_16": {"name": "procedure_code_16", "description": "16th ICD (9 or 10) procedure code on the claim.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__icd_10_pcs.csv", "terminology_note": "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters."}, "data_type": null, "quote": null, "tags": []}, "procedure_code_17": {"name": "procedure_code_17", "description": "17th ICD (9 or 10) procedure code on the claim.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__icd_10_pcs.csv", "terminology_note": "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters."}, "data_type": null, "quote": null, "tags": []}, "procedure_code_18": {"name": "procedure_code_18", "description": "18th ICD (9 or 10) procedure code on the claim.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__icd_10_pcs.csv", "terminology_note": "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters."}, "data_type": null, "quote": null, "tags": []}, "procedure_code_19": {"name": "procedure_code_19", "description": "19th ICD (9 or 10) procedure code on the claim.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__icd_10_pcs.csv", "terminology_note": "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters."}, "data_type": null, "quote": null, "tags": []}, "procedure_code_20": {"name": "procedure_code_20", "description": "20th ICD (9 or 10) procedure code on the claim.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__icd_10_pcs.csv", "terminology_note": "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters."}, "data_type": null, "quote": null, "tags": []}, "procedure_code_21": {"name": "procedure_code_21", "description": "21st ICD (9 or 10) procedure code on the claim.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__icd_10_pcs.csv", "terminology_note": "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters."}, "data_type": null, "quote": null, "tags": []}, "procedure_code_22": {"name": "procedure_code_22", "description": "22nd ICD (9 or 10) procedure code on the claim.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__icd_10_pcs.csv", "terminology_note": "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters."}, "data_type": null, "quote": null, "tags": []}, "procedure_code_23": {"name": "procedure_code_23", "description": "23rd ICD (9 or 10) procedure code on the claim.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__icd_10_pcs.csv", "terminology_note": "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters."}, "data_type": null, "quote": null, "tags": []}, "procedure_code_24": {"name": "procedure_code_24", "description": "24th ICD (9 or 10) procedure code on the claim.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__icd_10_pcs.csv", "terminology_note": "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters."}, "data_type": null, "quote": null, "tags": []}, "procedure_code_25": {"name": "procedure_code_25", "description": "25th ICD (9 or 10) procedure code on the claim.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__icd_10_pcs.csv", "terminology_note": "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters."}, "data_type": null, "quote": null, "tags": []}, "procedure_date_1": {"name": "procedure_date_1", "description": "Date of the 1st procedure on the claim.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "procedure_date_2": {"name": "procedure_date_2", "description": "Date of the 2nd procedure on the claim.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "procedure_date_3": {"name": "procedure_date_3", "description": "Date of the 3rd procedure on the claim.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "procedure_date_4": {"name": "procedure_date_4", "description": "Date of the 4th procedure on the claim.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "procedure_date_5": {"name": "procedure_date_5", "description": "Date of the 5th procedure on the claim.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "procedure_date_6": {"name": "procedure_date_6", "description": "Date of the 6th procedure on the claim.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "procedure_date_7": {"name": "procedure_date_7", "description": "Date of the 7th procedure on the claim.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "procedure_date_8": {"name": "procedure_date_8", "description": "Date of the 8th procedure on the claim.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "procedure_date_9": {"name": "procedure_date_9", "description": "Date of the 9th procedure on the claim.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "procedure_date_10": {"name": "procedure_date_10", "description": "Date of the 10th procedure on the claim.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "procedure_date_11": {"name": "procedure_date_11", "description": "Date of the 11th procedure on the claim.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "procedure_date_12": {"name": "procedure_date_12", "description": "Date of the 12th procedure on the claim.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "procedure_date_13": {"name": "procedure_date_13", "description": "Date of the 13th procedure on the claim.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "procedure_date_14": {"name": "procedure_date_14", "description": "Date of the 14th procedure on the claim.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "procedure_date_15": {"name": "procedure_date_15", "description": "Date of the 15th procedure on the claim.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "procedure_date_16": {"name": "procedure_date_16", "description": "Date of the 16th procedure on the claim.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "procedure_date_17": {"name": "procedure_date_17", "description": "Date of the 17th procedure on the claim.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "procedure_date_18": {"name": "procedure_date_18", "description": "Date of the 18th procedure on the claim.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "procedure_date_19": {"name": "procedure_date_19", "description": "Date of the 19th procedure on the claim.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "procedure_date_20": {"name": "procedure_date_20", "description": "Date of the 20th procedure on the claim.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "procedure_date_21": {"name": "procedure_date_21", "description": "Date of the 21st procedure on the claim.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "procedure_date_22": {"name": "procedure_date_22", "description": "Date of the 22nd procedure on the claim.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "procedure_date_23": {"name": "procedure_date_23", "description": "Date of the 23rd procedure on the claim.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "procedure_date_24": {"name": "procedure_date_24", "description": "Date of the 24th procedure on the claim.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "procedure_date_25": {"name": "procedure_date_25", "description": "Date of the 25th procedure on the claim.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "data_source": {"name": "data_source", "description": "User-configured field that indicates the data source (e.g. typically named after the payer and state \"BCBS Tennessee\").\n", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "input_layer://models\\_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"bind": false, "database": "tuva", "schema": "input_layer"}, "created_at": 1702510320.2701747, "relation_name": "tuva.input_layer.medical_claim", "raw_code": "select\r\n claim_id\r\n , claim_line_number\r\n , claim_type\r\n , patient_id\r\n , member_id\r\n , payer\r\n , plan\r\n , claim_start_date\r\n , claim_end_date\r\n , claim_line_start_date\r\n , claim_line_end_date\r\n , admission_date\r\n , discharge_date\r\n , admit_source_code\r\n , admit_type_code\r\n , discharge_disposition_code\r\n , place_of_service_code\r\n , bill_type_code\r\n , ms_drg_code\r\n , apr_drg_code\r\n , revenue_center_code\r\n , service_unit_quantity\r\n , hcpcs_code\r\n , hcpcs_modifier_1\r\n , hcpcs_modifier_2\r\n , hcpcs_modifier_3\r\n , hcpcs_modifier_4\r\n , hcpcs_modifier_5\r\n , rendering_npi\r\n , billing_npi\r\n , facility_npi\r\n , paid_date\r\n , paid_amount\r\n , allowed_amount\r\n , charge_amount\r\n , coinsurance_amount\r\n , copayment_amount\r\n , deductible_amount\r\n , total_cost_amount\r\n , diagnosis_code_type\r\n , diagnosis_code_1\r\n , diagnosis_code_2\r\n , diagnosis_code_3\r\n , diagnosis_code_4\r\n , diagnosis_code_5\r\n , diagnosis_code_6\r\n , diagnosis_code_7\r\n , diagnosis_code_8\r\n , diagnosis_code_9\r\n , diagnosis_code_10\r\n , diagnosis_code_11\r\n , diagnosis_code_12\r\n , diagnosis_code_13\r\n , diagnosis_code_14\r\n , diagnosis_code_15\r\n , diagnosis_code_16\r\n , diagnosis_code_17\r\n , diagnosis_code_18\r\n , diagnosis_code_19\r\n , diagnosis_code_20\r\n , diagnosis_code_21\r\n , diagnosis_code_22\r\n , diagnosis_code_23\r\n , diagnosis_code_24\r\n , diagnosis_code_25\r\n , diagnosis_poa_1\r\n , diagnosis_poa_2\r\n , diagnosis_poa_3\r\n , diagnosis_poa_4\r\n , diagnosis_poa_5\r\n , diagnosis_poa_6\r\n , diagnosis_poa_7\r\n , diagnosis_poa_8\r\n , diagnosis_poa_9\r\n , diagnosis_poa_10\r\n , diagnosis_poa_11\r\n , diagnosis_poa_12\r\n , diagnosis_poa_13\r\n , diagnosis_poa_14\r\n , diagnosis_poa_15\r\n , diagnosis_poa_16\r\n , diagnosis_poa_17\r\n , diagnosis_poa_18\r\n , diagnosis_poa_19\r\n , diagnosis_poa_20\r\n , diagnosis_poa_21\r\n , diagnosis_poa_22\r\n , diagnosis_poa_23\r\n , diagnosis_poa_24\r\n , diagnosis_poa_25\r\n , procedure_code_type\r\n , procedure_code_1\r\n , procedure_code_2\r\n , procedure_code_3\r\n , procedure_code_4\r\n , procedure_code_5\r\n , procedure_code_6\r\n , procedure_code_7\r\n , procedure_code_8\r\n , procedure_code_9\r\n , procedure_code_10\r\n , procedure_code_11\r\n , procedure_code_12\r\n , procedure_code_13\r\n , procedure_code_14\r\n , procedure_code_15\r\n , procedure_code_16\r\n , procedure_code_17\r\n , procedure_code_18\r\n , procedure_code_19\r\n , procedure_code_20\r\n , procedure_code_21\r\n , procedure_code_22\r\n , procedure_code_23\r\n , procedure_code_24\r\n , procedure_code_25\r\n , procedure_date_1\r\n , procedure_date_2\r\n , procedure_date_3\r\n , procedure_date_4\r\n , procedure_date_5\r\n , procedure_date_6\r\n , procedure_date_7\r\n , procedure_date_8\r\n , procedure_date_9\r\n , procedure_date_10\r\n , procedure_date_11\r\n , procedure_date_12\r\n , procedure_date_13\r\n , procedure_date_14\r\n , procedure_date_15\r\n , procedure_date_16\r\n , procedure_date_17\r\n , procedure_date_18\r\n , procedure_date_19\r\n , procedure_date_20\r\n , procedure_date_21\r\n , procedure_date_22\r\n , procedure_date_23\r\n , procedure_date_24\r\n , procedure_date_25\r\n , data_source\r\nfrom {{ ref('medical_claim_seed') }}", "language": "sql", "refs": [["medical_claim_seed"]], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["seed.input_layer.medical_claim_seed"]}, "compiled_path": "../target\\compiled\\input_layer\\models\\medical_claim.sql", "compiled": true, "compiled_code": "select\n claim_id\n , claim_line_number\n , claim_type\n , patient_id\n , member_id\n , payer\n , plan\n , claim_start_date\n , claim_end_date\n , claim_line_start_date\n , claim_line_end_date\n , admission_date\n , discharge_date\n , admit_source_code\n , admit_type_code\n , discharge_disposition_code\n , place_of_service_code\n , bill_type_code\n , ms_drg_code\n , apr_drg_code\n , revenue_center_code\n , service_unit_quantity\n , hcpcs_code\n , hcpcs_modifier_1\n , hcpcs_modifier_2\n , hcpcs_modifier_3\n , hcpcs_modifier_4\n , hcpcs_modifier_5\n , rendering_npi\n , billing_npi\n , facility_npi\n , paid_date\n , paid_amount\n , allowed_amount\n , charge_amount\n , coinsurance_amount\n , copayment_amount\n , deductible_amount\n , total_cost_amount\n , diagnosis_code_type\n , diagnosis_code_1\n , diagnosis_code_2\n , diagnosis_code_3\n , diagnosis_code_4\n , diagnosis_code_5\n , diagnosis_code_6\n , diagnosis_code_7\n , diagnosis_code_8\n , diagnosis_code_9\n , diagnosis_code_10\n , diagnosis_code_11\n , diagnosis_code_12\n , diagnosis_code_13\n , diagnosis_code_14\n , diagnosis_code_15\n , diagnosis_code_16\n , diagnosis_code_17\n , diagnosis_code_18\n , diagnosis_code_19\n , diagnosis_code_20\n , diagnosis_code_21\n , diagnosis_code_22\n , diagnosis_code_23\n , diagnosis_code_24\n , diagnosis_code_25\n , diagnosis_poa_1\n , diagnosis_poa_2\n , diagnosis_poa_3\n , diagnosis_poa_4\n , diagnosis_poa_5\n , diagnosis_poa_6\n , diagnosis_poa_7\n , diagnosis_poa_8\n , diagnosis_poa_9\n , diagnosis_poa_10\n , diagnosis_poa_11\n , diagnosis_poa_12\n , diagnosis_poa_13\n , diagnosis_poa_14\n , diagnosis_poa_15\n , diagnosis_poa_16\n , diagnosis_poa_17\n , diagnosis_poa_18\n , diagnosis_poa_19\n , diagnosis_poa_20\n , diagnosis_poa_21\n , diagnosis_poa_22\n , diagnosis_poa_23\n , diagnosis_poa_24\n , diagnosis_poa_25\n , procedure_code_type\n , procedure_code_1\n , procedure_code_2\n , procedure_code_3\n , procedure_code_4\n , procedure_code_5\n , procedure_code_6\n , procedure_code_7\n , procedure_code_8\n , procedure_code_9\n , procedure_code_10\n , procedure_code_11\n , procedure_code_12\n , procedure_code_13\n , procedure_code_14\n , procedure_code_15\n , procedure_code_16\n , procedure_code_17\n , procedure_code_18\n , procedure_code_19\n , procedure_code_20\n , procedure_code_21\n , procedure_code_22\n , procedure_code_23\n , procedure_code_24\n , procedure_code_25\n , procedure_date_1\n , procedure_date_2\n , procedure_date_3\n , procedure_date_4\n , procedure_date_5\n , procedure_date_6\n , procedure_date_7\n , procedure_date_8\n , procedure_date_9\n , procedure_date_10\n , procedure_date_11\n , procedure_date_12\n , procedure_date_13\n , procedure_date_14\n , procedure_date_15\n , procedure_date_16\n , procedure_date_17\n , procedure_date_18\n , procedure_date_19\n , procedure_date_20\n , procedure_date_21\n , procedure_date_22\n , procedure_date_23\n , procedure_date_24\n , procedure_date_25\n , data_source\nfrom devforrest._tuva_synthetic.medical_claim_seed", "extra_ctes_injected": true, "extra_ctes": []}, "model.input_layer.lab_result": {"database": "tuva", "schema": "input_layer", "name": "lab_result", "resource_type": "model", "package_name": "input_layer", "path": "lab_result.sql", "original_file_path": "models\\lab_result.sql", "unique_id": "model.input_layer.lab_result", "fqn": ["input_layer", "lab_result"], "alias": "lab_result", "checksum": {"name": "sha256", "checksum": "46aef97252e6408feeb23ae4e452e12dbf5f1e5ce40259c7ac62d5ca99694e62"}, "config": {"enabled": true, "alias": null, "schema": "input_layer", "database": "tuva", "tags": [], "meta": {}, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "bind": false, "post-hook": [], "pre-hook": []}, "tags": [], "description": "The lab result table contains information about lab test results, including the LOINC code and description, units, reference range, and result.\n", "columns": {"lab_result_id": {"name": "lab_result_id", "description": "Unique identifier for the lab test.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "patient_id": {"name": "patient_id", "description": "Unique identifier for each patient.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "encounter_id": {"name": "encounter_id", "description": "Unique identifier for each encounter. Included in this table if the lab test can be linked to an encounter.\n", "meta": {}, "data_type": null, "quote": null, "tags": []}, "accession_number": {"name": "accession_number", "description": "The lab order number from the source system.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "source_code_type": {"name": "source_code_type", "description": "The code type from the source system.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__code_type.csv"}, "data_type": null, "quote": null, "tags": []}, "source_code": {"name": "source_code", "description": "The code for the lab from the source system.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__loinc.csv", "terminology_note": "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters."}, "data_type": null, "quote": null, "tags": []}, "source_description": {"name": "source_description", "description": "The description for the lab test from the source system.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "source_component": {"name": "source_component", "description": "The description for the component of the test from the source system.\n", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__loinc.csv", "terminology_note": "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters."}, "data_type": null, "quote": null, "tags": []}, "normalized_code_type": {"name": "normalized_code_type", "description": "The normalized code type.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__code_type.csv"}, "data_type": null, "quote": null, "tags": []}, "normalized_code": {"name": "normalized_code", "description": "The normalized code e.g. LOINC.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__loinc.csv", "terminology_note": "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters."}, "data_type": null, "quote": null, "tags": []}, "normalized_description": {"name": "normalized_description", "description": "The normalized description for the code.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "normalized_component": {"name": "normalized_component", "description": "The normalized component.", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__loinc.csv", "terminology_note": "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters."}, "data_type": null, "quote": null, "tags": []}, "status": {"name": "status", "description": "The status of the lab test.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "result": {"name": "result", "description": "The result of the lab test.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "result_date": {"name": "result_date", "description": "Date of the test result.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "collection_date": {"name": "collection_date", "description": "Date the test was collected.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "source_units": {"name": "source_units", "description": "Source units of the lab test.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "normalized_units": {"name": "normalized_units", "description": "Normalized units of the lab test.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "source_reference_range_low": {"name": "source_reference_range_low", "description": "The low end of the reference range from the source system.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "source_reference_range_high": {"name": "source_reference_range_high", "description": "The high end of the reference range from the source system.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "normalized_reference_range_low": {"name": "normalized_reference_range_low", "description": "The normalized low end of the reference range.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "normalized_reference_range_high": {"name": "normalized_reference_range_high", "description": "The normalized high end of the reference range.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "source_abnormal_flag": {"name": "source_abnormal_flag", "description": "Indicates whether the result is abnormal or normal.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "normalized_abnormal_flag": {"name": "normalized_abnormal_flag", "description": "Normalized abnormal flag.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "specimen": {"name": "specimen", "description": "The type of specimen e.g. blood, plasma, urine.", "meta": {}, "data_type": null, "quote": null, "tags": []}, "ordering_practitioner_id": {"name": "ordering_practitioner_id", "description": "Unique identifier for the practitioner who ordered the lab test.\n", "meta": {"terminology": "https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__provider.csv", "terminology_note": "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters."}, "data_type": null, "quote": null, "tags": []}, "data_source": {"name": "data_source", "description": "Custom description of the source system e.g. Epic.", "meta": {}, "data_type": null, "quote": null, "tags": []}}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "input_layer://models\\_models.yml", "build_path": null, "deferred": false, "unrendered_config": {"bind": false, "database": "tuva", "schema": "input_layer"}, "created_at": 1702510320.2701747, "relation_name": "tuva.input_layer.lab_result", "raw_code": "select\r\n cast(null as {{ dbt.type_string() }} ) as lab_result_id\r\n , cast(null as {{ dbt.type_string() }} ) as patient_id\r\n , cast(null as {{ dbt.type_string() }} ) as encounter_id\r\n , cast(null as {{ dbt.type_string() }} ) as accession_number\r\n , cast(null as {{ dbt.type_string() }} ) as source_code_type\r\n , cast(null as {{ dbt.type_string() }} ) as source_code\r\n , cast(null as {{ dbt.type_string() }} ) as source_description\r\n , cast(null as {{ dbt.type_string() }} ) as source_component\r\n , cast(null as {{ dbt.type_string() }} ) as normalized_code_type\r\n , cast(null as {{ dbt.type_string() }} ) as normalized_code\r\n , cast(null as {{ dbt.type_string() }} ) as normalized_description\r\n , cast(null as {{ dbt.type_string() }} ) as normalized_component\r\n , cast(null as {{ dbt.type_string() }} ) as status\r\n , cast(null as {{ dbt.type_string() }} ) as result\r\n , cast(null as date) as result_date\r\n , cast(null as date) as collection_date\r\n , cast(null as {{ dbt.type_string() }} ) as source_units\r\n , cast(null as {{ dbt.type_string() }} ) as normalized_units\r\n , cast(null as {{ dbt.type_string() }} ) as source_reference_range_low\r\n , cast(null as {{ dbt.type_string() }} ) as source_reference_range_high\r\n , cast(null as {{ dbt.type_string() }} ) as normalized_reference_range_low\r\n , cast(null as {{ dbt.type_string() }} ) as normalized_reference_range_high\r\n , cast(null as {{ dbt.type_int() }} ) as source_abnormal_flag\r\n , cast(null as {{ dbt.type_int() }} ) as normalized_abnormal_flag\r\n , cast(null as {{ dbt.type_string() }} ) as specimen\r\n , cast(null as {{ dbt.type_string() }} ) as ordering_practitioner_id\r\n , cast(null as {{ dbt.type_string() }} ) as data_source\r\nlimit 0", "language": "sql", "refs": [], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.type_string", "macro.dbt.type_int"], "nodes": []}, "compiled_path": "../target\\compiled\\input_layer\\models\\lab_result.sql", "compiled": true, "compiled_code": "select\n cast(null as TEXT ) as lab_result_id\n , cast(null as TEXT ) as patient_id\n , cast(null as TEXT ) as encounter_id\n , cast(null as TEXT ) as accession_number\n , cast(null as TEXT ) as source_code_type\n , cast(null as TEXT ) as source_code\n , cast(null as TEXT ) as source_description\n , cast(null as TEXT ) as source_component\n , cast(null as TEXT ) as normalized_code_type\n , cast(null as TEXT ) as normalized_code\n , cast(null as TEXT ) as normalized_description\n , cast(null as TEXT ) as normalized_component\n , cast(null as TEXT ) as status\n , cast(null as TEXT ) as result\n , cast(null as date) as result_date\n , cast(null as date) as collection_date\n , cast(null as TEXT ) as source_units\n , cast(null as TEXT ) as normalized_units\n , cast(null as TEXT ) as source_reference_range_low\n , cast(null as TEXT ) as source_reference_range_high\n , cast(null as TEXT ) as normalized_reference_range_low\n , cast(null as TEXT ) as normalized_reference_range_high\n , cast(null as INT ) as source_abnormal_flag\n , cast(null as INT ) as normalized_abnormal_flag\n , cast(null as TEXT ) as specimen\n , cast(null as TEXT ) as ordering_practitioner_id\n , cast(null as TEXT ) as data_source\nlimit 0", "extra_ctes_injected": true, "extra_ctes": []}}, "sources": {}, "macros": {"macro.input_layer.default__generate_schema_name": {"name": "default__generate_schema_name", "resource_type": "macro", "package_name": "input_layer", "path": "../macros\\generate_schema_name.sql", "original_file_path": "../macros\\generate_schema_name.sql", "unique_id": "macro.input_layer.default__generate_schema_name", "macro_sql": "{% macro default__generate_schema_name(custom_schema_name, node) -%}\r\n {%- set default_schema = target.schema -%}\r\n {%- if custom_schema_name is not none -%}\r\n {{ custom_schema_name | trim }}\r\n {%- else -%}\r\n {{ default_schema }}\r\n {%- endif -%}\r\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1702481693.040536, "supported_languages": null}, "macro.input_layer.try_to_cast_date": {"name": "try_to_cast_date", "resource_type": "macro", "package_name": "input_layer", "path": "../macros\\try_to_cast_date.sql", "original_file_path": "../macros\\try_to_cast_date.sql", "unique_id": "macro.input_layer.try_to_cast_date", "macro_sql": "\r\n\r\n{%- macro try_to_cast_date(column_name, date_format='YYYY-MM-DD') -%}\r\n\r\n {{ return(adapter.dispatch('try_to_cast_date')(column_name, date_format)) }}\r\n\r\n{%- endmacro -%}\r\n\r\n", "depends_on": {"macros": ["macro.input_layer.snowflake__try_to_cast_date"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1702481693.0441973, "supported_languages": null}, "macro.input_layer.bigquery__try_to_cast_date": {"name": "bigquery__try_to_cast_date", "resource_type": "macro", "package_name": "input_layer", "path": "../macros\\try_to_cast_date.sql", "original_file_path": "../macros\\try_to_cast_date.sql", "unique_id": "macro.input_layer.bigquery__try_to_cast_date", "macro_sql": "{%- macro bigquery__try_to_cast_date(column_name, date_format) -%}\r\n\r\n {%- if date_format == 'YYYY-MM-DD HH:MI:SS' -%}\r\n safe_cast( date( {{ column_name }} ) as date )\r\n {%- else -%}\r\n safe_cast( {{ column_name }} as date )\r\n {%- endif -%}\r\n\r\n{%- endmacro -%}\r\n\r\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1702481693.0441973, "supported_languages": null}, "macro.input_layer.default__try_to_cast_date": {"name": "default__try_to_cast_date", "resource_type": "macro", "package_name": "input_layer", "path": "../macros\\try_to_cast_date.sql", "original_file_path": "../macros\\try_to_cast_date.sql", "unique_id": "macro.input_layer.default__try_to_cast_date", "macro_sql": "{%- macro default__try_to_cast_date(column_name, date_format) -%}\r\n\r\n try_cast( {{ column_name }} as date )\r\n\r\n{%- endmacro -%}\r\n\r\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1702481693.0441973, "supported_languages": null}, "macro.input_layer.postgres__try_to_cast_date": {"name": "postgres__try_to_cast_date", "resource_type": "macro", "package_name": "input_layer", "path": "../macros\\try_to_cast_date.sql", "original_file_path": "../macros\\try_to_cast_date.sql", "unique_id": "macro.input_layer.postgres__try_to_cast_date", "macro_sql": "{%- macro postgres__try_to_cast_date(column_name, date_format) -%}\r\n\r\n {%- if date_format == 'YYYY-MM-DD' -%}\r\n case\r\n when {{ column_name }} similar to '[0-9]{4}-[0-9]{2}-[0-9]{2}'\r\n then to_date( {{ column_name }}, 'YYYY-MM-DD')\r\n else date(NULL)\r\n end\r\n {%- elif date_format == 'YYYYMMDD' -%}\r\n case\r\n when {{ column_name }} similar to '[0-9]{4}[0-9]{2}[0-9]{2}'\r\n then to_date( {{ column_name }}, 'YYYYMMDD')\r\n else date(NULL)\r\n end\r\n {%- elif date_format == 'MM/DD/YYYY' -%}\r\n case\r\n when {{ column_name }} similar to '[0-9]{2}/[0-9]{2}/[0-9]{4}'\r\n then to_date( {{ column_name }}, 'MM/DD/YYYY')\r\n else date(NULL)\r\n end\r\n {%- elif date_format == 'YYYY-MM-DD HH:MI:SS' -%}\r\n case\r\n when {{ column_name }} similar to '[0-9]{4}-[0-9]{2}-[0-9]{2} [0-9]{2}:[0-9]{2}:[0-9]{2}'\r\n then to_date( {{ column_name }}, 'YYYY-MM-DD HH:MI:SS')\r\n else date(NULL)\r\n end\r\n {%- else -%}\r\n date(NULL)\r\n {%- endif -%}\r\n\r\n{%- endmacro -%}\r\n\r\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1702481693.0452034, "supported_languages": null}, "macro.input_layer.redshift__try_to_cast_date": {"name": "redshift__try_to_cast_date", "resource_type": "macro", "package_name": "input_layer", "path": "../macros\\try_to_cast_date.sql", "original_file_path": "../macros\\try_to_cast_date.sql", "unique_id": "macro.input_layer.redshift__try_to_cast_date", "macro_sql": "{%- macro redshift__try_to_cast_date(column_name, date_format) -%}\r\n\r\n {%- if date_format == 'YYYY-MM-DD' -%}\r\n case\r\n when {{ column_name }} similar to '\\\\d{4}-\\\\d{2}-\\\\d{2}'\r\n then to_date( {{ column_name }}, 'YYYY-MM-DD')\r\n else date(NULL)\r\n end\r\n {%- elif date_format == 'YYYYMMDD' -%}\r\n case\r\n when {{ column_name }} similar to '\\\\d{4}\\\\d{2}\\\\d{2}'\r\n then to_date( {{ column_name }}, 'YYYYMMDD')\r\n else date(NULL)\r\n end\r\n {%- elif date_format == 'MM/DD/YYYY' -%}\r\n case\r\n when {{ column_name }} similar to '\\\\d{2}/\\\\d{2}/\\\\d{4}'\r\n then to_date( {{ column_name }}, 'MM/DD/YYYY')\r\n else date(NULL)\r\n end\r\n {%- elif date_format == 'YYYY-MM-DD HH:MI:SS' -%}\r\n case\r\n when {{ column_name }} similar to '\\\\d{4}-\\\\d{2}-\\\\d{2} \\\\d{2}:\\\\d{2}:\\\\d{2}'\r\n then to_date( {{ column_name }}, 'YYYY-MM-DD HH:MI:SS')\r\n else date(NULL)\r\n end\r\n {%- else -%}\r\n date(NULL)\r\n {%- endif -%}\r\n\r\n{%- endmacro -%}\r\n\r\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1702481693.046202, "supported_languages": null}, "macro.input_layer.snowflake__try_to_cast_date": {"name": "snowflake__try_to_cast_date", "resource_type": "macro", "package_name": "input_layer", "path": "../macros\\try_to_cast_date.sql", "original_file_path": "../macros\\try_to_cast_date.sql", "unique_id": "macro.input_layer.snowflake__try_to_cast_date", "macro_sql": "{%- macro snowflake__try_to_cast_date(column_name, date_format) -%}\r\n\r\n try_cast( {{ column_name }} as date )\r\n\r\n{%- endmacro -%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1702481693.046202, "supported_languages": null}, "macro.dbt_snowflake.snowflake__create_table_as": {"name": "snowflake__create_table_as", "resource_type": "macro", "package_name": "dbt_snowflake", "path": "macros\\adapters.sql", "original_file_path": "macros\\adapters.sql", "unique_id": "macro.dbt_snowflake.snowflake__create_table_as", "macro_sql": "{% macro snowflake__create_table_as(temporary, relation, compiled_code, language='sql') -%}\n {%- if language == 'sql' -%}\n {%- set transient = config.get('transient', default=true) -%}\n {%- set cluster_by_keys = config.get('cluster_by', default=none) -%}\n {%- set enable_automatic_clustering = config.get('automatic_clustering', default=false) -%}\n {%- set copy_grants = config.get('copy_grants', default=false) -%}\n\n {%- if cluster_by_keys is not none and cluster_by_keys is string -%}\n {%- set cluster_by_keys = [cluster_by_keys] -%}\n {%- endif -%}\n {%- if cluster_by_keys is not none -%}\n {%- set cluster_by_string = cluster_by_keys|join(\", \")-%}\n {% else %}\n {%- set cluster_by_string = none -%}\n {%- endif -%}\n {%- set sql_header = config.get('sql_header', none) -%}\n\n {{ sql_header if sql_header is not none }}\n\n create or replace {% if temporary -%}\n temporary\n {%- elif transient -%}\n transient\n {%- endif %} table {{ relation }} {% if copy_grants and not temporary -%} copy grants {%- endif %} as\n (\n {%- if cluster_by_string is not none -%}\n select * from(\n {{ compiled_code }}\n ) order by ({{ cluster_by_string }})\n {%- else -%}\n {{ compiled_code }}\n {%- endif %}\n );\n {% if cluster_by_string is not none and not temporary -%}\n alter table {{relation}} cluster by ({{cluster_by_string}});\n {%- endif -%}\n {% if enable_automatic_clustering and cluster_by_string is not none and not temporary -%}\n alter table {{relation}} resume recluster;\n {%- endif -%}\n\n {%- elif language == 'python' -%}\n {{ py_write_table(compiled_code=compiled_code, target_relation=relation, temporary=temporary) }}\n {%- else -%}\n {% do exceptions.raise_compiler_error(\"snowflake__create_table_as macro didn't get supported language, it got %s\" % language) %}\n {%- endif -%}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_snowflake.py_write_table"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1702481693.0599093, "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": 1702481693.0599093, "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": 1702481693.0599093, "supported_languages": null}, "macro.dbt_snowflake.snowflake__create_view_as_with_temp_flag": {"name": "snowflake__create_view_as_with_temp_flag", "resource_type": "macro", "package_name": "dbt_snowflake", "path": "macros\\adapters.sql", "original_file_path": "macros\\adapters.sql", "unique_id": "macro.dbt_snowflake.snowflake__create_view_as_with_temp_flag", "macro_sql": "{% macro snowflake__create_view_as_with_temp_flag(relation, sql, is_temporary=False) -%}\n {%- set secure = config.get('secure', default=false) -%}\n {%- set copy_grants = config.get('copy_grants', default=false) -%}\n {%- set sql_header = config.get('sql_header', none) -%}\n\n {{ sql_header if sql_header is not none }}\n create or replace {% if secure -%}\n secure\n {%- endif %} {% if is_temporary -%}\n temporary\n {%- endif %} view {{ relation }}\n {% if config.persist_column_docs() -%}\n {% set model_columns = model.columns %}\n {% set query_columns = get_columns_in_query(sql) %}\n {{ get_persist_docs_column_list(model_columns, query_columns) }}\n\n {%- endif %}\n {% if copy_grants -%} copy grants {%- endif %} as (\n {{ sql }}\n );\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_columns_in_query", "macro.dbt_snowflake.get_persist_docs_column_list"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1702481693.0599093, "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": 1702481693.0599093, "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": 1702481693.0599093, "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": 1702481693.0599093, "supported_languages": null}, "macro.dbt_snowflake.snowflake__list_relations_without_caching": {"name": "snowflake__list_relations_without_caching", "resource_type": "macro", "package_name": "dbt_snowflake", "path": "macros\\adapters.sql", "original_file_path": "macros\\adapters.sql", "unique_id": "macro.dbt_snowflake.snowflake__list_relations_without_caching", "macro_sql": "{% macro snowflake__list_relations_without_caching(schema_relation) %}\n {%- set sql -%}\n show terse objects in {{ schema_relation }}\n {%- endset -%}\n\n {%- set result = run_query(sql) -%}\n {% set maximum = 10000 %}\n {% if (result | length) >= maximum %}\n {% set msg %}\n Too many schemas in schema {{ schema_relation }}! dbt can only get\n information about schemas with fewer than {{ maximum }} objects.\n {% endset %}\n {% do exceptions.raise_compiler_error(msg) %}\n {% endif %}\n {%- do return(result) -%}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1702481693.0599093, "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": 1702481693.0599093, "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": 1702481693.0599093, "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": 1702481693.0599093, "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": 1702481693.0599093, "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": 1702481693.0599093, "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": 1702481693.0599093, "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": 1702481693.0599093, "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": 1702481693.0599093, "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": 1702481693.0599093, "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": 1702481693.0599093, "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": 1702481693.0599093, "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": 1702481693.0599093, "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": 1702481693.0599093, "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": 1702481693.0599093, "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": 1702481693.0599093, "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": 1702481693.0599093, "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": 1702481693.0752635, "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": 1702481693.0792918, "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": 1702481693.0792918, "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": 1702481693.081257, "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": 1702481693.081257, "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": 1702481693.081257, "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": 1702481693.0842557, "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": 1702481693.0842557, "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": 1702481693.0842557, "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": 1702481693.0872555, "supported_languages": ["sql", "python"]}, "macro.dbt_snowflake.py_write_table": {"name": "py_write_table", "resource_type": "macro", "package_name": "dbt_snowflake", "path": "macros\\materializations\\table.sql", "original_file_path": "macros\\materializations\\table.sql", "unique_id": "macro.dbt_snowflake.py_write_table", "macro_sql": "{% macro py_write_table(compiled_code, target_relation, temporary=False) %}\n{{ compiled_code }}\ndef materialize(session, df, target_relation):\n # make sure pandas exists\n import importlib.util\n package_name = 'pandas'\n if importlib.util.find_spec(package_name):\n import pandas\n if isinstance(df, pandas.core.frame.DataFrame):\n # session.write_pandas does not have overwrite function\n df = session.createDataFrame(df)\n df.write.mode(\"overwrite\").save_as_table(\"{{ target_relation }}\", create_temp_table={{temporary}})\n\ndef main(session):\n dbt = dbtObj(session.table)\n df = model(dbt, session)\n materialize(session, df, dbt.this)\n return \"OK\"\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1702481693.0872555, "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": 1702481693.0872555, "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": 1702481693.088256, "supported_languages": ["sql"]}, "macro.dbt_snowflake.materialization_view_snowflake": {"name": "materialization_view_snowflake", "resource_type": "macro", "package_name": "dbt_snowflake", "path": "macros\\materializations\\view.sql", "original_file_path": "macros\\materializations\\view.sql", "unique_id": "macro.dbt_snowflake.materialization_view_snowflake", "macro_sql": "{% materialization view, adapter='snowflake' -%}\n\n {% set original_query_tag = set_query_tag() %}\n {% set to_return = create_or_replace_view() %}\n\n {% set target_relation = this.incorporate(type='view') %}\n\n {% do persist_docs(target_relation, model, for_columns=false) %}\n\n {% do return(to_return) %}\n\n {% do unset_query_tag(original_query_tag) %}\n\n{%- endmaterialization %}", "depends_on": {"macros": ["macro.dbt_snowflake.set_query_tag", "macro.dbt.create_or_replace_view", "macro.dbt.persist_docs", "macro.dbt_snowflake.unset_query_tag"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1702481693.08925, "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": 1702481693.08925, "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": 1702481693.08925, "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": 1702481693.08925, "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": 1702481693.090243, "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": 1702481693.090243, "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": 1702481693.090243, "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": 1702481693.090243, "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": 1702481693.090243, "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": 1702481693.0912685, "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": 1702481693.0914676, "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": 1702481693.092573, "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": 1702481693.092573, "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": 1702481693.093583, "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": 1702481693.093583, "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": 1702481693.093583, "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": 1702481693.093583, "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": 1702481693.093583, "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": 1702481693.0945888, "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": 1702481693.0945888, "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": 1702481693.0945888, "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": 1702481693.0945888, "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": 1702481693.0955966, "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": 1702481693.0965784, "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": 1702481693.0965784, "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": 1702481693.0965784, "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": 1702481693.0965784, "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": 1702481693.098582, "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": 1702481693.1005883, "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": 1702481693.1005883, "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": 1702481693.1005883, "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": 1702481693.1005883, "supported_languages": null}, "macro.dbt.default__get_columns_in_query": {"name": "default__get_columns_in_query", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\columns.sql", "original_file_path": "macros\\adapters\\columns.sql", "unique_id": "macro.dbt.default__get_columns_in_query", "macro_sql": "{% macro default__get_columns_in_query(select_sql) %}\n {% call statement('get_columns_in_query', fetch_result=True, auto_begin=False) -%}\n select * from (\n {{ select_sql }}\n ) as __dbt_sbq\n where false\n limit 0\n {% endcall %}\n\n {{ return(load_result('get_columns_in_query').table.columns | map(attribute='name') | list) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1702481693.1015894, "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": 1702481693.1015894, "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": 1702481693.1025834, "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": 1702481693.1025834, "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": 1702481693.103584, "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": 1702481693.1045873, "supported_languages": null}, "macro.dbt.default__collect_freshness": {"name": "default__collect_freshness", "resource_type": "macro", "package_name": "dbt", "path": "macros\\adapters\\freshness.sql", "original_file_path": "macros\\adapters\\freshness.sql", "unique_id": "macro.dbt.default__collect_freshness", "macro_sql": "{% macro default__collect_freshness(source, loaded_at_field, filter) %}\n {% call statement('collect_freshness', fetch_result=True, auto_begin=False) -%}\n select\n max({{ loaded_at_field }}) as max_loaded_at,\n {{ current_timestamp() }} as snapshotted_at\n from {{ source }}\n {% if filter %}\n where {{ filter }}\n {% endif %}\n {% endcall %}\n {{ return(load_result('collect_freshness').table) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement", "macro.dbt.current_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1702481693.1045873, "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": 1702481693.105581, "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": 1702481693.105581, "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": 1702481693.105581, "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": 1702481693.105581, "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": 1702481693.10732, "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": 1702481693.10732, "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": 1702481693.10732, "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": 1702481693.10732, "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": 1702481693.10732, "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": 1702481693.10732, "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": 1702481693.10732, "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": 1702481693.10732, "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": 1702481693.10732, "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": 1702481693.10732, "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": 1702481693.10732, "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": 1702481693.10732, "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": 1702481693.10732, "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": 1702481693.10732, "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": 1702481693.10732, "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": 1702481693.10732, "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": 1702481693.10732, "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": 1702481693.10732, "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": 1702481693.10732, "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": 1702481693.10732, "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": 1702481693.10732, "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": 1702481693.10732, "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": 1702481693.10732, "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": 1702481693.10732, "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": 1702481693.10732, "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": 1702481693.10732, "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": 1702481693.10732, "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": 1702481693.10732, "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": 1702481693.10732, "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": 1702481693.10732, "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": 1702481693.10732, "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": 1702481693.10732, "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": 1702481693.10732, "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": 1702481693.10732, "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": 1702481693.10732, "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": 1702481693.10732, "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": 1702481693.10732, "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": 1702481693.1224227, "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": 1702481693.1224227, "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": 1702481693.1224227, "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": 1702481693.1224227, "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": 1702481693.1224227, "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": 1702481693.1224227, "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": 1702481693.1224227, "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": 1702481693.1224227, "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": 1702481693.1224227, "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": 1702481693.1224227, "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": 1702481693.1224227, "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": 1702481693.1224227, "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": 1702481693.1224227, "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": 1702481693.1224227, "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": 1702481693.1224227, "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": 1702481693.1224227, "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": 1702481693.1224227, "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": 1702481693.1224227, "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": 1702481693.1224227, "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": 1702481693.1224227, "supported_languages": null}, "macro.dbt.default__generate_alias_name": {"name": "default__generate_alias_name", "resource_type": "macro", "package_name": "dbt", "path": "macros\\get_custom_name\\get_custom_alias.sql", "original_file_path": "macros\\get_custom_name\\get_custom_alias.sql", "unique_id": "macro.dbt.default__generate_alias_name", "macro_sql": "{% macro default__generate_alias_name(custom_alias_name=none, node=none) -%}\n\n {%- if custom_alias_name is none -%}\n\n {{ node.name }}\n\n {%- else -%}\n\n {{ custom_alias_name | trim }}\n\n {%- endif -%}\n\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1702481693.1224227, "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": 1702481693.1224227, "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": 1702481693.1224227, "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": 1702481693.1224227, "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": 1702481693.1224227, "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": 1702481693.1224227, "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": 1702481693.1224227, "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": 1702481693.1224227, "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": 1702481693.1224227, "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": 1702481693.1224227, "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": 1702481693.1383362, "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": 1702481693.1383362, "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": 1702481693.1383362, "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": 1702481693.1383362, "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": 1702481693.140442, "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": 1702481693.140442, "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": 1702481693.1414175, "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": 1702481693.142417, "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": 1702481693.142417, "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": 1702481693.1491053, "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": 1702481693.1491053, "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": 1702481693.1512976, "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": 1702481693.1512976, "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": 1702481693.1512976, "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": 1702481693.1512976, "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": 1702481693.1512976, "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": 1702481693.1512976, "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": 1702481693.1512976, "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": 1702481693.1512976, "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": 1702481693.1670032, "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": 1702481693.1670032, "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": 1702481693.1670032, "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": 1702481693.1670032, "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": 1702481693.1670032, "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": 1702481693.1670032, "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": 1702481693.1670032, "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": 1702481693.1670032, "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": 1702481693.1670032, "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": 1702481693.1670032, "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": 1702481693.1670032, "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": 1702481693.1670032, "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": 1702481693.1670032, "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": 1702481693.1670032, "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": 1702481693.1670032, "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": 1702481693.1670032, "supported_languages": null}, "macro.dbt.default__create_table_as": {"name": "default__create_table_as", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\models\\table\\create_table_as.sql", "original_file_path": "macros\\materializations\\models\\table\\create_table_as.sql", "unique_id": "macro.dbt.default__create_table_as", "macro_sql": "{% macro default__create_table_as(temporary, relation, sql) -%}\n {%- set sql_header = config.get('sql_header', none) -%}\n\n {{ sql_header if sql_header is not none }}\n\n create {% if temporary: -%}temporary{%- endif %} table\n {{ relation.include(database=(not temporary), schema=(not temporary)) }}\n as (\n {{ sql }}\n );\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1702481693.1670032, "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": 1702481693.1670032, "supported_languages": ["sql"]}, "macro.dbt.create_or_replace_view": {"name": "create_or_replace_view", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\models\\view\\create_or_replace_view.sql", "original_file_path": "macros\\materializations\\models\\view\\create_or_replace_view.sql", "unique_id": "macro.dbt.create_or_replace_view", "macro_sql": "{% macro create_or_replace_view() %}\n {%- set identifier = model['alias'] -%}\n\n {%- set old_relation = adapter.get_relation(database=database, schema=schema, identifier=identifier) -%}\n {%- set exists_as_view = (old_relation is not none and old_relation.is_view) -%}\n\n {%- set target_relation = api.Relation.create(\n identifier=identifier, schema=schema, database=database,\n type='view') -%}\n {% set grant_config = config.get('grants') %}\n\n {{ run_hooks(pre_hooks) }}\n\n -- If there's a table with the same name and we weren't told to full refresh,\n -- that's an error. If we were told to full refresh, drop it. This behavior differs\n -- for Snowflake and BigQuery, so multiple dispatch is used.\n {%- if old_relation is not none and old_relation.is_table -%}\n {{ handle_existing_table(should_full_refresh(), old_relation) }}\n {%- endif -%}\n\n -- build model\n {% call statement('main') -%}\n {{ get_create_view_as_sql(target_relation, sql) }}\n {%- endcall %}\n\n {% set should_revoke = should_revoke(exists_as_view, full_refresh_mode=True) %}\n {% do apply_grants(target_relation, grant_config, should_revoke=True) %}\n\n {{ run_hooks(post_hooks) }}\n\n {{ return({'relations': [target_relation]}) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.run_hooks", "macro.dbt.handle_existing_table", "macro.dbt.should_full_refresh", "macro.dbt.statement", "macro.dbt.get_create_view_as_sql", "macro.dbt.should_revoke", "macro.dbt.apply_grants"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1702481693.1670032, "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": 1702481693.182546, "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": 1702481693.182546, "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": 1702481693.182546, "supported_languages": null}, "macro.dbt.default__create_view_as": {"name": "default__create_view_as", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\models\\view\\create_view_as.sql", "original_file_path": "macros\\materializations\\models\\view\\create_view_as.sql", "unique_id": "macro.dbt.default__create_view_as", "macro_sql": "{% macro default__create_view_as(relation, sql) -%}\n {%- set sql_header = config.get('sql_header', none) -%}\n\n {{ sql_header if sql_header is not none }}\n create view {{ relation }} as (\n {{ sql }}\n );\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1702481693.182546, "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": 1702481693.182546, "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": 1702481693.182546, "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": 1702481693.182546, "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": 1702481693.182546, "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": 1702481693.182546, "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": 1702481693.182546, "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": 1702481693.182546, "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": 1702481693.182546, "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": 1702481693.182546, "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": 1702481693.182546, "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": 1702481693.182546, "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": 1702481693.182546, "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": 1702481693.182546, "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": 1702481693.182546, "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": 1702481693.182546, "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": 1702481693.1997354, "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": 1702481693.203734, "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": 1702481693.2077334, "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": 1702481693.2087352, "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": 1702481693.2087352, "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": 1702481693.2087352, "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": 1702481693.2087352, "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": 1702481693.2097347, "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": 1702481693.2097347, "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": 1702481693.2107348, "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": 1702481693.2117345, "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": 1702481693.2117345, "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": 1702481693.2127345, "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": 1702481693.2204316, "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": 1702481693.2214332, "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": 1702481693.222434, "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": 1702481693.226431, "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": 1702481693.226431, "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": 1702481693.2274323, "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": 1702481693.2284317, "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": 1702481693.2284317, "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": 1702481693.2284317, "supported_languages": null}, "macro.dbt.snapshot_check_all_get_existing_columns": {"name": "snapshot_check_all_get_existing_columns", "resource_type": "macro", "package_name": "dbt", "path": "macros\\materializations\\snapshots\\strategies.sql", "original_file_path": "macros\\materializations\\snapshots\\strategies.sql", "unique_id": "macro.dbt.snapshot_check_all_get_existing_columns", "macro_sql": "{% macro snapshot_check_all_get_existing_columns(node, target_exists, check_cols_config) -%}\n {%- if not target_exists -%}\n {#-- no table yet -> return whatever the query does --#}\n {{ return((false, query_columns)) }}\n {%- endif -%}\n\n {#-- handle any schema changes --#}\n {%- set target_relation = adapter.get_relation(database=node.database, schema=node.schema, identifier=node.alias) -%}\n\n {% if check_cols_config == 'all' %}\n {%- set query_columns = get_columns_in_query(node['compiled_code']) -%}\n\n {% elif check_cols_config is iterable and (check_cols_config | length) > 0 %}\n {#-- query for proper casing/quoting, to support comparison below --#}\n {%- set select_check_cols_from_target -%}\n select {{ check_cols_config | join(', ') }} from ({{ node['compiled_code'] }}) subq\n {%- endset -%}\n {% set query_columns = get_columns_in_query(select_check_cols_from_target) %}\n\n {% else %}\n {% do exceptions.raise_compiler_error(\"Invalid value for 'check_cols': \" ~ check_cols_config) %}\n {% endif %}\n\n {%- set existing_cols = adapter.get_columns_in_relation(target_relation) | map(attribute = 'name') | list -%}\n {%- set ns = namespace() -%} {#-- handle for-loop scoping with a namespace --#}\n {%- set ns.column_added = false -%}\n\n {%- set intersection = [] -%}\n {%- for col in query_columns -%}\n {%- if col in existing_cols -%}\n {%- do intersection.append(adapter.quote(col)) -%}\n {%- else -%}\n {% set ns.column_added = true %}\n {%- endif -%}\n {%- endfor -%}\n {{ return((ns.column_added, intersection)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.get_columns_in_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1702481693.231438, "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": 1702481693.2334385, "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": 1702481693.2344413, "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": 1702481693.2344413, "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": 1702481693.2375488, "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": 1702481693.2385316, "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": 1702481693.2385316, "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": 1702481693.2405293, "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": 1702481693.2405293, "supported_languages": null}, "macro.dbt.build_ref_function": {"name": "build_ref_function", "resource_type": "macro", "package_name": "dbt", "path": "macros\\python_model\\python.sql", "original_file_path": "macros\\python_model\\python.sql", "unique_id": "macro.dbt.build_ref_function", "macro_sql": "{% macro build_ref_function(model) %}\n\n {%- set ref_dict = {} -%}\n {%- for _ref in model.refs -%}\n {%- set resolved = ref(*_ref) -%}\n {%- do ref_dict.update({_ref | join('.'): resolve_model_name(resolved)}) -%}\n {%- endfor -%}\n\ndef ref(*args,dbt_load_df_function):\n refs = {{ ref_dict | tojson }}\n key = '.'.join(args)\n return dbt_load_df_function(refs[key])\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.resolve_model_name"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1702481693.2415247, "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": 1702481693.2415247, "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": 1702481693.2425487, "supported_languages": null}, "macro.dbt.py_script_postfix": {"name": "py_script_postfix", "resource_type": "macro", "package_name": "dbt", "path": "macros\\python_model\\python.sql", "original_file_path": "macros\\python_model\\python.sql", "unique_id": "macro.dbt.py_script_postfix", "macro_sql": "{% macro py_script_postfix(model) %}\n# This part is user provided model code\n# you will need to copy the next section to run the code\n# COMMAND ----------\n# this part is dbt logic for get ref work, do not modify\n\n{{ build_ref_function(model ) }}\n{{ build_source_function(model ) }}\n{{ build_config_dict(model) }}\n\nclass config:\n def __init__(self, *args, **kwargs):\n pass\n\n @staticmethod\n def get(key, default=None):\n return config_dict.get(key, default)\n\nclass this:\n \"\"\"dbt.this() or dbt.this.identifier\"\"\"\n database = \"{{ this.database }}\"\n schema = \"{{ this.schema }}\"\n identifier = \"{{ this.identifier }}\"\n {% set this_relation_name = resolve_model_name(this) %}\n def __repr__(self):\n return '{{ this_relation_name }}'\n\n\nclass dbtObj:\n def __init__(self, load_df_function) -> None:\n self.source = lambda *args: source(*args, dbt_load_df_function=load_df_function)\n self.ref = lambda *args: ref(*args, dbt_load_df_function=load_df_function)\n self.config = config\n self.this = this()\n self.is_incremental = {{ is_incremental() }}\n\n# COMMAND ----------\n{{py_script_comment()}}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.build_ref_function", "macro.dbt.build_source_function", "macro.dbt.build_config_dict", "macro.dbt.resolve_model_name", "macro.dbt.is_incremental", "macro.dbt.py_script_comment"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1702481693.2435334, "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": 1702481693.2435334, "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": 1702481693.2435334, "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": 1702481693.2445612, "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": 1702481693.2445612, "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": 1702481693.2451637, "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": 1702481693.2451637, "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": 1702481693.2451637, "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": 1702481693.2462807, "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": 1702481693.2462807, "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": 1702481693.247292, "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": 1702481693.247292, "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": 1702481693.247292, "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": 1702481693.247292, "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": 1702481693.2482617, "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": 1702481693.2482617, "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": 1702481693.2513936, "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": 1702481693.2513936, "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": 1702481693.2513936, "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": 1702481693.2513936, "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": 1702481693.252393, "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": 1702481693.252393, "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": 1702481693.252393, "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": 1702481693.252393, "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": 1702481693.2533927, "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": 1702481693.2533927, "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": 1702481693.2533927, "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": 1702481693.2533927, "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": 1702481693.2533927, "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": 1702481693.2533927, "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": 1702481693.2544968, "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": 1702481693.2544968, "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": 1702481693.255487, "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": 1702481693.255487, "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": 1702481693.255487, "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": 1702481693.255487, "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": 1702481693.2565203, "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": 1702481693.2565203, "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": 1702481693.2565203, "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": 1702481693.2565203, "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": 1702481693.2565203, "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": 1702481693.257482, "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": 1702481693.257482, "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": 1702481693.257482, "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": 1702481693.257482, "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": 1702481693.2584872, "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": 1702481693.2584872, "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": 1702481693.2584872, "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": 1702481693.2584872, "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": 1702481693.259489, "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": 1702481693.2605, "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": 1702481693.2605, "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": 1702481693.2605, "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": 1702481693.2605, "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": 1702481693.2614744, "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": 1702481693.2614744, "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": 1702481693.2614744, "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": 1702481693.2614744, "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": 1702481693.2624967, "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": 1702481693.2624967, "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": 1702481693.2624967, "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": 1702481693.2634838, "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": 1702481693.2634838, "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": 1702481693.2634838, "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": 1702481693.2644968, "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": 1702481693.2644968, "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": 1702481693.2644968, "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": 1702481693.2655065, "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": 1702481693.2655065, "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": 1702481693.2664847, "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": 1702481693.2675052, "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": 1702481693.2686217, "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": 1702481693.2686217, "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": 1702481693.2686217, "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": 1702481693.2686217, "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": 1702481693.2686217, "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": 1702481693.2686217, "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": 1702481693.2686217, "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": 1702481693.2686217, "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": 1702481693.2686217, "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": 1702481693.2686217, "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": 1702481693.2686217, "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": 1702481693.2686217, "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": 1702481693.2686217, "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": 1702481693.2686217, "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": 1702481693.2686217, "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": 1702481693.2686217, "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": 1702481693.2843482, "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": 1702481693.2843482, "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": 1702481693.2843482, "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": 1702481693.2843482, "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": 1702481693.2843482, "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": 1702481693.2843482, "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": 1702481693.2843482, "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": 1702481693.2843482, "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": 1702481693.2843482, "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": 1702481693.2843482, "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": 1702481693.2843482, "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": 1702481693.2843482, "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": 1702481693.2843482, "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": 1702481693.2843482, "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": 1702481693.2843482, "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": 1702481693.2843482, "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": 1702481693.2843482, "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": 1702481693.2843482, "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": 1702481693.2843482, "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": 1702481693.2843482, "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": 1702481693.299983, "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": 1702481693.299983, "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": 1702481693.299983, "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": 1702481693.299983, "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": 1702481693.299983, "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": 1702481693.299983, "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": 1702481693.299983, "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": 1702481693.299983, "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": 1702481693.299983, "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": 1702481693.299983, "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": 1702481693.299983, "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": 1702481693.299983, "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": 1702481693.299983, "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": 1702481693.299983, "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": 1702481693.299983, "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": 1702481693.299983, "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": 1702481693.299983, "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": 1702481693.299983, "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": 1702481693.299983, "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": 1702481693.299983, "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": 1702481693.299983, "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": 1702481693.299983, "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": 1702481693.299983, "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": 1702481693.299983, "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": 1702481693.299983, "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": 1702481693.3155892, "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": 1702481693.3155892, "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": 1702481693.3155892, "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": 1702481693.3155892, "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": 1702481693.3155892, "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": 1702481693.3155892, "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": 1702481693.3155892, "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": 1702481693.3155892, "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": 1702481693.3155892, "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": 1702481693.3155892, "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": 1702481693.3155892, "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": 1702481693.3155892, "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": 1702481693.3155892, "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": 1702481693.3155892, "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": 1702481693.3155892, "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": 1702481693.3155892, "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": 1702481693.3155892, "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": 1702481693.3155892, "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": 1702481693.3155892, "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": 1702481693.3155892, "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": 1702481693.3155892, "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": 1702481693.3155892, "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": 1702481693.3155892, "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": 1702481693.3155892, "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": 1702481693.3155892, "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": 1702481693.3155892, "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": 1702481693.3311975, "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": 1702481693.3311975, "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": 1702481693.3311975, "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": 1702481693.3311975, "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": 1702481693.3311975, "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": 1702481693.3311975, "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": 1702481693.3311975, "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": 1702481693.3311975, "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": 1702481693.3311975, "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": 1702481693.3311975, "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": 1702481693.3311975, "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": 1702481693.3311975, "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": 1702481693.3447928, "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": 1702481693.347814, "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": 1702481693.349905, "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": 1702481693.3509126, "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": 1702481693.351814, "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": 1702481693.351814, "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": 1702481693.351814, "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": 1702481693.3528564, "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": 1702481693.3528564, "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": 1702481693.3538973, "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": 1702481693.3538973, "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": 1702481693.3549173, "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": 1702481693.3549173, "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": 1702481693.3549173, "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": 1702481693.3549173, "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": 1702481693.3559086, "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": 1702481693.3559086, "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": 1702481693.3569076, "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": 1702481693.358908, "supported_languages": null}, "macro.the_tuva_project.duckdb__load_seed": {"name": "duckdb__load_seed", "resource_type": "macro", "package_name": "the_tuva_project", "path": "macros\\load_seed.sql", "original_file_path": "macros\\load_seed.sql", "unique_id": "macro.the_tuva_project.duckdb__load_seed", "macro_sql": "{% macro duckdb__load_seed(uri,pattern,compression,headers,null_marker) %}\r\n{%- set columns = adapter.get_columns_in_relation(this) -%}\r\n{%- set collist = [] -%}\r\n\r\n{% for col in columns %}\r\n {% do collist.append(\"'\" ~col.name~\"'\" ~ \": \" ~ \"'\"~col.dtype~\"'\") %}\r\n{% endfor %}\r\n\r\n{%- set cols = collist|join(',') -%}\r\n{# { log( cols,true) } #}\r\n\r\n{% set sql %}\r\n set s3_access_key_id='AKIA2EPVNTV4FLAEBFGE';\r\n set s3_secret_access_key='TARgblERrFP81Op+52KZW7HrP1Om6ObEDQAUVN2u';\r\n set s3_region='us-east-1';\r\n create or replace table {{this}} as\r\n select\r\n *\r\n from\r\n read_csv('s3://{{ uri }}/{{ pattern }}*',\r\n {% if null_marker == true %} nullstr = '\\N' {% else %} nullstr = '' {% endif %},\r\n header=true,\r\n columns= { {{ cols }} } )\r\n\r\n{% endset %}\r\n\r\n{% call statement('ducksql',fetch_result=true) %}\r\n{{ sql }}\r\n{% endcall %}\r\n\r\n{% if execute %}\r\n{# debugging { log(sql, True)} #}\r\n{% set results = load_result('ducksql') %}\r\n{{ log(\"Loaded data from external s3 resource\\n loaded to: \" ~ this ~ \"\\n from: s3://\" ~ uri ,True) }}\r\n{# debugging { log(results, True) } #}\r\n{% endif %}\r\n\r\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1702481693.3609056, "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": 1702481693.3619056, "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": 1702481693.3629053, "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": 1702481693.363893, "supported_languages": null}, "macro.the_tuva_project.databricks__load_seed": {"name": "databricks__load_seed", "resource_type": "macro", "package_name": "the_tuva_project", "path": "macros\\load_seed.sql", "original_file_path": "macros\\load_seed.sql", "unique_id": "macro.the_tuva_project.databricks__load_seed", "macro_sql": "{% macro databricks__load_seed(uri,pattern,compression,headers,null_marker) %}\r\n{% if execute %}\r\n\r\n{%- set s3_path = 's3://' ~ uri ~ '/' -%}\r\n{%- set columns = adapter.get_columns_in_relation(this) -%}\r\n{%- set collist = [] -%}\r\n\r\n{% for col in columns %}\r\n {% do collist.append(\"_c\" ~ loop.index0 ~ \"::\" ~ col.dtype ~ \" AS \" ~ col.name ) %}\r\n{% endfor %}\r\n\r\n{%- set cols = collist|join(',\\n ') -%}\r\n\r\n{% set sql %}\r\nCOPY INTO {{ this }}\r\nFROM (\r\n SELECT\r\n {{ cols }}\r\n\r\n FROM '{{ s3_path }}'\r\n {% if env_var('AWS_SESSION_TOKEN', False) %}\r\n WITH (\r\n CREDENTIAL (\r\n AWS_ACCESS_KEY = \"{{ env_var('AWS_ACCESS_KEY') }}\",\r\n AWS_SECRET_KEY = \"{{ env_var('AWS_SECRET_KEY') }}\",\r\n AWS_SESSION_TOKEN = \"{{ env_var('AWS_SESSION_TOKEN') }}\"\r\n )\r\n )\r\n {% endif %}\r\n)\r\nFILEFORMAT = CSV\r\nPATTERN = '{{ pattern }}*'\r\nFORMAT_OPTIONS (\r\n {% if headers == true %} 'skipRows' = '1', {% else %} 'skipRows' = '0', {% endif %}\r\n {% if null_marker == true %} 'nullValue' = '\\\\N', {% else %} {% endif %}\r\n 'enforceSchema' = 'true',\r\n 'inferSchema' = 'false',\r\n 'sep' = ','\r\n)\r\nCOPY_OPTIONS (\r\n 'mergeSchema' = 'false',\r\n 'force' = 'true'\r\n)\r\n{% endset %}\r\n\r\n{# check logs/dbt.log for output #}\r\n{{ log(cols, info=False) }}\r\n{{ log('Current model: ' ~ this ~ '\\n', info=False) }}\r\n{{ log('Full s3 path: ' ~ s3_path ~ '\\n', info=False) }}\r\n{{ log(sql, info=False) }}\r\n\r\n{% call statement('databrickssql',fetch_result=true) %}\r\n{{ sql }}\r\n{% endcall %}\r\n\r\n{% set results = load_result('databrickssql') %}\r\n{% set rows_affected = results['data'][0][0] %}\r\n\r\n{{ log(results, info=False) }}\r\n{{ log(rows_affected, info=False) }}\r\n\r\n{{ log(\"Loaded data from external s3 resource:\", True) }}\r\n{{ log(\" source: \\t\" ~ s3_path ~ pattern, True) }}\r\n{{ log(\" target: \\t\" ~ this | replace('`',''), True) }}\r\n{{ log(\" rows: \\t\\033[92m\" ~ rows_affected ~ \"\\033[0m\", True) }}\r\n\r\n{% endif %}\r\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1702481693.3671944, "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": 1702481693.3671944, "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": 1702481693.3671944, "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": 1702481693.368272, "supported_languages": null}, "macro.the_tuva_project.try_to_cast_date": {"name": "try_to_cast_date", "resource_type": "macro", "package_name": "the_tuva_project", "path": "macros\\try_to_cast_date.sql", "original_file_path": "macros\\try_to_cast_date.sql", "unique_id": "macro.the_tuva_project.try_to_cast_date", "macro_sql": "\r\n\r\n{%- macro try_to_cast_date(column_name, date_format='YYYY-MM-DD') -%}\r\n\r\n {{ return(adapter.dispatch('try_to_cast_date')(column_name, date_format)) }}\r\n\r\n{%- endmacro -%}\r\n\r\n", "depends_on": {"macros": ["macro.input_layer.snowflake__try_to_cast_date"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1702481693.3702788, "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": 1702481693.3702788, "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": 1702481693.3702788, "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": 1702481693.3712814, "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": 1702481693.3722806, "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": 1702481693.3722806, "supported_languages": null}}, "docs": {"doc.input_layer.__overview__": {"name": "__overview__", "resource_type": "doc", "package_name": "input_layer", "path": "overview.md", "original_file_path": "docs\\overview.md", "unique_id": "doc.input_layer.__overview__", "block_contents": "# \ud83e\uddf0\u00a0What is The Tuva Project?\r\n\r\nHealthcare data is difficult to analyze - we're working to change that. The Tuva Project is an open source knowledge base, code base, and community for healthcare data people.\r\n\r\n### \ud83d\udd6e\u00a0[Knowledge](https://thetuvaproject.com/)\r\nWe're writing the open book on how to transform and analyze healthcare data.\r\n\r\n### \ud83d\udda5\ufe0f\u00a0[Code](https://github.com/tuva-health)\r\nWe're translating knowledge into precise code that anyone can run on their healthcare data.\r\n\r\n### \ud83e\udd1d\u00a0[Community](https://join.slack.com/t/thetuvaproject/shared_invite/zt-16iz61187-G522Mc2WGA2mHF57e0il0Q)\r\nWe're building a community we're healthcare data people can ask questions and share knowledge about healthcare data."}, "doc.dbt.__overview__": {"name": "__overview__", "resource_type": "doc", "package_name": "dbt", "path": "overview.md", "original_file_path": "docs\\overview.md", "unique_id": "doc.dbt.__overview__", "block_contents": "### Welcome!\n\nWelcome to the auto-generated documentation for your dbt project!\n\n### Navigation\n\nYou can use the `Project` and `Database` navigation tabs on the left side of the window to explore the models\nin your project.\n\n#### Project Tab\nThe `Project` tab mirrors the directory structure of your dbt project. In this tab, you can see all of the\nmodels defined in your dbt project, as well as models imported from dbt packages.\n\n#### Database Tab\nThe `Database` tab also exposes your models, but in a format that looks more like a database explorer. This view\nshows relations (tables and views) grouped into database schemas. Note that ephemeral models are _not_ shown\nin this interface, as they do not exist in the database.\n\n### Graph Exploration\nYou can click the blue icon on the bottom-right corner of the page to view the lineage graph of your models.\n\nOn model pages, you'll see the immediate parents and children of the model you're exploring. By clicking the `Expand`\nbutton at the top-right of this lineage pane, you'll be able to see all of the models that are used to build,\nor are built from, the model you're exploring.\n\nOnce expanded, you'll be able to use the `--select` and `--exclude` model selection syntax to filter the\nmodels in the graph. For more information on model selection, check out the [dbt docs](https://docs.getdbt.com/docs/model-selection-syntax).\n\nNote that you can also right-click on models to interactively filter and explore the graph.\n\n---\n\n### More information\n\n- [What is dbt](https://docs.getdbt.com/docs/introduction)?\n- Read the [dbt viewpoint](https://docs.getdbt.com/docs/viewpoint)\n- [Installation](https://docs.getdbt.com/docs/installation)\n- Join the [dbt Community](https://www.getdbt.com/community/) for questions and discussion"}}, "exposures": {}, "metrics": {}, "selectors": {}, "disabled": {"snapshot.the_tuva_project.cms_hcc__patient_risk_factors_snapshot": [{"database": "devforrest", "schema": "cms_hcc", "name": "cms_hcc__patient_risk_factors_snapshot", "resource_type": "snapshot", "package_name": "the_tuva_project", "path": "cms_hcc\\cms_hcc__patient_risk_factors_snapshot.sql", "original_file_path": "snapshots\\cms_hcc\\cms_hcc__patient_risk_factors_snapshot.sql", "unique_id": "snapshot.the_tuva_project.cms_hcc__patient_risk_factors_snapshot", "fqn": ["the_tuva_project", "cms_hcc", "cms_hcc__patient_risk_factors_snapshot", "cms_hcc__patient_risk_factors_snapshot"], "alias": "patient_risk_factors_snapshot", "checksum": {"name": "sha256", "checksum": "93de4ccb7b0962ce79e9d1b54e8b3ce626ab0fc1757a0a8a7583c350fd5f1c3e"}, "config": {"enabled": false, "alias": "patient_risk_factors_snapshot", "schema": null, "database": null, "tags": ["cms_hcc"], "meta": {}, "materialized": "snapshot", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": "patient_id||model_version||payment_year||tuva_last_run", "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "strategy": "timestamp", "target_schema": "cms_hcc", "target_database": null, "updated_at": "tuva_last_run", "check_cols": null, "post-hook": [], "pre-hook": []}, "tags": ["cms_hcc"], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"target_schema": "cms_hcc", "alias": "patient_risk_factors_snapshot", "tags": ["cms_hcc"], "strategy": "timestamp", "updated_at": "tuva_last_run", "unique_key": "patient_id||model_version||payment_year||tuva_last_run", "enabled": false}, "created_at": 1702481695.713187, "config_call_dict": {"target_schema": "cms_hcc", "alias": "patient_risk_factors_snapshot", "tags": ["cms_hcc"], "strategy": "timestamp", "updated_at": "tuva_last_run", "unique_key": "patient_id||model_version||payment_year||tuva_last_run", "enabled": false}, "relation_name": "devforrest.cms_hcc.patient_risk_factors_snapshot", "raw_code": "\r\n\r\n{% set schema_var %}\r\n{%- if var('tuva_schema_prefix',None) != None -%}{{var('tuva_schema_prefix')}}_cms_hcc{% else %}cms_hcc{%- endif -%}\r\n{% endset %}\r\n\r\n{{\r\n config({\r\n \"target_schema\": schema_var\r\n , \"alias\": \"patient_risk_factors_snapshot\"\r\n , \"tags\": \"cms_hcc\"\r\n , \"strategy\": \"timestamp\"\r\n , \"updated_at\": \"tuva_last_run\"\r\n , \"unique_key\": \"patient_id||model_version||payment_year||tuva_last_run\"\r\n , \"enabled\": var('snapshots_enabled',False) == true and var('cms_hcc_enabled',var('claims_enabled',var('tuva_marts_enabled',False))) == true | as_bool\r\n })\r\n}}\r\n\r\nselect * from {{ ref('cms_hcc__patient_risk_factors') }}\r\n\r\n", "language": "sql", "refs": [["cms_hcc__patient_risk_factors"]], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": []}, "compiled_path": null}], "snapshot.the_tuva_project.cms_hcc__patient_risk_scores_snapshot": [{"database": "devforrest", "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": "f8a5946c2a0a2d3d2c2223046c98164f74f704a05bfb0e4de20f19158ec95d7a"}, "config": {"enabled": false, "alias": "patient_risk_scores_snapshot", "schema": null, "database": null, "tags": ["cms_hcc"], "meta": {}, "materialized": "snapshot", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": "patient_id||model_version||payment_year||tuva_last_run", "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "strategy": "timestamp", "target_schema": "cms_hcc", "target_database": null, "updated_at": "tuva_last_run", "check_cols": null, "post-hook": [], "pre-hook": []}, "tags": ["cms_hcc"], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"target_schema": "cms_hcc", "alias": "patient_risk_scores_snapshot", "tags": ["cms_hcc"], "strategy": "timestamp", "updated_at": "tuva_last_run", "unique_key": "patient_id||model_version||payment_year||tuva_last_run", "enabled": false}, "created_at": 1702481695.7305324, "config_call_dict": {"target_schema": "cms_hcc", "alias": "patient_risk_scores_snapshot", "tags": ["cms_hcc"], "strategy": "timestamp", "updated_at": "tuva_last_run", "unique_key": "patient_id||model_version||payment_year||tuva_last_run", "enabled": false}, "relation_name": "devforrest.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('snapshots_enabled',False) == true and var('cms_hcc_enabled',var('claims_enabled',var('tuva_marts_enabled',False))) == true | as_bool\r\n })\r\n}}\r\n\r\nselect * from {{ ref('cms_hcc__patient_risk_scores') }}\r\n\r\n", "language": "sql", "refs": [["cms_hcc__patient_risk_scores"]], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": []}, "compiled_path": null}], "snapshot.the_tuva_project.quality_measures__summary_counts_snapshot": [{"database": "devforrest", "schema": "quality_measures", "name": "quality_measures__summary_counts_snapshot", "resource_type": "snapshot", "package_name": "the_tuva_project", "path": "quality_measures\\quality_measures__summary_counts_snapshot.sql", "original_file_path": "snapshots\\quality_measures\\quality_measures__summary_counts_snapshot.sql", "unique_id": "snapshot.the_tuva_project.quality_measures__summary_counts_snapshot", "fqn": ["the_tuva_project", "quality_measures", "quality_measures__summary_counts_snapshot", "quality_measures__summary_counts_snapshot"], "alias": "summary_counts_snapshot", "checksum": {"name": "sha256", "checksum": "7d70c425e79217b6b2af25984cc5901a5a70e2cd1d16eee9e6f5af049c719978"}, "config": {"enabled": false, "alias": "summary_counts_snapshot", "schema": null, "database": null, "tags": ["quality_measures"], "meta": {}, "materialized": "snapshot", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": "measure_id||measure_name||measure_version||performance_period_begin||performance_period_end||tuva_last_run", "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "strategy": "timestamp", "target_schema": "quality_measures", "target_database": null, "updated_at": "tuva_last_run", "check_cols": null, "post-hook": [], "pre-hook": []}, "tags": ["quality_measures"], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"target_schema": "quality_measures", "alias": "summary_counts_snapshot", "tags": ["quality_measures"], "strategy": "timestamp", "updated_at": "tuva_last_run", "unique_key": "measure_id||measure_name||measure_version||performance_period_begin||performance_period_end||tuva_last_run", "enabled": false}, "created_at": 1702481695.7356474, "config_call_dict": {"target_schema": "quality_measures", "alias": "summary_counts_snapshot", "tags": ["quality_measures"], "strategy": "timestamp", "updated_at": "tuva_last_run", "unique_key": "measure_id||measure_name||measure_version||performance_period_begin||performance_period_end||tuva_last_run", "enabled": false}, "relation_name": "devforrest.quality_measures.summary_counts_snapshot", "raw_code": "\r\n\r\n{% set schema_var %}\r\n{%- if var('tuva_schema_prefix',None) != None -%}{{var('tuva_schema_prefix')}}_quality_measures{% else %}quality_measures{%- endif -%}\r\n{% endset %}\r\n\r\n{{\r\n config({\r\n \"target_schema\": schema_var\r\n , \"alias\": \"summary_counts_snapshot\"\r\n , \"tags\": \"quality_measures\"\r\n , \"strategy\": \"timestamp\"\r\n , \"updated_at\": \"tuva_last_run\"\r\n , \"unique_key\": \"measure_id||measure_name||measure_version||performance_period_begin||performance_period_end||tuva_last_run\"\r\n , \"enabled\": var('snapshots_enabled',False) == true and var('quality_measures_enabled',var('claims_enabled',var('clinical_enabled',var('tuva_marts_enabled',False)))) == true | as_bool\r\n })\r\n}}\r\n\r\nselect * from {{ ref('quality_measures__summary_counts') }}\r\n\r\n", "language": "sql", "refs": [["quality_measures__summary_counts"]], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": []}, "compiled_path": null}], "snapshot.the_tuva_project.quality_measures__summary_long_snapshot": [{"database": "devforrest", "schema": "quality_measures", "name": "quality_measures__summary_long_snapshot", "resource_type": "snapshot", "package_name": "the_tuva_project", "path": "quality_measures\\quality_measures__summary_long_snapshot.sql", "original_file_path": "snapshots\\quality_measures\\quality_measures__summary_long_snapshot.sql", "unique_id": "snapshot.the_tuva_project.quality_measures__summary_long_snapshot", "fqn": ["the_tuva_project", "quality_measures", "quality_measures__summary_long_snapshot", "quality_measures__summary_long_snapshot"], "alias": "summary_long_snapshot", "checksum": {"name": "sha256", "checksum": "4bfc791820a1666cb034b4056c07c14bbed4a0f1303be9230db39500626d9305"}, "config": {"enabled": false, "alias": "summary_long_snapshot", "schema": null, "database": null, "tags": ["quality_measures"], "meta": {}, "materialized": "snapshot", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": "patient_id||denominator_flag||numerator_flag||exclusion_flag||evidence_date||exclusion_date||exclusion_reason||performance_period_begin||performance_period_end||measure_id||measure_name||measure_version||tuva_last_run", "on_schema_change": "ignore", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "strategy": "timestamp", "target_schema": "quality_measures", "target_database": null, "updated_at": "tuva_last_run", "check_cols": null, "post-hook": [], "pre-hook": []}, "tags": ["quality_measures"], "description": "", "columns": {}, "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"target_schema": "quality_measures", "alias": "summary_long_snapshot", "tags": ["quality_measures"], "strategy": "timestamp", "updated_at": "tuva_last_run", "unique_key": "patient_id||denominator_flag||numerator_flag||exclusion_flag||evidence_date||exclusion_date||exclusion_reason||performance_period_begin||performance_period_end||measure_id||measure_name||measure_version||tuva_last_run", "enabled": false}, "created_at": 1702481695.7406454, "config_call_dict": {"target_schema": "quality_measures", "alias": "summary_long_snapshot", "tags": ["quality_measures"], "strategy": "timestamp", "updated_at": "tuva_last_run", "unique_key": "patient_id||denominator_flag||numerator_flag||exclusion_flag||evidence_date||exclusion_date||exclusion_reason||performance_period_begin||performance_period_end||measure_id||measure_name||measure_version||tuva_last_run", "enabled": false}, "relation_name": "devforrest.quality_measures.summary_long_snapshot", "raw_code": "\r\n\r\n{% set schema_var %}\r\n{%- if var('tuva_schema_prefix',None) != None -%}{{var('tuva_schema_prefix')}}_quality_measures{% else %}quality_measures{%- endif -%}\r\n{% endset %}\r\n\r\n{{\r\n config({\r\n \"target_schema\": schema_var\r\n , \"alias\": \"summary_long_snapshot\"\r\n , \"tags\": \"quality_measures\"\r\n , \"strategy\": \"timestamp\"\r\n , \"updated_at\": \"tuva_last_run\"\r\n , \"unique_key\": \"patient_id||denominator_flag||numerator_flag||exclusion_flag||evidence_date||exclusion_date||exclusion_reason||performance_period_begin||performance_period_end||measure_id||measure_name||measure_version||tuva_last_run\"\r\n , \"enabled\": var('snapshots_enabled',False) == true and var('quality_measures_enabled',var('claims_enabled',var('clinical_enabled',var('tuva_marts_enabled',False)))) == true | as_bool\r\n })\r\n}}\r\n\r\nselect * from {{ ref('quality_measures__summary_long') }}\r\n\r\n", "language": "sql", "refs": [["quality_measures__summary_long"]], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": []}, "compiled_path": null}]}, "parent_map": {"seed.input_layer.eligibility_seed": [], "seed.input_layer.medical_claim_seed": [], "seed.input_layer.pharmacy_claim_seed": [], "model.the_tuva_project.ccsr__singular_condition_category": ["model.the_tuva_project.ccsr__long_condition_category"], "model.the_tuva_project.ccsr__dx_vertical_pivot": ["seed.the_tuva_project.ccsr__dxccsr_v2023_1_cleaned_map"], "model.the_tuva_project.ccsr__procedure_category_map": ["seed.the_tuva_project.ccsr__prccsr_v2023_1_cleaned_map"], "model.the_tuva_project.ccsr__stg_core__condition": ["model.the_tuva_project.core__condition"], "model.the_tuva_project.ccsr__stg_core__procedure": ["model.the_tuva_project.core__procedure"], "model.the_tuva_project.chronic_conditions__cms_chronic_conditions_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_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.input_layer.medical_claim"], "model.the_tuva_project.cms_chronic_conditions__stg_pharmacy_claim": ["model.input_layer.pharmacy_claim"], "model.the_tuva_project.tuva_chronic_conditions__stg_core__condition": ["model.the_tuva_project.core__condition"], "model.the_tuva_project.tuva_chronic_conditions__stg_core__patient": ["model.the_tuva_project.core__patient"], "model.the_tuva_project.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.input_layer.medical_claim", "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__first_claim_values": ["model.input_layer.medical_claim", "model.the_tuva_project.acute_inpatient__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"], "model.the_tuva_project.acute_inpatient__institutional_encounter_id": ["model.the_tuva_project.acute_inpatient__institutional_claims"], "model.the_tuva_project.acute_inpatient__last_claim_values": ["model.input_layer.medical_claim", "model.the_tuva_project.acute_inpatient__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__stg_medical_claim", "model.the_tuva_project.acute_inpatient__stg_service_category"], "model.the_tuva_project.acute_inpatient__stg_eligibility": ["model.input_layer.eligibility"], "model.the_tuva_project.acute_inpatient__stg_medical_claim": ["model.input_layer.medical_claim"], "model.the_tuva_project.acute_inpatient__stg_service_category": ["model.the_tuva_project.service_category__service_category_grouper"], "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.input_layer.eligibility", "model.input_layer.medical_claim", "model.input_layer.medical_claim", "model.input_layer.medical_claim", "model.input_layer.medical_claim", "model.input_layer.medical_claim", "model.input_layer.pharmacy_claim", "model.input_layer.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.input_layer.medical_claim"], "model.the_tuva_project.data_profiling__claim_type_unmapped": ["model.input_layer.medical_claim"], "model.the_tuva_project.data_profiling__eligibility_denominators": ["model.input_layer.eligibility", "model.input_layer.eligibility", "model.input_layer.eligibility", "model.input_layer.eligibility", "model.input_layer.eligibility", "model.input_layer.eligibility", "model.input_layer.eligibility"], "model.the_tuva_project.data_profiling__eligibility_duplicates": ["model.input_layer.eligibility"], "model.the_tuva_project.data_profiling__eligibility_invalid_values": ["model.input_layer.eligibility", "model.input_layer.eligibility", "model.input_layer.eligibility", "model.input_layer.eligibility", "model.input_layer.eligibility", "model.input_layer.eligibility", "seed.the_tuva_project.terminology__gender", "seed.the_tuva_project.terminology__medicare_dual_eligibility", "seed.the_tuva_project.terminology__medicare_orec", "seed.the_tuva_project.terminology__medicare_status", "seed.the_tuva_project.terminology__payer_type", "seed.the_tuva_project.terminology__race"], "model.the_tuva_project.data_profiling__eligibility_missing_values": ["model.input_layer.eligibility"], "model.the_tuva_project.data_profiling__eligibility_plausibility": ["model.input_layer.eligibility", "model.input_layer.eligibility", "model.input_layer.eligibility", "model.input_layer.eligibility", "model.input_layer.eligibility"], "model.the_tuva_project.data_profiling__institutional_header_failures": ["model.input_layer.medical_claim", "model.input_layer.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.input_layer.medical_claim", "model.input_layer.medical_claim", "model.input_layer.medical_claim", "model.input_layer.medical_claim", "model.input_layer.medical_claim", "model.input_layer.medical_claim", "model.input_layer.medical_claim", "model.input_layer.medical_claim", "model.input_layer.medical_claim", "model.input_layer.medical_claim", "model.input_layer.medical_claim", "model.input_layer.medical_claim", "model.input_layer.medical_claim", "model.input_layer.medical_claim", "model.input_layer.medical_claim"], "model.the_tuva_project.data_profiling__medical_claim_duplicates": ["model.input_layer.medical_claim"], "model.the_tuva_project.data_profiling__medical_claim_inst_missing_values": ["model.input_layer.medical_claim"], "model.the_tuva_project.data_profiling__medical_claim_invalid_values": ["model.input_layer.medical_claim", "model.input_layer.medical_claim", "model.input_layer.medical_claim", "model.input_layer.medical_claim", "model.input_layer.medical_claim", "model.input_layer.medical_claim", "model.input_layer.medical_claim", "model.input_layer.medical_claim", "model.input_layer.medical_claim", "model.input_layer.medical_claim", "model.input_layer.medical_claim", "model.input_layer.medical_claim", "model.input_layer.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.input_layer.medical_claim", "model.input_layer.medical_claim"], "model.the_tuva_project.data_profiling__medical_claim_prof_missing_values": ["model.input_layer.medical_claim"], "model.the_tuva_project.data_profiling__pharmacy_claim_duplicates": ["model.input_layer.pharmacy_claim"], "model.the_tuva_project.data_profiling__pharmacy_claim_missing_values": ["model.input_layer.pharmacy_claim"], "model.the_tuva_project.data_profiling__professional_header_failures": ["model.input_layer.medical_claim", "model.input_layer.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.input_layer.pharmacy_claim", "model.the_tuva_project.data_profiling__test_detail"], "model.the_tuva_project.emergency_department__summary": ["model.input_layer.eligibility", "model.input_layer.medical_claim", "model.input_layer.medical_claim", "model.the_tuva_project.emergency_department__int_encounter_id", "model.the_tuva_project.emergency_department__int_encounter_id", "model.the_tuva_project.emergency_department__int_encounter_id", "model.the_tuva_project.emergency_department__int_encounter_start_and_end_dates", "model.the_tuva_project.emergency_department__int_first_claim_values", "model.the_tuva_project.emergency_department__int_institutional_encounter_id", "model.the_tuva_project.emergency_department__int_last_claim_values", "seed.the_tuva_project.terminology__admit_source", "seed.the_tuva_project.terminology__admit_type", "seed.the_tuva_project.terminology__apr_drg", "seed.the_tuva_project.terminology__discharge_disposition", "seed.the_tuva_project.terminology__icd_10_cm", "seed.the_tuva_project.terminology__icd_9_cm", "seed.the_tuva_project.terminology__ms_drg", "seed.the_tuva_project.terminology__provider"], "model.the_tuva_project.emergency_department__int_encounter_id": ["model.input_layer.medical_claim", "model.the_tuva_project.emergency_department__int_institutional_encounter_id", "model.the_tuva_project.emergency_department__int_professional_encounter_id"], "model.the_tuva_project.emergency_department__int_encounter_start_and_end_dates": ["model.the_tuva_project.emergency_department__int_institutional_claims", "model.the_tuva_project.emergency_department__int_institutional_encounter_id"], "model.the_tuva_project.emergency_department__int_first_claim_values": ["model.input_layer.medical_claim", "model.the_tuva_project.emergency_department__int_encounter_id"], "model.the_tuva_project.emergency_department__int_institutional_claims": ["model.input_layer.medical_claim", "model.the_tuva_project.service_category__service_category_grouper"], "model.the_tuva_project.emergency_department__int_institutional_encounter_id": ["model.the_tuva_project.emergency_department__int_institutional_claims"], "model.the_tuva_project.emergency_department__int_last_claim_values": ["model.input_layer.medical_claim", "model.the_tuva_project.emergency_department__int_encounter_id"], "model.the_tuva_project.emergency_department__int_professional_encounter_id": ["model.input_layer.medical_claim", "model.the_tuva_project.emergency_department__int_encounter_start_and_end_dates", "model.the_tuva_project.service_category__service_category_grouper"], "model.the_tuva_project.service_category__dq_input_layer_results": ["model.the_tuva_project.service_category__dq_input_layer_tests"], "model.the_tuva_project.service_category__dq_input_layer_tests": ["model.the_tuva_project.service_category__stg_medical_claim", "model.the_tuva_project.service_category__stg_medical_claim", "model.the_tuva_project.service_category__stg_medical_claim", "model.the_tuva_project.service_category__stg_medical_claim", "model.the_tuva_project.service_category__stg_medical_claim", "model.the_tuva_project.service_category__stg_medical_claim", "model.the_tuva_project.service_category__stg_medical_claim", "model.the_tuva_project.service_category__stg_medical_claim", "model.the_tuva_project.service_category__stg_medical_claim", "model.the_tuva_project.service_category__stg_medical_claim", "model.the_tuva_project.service_category__stg_medical_claim", "model.the_tuva_project.service_category__stg_medical_claim", "model.the_tuva_project.service_category__stg_medical_claim", "model.the_tuva_project.service_category__stg_medical_claim", "seed.the_tuva_project.terminology__apr_drg", "seed.the_tuva_project.terminology__bill_type", "seed.the_tuva_project.terminology__claim_type", "seed.the_tuva_project.terminology__hcpcs_level_2", "seed.the_tuva_project.terminology__ms_drg", "seed.the_tuva_project.terminology__place_of_service", "seed.the_tuva_project.terminology__revenue_center"], "model.the_tuva_project.service_category__dq_multiple_service_categories_institutional": ["model.the_tuva_project.service_category__combined_institutional"], "model.the_tuva_project.service_category__dq_multiple_service_categories_professional": ["model.the_tuva_project.service_category__combined_professional"], "model.the_tuva_project.service_category__service_category_grouper": ["model.the_tuva_project.service_category__combined_institutional", "model.the_tuva_project.service_category__combined_professional", "model.the_tuva_project.service_category__stg_medical_claim", "model.the_tuva_project.service_category__stg_medical_claim"], "model.the_tuva_project.service_category__acute_inpatient_institutional": ["model.the_tuva_project.service_category__stg_medical_claim", "model.the_tuva_project.service_category__stg_medical_claim", "model.the_tuva_project.service_category__stg_medical_claim", "model.the_tuva_project.service_category__stg_medical_claim", "seed.the_tuva_project.terminology__apr_drg", "seed.the_tuva_project.terminology__ms_drg"], "model.the_tuva_project.service_category__acute_inpatient_professional": ["model.the_tuva_project.service_category__stg_medical_claim"], "model.the_tuva_project.service_category__ambulance_professional": ["model.the_tuva_project.service_category__stg_medical_claim"], "model.the_tuva_project.service_category__ambulatory_surgery_professional": ["model.the_tuva_project.service_category__dme_professional", "model.the_tuva_project.service_category__stg_medical_claim"], "model.the_tuva_project.service_category__combined_institutional": ["model.the_tuva_project.service_category__acute_inpatient_institutional", "model.the_tuva_project.service_category__dialysis_institutional", "model.the_tuva_project.service_category__duplicate_bill_types", "model.the_tuva_project.service_category__emergency_department_institutional", "model.the_tuva_project.service_category__home_health_institutional", "model.the_tuva_project.service_category__hospice_institutional", "model.the_tuva_project.service_category__lab_institutional", "model.the_tuva_project.service_category__outpatient_hospital_or_clinic_institutional", "model.the_tuva_project.service_category__outpatient_psychiatric_institutional", "model.the_tuva_project.service_category__skilled_nursing_institutional", "model.the_tuva_project.service_category__urgent_care_institutional"], "model.the_tuva_project.service_category__combined_professional": ["model.the_tuva_project.service_category__acute_inpatient_professional", "model.the_tuva_project.service_category__ambulance_professional", "model.the_tuva_project.service_category__ambulance_professional", "model.the_tuva_project.service_category__ambulatory_surgery_professional", "model.the_tuva_project.service_category__dialysis_professional", "model.the_tuva_project.service_category__dme_professional", "model.the_tuva_project.service_category__dme_professional", "model.the_tuva_project.service_category__dme_professional", "model.the_tuva_project.service_category__emergency_department_professional", "model.the_tuva_project.service_category__home_health_professional", "model.the_tuva_project.service_category__hospice_professional", "model.the_tuva_project.service_category__inpatient_psychiatric_professional", "model.the_tuva_project.service_category__inpatient_rehab_professional", "model.the_tuva_project.service_category__lab_professional", "model.the_tuva_project.service_category__office_visit_professional", "model.the_tuva_project.service_category__outpatient_hospital_or_clinic_professional", "model.the_tuva_project.service_category__outpatient_psychiatric_professional", "model.the_tuva_project.service_category__outpatient_rehab_professional", "model.the_tuva_project.service_category__skilled_nursing_professional", "model.the_tuva_project.service_category__urgent_care_professional"], "model.the_tuva_project.service_category__dialysis_institutional": ["model.the_tuva_project.service_category__stg_medical_claim"], "model.the_tuva_project.service_category__dialysis_professional": ["model.the_tuva_project.service_category__stg_medical_claim"], "model.the_tuva_project.service_category__dme_professional": ["model.the_tuva_project.service_category__stg_medical_claim"], "model.the_tuva_project.service_category__duplicate_bill_types": ["model.the_tuva_project.service_category__stg_medical_claim"], "model.the_tuva_project.service_category__emergency_department_institutional": ["model.the_tuva_project.service_category__acute_inpatient_institutional", "model.the_tuva_project.service_category__stg_medical_claim"], "model.the_tuva_project.service_category__emergency_department_professional": ["model.the_tuva_project.service_category__stg_medical_claim"], "model.the_tuva_project.service_category__home_health_institutional": ["model.the_tuva_project.service_category__stg_medical_claim"], "model.the_tuva_project.service_category__home_health_professional": ["model.the_tuva_project.service_category__dme_professional", "model.the_tuva_project.service_category__stg_medical_claim"], "model.the_tuva_project.service_category__hospice_institutional": ["model.the_tuva_project.service_category__stg_medical_claim"], "model.the_tuva_project.service_category__hospice_professional": ["model.the_tuva_project.service_category__stg_medical_claim"], "model.the_tuva_project.service_category__inpatient_psychiatric_professional": ["model.the_tuva_project.service_category__stg_medical_claim"], "model.the_tuva_project.service_category__inpatient_rehab_professional": ["model.the_tuva_project.service_category__stg_medical_claim"], "model.the_tuva_project.service_category__lab_institutional": ["model.the_tuva_project.service_category__stg_medical_claim"], "model.the_tuva_project.service_category__lab_professional": ["model.the_tuva_project.service_category__stg_medical_claim"], "model.the_tuva_project.service_category__office_visit_professional": ["model.the_tuva_project.service_category__stg_medical_claim"], "model.the_tuva_project.service_category__outpatient_hospital_or_clinic_institutional": ["model.the_tuva_project.service_category__emergency_department_institutional", "model.the_tuva_project.service_category__stg_medical_claim", "model.the_tuva_project.service_category__urgent_care_institutional"], "model.the_tuva_project.service_category__outpatient_hospital_or_clinic_professional": ["model.the_tuva_project.service_category__stg_medical_claim"], "model.the_tuva_project.service_category__outpatient_psychiatric_institutional": ["model.the_tuva_project.service_category__stg_medical_claim"], "model.the_tuva_project.service_category__outpatient_psychiatric_professional": ["model.the_tuva_project.service_category__stg_medical_claim"], "model.the_tuva_project.service_category__outpatient_rehab_professional": ["model.the_tuva_project.service_category__stg_medical_claim"], "model.the_tuva_project.service_category__skilled_nursing_institutional": ["model.the_tuva_project.service_category__stg_medical_claim"], "model.the_tuva_project.service_category__skilled_nursing_professional": ["model.the_tuva_project.service_category__dme_professional", "model.the_tuva_project.service_category__stg_medical_claim"], "model.the_tuva_project.service_category__urgent_care_institutional": ["model.the_tuva_project.service_category__emergency_department_institutional", "model.the_tuva_project.service_category__stg_medical_claim"], "model.the_tuva_project.service_category__urgent_care_professional": ["model.the_tuva_project.service_category__stg_medical_claim"], "model.the_tuva_project.service_category__stg_medical_claim": ["model.input_layer.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_all_conditions": ["model.the_tuva_project.cms_hcc__stg_core__condition", "seed.the_tuva_project.cms_hcc__disease_factors", "seed.the_tuva_project.cms_hcc__icd_10_cm_mappings", "seed.the_tuva_project.cms_hcc__icd_10_cm_mappings"], "model.the_tuva_project.cms_hcc__int_demographic_factors": ["model.the_tuva_project.cms_hcc__int_members", "seed.the_tuva_project.cms_hcc__demographic_factors"], "model.the_tuva_project.cms_hcc__int_disabled_interaction_factors": ["model.the_tuva_project.cms_hcc__int_demographic_factors", "model.the_tuva_project.cms_hcc__int_hcc_hierarchy", "seed.the_tuva_project.cms_hcc__disabled_interaction_factors"], "model.the_tuva_project.cms_hcc__int_disease_factors": ["model.the_tuva_project.cms_hcc__int_demographic_factors", "model.the_tuva_project.cms_hcc__int_hcc_hierarchy", "seed.the_tuva_project.cms_hcc__disease_factors"], "model.the_tuva_project.cms_hcc__int_disease_interaction_factors": ["model.the_tuva_project.cms_hcc__int_demographic_factors", "model.the_tuva_project.cms_hcc__int_hcc_hierarchy", "seed.the_tuva_project.cms_hcc__disease_interaction_factors"], "model.the_tuva_project.cms_hcc__int_eligible_conditions": ["model.the_tuva_project.cms_hcc__stg_core__condition", "model.the_tuva_project.cms_hcc__stg_core__medical_claim", "seed.the_tuva_project.cms_hcc__cpt_hcpcs"], "model.the_tuva_project.cms_hcc__int_enrollment_interaction_factors": ["model.the_tuva_project.cms_hcc__int_demographic_factors", "seed.the_tuva_project.cms_hcc__enrollment_interaction_factors"], "model.the_tuva_project.cms_hcc__int_hcc_count_factors": ["model.the_tuva_project.cms_hcc__int_demographic_factors", "model.the_tuva_project.cms_hcc__int_hcc_hierarchy", "seed.the_tuva_project.cms_hcc__payment_hcc_count_factors"], "model.the_tuva_project.cms_hcc__int_hcc_hierarchy": ["model.the_tuva_project.cms_hcc__int_hcc_mapping", "seed.the_tuva_project.cms_hcc__disease_hierarchy"], "model.the_tuva_project.cms_hcc__int_hcc_mapping": ["model.the_tuva_project.cms_hcc__int_eligible_conditions", "seed.the_tuva_project.cms_hcc__icd_10_cm_mappings"], "model.the_tuva_project.cms_hcc__int_members": ["model.the_tuva_project.cms_hcc__stg_core__eligibility", "model.the_tuva_project.cms_hcc__stg_core__patient"], "model.the_tuva_project.cms_hcc__stg_core__condition": ["model.the_tuva_project.core__condition"], "model.the_tuva_project.cms_hcc__stg_core__eligibility": ["model.the_tuva_project.core__eligibility"], "model.the_tuva_project.cms_hcc__stg_core__medical_claim": ["model.the_tuva_project.core__medical_claim"], "model.the_tuva_project.cms_hcc__stg_core__patient": ["model.the_tuva_project.core__patient"], "model.the_tuva_project.core__eligibility": ["model.the_tuva_project.core__stg_claims_eligibility"], "model.the_tuva_project.core__stg_claims_condition": ["model.input_layer.medical_claim", "model.input_layer.medical_claim", "model.input_layer.medical_claim", "model.input_layer.medical_claim", "model.input_layer.medical_claim", "model.input_layer.medical_claim", "model.input_layer.medical_claim", "model.input_layer.medical_claim", "model.input_layer.medical_claim", "model.input_layer.medical_claim", "model.input_layer.medical_claim", "model.input_layer.medical_claim", "model.input_layer.medical_claim", "model.input_layer.medical_claim", "model.input_layer.medical_claim", "model.input_layer.medical_claim", "model.input_layer.medical_claim", "model.input_layer.medical_claim", "model.input_layer.medical_claim", "model.input_layer.medical_claim", "model.input_layer.medical_claim", "model.input_layer.medical_claim", "model.input_layer.medical_claim", "model.input_layer.medical_claim", "model.input_layer.medical_claim", "model.the_tuva_project.acute_inpatient__encounter_id", "model.the_tuva_project.emergency_department__int_encounter_id", "seed.the_tuva_project.terminology__icd_10_cm", "seed.the_tuva_project.terminology__present_on_admission"], "model.the_tuva_project.core__stg_claims_eligibility": ["model.input_layer.eligibility"], "model.the_tuva_project.core__stg_claims_encounter": ["model.the_tuva_project.acute_inpatient__summary", "model.the_tuva_project.emergency_department__summary"], "model.the_tuva_project.core__stg_claims_location": ["model.the_tuva_project.core__stg_claims_medical_claim", "model.the_tuva_project.core__stg_claims_medical_claim", "model.the_tuva_project.core__stg_claims_medical_claim", "seed.the_tuva_project.terminology__provider"], "model.the_tuva_project.core__stg_claims_medical_claim": ["model.input_layer.medical_claim", "model.the_tuva_project.acute_inpatient__encounter_id", "model.the_tuva_project.emergency_department__int_encounter_id", "model.the_tuva_project.service_category__service_category_grouper"], "model.the_tuva_project.core__stg_claims_patient": ["model.input_layer.eligibility"], "model.the_tuva_project.core__stg_claims_pharmacy_claim": ["model.input_layer.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.input_layer.medical_claim", "model.input_layer.medical_claim", "model.input_layer.medical_claim", "model.input_layer.medical_claim", "model.input_layer.medical_claim", "model.input_layer.medical_claim", "model.input_layer.medical_claim", "model.input_layer.medical_claim", "model.input_layer.medical_claim", "model.input_layer.medical_claim", "model.input_layer.medical_claim", "model.input_layer.medical_claim", "model.input_layer.medical_claim", "model.input_layer.medical_claim", "model.input_layer.medical_claim", "model.input_layer.medical_claim", "model.input_layer.medical_claim", "model.input_layer.medical_claim", "model.input_layer.medical_claim", "model.input_layer.medical_claim", "model.input_layer.medical_claim", "model.input_layer.medical_claim", "model.input_layer.medical_claim", "model.input_layer.medical_claim", "model.input_layer.medical_claim", "model.the_tuva_project.acute_inpatient__encounter_id", "model.the_tuva_project.emergency_department__int_encounter_id", "seed.the_tuva_project.terminology__icd_10_pcs"], "model.the_tuva_project.core__stg_clinical_condition": ["model.input_layer.condition"], "model.the_tuva_project.core__stg_clinical_encounter": ["model.input_layer.encounter"], "model.the_tuva_project.core__stg_clinical_lab_result": ["model.input_layer.lab_result"], "model.the_tuva_project.core__stg_clinical_location": ["model.input_layer.location"], "model.the_tuva_project.core__stg_clinical_medication": ["model.input_layer.medication"], "model.the_tuva_project.core__stg_clinical_observation": ["model.input_layer.observation"], "model.the_tuva_project.core__stg_clinical_patient": ["model.input_layer.patient"], "model.the_tuva_project.core__stg_clinical_practitioner": ["model.input_layer.practitioner"], "model.the_tuva_project.core__stg_clinical_procedure": ["model.input_layer.procedure"], "model.the_tuva_project.ed_classification__int_filter_encounter_with_classification": ["model.the_tuva_project.ed_classification__int_map_primary_dx"], "model.the_tuva_project.ed_classification__int_map_primary_dx": ["model.the_tuva_project.ed_classification__stg_encounter", "seed.the_tuva_project.ed_classification__johnston_icd10", "seed.the_tuva_project.ed_classification__johnston_icd9"], "model.the_tuva_project.ed_classification__stg_encounter": ["model.the_tuva_project.core__encounter"], "model.the_tuva_project.ed_classification__stg_patient": ["model.the_tuva_project.core__patient"], "model.the_tuva_project.financial_pmpm__member_months": ["model.the_tuva_project.financial_pmpm__stg_eligibility", "seed.the_tuva_project.terminology__calendar"], "model.the_tuva_project.financial_pmpm__pmpm": ["model.the_tuva_project.financial_pmpm__pmpm_prep"], "model.the_tuva_project.financial_pmpm__pmpm_prep": ["model.the_tuva_project.financial_pmpm__member_months", "model.the_tuva_project.financial_pmpm__service_category_1_allowed_pivot", "model.the_tuva_project.financial_pmpm__service_category_1_paid_pivot", "model.the_tuva_project.financial_pmpm__service_category_2_allowed_pivot", "model.the_tuva_project.financial_pmpm__service_category_2_paid_pivot"], "model.the_tuva_project.financial_pmpm__patient_spend_with_service_categories": ["model.the_tuva_project.financial_pmpm__stg_medical_claim", "model.the_tuva_project.financial_pmpm__stg_pharmacy_claim"], "model.the_tuva_project.financial_pmpm__service_category_1_allowed_pivot": ["model.the_tuva_project.financial_pmpm__patient_spend_with_service_categories"], "model.the_tuva_project.financial_pmpm__service_category_1_paid_pivot": ["model.the_tuva_project.financial_pmpm__patient_spend_with_service_categories"], "model.the_tuva_project.financial_pmpm__service_category_2_allowed_pivot": ["model.the_tuva_project.financial_pmpm__patient_spend_with_service_categories"], "model.the_tuva_project.financial_pmpm__service_category_2_paid_pivot": ["model.the_tuva_project.financial_pmpm__patient_spend_with_service_categories"], "model.the_tuva_project.financial_pmpm__stg_eligibility": ["model.the_tuva_project.core__eligibility"], "model.the_tuva_project.financial_pmpm__stg_medical_claim": ["model.the_tuva_project.core__medical_claim"], "model.the_tuva_project.financial_pmpm__stg_pharmacy_claim": ["model.the_tuva_project.core__pharmacy_claim"], "model.the_tuva_project.insights__count_claim_by_claim_type": ["model.the_tuva_project.core__medical_claim", "model.the_tuva_project.core__pharmacy_claim"], "model.the_tuva_project.insights__count_claim_by_date_column": ["model.the_tuva_project.core__medical_claim", "model.the_tuva_project.core__medical_claim", "model.the_tuva_project.core__medical_claim", "model.the_tuva_project.core__medical_claim", "model.the_tuva_project.core__medical_claim", "model.the_tuva_project.core__pharmacy_claim", "model.the_tuva_project.core__pharmacy_claim", "model.the_tuva_project.financial_pmpm__member_months", "seed.the_tuva_project.terminology__calendar"], "model.the_tuva_project.insights__count_claim_by_service_category": ["model.the_tuva_project.core__medical_claim", "model.the_tuva_project.core__medical_claim"], "model.the_tuva_project.insights__orphan_claim_by_claim_type": ["model.the_tuva_project.core__medical_claim", "model.the_tuva_project.core__pharmacy_claim", "model.the_tuva_project.financial_pmpm__member_months", "model.the_tuva_project.financial_pmpm__member_months"], "model.the_tuva_project.insights__sum_amount_by_claim_type": ["model.the_tuva_project.core__medical_claim", "model.the_tuva_project.core__pharmacy_claim"], "model.the_tuva_project.insights__sum_amount_by_service_category": ["model.the_tuva_project.core__medical_claim", "model.the_tuva_project.core__medical_claim"], "model.the_tuva_project.insights__trend_count_claim_by_claim_type": ["model.the_tuva_project.core__medical_claim"], "model.the_tuva_project.insights__trend_count_claim_by_service_category": ["model.the_tuva_project.core__medical_claim", "model.the_tuva_project.core__medical_claim"], "model.the_tuva_project.insights__trend_sum_amount_by_claim_type": ["model.the_tuva_project.core__medical_claim", "model.the_tuva_project.core__pharmacy_claim"], "model.the_tuva_project.insights__trend_sum_amount_by_service_category": ["model.the_tuva_project.core__medical_claim", "model.the_tuva_project.core__medical_claim"], "model.the_tuva_project.quality_measures__summary_wide": ["model.the_tuva_project.quality_measures__summary_long"], "model.the_tuva_project.quality_measures__int_nqf0034_denominator": ["model.the_tuva_project.quality_measures__int_nqf0034__performance_period", "model.the_tuva_project.quality_measures__int_nqf0034__performance_period", "model.the_tuva_project.quality_measures__int_nqf0034__performance_period", "model.the_tuva_project.quality_measures__stg_core__encounter", "model.the_tuva_project.quality_measures__stg_core__patient", "model.the_tuva_project.quality_measures__stg_core__procedure", "model.the_tuva_project.quality_measures__stg_medical_claim", "seed.the_tuva_project.quality_measures__value_sets"], "model.the_tuva_project.quality_measures__int_nqf0034_exclude_advanced_illness": ["model.the_tuva_project.quality_measures__int_nqf0034__frailty", "model.the_tuva_project.quality_measures__int_nqf0034__performance_period", "model.the_tuva_project.quality_measures__int_nqf0034__performance_period", "model.the_tuva_project.quality_measures__int_nqf0034__performance_period", "model.the_tuva_project.quality_measures__int_nqf0034__performance_period", "model.the_tuva_project.quality_measures__int_nqf0034__performance_period", "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", "seed.the_tuva_project.quality_measures__value_sets"], "model.the_tuva_project.quality_measures__int_nqf0034_exclude_colectomy_cancer": ["model.the_tuva_project.quality_measures__stg_core__condition", "model.the_tuva_project.quality_measures__stg_core__observation", "model.the_tuva_project.quality_measures__stg_core__procedure", "model.the_tuva_project.quality_measures__stg_medical_claim", "seed.the_tuva_project.quality_measures__value_sets"], "model.the_tuva_project.quality_measures__int_nqf0034_exclude_dementia": ["model.the_tuva_project.quality_measures__int_nqf0034__frailty", "model.the_tuva_project.quality_measures__int_nqf0034__performance_period", "model.the_tuva_project.quality_measures__int_nqf0034__performance_period", "model.the_tuva_project.quality_measures__int_nqf0034__performance_period", "model.the_tuva_project.quality_measures__int_nqf0034__performance_period", "model.the_tuva_project.quality_measures__stg_core__medication", "model.the_tuva_project.quality_measures__stg_pharmacy_claim", "seed.the_tuva_project.quality_measures__value_sets"], "model.the_tuva_project.quality_measures__int_nqf0034_exclude_hospice_palliative": ["model.the_tuva_project.quality_measures__int_nqf0034__performance_period", "model.the_tuva_project.quality_measures__int_nqf0034__performance_period", "model.the_tuva_project.quality_measures__int_nqf0034__performance_period", "model.the_tuva_project.quality_measures__int_nqf0034__performance_period", "model.the_tuva_project.quality_measures__stg_core__condition", "model.the_tuva_project.quality_measures__stg_core__observation", "model.the_tuva_project.quality_measures__stg_core__procedure", "model.the_tuva_project.quality_measures__stg_medical_claim", "seed.the_tuva_project.quality_measures__value_sets"], "model.the_tuva_project.quality_measures__int_nqf0034_exclude_institutional_snp": ["model.the_tuva_project.quality_measures__int_nqf0034__performance_period", "model.the_tuva_project.quality_measures__int_nqf0034_denominator", "model.the_tuva_project.quality_measures__stg_medical_claim"], "model.the_tuva_project.quality_measures__int_nqf0034_exclusions": ["model.the_tuva_project.quality_measures__int_nqf0034_denominator", "model.the_tuva_project.quality_measures__int_nqf0034_exclude_advanced_illness", "model.the_tuva_project.quality_measures__int_nqf0034_exclude_colectomy_cancer", "model.the_tuva_project.quality_measures__int_nqf0034_exclude_dementia", "model.the_tuva_project.quality_measures__int_nqf0034_exclude_hospice_palliative", "model.the_tuva_project.quality_measures__int_nqf0034_exclude_institutional_snp"], "model.the_tuva_project.quality_measures__int_nqf0034_long": ["model.the_tuva_project.quality_measures__int_nqf0034__performance_period", "model.the_tuva_project.quality_measures__int_nqf0034_denominator", "model.the_tuva_project.quality_measures__int_nqf0034_exclusions", "model.the_tuva_project.quality_measures__int_nqf0034_numerator", "model.the_tuva_project.quality_measures__stg_core__patient", "seed.the_tuva_project.quality_measures__measures", "seed.the_tuva_project.quality_measures__measures", "seed.the_tuva_project.quality_measures__measures"], "model.the_tuva_project.quality_measures__int_nqf0034_numerator": ["model.the_tuva_project.quality_measures__int_nqf0034__performance_period", "model.the_tuva_project.quality_measures__int_nqf0034_denominator", "model.the_tuva_project.quality_measures__stg_core__lab_result", "model.the_tuva_project.quality_measures__stg_core__observation", "model.the_tuva_project.quality_measures__stg_core__procedure", "model.the_tuva_project.quality_measures__stg_medical_claim", "seed.the_tuva_project.quality_measures__value_sets"], "model.the_tuva_project.quality_measures__int_nqf0034__frailty": ["model.the_tuva_project.quality_measures__int_nqf0034__performance_period", "model.the_tuva_project.quality_measures__int_nqf0034__performance_period", "model.the_tuva_project.quality_measures__int_nqf0034__performance_period", "model.the_tuva_project.quality_measures__int_nqf0034__performance_period", "model.the_tuva_project.quality_measures__int_nqf0034_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_nqf0034__performance_period": [], "model.the_tuva_project.quality_measures__int_nqf2372_denominator": ["model.the_tuva_project.quality_measures__int_nqf2372__performance_period", "model.the_tuva_project.quality_measures__stg_core__encounter", "model.the_tuva_project.quality_measures__stg_core__patient", "model.the_tuva_project.quality_measures__stg_core__procedure", "model.the_tuva_project.quality_measures__stg_medical_claim", "seed.the_tuva_project.quality_measures__value_sets"], "model.the_tuva_project.quality_measures__int_nqf2372_exclude_advanced_illness": ["model.the_tuva_project.quality_measures__int_nqf2372__frailty", "model.the_tuva_project.quality_measures__stg_core__condition", "model.the_tuva_project.quality_measures__stg_core__procedure", "model.the_tuva_project.quality_measures__stg_medical_claim", "seed.the_tuva_project.quality_measures__value_sets"], "model.the_tuva_project.quality_measures__int_nqf2372_exclude_dementia": ["model.the_tuva_project.quality_measures__int_nqf2372__frailty", "model.the_tuva_project.quality_measures__stg_core__medication", "model.the_tuva_project.quality_measures__stg_pharmacy_claim", "seed.the_tuva_project.quality_measures__value_sets"], "model.the_tuva_project.quality_measures__int_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__int_nqf2372__frailty": ["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__performance_period": ["seed.the_tuva_project.quality_measures__measures", "seed.the_tuva_project.quality_measures__measures", "seed.the_tuva_project.quality_measures__measures"], "model.the_tuva_project.quality_measures__stg_core__condition": ["model.the_tuva_project.core__condition"], "model.the_tuva_project.quality_measures__stg_core__encounter": ["model.the_tuva_project.core__encounter"], "model.the_tuva_project.quality_measures__stg_core__lab_result": ["model.the_tuva_project.core__lab_result"], "model.the_tuva_project.quality_measures__stg_core__medication": ["model.the_tuva_project.core__medication"], "model.the_tuva_project.quality_measures__stg_core__observation": ["model.the_tuva_project.core__observation"], "model.the_tuva_project.quality_measures__stg_core__patient": ["model.the_tuva_project.core__patient"], "model.the_tuva_project.quality_measures__stg_core__procedure": ["model.the_tuva_project.core__procedure"], "model.the_tuva_project.quality_measures__stg_medical_claim": ["model.the_tuva_project.core__medical_claim"], "model.the_tuva_project.quality_measures__stg_pharmacy_claim": ["model.the_tuva_project.core__pharmacy_claim"], "model.the_tuva_project.readmissions__encounter": ["model.the_tuva_project.readmissions__stg_core__encounter"], "model.the_tuva_project.readmissions__encounter_data_quality": ["model.the_tuva_project.readmissions__encounter_overlap", "model.the_tuva_project.readmissions__encounter_overlap", "model.the_tuva_project.readmissions__encounter_with_ccs", "seed.the_tuva_project.terminology__discharge_disposition", "seed.the_tuva_project.terminology__ms_drg"], "model.the_tuva_project.readmissions__encounter_overlap": ["model.the_tuva_project.readmissions__encounter"], "model.the_tuva_project.readmissions__encounter_specialty_cohort": ["model.the_tuva_project.readmissions__encounter", "model.the_tuva_project.readmissions__encounter_with_ccs", "model.the_tuva_project.readmissions__procedure_ccs", "seed.the_tuva_project.readmissions__specialty_cohort", "seed.the_tuva_project.readmissions__specialty_cohort", "seed.the_tuva_project.readmissions__surgery_gynecology_cohort"], "model.the_tuva_project.readmissions__encounter_with_ccs": ["model.the_tuva_project.readmissions__encounter", "seed.the_tuva_project.readmissions__icd_10_cm_to_ccs", "seed.the_tuva_project.terminology__icd_10_cm"], "model.the_tuva_project.readmissions__exclusion": ["model.the_tuva_project.readmissions__encounter_with_ccs", "seed.the_tuva_project.readmissions__exclusion_ccs_diagnosis_category"], "model.the_tuva_project.readmissions__index_admission": ["model.the_tuva_project.readmissions__encounter", "model.the_tuva_project.readmissions__exclusion", "model.the_tuva_project.readmissions__index_discharge_requirement", "model.the_tuva_project.readmissions__index_time_requirement"], "model.the_tuva_project.readmissions__index_discharge_requirement": ["model.the_tuva_project.readmissions__encounter", "model.the_tuva_project.readmissions__encounter"], "model.the_tuva_project.readmissions__index_time_requirement": ["model.the_tuva_project.readmissions__encounter", "model.the_tuva_project.readmissions__encounter"], "model.the_tuva_project.readmissions__planned_encounter": ["model.the_tuva_project.readmissions__encounter_with_ccs", "model.the_tuva_project.readmissions__encounter_with_ccs", "model.the_tuva_project.readmissions__procedure_ccs", "model.the_tuva_project.readmissions__procedure_ccs", "model.the_tuva_project.readmissions__procedure_ccs", "seed.the_tuva_project.readmissions__acute_diagnosis_ccs", "seed.the_tuva_project.readmissions__acute_diagnosis_icd_10_cm", "seed.the_tuva_project.readmissions__always_planned_ccs_diagnosis_category", "seed.the_tuva_project.readmissions__always_planned_ccs_procedure_category", "seed.the_tuva_project.readmissions__potentially_planned_ccs_procedure_category", "seed.the_tuva_project.readmissions__potentially_planned_icd_10_pcs"], "model.the_tuva_project.readmissions__procedure_ccs": ["model.the_tuva_project.readmissions__stg_core__procedure", "seed.the_tuva_project.readmissions__icd_10_pcs_to_ccs", "seed.the_tuva_project.terminology__icd_10_pcs"], "model.the_tuva_project.readmissions__readmission_crude": ["model.the_tuva_project.readmissions__encounter", "model.the_tuva_project.readmissions__encounter_overlap", "model.the_tuva_project.readmissions__encounter_overlap"], "model.the_tuva_project.readmissions__stg_core__condition": ["model.the_tuva_project.core__condition"], "model.the_tuva_project.readmissions__stg_core__encounter": ["model.the_tuva_project.core__encounter"], "model.the_tuva_project.readmissions__stg_core__medical_claim": ["model.the_tuva_project.core__medical_claim"], "model.the_tuva_project.readmissions__stg_core__procedure": ["model.the_tuva_project.core__procedure"], "seed.the_tuva_project.terminology__admit_source": [], "seed.the_tuva_project.terminology__admit_type": [], "seed.the_tuva_project.terminology__ansi_fips_state": [], "seed.the_tuva_project.terminology__apr_drg": [], "seed.the_tuva_project.terminology__bill_type": [], "seed.the_tuva_project.terminology__calendar": [], "seed.the_tuva_project.terminology__claim_type": [], "seed.the_tuva_project.terminology__code_type": [], "seed.the_tuva_project.terminology__discharge_disposition": [], "seed.the_tuva_project.terminology__encounter_type": [], "seed.the_tuva_project.terminology__ethnicity": [], "seed.the_tuva_project.terminology__fips_county": [], "seed.the_tuva_project.terminology__gender": [], "seed.the_tuva_project.terminology__hcpcs_level_2": [], "seed.the_tuva_project.terminology__icd_10_cm": [], "seed.the_tuva_project.terminology__icd_10_pcs": [], "seed.the_tuva_project.terminology__icd_9_cm": [], "seed.the_tuva_project.terminology__icd_9_pcs": [], "seed.the_tuva_project.terminology__loinc": [], "seed.the_tuva_project.terminology__loinc_deprecated_mapping": [], "seed.the_tuva_project.terminology__mdc": [], "seed.the_tuva_project.terminology__medicare_dual_eligibility": [], "seed.the_tuva_project.terminology__medicare_orec": [], "seed.the_tuva_project.terminology__medicare_status": [], "seed.the_tuva_project.terminology__ms_drg": [], "seed.the_tuva_project.terminology__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.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_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_wide_patient_id.02386b9158": ["model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_wide"], "test.the_tuva_project.not_null_chronic_conditions__tuva_chronic_conditions_wide_patient_id.705b1ca561": ["model.the_tuva_project.chronic_conditions__tuva_chronic_conditions_wide"], "test.the_tuva_project.unique_cms_hcc__patient_risk_scores_patient_id.05b154e126": ["model.the_tuva_project.cms_hcc__patient_risk_scores"], "test.the_tuva_project.unique_cms_hcc__int_demographic_factors_patient_id.1e7ac0d681": ["model.the_tuva_project.cms_hcc__int_demographic_factors"], "test.the_tuva_project.not_null_cms_hcc__int_eligible_conditions_condition_code.e811a078bc": ["model.the_tuva_project.cms_hcc__int_eligible_conditions"], "test.the_tuva_project.not_null_cms_hcc__int_members_patient_id.75e528329b": ["model.the_tuva_project.cms_hcc__int_members"], "test.the_tuva_project.unique_cms_hcc__int_members_patient_id.4d202f2bbb": ["model.the_tuva_project.cms_hcc__int_members"], "test.the_tuva_project.unique_financial_pmpm__pmpm_prep__patient_id___year_month___plan_.b941ddaf9e": ["model.the_tuva_project.financial_pmpm__pmpm_prep"], "test.the_tuva_project.not_null_quality_measures__stg_core__condition_patient_id.1f1222e348": ["model.the_tuva_project.quality_measures__stg_core__condition"], "test.the_tuva_project.not_null_quality_measures__stg_core__encounter_patient_id.a0d82e2159": ["model.the_tuva_project.quality_measures__stg_core__encounter"], "test.the_tuva_project.not_null_quality_measures__stg_core__medication_patient_id.0aaf3a0652": ["model.the_tuva_project.quality_measures__stg_core__medication"], "test.the_tuva_project.not_null_quality_measures__stg_core__observation_patient_id.31e33f2d7e": ["model.the_tuva_project.quality_measures__stg_core__observation"], "test.the_tuva_project.not_null_quality_measures__stg_core__patient_patient_id.5510e1a0fd": ["model.the_tuva_project.quality_measures__stg_core__patient"], "test.the_tuva_project.not_null_quality_measures__stg_core__patient_sex.e2f34cab69": ["model.the_tuva_project.quality_measures__stg_core__patient"], "test.the_tuva_project.accepted_values_quality_measures__stg_core__patient_sex__female__male.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"], "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"], "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__practitioner": ["model.the_tuva_project.core__stg_claims_practitioner", "model.the_tuva_project.core__stg_clinical_practitioner"], "model.the_tuva_project.core__medical_claim": ["model.the_tuva_project.core__stg_claims_medical_claim"], "test.the_tuva_project.unique_core__medical_claim__claim_id_claim_line_number_.b9ab42f1f0": ["model.the_tuva_project.core__medical_claim"], "model.the_tuva_project.acute_inpatient__summary": ["model.input_layer.medical_claim", "model.the_tuva_project.acute_inpatient__encounter_id", "model.the_tuva_project.acute_inpatient__encounter_id", "model.the_tuva_project.acute_inpatient__encounter_id", "model.the_tuva_project.acute_inpatient__encounter_start_and_end_dates", "model.the_tuva_project.acute_inpatient__first_claim_values", "model.the_tuva_project.acute_inpatient__institutional_encounter_id", "model.the_tuva_project.acute_inpatient__last_claim_values", "model.the_tuva_project.acute_inpatient__stg_eligibility", "model.the_tuva_project.acute_inpatient__stg_medical_claim", "seed.the_tuva_project.terminology__admit_source", "seed.the_tuva_project.terminology__admit_type", "seed.the_tuva_project.terminology__apr_drg", "seed.the_tuva_project.terminology__discharge_disposition", "seed.the_tuva_project.terminology__icd_10_cm", "seed.the_tuva_project.terminology__icd_9_cm", "seed.the_tuva_project.terminology__ms_drg", "seed.the_tuva_project.terminology__provider"], "model.the_tuva_project.quality_measures__summary_long": ["model.the_tuva_project.quality_measures__int_nqf0034_long", "model.the_tuva_project.quality_measures__int_nqf2372_long"], "model.the_tuva_project.quality_measures__summary_counts": ["model.the_tuva_project.quality_measures__summary_long"], "model.the_tuva_project.ed_classification__summary": ["model.the_tuva_project.ccsr__long_condition_category", "model.the_tuva_project.ed_classification__int_filter_encounter_with_classification", "model.the_tuva_project.ed_classification__stg_patient", "seed.the_tuva_project.ed_classification__categories", "seed.the_tuva_project.terminology__provider"], "model.the_tuva_project.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.core__observation": ["model.the_tuva_project.core__stg_clinical_observation"], "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__medication": ["model.the_tuva_project.core__stg_clinical_medication"], "model.the_tuva_project.core__pharmacy_claim": ["model.the_tuva_project.core__stg_claims_pharmacy_claim"], "model.the_tuva_project.readmissions__readmission_summary": ["model.the_tuva_project.readmissions__encounter_augmented"], "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"], "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.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"], "model.input_layer.practitioner": [], "model.input_layer.eligibility": ["seed.input_layer.eligibility_seed"], "model.input_layer.pharmacy_claim": ["seed.input_layer.pharmacy_claim_seed"], "model.input_layer.patient": [], "model.input_layer.observation": [], "model.input_layer.location": [], "model.input_layer.medication": [], "model.the_tuva_project.cms_hcc__patient_hcc_history": ["model.the_tuva_project.cms_hcc__int_all_conditions"], "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.core__lab_result": ["model.the_tuva_project.core__stg_clinical_lab_result"], "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__encounter": ["model.the_tuva_project.core__stg_clinical_encounter"], "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.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.input_layer.encounter": [], "model.input_layer.procedure": [], "model.input_layer.condition": [], "model.input_layer.medical_claim": ["seed.input_layer.medical_claim_seed"], "model.input_layer.lab_result": []}, "child_map": {"seed.input_layer.eligibility_seed": ["model.input_layer.eligibility"], "seed.input_layer.medical_claim_seed": ["model.input_layer.medical_claim"], "seed.input_layer.pharmacy_claim_seed": ["model.input_layer.pharmacy_claim"], "model.the_tuva_project.ccsr__singular_condition_category": ["test.the_tuva_project.not_null_ccsr__singular_condition_category_claim_id.41e0e51ac8", "test.the_tuva_project.unique_ccsr__singular_condition_category_claim_id.21b76e504b"], "model.the_tuva_project.ccsr__dx_vertical_pivot": ["model.the_tuva_project.ccsr__long_condition_category"], "model.the_tuva_project.ccsr__procedure_category_map": ["model.the_tuva_project.ccsr__long_procedure_category"], "model.the_tuva_project.ccsr__stg_core__condition": ["model.the_tuva_project.ccsr__long_condition_category"], "model.the_tuva_project.ccsr__stg_core__procedure": ["model.the_tuva_project.ccsr__long_procedure_category"], "model.the_tuva_project.chronic_conditions__cms_chronic_conditions_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_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__claims_with_encounter_data": ["model.the_tuva_project.acute_inpatient__encounter_data_for_medical_claims"], "model.the_tuva_project.acute_inpatient__data_quality_summary": [], "model.the_tuva_project.acute_inpatient__encounter_data_for_medical_claims": [], "model.the_tuva_project.acute_inpatient__encounter_id": ["model.the_tuva_project.acute_inpatient__claims_with_encounter_data", "model.the_tuva_project.acute_inpatient__first_claim_values", "model.the_tuva_project.acute_inpatient__last_claim_values", "model.the_tuva_project.acute_inpatient__summary", "model.the_tuva_project.acute_inpatient__summary", "model.the_tuva_project.acute_inpatient__summary", "model.the_tuva_project.core__stg_claims_condition", "model.the_tuva_project.core__stg_claims_medical_claim", "model.the_tuva_project.core__stg_claims_procedure"], "model.the_tuva_project.acute_inpatient__encounter_start_and_end_dates": ["model.the_tuva_project.acute_inpatient__claims_with_encounter_data", "model.the_tuva_project.acute_inpatient__professional_encounter_id", "model.the_tuva_project.acute_inpatient__summary"], "model.the_tuva_project.acute_inpatient__first_claim_values": ["model.the_tuva_project.acute_inpatient__summary"], "model.the_tuva_project.acute_inpatient__institutional_claims": ["model.the_tuva_project.acute_inpatient__claims_with_encounter_data", "model.the_tuva_project.acute_inpatient__data_quality_summary", "model.the_tuva_project.acute_inpatient__data_quality_summary", "model.the_tuva_project.acute_inpatient__data_quality_summary", "model.the_tuva_project.acute_inpatient__data_quality_summary", "model.the_tuva_project.acute_inpatient__data_quality_summary", "model.the_tuva_project.acute_inpatient__data_quality_summary", "model.the_tuva_project.acute_inpatient__data_quality_summary", "model.the_tuva_project.acute_inpatient__data_quality_summary", "model.the_tuva_project.acute_inpatient__data_quality_summary", "model.the_tuva_project.acute_inpatient__data_quality_summary", "model.the_tuva_project.acute_inpatient__data_quality_summary", "model.the_tuva_project.acute_inpatient__data_quality_summary", "model.the_tuva_project.acute_inpatient__data_quality_summary", "model.the_tuva_project.acute_inpatient__data_quality_summary", "model.the_tuva_project.acute_inpatient__data_quality_summary", "model.the_tuva_project.acute_inpatient__data_quality_summary", "model.the_tuva_project.acute_inpatient__data_quality_summary", "model.the_tuva_project.acute_inpatient__data_quality_summary", "model.the_tuva_project.acute_inpatient__data_quality_summary", "model.the_tuva_project.acute_inpatient__data_quality_summary", "model.the_tuva_project.acute_inpatient__data_quality_summary", "model.the_tuva_project.acute_inpatient__data_quality_summary", "model.the_tuva_project.acute_inpatient__data_quality_summary", "model.the_tuva_project.acute_inpatient__data_quality_summary", "model.the_tuva_project.acute_inpatient__data_quality_summary", "model.the_tuva_project.acute_inpatient__data_quality_summary", "model.the_tuva_project.acute_inpatient__data_quality_summary", "model.the_tuva_project.acute_inpatient__data_quality_summary", "model.the_tuva_project.acute_inpatient__data_quality_summary", "model.the_tuva_project.acute_inpatient__encounter_start_and_end_dates", "model.the_tuva_project.acute_inpatient__institutional_encounter_id"], "model.the_tuva_project.acute_inpatient__institutional_encounter_id": ["model.the_tuva_project.acute_inpatient__encounter_id", "model.the_tuva_project.acute_inpatient__encounter_start_and_end_dates", "model.the_tuva_project.acute_inpatient__summary"], "model.the_tuva_project.acute_inpatient__last_claim_values": ["model.the_tuva_project.acute_inpatient__summary"], "model.the_tuva_project.acute_inpatient__professional_encounter_id": ["model.the_tuva_project.acute_inpatient__encounter_data_for_medical_claims", "model.the_tuva_project.acute_inpatient__encounter_id"], "model.the_tuva_project.acute_inpatient__stg_eligibility": ["model.the_tuva_project.acute_inpatient__summary"], "model.the_tuva_project.acute_inpatient__stg_medical_claim": ["model.the_tuva_project.acute_inpatient__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": ["model.the_tuva_project.acute_inpatient__institutional_claims", "model.the_tuva_project.acute_inpatient__professional_encounter_id"], "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.emergency_department__summary": ["model.the_tuva_project.core__stg_claims_encounter"], "model.the_tuva_project.emergency_department__int_encounter_id": ["model.the_tuva_project.core__stg_claims_condition", "model.the_tuva_project.core__stg_claims_medical_claim", "model.the_tuva_project.core__stg_claims_procedure", "model.the_tuva_project.emergency_department__int_first_claim_values", "model.the_tuva_project.emergency_department__int_last_claim_values", "model.the_tuva_project.emergency_department__summary", "model.the_tuva_project.emergency_department__summary", "model.the_tuva_project.emergency_department__summary"], "model.the_tuva_project.emergency_department__int_encounter_start_and_end_dates": ["model.the_tuva_project.emergency_department__int_professional_encounter_id", "model.the_tuva_project.emergency_department__summary"], "model.the_tuva_project.emergency_department__int_first_claim_values": ["model.the_tuva_project.emergency_department__summary"], "model.the_tuva_project.emergency_department__int_institutional_claims": ["model.the_tuva_project.emergency_department__int_encounter_start_and_end_dates", "model.the_tuva_project.emergency_department__int_institutional_encounter_id"], "model.the_tuva_project.emergency_department__int_institutional_encounter_id": ["model.the_tuva_project.emergency_department__int_encounter_id", "model.the_tuva_project.emergency_department__int_encounter_start_and_end_dates", "model.the_tuva_project.emergency_department__summary"], "model.the_tuva_project.emergency_department__int_last_claim_values": ["model.the_tuva_project.emergency_department__summary"], "model.the_tuva_project.emergency_department__int_professional_encounter_id": ["model.the_tuva_project.emergency_department__int_encounter_id"], "model.the_tuva_project.service_category__dq_input_layer_results": [], "model.the_tuva_project.service_category__dq_input_layer_tests": ["model.the_tuva_project.service_category__dq_input_layer_results"], "model.the_tuva_project.service_category__dq_multiple_service_categories_institutional": [], "model.the_tuva_project.service_category__dq_multiple_service_categories_professional": [], "model.the_tuva_project.service_category__service_category_grouper": ["model.the_tuva_project.acute_inpatient__stg_service_category", "model.the_tuva_project.core__stg_claims_medical_claim", "model.the_tuva_project.emergency_department__int_institutional_claims", "model.the_tuva_project.emergency_department__int_professional_encounter_id"], "model.the_tuva_project.service_category__acute_inpatient_institutional": ["model.the_tuva_project.service_category__combined_institutional", "model.the_tuva_project.service_category__emergency_department_institutional"], "model.the_tuva_project.service_category__acute_inpatient_professional": ["model.the_tuva_project.service_category__combined_professional"], "model.the_tuva_project.service_category__ambulance_professional": ["model.the_tuva_project.service_category__combined_professional", "model.the_tuva_project.service_category__combined_professional"], "model.the_tuva_project.service_category__ambulatory_surgery_professional": ["model.the_tuva_project.service_category__combined_professional"], "model.the_tuva_project.service_category__combined_institutional": ["model.the_tuva_project.service_category__dq_multiple_service_categories_institutional", "model.the_tuva_project.service_category__service_category_grouper"], "model.the_tuva_project.service_category__combined_professional": ["model.the_tuva_project.service_category__dq_multiple_service_categories_professional", "model.the_tuva_project.service_category__service_category_grouper"], "model.the_tuva_project.service_category__dialysis_institutional": ["model.the_tuva_project.service_category__combined_institutional"], "model.the_tuva_project.service_category__dialysis_professional": ["model.the_tuva_project.service_category__combined_professional"], "model.the_tuva_project.service_category__dme_professional": ["model.the_tuva_project.service_category__ambulatory_surgery_professional", "model.the_tuva_project.service_category__combined_professional", "model.the_tuva_project.service_category__combined_professional", "model.the_tuva_project.service_category__combined_professional", "model.the_tuva_project.service_category__home_health_professional", "model.the_tuva_project.service_category__skilled_nursing_professional"], "model.the_tuva_project.service_category__duplicate_bill_types": ["model.the_tuva_project.service_category__combined_institutional"], "model.the_tuva_project.service_category__emergency_department_institutional": ["model.the_tuva_project.service_category__combined_institutional", "model.the_tuva_project.service_category__outpatient_hospital_or_clinic_institutional", "model.the_tuva_project.service_category__urgent_care_institutional"], "model.the_tuva_project.service_category__emergency_department_professional": ["model.the_tuva_project.service_category__combined_professional"], "model.the_tuva_project.service_category__home_health_institutional": ["model.the_tuva_project.service_category__combined_institutional"], "model.the_tuva_project.service_category__home_health_professional": ["model.the_tuva_project.service_category__combined_professional"], "model.the_tuva_project.service_category__hospice_institutional": ["model.the_tuva_project.service_category__combined_institutional"], "model.the_tuva_project.service_category__hospice_professional": ["model.the_tuva_project.service_category__combined_professional"], "model.the_tuva_project.service_category__inpatient_psychiatric_professional": ["model.the_tuva_project.service_category__combined_professional"], "model.the_tuva_project.service_category__inpatient_rehab_professional": ["model.the_tuva_project.service_category__combined_professional"], "model.the_tuva_project.service_category__lab_institutional": ["model.the_tuva_project.service_category__combined_institutional"], "model.the_tuva_project.service_category__lab_professional": ["model.the_tuva_project.service_category__combined_professional"], "model.the_tuva_project.service_category__office_visit_professional": ["model.the_tuva_project.service_category__combined_professional"], "model.the_tuva_project.service_category__outpatient_hospital_or_clinic_institutional": ["model.the_tuva_project.service_category__combined_institutional"], "model.the_tuva_project.service_category__outpatient_hospital_or_clinic_professional": ["model.the_tuva_project.service_category__combined_professional"], "model.the_tuva_project.service_category__outpatient_psychiatric_institutional": ["model.the_tuva_project.service_category__combined_institutional"], "model.the_tuva_project.service_category__outpatient_psychiatric_professional": ["model.the_tuva_project.service_category__combined_professional"], "model.the_tuva_project.service_category__outpatient_rehab_professional": ["model.the_tuva_project.service_category__combined_professional"], "model.the_tuva_project.service_category__skilled_nursing_institutional": ["model.the_tuva_project.service_category__combined_institutional"], "model.the_tuva_project.service_category__skilled_nursing_professional": ["model.the_tuva_project.service_category__combined_professional"], "model.the_tuva_project.service_category__urgent_care_institutional": ["model.the_tuva_project.service_category__combined_institutional", "model.the_tuva_project.service_category__outpatient_hospital_or_clinic_institutional"], "model.the_tuva_project.service_category__urgent_care_professional": ["model.the_tuva_project.service_category__combined_professional"], "model.the_tuva_project.service_category__stg_medical_claim": ["model.the_tuva_project.service_category__acute_inpatient_institutional", "model.the_tuva_project.service_category__acute_inpatient_institutional", "model.the_tuva_project.service_category__acute_inpatient_institutional", "model.the_tuva_project.service_category__acute_inpatient_institutional", "model.the_tuva_project.service_category__acute_inpatient_professional", "model.the_tuva_project.service_category__ambulance_professional", "model.the_tuva_project.service_category__ambulatory_surgery_professional", "model.the_tuva_project.service_category__dialysis_institutional", "model.the_tuva_project.service_category__dialysis_professional", "model.the_tuva_project.service_category__dme_professional", "model.the_tuva_project.service_category__dq_input_layer_tests", "model.the_tuva_project.service_category__dq_input_layer_tests", "model.the_tuva_project.service_category__dq_input_layer_tests", "model.the_tuva_project.service_category__dq_input_layer_tests", "model.the_tuva_project.service_category__dq_input_layer_tests", "model.the_tuva_project.service_category__dq_input_layer_tests", "model.the_tuva_project.service_category__dq_input_layer_tests", "model.the_tuva_project.service_category__dq_input_layer_tests", "model.the_tuva_project.service_category__dq_input_layer_tests", "model.the_tuva_project.service_category__dq_input_layer_tests", "model.the_tuva_project.service_category__dq_input_layer_tests", "model.the_tuva_project.service_category__dq_input_layer_tests", "model.the_tuva_project.service_category__dq_input_layer_tests", "model.the_tuva_project.service_category__dq_input_layer_tests", "model.the_tuva_project.service_category__duplicate_bill_types", "model.the_tuva_project.service_category__emergency_department_institutional", "model.the_tuva_project.service_category__emergency_department_professional", "model.the_tuva_project.service_category__home_health_institutional", "model.the_tuva_project.service_category__home_health_professional", "model.the_tuva_project.service_category__hospice_institutional", "model.the_tuva_project.service_category__hospice_professional", "model.the_tuva_project.service_category__inpatient_psychiatric_professional", "model.the_tuva_project.service_category__inpatient_rehab_professional", "model.the_tuva_project.service_category__lab_institutional", "model.the_tuva_project.service_category__lab_professional", "model.the_tuva_project.service_category__office_visit_professional", "model.the_tuva_project.service_category__outpatient_hospital_or_clinic_institutional", "model.the_tuva_project.service_category__outpatient_hospital_or_clinic_professional", "model.the_tuva_project.service_category__outpatient_psychiatric_institutional", "model.the_tuva_project.service_category__outpatient_psychiatric_professional", "model.the_tuva_project.service_category__outpatient_rehab_professional", "model.the_tuva_project.service_category__service_category_grouper", "model.the_tuva_project.service_category__service_category_grouper", "model.the_tuva_project.service_category__skilled_nursing_institutional", "model.the_tuva_project.service_category__skilled_nursing_professional", "model.the_tuva_project.service_category__urgent_care_institutional", "model.the_tuva_project.service_category__urgent_care_professional"], "model.the_tuva_project.cms_hcc__patient_risk_factors": ["model.the_tuva_project.cms_hcc__patient_risk_scores"], "model.the_tuva_project.cms_hcc__patient_risk_scores": ["test.the_tuva_project.unique_cms_hcc__patient_risk_scores_patient_id.05b154e126"], "model.the_tuva_project.cms_hcc__int_all_conditions": ["model.the_tuva_project.cms_hcc__patient_hcc_history"], "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_all_conditions", "model.the_tuva_project.cms_hcc__int_eligible_conditions"], "model.the_tuva_project.cms_hcc__stg_core__eligibility": ["model.the_tuva_project.cms_hcc__int_members"], "model.the_tuva_project.cms_hcc__stg_core__medical_claim": ["model.the_tuva_project.cms_hcc__int_eligible_conditions"], "model.the_tuva_project.cms_hcc__stg_core__patient": ["model.the_tuva_project.cms_hcc__int_members"], "model.the_tuva_project.core__eligibility": ["model.the_tuva_project.cms_hcc__stg_core__eligibility", "model.the_tuva_project.financial_pmpm__stg_eligibility"], "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__int_filter_encounter_with_classification": ["model.the_tuva_project.ed_classification__summary"], "model.the_tuva_project.ed_classification__int_map_primary_dx": ["model.the_tuva_project.ed_classification__int_filter_encounter_with_classification"], "model.the_tuva_project.ed_classification__stg_encounter": ["model.the_tuva_project.ed_classification__int_map_primary_dx"], "model.the_tuva_project.ed_classification__stg_patient": ["model.the_tuva_project.ed_classification__summary"], "model.the_tuva_project.financial_pmpm__member_months": ["model.the_tuva_project.financial_pmpm__pmpm_prep", "model.the_tuva_project.insights__count_claim_by_date_column", "model.the_tuva_project.insights__orphan_claim_by_claim_type", "model.the_tuva_project.insights__orphan_claim_by_claim_type"], "model.the_tuva_project.financial_pmpm__pmpm": [], "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___plan_.b941ddaf9e"], "model.the_tuva_project.financial_pmpm__patient_spend_with_service_categories": ["model.the_tuva_project.financial_pmpm__service_category_1_allowed_pivot", "model.the_tuva_project.financial_pmpm__service_category_1_paid_pivot", "model.the_tuva_project.financial_pmpm__service_category_2_allowed_pivot", "model.the_tuva_project.financial_pmpm__service_category_2_paid_pivot"], "model.the_tuva_project.financial_pmpm__service_category_1_allowed_pivot": ["model.the_tuva_project.financial_pmpm__pmpm_prep"], "model.the_tuva_project.financial_pmpm__service_category_1_paid_pivot": ["model.the_tuva_project.financial_pmpm__pmpm_prep"], "model.the_tuva_project.financial_pmpm__service_category_2_allowed_pivot": ["model.the_tuva_project.financial_pmpm__pmpm_prep"], "model.the_tuva_project.financial_pmpm__service_category_2_paid_pivot": ["model.the_tuva_project.financial_pmpm__pmpm_prep"], "model.the_tuva_project.financial_pmpm__stg_eligibility": ["model.the_tuva_project.financial_pmpm__member_months"], "model.the_tuva_project.financial_pmpm__stg_medical_claim": ["model.the_tuva_project.financial_pmpm__patient_spend_with_service_categories"], "model.the_tuva_project.financial_pmpm__stg_pharmacy_claim": ["model.the_tuva_project.financial_pmpm__patient_spend_with_service_categories"], "model.the_tuva_project.insights__count_claim_by_claim_type": [], "model.the_tuva_project.insights__count_claim_by_date_column": [], "model.the_tuva_project.insights__count_claim_by_service_category": [], "model.the_tuva_project.insights__orphan_claim_by_claim_type": [], "model.the_tuva_project.insights__sum_amount_by_claim_type": [], "model.the_tuva_project.insights__sum_amount_by_service_category": [], "model.the_tuva_project.insights__trend_count_claim_by_claim_type": [], "model.the_tuva_project.insights__trend_count_claim_by_service_category": [], "model.the_tuva_project.insights__trend_sum_amount_by_claim_type": [], "model.the_tuva_project.insights__trend_sum_amount_by_service_category": [], "model.the_tuva_project.quality_measures__summary_wide": [], "model.the_tuva_project.quality_measures__int_nqf0034_denominator": ["model.the_tuva_project.quality_measures__int_nqf0034__frailty", "model.the_tuva_project.quality_measures__int_nqf0034_exclude_institutional_snp", "model.the_tuva_project.quality_measures__int_nqf0034_exclusions", "model.the_tuva_project.quality_measures__int_nqf0034_long", "model.the_tuva_project.quality_measures__int_nqf0034_numerator"], "model.the_tuva_project.quality_measures__int_nqf0034_exclude_advanced_illness": ["model.the_tuva_project.quality_measures__int_nqf0034_exclusions"], "model.the_tuva_project.quality_measures__int_nqf0034_exclude_colectomy_cancer": ["model.the_tuva_project.quality_measures__int_nqf0034_exclusions"], "model.the_tuva_project.quality_measures__int_nqf0034_exclude_dementia": ["model.the_tuva_project.quality_measures__int_nqf0034_exclusions"], "model.the_tuva_project.quality_measures__int_nqf0034_exclude_hospice_palliative": ["model.the_tuva_project.quality_measures__int_nqf0034_exclusions"], "model.the_tuva_project.quality_measures__int_nqf0034_exclude_institutional_snp": ["model.the_tuva_project.quality_measures__int_nqf0034_exclusions"], "model.the_tuva_project.quality_measures__int_nqf0034_exclusions": ["model.the_tuva_project.quality_measures__int_nqf0034_long"], "model.the_tuva_project.quality_measures__int_nqf0034_long": ["model.the_tuva_project.quality_measures__summary_long"], "model.the_tuva_project.quality_measures__int_nqf0034_numerator": ["model.the_tuva_project.quality_measures__int_nqf0034_long"], "model.the_tuva_project.quality_measures__int_nqf0034__frailty": ["model.the_tuva_project.quality_measures__int_nqf0034_exclude_advanced_illness", "model.the_tuva_project.quality_measures__int_nqf0034_exclude_dementia"], "model.the_tuva_project.quality_measures__int_nqf0034__performance_period": ["model.the_tuva_project.quality_measures__int_nqf0034__frailty", "model.the_tuva_project.quality_measures__int_nqf0034__frailty", "model.the_tuva_project.quality_measures__int_nqf0034__frailty", "model.the_tuva_project.quality_measures__int_nqf0034__frailty", "model.the_tuva_project.quality_measures__int_nqf0034_denominator", "model.the_tuva_project.quality_measures__int_nqf0034_denominator", "model.the_tuva_project.quality_measures__int_nqf0034_denominator", "model.the_tuva_project.quality_measures__int_nqf0034_exclude_advanced_illness", "model.the_tuva_project.quality_measures__int_nqf0034_exclude_advanced_illness", "model.the_tuva_project.quality_measures__int_nqf0034_exclude_advanced_illness", "model.the_tuva_project.quality_measures__int_nqf0034_exclude_advanced_illness", "model.the_tuva_project.quality_measures__int_nqf0034_exclude_advanced_illness", "model.the_tuva_project.quality_measures__int_nqf0034_exclude_dementia", "model.the_tuva_project.quality_measures__int_nqf0034_exclude_dementia", "model.the_tuva_project.quality_measures__int_nqf0034_exclude_dementia", "model.the_tuva_project.quality_measures__int_nqf0034_exclude_dementia", "model.the_tuva_project.quality_measures__int_nqf0034_exclude_hospice_palliative", "model.the_tuva_project.quality_measures__int_nqf0034_exclude_hospice_palliative", "model.the_tuva_project.quality_measures__int_nqf0034_exclude_hospice_palliative", "model.the_tuva_project.quality_measures__int_nqf0034_exclude_hospice_palliative", "model.the_tuva_project.quality_measures__int_nqf0034_exclude_institutional_snp", "model.the_tuva_project.quality_measures__int_nqf0034_long", "model.the_tuva_project.quality_measures__int_nqf0034_numerator"], "model.the_tuva_project.quality_measures__int_nqf2372_denominator": ["model.the_tuva_project.quality_measures__int_nqf2372__frailty", "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__int_nqf2372__frailty": ["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__performance_period": ["model.the_tuva_project.quality_measures__int_nqf2372_denominator"], "model.the_tuva_project.quality_measures__stg_core__condition": ["model.the_tuva_project.quality_measures__int_nqf0034__frailty", "model.the_tuva_project.quality_measures__int_nqf0034_exclude_advanced_illness", "model.the_tuva_project.quality_measures__int_nqf0034_exclude_colectomy_cancer", "model.the_tuva_project.quality_measures__int_nqf0034_exclude_hospice_palliative", "model.the_tuva_project.quality_measures__int_nqf2372__frailty", "model.the_tuva_project.quality_measures__int_nqf2372_exclude_advanced_illness", "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_nqf0034_denominator", "model.the_tuva_project.quality_measures__int_nqf2372_denominator", "test.the_tuva_project.not_null_quality_measures__stg_core__encounter_patient_id.a0d82e2159"], "model.the_tuva_project.quality_measures__stg_core__lab_result": ["model.the_tuva_project.quality_measures__int_nqf0034_numerator"], "model.the_tuva_project.quality_measures__stg_core__medication": ["model.the_tuva_project.quality_measures__int_nqf0034_exclude_dementia", "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_nqf0034__frailty", "model.the_tuva_project.quality_measures__int_nqf0034_exclude_advanced_illness", "model.the_tuva_project.quality_measures__int_nqf0034_exclude_colectomy_cancer", "model.the_tuva_project.quality_measures__int_nqf0034_exclude_hospice_palliative", "model.the_tuva_project.quality_measures__int_nqf0034_numerator", "model.the_tuva_project.quality_measures__int_nqf2372__frailty", "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_nqf0034_denominator", "model.the_tuva_project.quality_measures__int_nqf0034_long", "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_nqf0034__frailty", "model.the_tuva_project.quality_measures__int_nqf0034_denominator", "model.the_tuva_project.quality_measures__int_nqf0034_exclude_advanced_illness", "model.the_tuva_project.quality_measures__int_nqf0034_exclude_colectomy_cancer", "model.the_tuva_project.quality_measures__int_nqf0034_exclude_hospice_palliative", "model.the_tuva_project.quality_measures__int_nqf0034_numerator", "model.the_tuva_project.quality_measures__int_nqf2372__frailty", "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_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_nqf0034__frailty", "model.the_tuva_project.quality_measures__int_nqf0034_denominator", "model.the_tuva_project.quality_measures__int_nqf0034_exclude_advanced_illness", "model.the_tuva_project.quality_measures__int_nqf0034_exclude_colectomy_cancer", "model.the_tuva_project.quality_measures__int_nqf0034_exclude_hospice_palliative", "model.the_tuva_project.quality_measures__int_nqf0034_exclude_institutional_snp", "model.the_tuva_project.quality_measures__int_nqf0034_numerator", "model.the_tuva_project.quality_measures__int_nqf2372__frailty", "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_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_nqf0034_exclude_dementia", "model.the_tuva_project.quality_measures__int_nqf2372_exclude_dementia"], "model.the_tuva_project.readmissions__encounter": ["model.the_tuva_project.readmissions__encounter_augmented", "model.the_tuva_project.readmissions__encounter_overlap", "model.the_tuva_project.readmissions__encounter_specialty_cohort", "model.the_tuva_project.readmissions__encounter_with_ccs", "model.the_tuva_project.readmissions__index_admission", "model.the_tuva_project.readmissions__index_discharge_requirement", "model.the_tuva_project.readmissions__index_discharge_requirement", "model.the_tuva_project.readmissions__index_time_requirement", "model.the_tuva_project.readmissions__index_time_requirement", "model.the_tuva_project.readmissions__readmission_crude"], "model.the_tuva_project.readmissions__encounter_data_quality": ["model.the_tuva_project.readmissions__encounter_augmented"], "model.the_tuva_project.readmissions__encounter_overlap": ["model.the_tuva_project.readmissions__encounter_data_quality", "model.the_tuva_project.readmissions__encounter_data_quality", "model.the_tuva_project.readmissions__readmission_crude", "model.the_tuva_project.readmissions__readmission_crude"], "model.the_tuva_project.readmissions__encounter_specialty_cohort": ["model.the_tuva_project.readmissions__encounter_augmented"], "model.the_tuva_project.readmissions__encounter_with_ccs": ["model.the_tuva_project.readmissions__encounter_data_quality", "model.the_tuva_project.readmissions__encounter_specialty_cohort", "model.the_tuva_project.readmissions__exclusion", "model.the_tuva_project.readmissions__planned_encounter", "model.the_tuva_project.readmissions__planned_encounter"], "model.the_tuva_project.readmissions__exclusion": ["model.the_tuva_project.readmissions__index_admission"], "model.the_tuva_project.readmissions__index_admission": ["model.the_tuva_project.readmissions__encounter_augmented"], "model.the_tuva_project.readmissions__index_discharge_requirement": ["model.the_tuva_project.readmissions__index_admission"], "model.the_tuva_project.readmissions__index_time_requirement": ["model.the_tuva_project.readmissions__index_admission"], "model.the_tuva_project.readmissions__planned_encounter": ["model.the_tuva_project.readmissions__encounter_augmented"], "model.the_tuva_project.readmissions__procedure_ccs": ["model.the_tuva_project.readmissions__encounter_specialty_cohort", "model.the_tuva_project.readmissions__planned_encounter", "model.the_tuva_project.readmissions__planned_encounter", "model.the_tuva_project.readmissions__planned_encounter"], "model.the_tuva_project.readmissions__readmission_crude": [], "model.the_tuva_project.readmissions__stg_core__condition": [], "model.the_tuva_project.readmissions__stg_core__encounter": ["model.the_tuva_project.readmissions__encounter"], "model.the_tuva_project.readmissions__stg_core__medical_claim": [], "model.the_tuva_project.readmissions__stg_core__procedure": ["model.the_tuva_project.readmissions__procedure_ccs"], "seed.the_tuva_project.terminology__admit_source": ["model.the_tuva_project.acute_inpatient__summary", "model.the_tuva_project.data_profiling__medical_claim_invalid_values", "model.the_tuva_project.emergency_department__summary"], "seed.the_tuva_project.terminology__admit_type": ["model.the_tuva_project.acute_inpatient__summary", "model.the_tuva_project.data_profiling__medical_claim_invalid_values", "model.the_tuva_project.emergency_department__summary"], "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.emergency_department__summary", "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", "model.the_tuva_project.insights__count_claim_by_date_column"], "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.emergency_department__summary", "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.acute_inpatient__summary", "model.the_tuva_project.core__stg_claims_condition", "model.the_tuva_project.data_profiling__medical_claim_invalid_values", "model.the_tuva_project.emergency_department__summary", "model.the_tuva_project.readmissions__encounter_with_ccs"], "seed.the_tuva_project.terminology__icd_10_pcs": ["model.the_tuva_project.core__stg_claims_procedure", "model.the_tuva_project.readmissions__procedure_ccs"], "seed.the_tuva_project.terminology__icd_9_cm": ["model.the_tuva_project.acute_inpatient__summary", "model.the_tuva_project.emergency_department__summary"], "seed.the_tuva_project.terminology__icd_9_pcs": [], "seed.the_tuva_project.terminology__loinc": [], "seed.the_tuva_project.terminology__loinc_deprecated_mapping": [], "seed.the_tuva_project.terminology__mdc": [], "seed.the_tuva_project.terminology__medicare_dual_eligibility": ["model.the_tuva_project.data_profiling__eligibility_invalid_values"], "seed.the_tuva_project.terminology__medicare_orec": ["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.emergency_department__summary", "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__summary", "model.the_tuva_project.emergency_department__summary"], "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_all_conditions", "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_all_conditions", "model.the_tuva_project.cms_hcc__int_all_conditions", "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__summary"], "seed.the_tuva_project.ed_classification__icd_10_cm_to_ccs": [], "seed.the_tuva_project.ed_classification__johnston_icd10": ["model.the_tuva_project.ed_classification__int_map_primary_dx", "test.the_tuva_project.not_null_ed_classification__johnston_icd10_icd10.d04e7f84c7", "test.the_tuva_project.unique_ed_classification__johnston_icd10_icd10.3d55f2b2dd"], "seed.the_tuva_project.ed_classification__johnston_icd9": ["model.the_tuva_project.ed_classification__int_map_primary_dx", "test.the_tuva_project.not_null_ed_classification__johnston_icd9_icd9.a7feea49c0", "test.the_tuva_project.unique_ed_classification__johnston_icd9_icd9.08c1dc4617"], "seed.the_tuva_project.quality_measures__concepts": [], "seed.the_tuva_project.quality_measures__measures": ["model.the_tuva_project.quality_measures__int_nqf0034_long", "model.the_tuva_project.quality_measures__int_nqf0034_long", "model.the_tuva_project.quality_measures__int_nqf0034_long", "model.the_tuva_project.quality_measures__int_nqf2372__performance_period", "model.the_tuva_project.quality_measures__int_nqf2372__performance_period", "model.the_tuva_project.quality_measures__int_nqf2372__performance_period"], "seed.the_tuva_project.quality_measures__value_sets": ["model.the_tuva_project.quality_measures__int_nqf0034__frailty", "model.the_tuva_project.quality_measures__int_nqf0034_denominator", "model.the_tuva_project.quality_measures__int_nqf0034_exclude_advanced_illness", "model.the_tuva_project.quality_measures__int_nqf0034_exclude_advanced_illness", "model.the_tuva_project.quality_measures__int_nqf0034_exclude_colectomy_cancer", "model.the_tuva_project.quality_measures__int_nqf0034_exclude_dementia", "model.the_tuva_project.quality_measures__int_nqf0034_exclude_hospice_palliative", "model.the_tuva_project.quality_measures__int_nqf0034_numerator", "model.the_tuva_project.quality_measures__int_nqf2372__frailty", "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__encounter_with_ccs"], "seed.the_tuva_project.readmissions__icd_10_pcs_to_ccs": ["model.the_tuva_project.readmissions__procedure_ccs"], "seed.the_tuva_project.readmissions__potentially_planned_ccs_procedure_category": ["model.the_tuva_project.readmissions__planned_encounter"], "seed.the_tuva_project.readmissions__potentially_planned_icd_10_pcs": ["model.the_tuva_project.readmissions__planned_encounter"], "seed.the_tuva_project.readmissions__specialty_cohort": ["model.the_tuva_project.readmissions__encounter_specialty_cohort", "model.the_tuva_project.readmissions__encounter_specialty_cohort"], "seed.the_tuva_project.readmissions__surgery_gynecology_cohort": ["model.the_tuva_project.readmissions__encounter_specialty_cohort"], "seed.the_tuva_project.service_category__service_categories": [], "test.the_tuva_project.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_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_wide_patient_id.02386b9158": [], "test.the_tuva_project.not_null_chronic_conditions__tuva_chronic_conditions_wide_patient_id.705b1ca561": [], "test.the_tuva_project.unique_cms_hcc__patient_risk_scores_patient_id.05b154e126": [], "test.the_tuva_project.unique_cms_hcc__int_demographic_factors_patient_id.1e7ac0d681": [], "test.the_tuva_project.not_null_cms_hcc__int_eligible_conditions_condition_code.e811a078bc": [], "test.the_tuva_project.not_null_cms_hcc__int_members_patient_id.75e528329b": [], "test.the_tuva_project.unique_cms_hcc__int_members_patient_id.4d202f2bbb": [], "test.the_tuva_project.unique_financial_pmpm__pmpm_prep__patient_id___year_month___plan_.b941ddaf9e": [], "test.the_tuva_project.not_null_quality_measures__stg_core__condition_patient_id.1f1222e348": [], "test.the_tuva_project.not_null_quality_measures__stg_core__encounter_patient_id.a0d82e2159": [], "test.the_tuva_project.not_null_quality_measures__stg_core__medication_patient_id.0aaf3a0652": [], "test.the_tuva_project.not_null_quality_measures__stg_core__observation_patient_id.31e33f2d7e": [], "test.the_tuva_project.not_null_quality_measures__stg_core__patient_patient_id.5510e1a0fd": [], "test.the_tuva_project.not_null_quality_measures__stg_core__patient_sex.e2f34cab69": [], "test.the_tuva_project.accepted_values_quality_measures__stg_core__patient_sex__female__male.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": [], "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": [], "model.the_tuva_project.core__patient": ["model.the_tuva_project.cms_chronic_conditions__stg_core__patient", "model.the_tuva_project.cms_hcc__stg_core__patient", "model.the_tuva_project.ed_classification__stg_patient", "model.the_tuva_project.quality_measures__stg_core__patient", "model.the_tuva_project.tuva_chronic_conditions__stg_core__patient"], "model.the_tuva_project.core__practitioner": [], "model.the_tuva_project.core__medical_claim": ["model.the_tuva_project.cms_hcc__stg_core__medical_claim", "model.the_tuva_project.financial_pmpm__stg_medical_claim", "model.the_tuva_project.insights__count_claim_by_claim_type", "model.the_tuva_project.insights__count_claim_by_date_column", "model.the_tuva_project.insights__count_claim_by_date_column", "model.the_tuva_project.insights__count_claim_by_date_column", "model.the_tuva_project.insights__count_claim_by_date_column", "model.the_tuva_project.insights__count_claim_by_date_column", "model.the_tuva_project.insights__count_claim_by_service_category", "model.the_tuva_project.insights__count_claim_by_service_category", "model.the_tuva_project.insights__orphan_claim_by_claim_type", "model.the_tuva_project.insights__sum_amount_by_claim_type", "model.the_tuva_project.insights__sum_amount_by_service_category", "model.the_tuva_project.insights__sum_amount_by_service_category", "model.the_tuva_project.insights__trend_count_claim_by_claim_type", "model.the_tuva_project.insights__trend_count_claim_by_service_category", "model.the_tuva_project.insights__trend_count_claim_by_service_category", "model.the_tuva_project.insights__trend_sum_amount_by_claim_type", "model.the_tuva_project.insights__trend_sum_amount_by_service_category", "model.the_tuva_project.insights__trend_sum_amount_by_service_category", "model.the_tuva_project.quality_measures__stg_medical_claim", "model.the_tuva_project.readmissions__stg_core__medical_claim", "test.the_tuva_project.unique_core__medical_claim__claim_id_claim_line_number_.b9ab42f1f0"], "test.the_tuva_project.unique_core__medical_claim__claim_id_claim_line_number_.b9ab42f1f0": [], "model.the_tuva_project.acute_inpatient__summary": ["model.the_tuva_project.core__stg_claims_encounter"], "model.the_tuva_project.quality_measures__summary_long": ["model.the_tuva_project.quality_measures__summary_counts", "model.the_tuva_project.quality_measures__summary_wide"], "model.the_tuva_project.quality_measures__summary_counts": [], "model.the_tuva_project.ed_classification__summary": [], "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.core__observation": ["model.the_tuva_project.quality_measures__stg_core__observation"], "model.the_tuva_project.core__location": [], "model.the_tuva_project.core__medication": ["model.the_tuva_project.quality_measures__stg_core__medication"], "model.the_tuva_project.core__pharmacy_claim": ["model.the_tuva_project.financial_pmpm__stg_pharmacy_claim", "model.the_tuva_project.insights__count_claim_by_claim_type", "model.the_tuva_project.insights__count_claim_by_date_column", "model.the_tuva_project.insights__count_claim_by_date_column", "model.the_tuva_project.insights__orphan_claim_by_claim_type", "model.the_tuva_project.insights__sum_amount_by_claim_type", "model.the_tuva_project.insights__trend_sum_amount_by_claim_type", "model.the_tuva_project.quality_measures__stg_pharmacy_claim"], "model.the_tuva_project.readmissions__readmission_summary": [], "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"], "test.the_tuva_project.unique_chronic_conditions__tuva_chronic_conditions_long__patient_id___condition_.c9509bb46f": [], "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": [], "model.input_layer.practitioner": ["model.the_tuva_project.core__stg_clinical_practitioner"], "model.input_layer.eligibility": ["model.the_tuva_project.acute_inpatient__stg_eligibility", "model.the_tuva_project.core__stg_claims_eligibility", "model.the_tuva_project.core__stg_claims_patient", "model.the_tuva_project.data_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_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_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.the_tuva_project.emergency_department__summary"], "model.input_layer.pharmacy_claim": ["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.input_layer.patient": ["model.the_tuva_project.core__stg_clinical_patient"], "model.input_layer.observation": ["model.the_tuva_project.core__stg_clinical_observation"], "model.input_layer.location": ["model.the_tuva_project.core__stg_clinical_location"], "model.input_layer.medication": ["model.the_tuva_project.core__stg_clinical_medication"], "model.the_tuva_project.cms_hcc__patient_hcc_history": [], "model.the_tuva_project.ccsr__long_condition_category": ["model.the_tuva_project.ccsr__singular_condition_category", "model.the_tuva_project.ed_classification__summary"], "model.the_tuva_project.ccsr__long_procedure_category": [], "model.the_tuva_project.core__lab_result": ["model.the_tuva_project.quality_measures__stg_core__lab_result"], "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__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__condition": ["model.the_tuva_project.ccsr__stg_core__condition", "model.the_tuva_project.cms_chronic_conditions__stg_core__condition", "model.the_tuva_project.cms_hcc__stg_core__condition", "model.the_tuva_project.quality_measures__stg_core__condition", "model.the_tuva_project.readmissions__stg_core__condition", "model.the_tuva_project.tuva_chronic_conditions__stg_core__condition"], "model.the_tuva_project.readmissions__encounter_augmented": ["model.the_tuva_project.readmissions__readmission_summary"], "model.input_layer.encounter": ["model.the_tuva_project.core__stg_clinical_encounter"], "model.input_layer.procedure": ["model.the_tuva_project.core__stg_clinical_procedure"], "model.input_layer.condition": ["model.the_tuva_project.core__stg_clinical_condition"], "model.input_layer.medical_claim": ["model.the_tuva_project.acute_inpatient__encounter_id", "model.the_tuva_project.acute_inpatient__first_claim_values", "model.the_tuva_project.acute_inpatient__last_claim_values", "model.the_tuva_project.acute_inpatient__stg_medical_claim", "model.the_tuva_project.acute_inpatient__summary", "model.the_tuva_project.cms_chronic_conditions__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.emergency_department__int_encounter_id", "model.the_tuva_project.emergency_department__int_first_claim_values", "model.the_tuva_project.emergency_department__int_institutional_claims", "model.the_tuva_project.emergency_department__int_last_claim_values", "model.the_tuva_project.emergency_department__int_professional_encounter_id", "model.the_tuva_project.emergency_department__summary", "model.the_tuva_project.emergency_department__summary", "model.the_tuva_project.service_category__stg_medical_claim"], "model.input_layer.lab_result": ["model.the_tuva_project.core__stg_clinical_lab_result"]}} \ No newline at end of file diff --git a/integration_tests/docs_generate/models/_models.yml b/integration_tests/docs_generate/models/_models.yml index 6d7a52067..25681ba42 100644 --- a/integration_tests/docs_generate/models/_models.yml +++ b/integration_tests/docs_generate/models/_models.yml @@ -23,11 +23,11 @@ models: - name: gender description: Biological sex of the patient. meta: - terminology: /terminology/demographics/gender + terminology: https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__gender.csv - name: race description: Race of the patient. meta: - terminology: /terminology/demographics/race + terminology: https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__race.csv - name: birth_date description: Date the patient was born. - name: death_date @@ -44,23 +44,23 @@ models: - name: payer_type description: Type of payer (e.g. commercial, medicare, medicaid, etc.). meta: - terminology: /terminology/tuva-concepts/payer-type + terminology: https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__payer_type.csv - name: plan description: Name of the plan (i.e. sub contract) providing coverage. - name: original_reason_entitlement_code description: Original reason for Medicare entitlement code. meta: - terminology: /terminology/administrative-codes/medicare-orec + terminology: https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__medicare_orec.csv - name: dual_status_code description: > Indicates whether the patient is dually eligible for Medicare and Medicaid. meta: - terminology: /terminology/administrative-codes/medicare-dual-eligibility + terminology: https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__medicare_dual_eligibility.csv - name: medicare_status_code description: Indicates how the patient became eligible for Medicare. meta: - terminology: /terminology/administrative-codes/medicare-status + terminology: https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__medicare_status.csv - name: first_name description: Patient's first name. - name: last_name @@ -102,7 +102,7 @@ models: Indicates whether the claim is professional (CMS-1500), institutional (UB-04), dental, or vision. meta: - terminology: /terminology/tuva-concepts/claim-type + terminology: https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__claim_type.csv - name: patient_id description: Unique identifier for each patient in the dataset. - name: member_id @@ -131,84 +131,87 @@ models: Indicates where the patient was before the healthcare encounter (inpatient claims only). meta: - terminology: /terminology/administrative-codes/admit-source + terminology: https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__admit_source.csv - name: admit_type_code description: Indicates the type of admission (inpatient claims only). meta: - terminology: /terminology/administrative-codes/admit-type + terminology: https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__admit_type.csv - 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 + terminology: https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__discharge_disposition.csv - name: place_of_service_code description: Place of service for the claim (professional claims only). meta: - terminology: /terminology/administrative-codes/place-of-service + terminology: https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__place_of_service.csv - name: bill_type_code description: Bill type code for the claim (institutional claims only). meta: - terminology: /terminology/administrative-codes/bill-type + terminology: https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__bill_type.csv - name: ms_drg_code description: MS-DRG for the claim (inpatient claims only). meta: - terminology: /terminology/conditions-and-procedures/ms-drg + terminology: https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__ms_drg.csv - name: apr_drg_code description: APR-DRG for the claim (inpatient claims only). meta: - terminology: /terminology/conditions-and-procedures/apr-drg + terminology: https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__apr_drg.csv - 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 + terminology: https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__revenue_center.csv - name: service_unit_quantity description: The number of units for the particular revenue center code. data_type: integer - name: hcpcs_code description: HCPCS level 1 or level 2 code for the claim line. meta: - terminology: /terminology/conditions-and-procedures/hcpcs-level-2 + terminology: https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__hcpcs_level_2.csv - name: hcpcs_modifier_1 description: 1st modifier for HCPCS code. meta: - terminology: /terminology/conditions-and-procedures/hcpcs-level-2 + terminology: https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__hcpcs_level_2.csv - name: hcpcs_modifier_2 description: 2nd modifier for HCPCS code. meta: - terminology: /terminology/conditions-and-procedures/hcpcs-level-2 + terminology: https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__hcpcs_level_2.csv - name: hcpcs_modifier_3 description: 3rd modifier for HCPCS code. meta: - terminology: /terminology/conditions-and-procedures/hcpcs-level-2 + terminology: https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__hcpcs_level_2.csv - name: hcpcs_modifier_4 description: 4th modifier for HCPCS code. meta: - terminology: /terminology/conditions-and-procedures/hcpcs-level-2 + terminology: https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__hcpcs_level_2.csv - name: hcpcs_modifier_5 description: 5th modifier for HCPCS code. meta: - terminology: /terminology/conditions-and-procedures/hcpcs-level-2 + terminology: https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__hcpcs_level_2.csv - name: rendering_npi description: > Rendering NPI for the claim (typically represents the physician or entity providing services). meta: - terminology: /terminology/providers/provider + terminology: https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__provider.csv + terminology_note: "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters." - name: billing_npi description: > Billing NPI for the claim (typically represents organization billing the claim). meta: - terminology: /terminology/providers/provider + terminology: https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__provider.csv + terminology_note: "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters." - name: facility_npi description: > Facility NPI for the claim (typically represents the facility where services were performed). meta: - terminology: /terminology/providers/provider + terminology: https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__provider.csv + terminology_note: "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters." - name: paid_date description: The date the claim was paid. - name: paid_amount @@ -229,337 +232,387 @@ models: description: The total amount paid on the claim by different parties. - name: diagnosis_code_type meta: - terminology: /terminology/tuva-concepts/code-type + terminology: https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__code_type.csv description: Indicates the type of diagnosis code (e.g. ICD-10-CM). - name: diagnosis_code_1 meta: - terminology: /terminology/conditions-and-procedures/icd-10-cm + terminology: https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__icd_10_cm.csv + terminology_note: "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters." description: 1st ICD (9 or 10) CM diagnosis code on the claim. - name: diagnosis_code_2 meta: - terminology: /terminology/conditions-and-procedures/icd-10-cm + terminology: https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__icd_10_cm.csv + terminology_note: "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters." description: 2nd ICD (9 or 10) CM diagnosis code on the claim. - name: diagnosis_code_3 meta: - terminology: /terminology/conditions-and-procedures/icd-10-cm + terminology: https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__icd_10_cm.csv + terminology_note: "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters." description: 3rd ICD (9 or 10) CM diagnosis code on the claim. - name: diagnosis_code_4 meta: - terminology: /terminology/conditions-and-procedures/icd-10-cm + terminology: https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__icd_10_cm.csv + terminology_note: "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters." description: 4th ICD (9 or 10) CM diagnosis code on the claim. - name: diagnosis_code_5 meta: - terminology: /terminology/conditions-and-procedures/icd-10-cm + terminology: https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__icd_10_cm.csv + terminology_note: "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters." description: 5th ICD (9 or 10) CM diagnosis code on the claim. - name: diagnosis_code_6 meta: - terminology: /terminology/conditions-and-procedures/icd-10-cm + terminology: https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__icd_10_cm.csv + terminology_note: "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters." description: 6th ICD (9 or 10) CM diagnosis code on the claim. - name: diagnosis_code_7 meta: - terminology: /terminology/conditions-and-procedures/icd-10-cm + terminology: https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__icd_10_cm.csv + terminology_note: "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters." description: 7th ICD (9 or 10) CM diagnosis code on the claim. - name: diagnosis_code_8 meta: - terminology: /terminology/conditions-and-procedures/icd-10-cm + terminology: https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__icd_10_cm.csv + terminology_note: "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters." description: 8th ICD (9 or 10) CM diagnosis code on the claim. - name: diagnosis_code_9 meta: - terminology: /terminology/conditions-and-procedures/icd-10-cm + terminology: https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__icd_10_cm.csv + terminology_note: "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters." description: 9th ICD (9 or 10) CM diagnosis code on the claim. - name: diagnosis_code_10 meta: - terminology: /terminology/conditions-and-procedures/icd-10-cm + terminology: https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__icd_10_cm.csv + terminology_note: "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters." description: 10th ICD (9 or 10) CM diagnosis code on the claim. - name: diagnosis_code_11 meta: - terminology: /terminology/conditions-and-procedures/icd-10-cm + terminology: https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__icd_10_cm.csv + terminology_note: "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters." description: 11th ICD (9 or 10) CM diagnosis code on the claim. - name: diagnosis_code_12 meta: - terminology: /terminology/conditions-and-procedures/icd-10-cm + terminology: https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__icd_10_cm.csv + terminology_note: "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters." description: 12th ICD (9 or 10) CM diagnosis code on the claim. - name: diagnosis_code_13 meta: - terminology: /terminology/conditions-and-procedures/icd-10-cm + terminology: https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__icd_10_cm.csv + terminology_note: "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters." description: 13th ICD (9 or 10) CM diagnosis code on the claim. - name: diagnosis_code_14 meta: - terminology: /terminology/conditions-and-procedures/icd-10-cm + terminology: https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__icd_10_cm.csv + terminology_note: "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters." description: 14th ICD (9 or 10) CM diagnosis code on the claim. - name: diagnosis_code_15 meta: - terminology: /terminology/conditions-and-procedures/icd-10-cm + terminology: https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__icd_10_cm.csv + terminology_note: "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters." description: 15th ICD (9 or 10) CM diagnosis code on the claim. - name: diagnosis_code_16 meta: - terminology: /terminology/conditions-and-procedures/icd-10-cm + terminology: https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__icd_10_cm.csv + terminology_note: "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters." description: 16th ICD (9 or 10) CM diagnosis code on the claim. - name: diagnosis_code_17 meta: - terminology: /terminology/conditions-and-procedures/icd-10-cm + terminology: https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__icd_10_cm.csv + terminology_note: "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters." description: 17th ICD (9 or 10) CM diagnosis code on the claim. - name: diagnosis_code_18 meta: - terminology: /terminology/conditions-and-procedures/icd-10-cm + terminology: https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__icd_10_cm.csv + terminology_note: "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters." description: 18th ICD (9 or 10) CM diagnosis code on the claim. - name: diagnosis_code_19 meta: - terminology: /terminology/conditions-and-procedures/icd-10-cm + terminology: https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__icd_10_cm.csv + terminology_note: "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters." description: 19th ICD (9 or 10) CM diagnosis code on the claim. - name: diagnosis_code_20 meta: - terminology: /terminology/conditions-and-procedures/icd-10-cm + terminology: https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__icd_10_cm.csv + terminology_note: "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters." description: 20th ICD (9 or 10) CM diagnosis code on the claim. - name: diagnosis_code_21 meta: - terminology: /terminology/conditions-and-procedures/icd-10-cm + terminology: https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__icd_10_cm.csv + terminology_note: "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters." description: 21st ICD (9 or 10) CM diagnosis code on the claim. - name: diagnosis_code_22 meta: - terminology: /terminology/conditions-and-procedures/icd-10-cm + terminology: https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__icd_10_cm.csv + terminology_note: "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters." description: 22nd ICD (9 or 10) CM diagnosis code on the claim. - name: diagnosis_code_23 meta: - terminology: /terminology/conditions-and-procedures/icd-10-cm + terminology: https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__icd_10_cm.csv + terminology_note: "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters." description: 23rd ICD (9 or 10) CM diagnosis code on the claim. - name: diagnosis_code_24 meta: - terminology: /terminology/conditions-and-procedures/icd-10-cm + terminology: https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__icd_10_cm.csv + terminology_note: "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters." description: 24th ICD (9 or 10) CM diagnosis code on the claim. - name: diagnosis_code_25 meta: - terminology: /terminology/conditions-and-procedures/icd-10-cm + terminology: https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__icd_10_cm.csv + terminology_note: "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters." description: 25th ICD (9 or 10) CM diagnosis code on the claim. - name: diagnosis_poa_1 description: > Present on admission code for the 1st diagnosis on the claim. meta: - terminology: /terminology/administrative-codes/present-on-admission + terminology: https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__present_on_admission.csv - name: diagnosis_poa_2 description: > Present on admission code for the 2nd diagnosis on the claim. meta: - terminology: /terminology/administrative-codes/present-on-admission + terminology: https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__present_on_admission.csv - name: diagnosis_poa_3 description: > Present on admission code for the 3rd diagnosis on the claim. meta: - terminology: /terminology/administrative-codes/present-on-admission + terminology: https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__present_on_admission.csv - name: diagnosis_poa_4 description: > Present on admission code for the 4th diagnosis on the claim. meta: - terminology: /terminology/administrative-codes/present-on-admission + terminology: https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__present_on_admission.csv - name: diagnosis_poa_5 description: > Present on admission code for the 5th diagnosis on the claim. meta: - terminology: /terminology/administrative-codes/present-on-admission + terminology: https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__present_on_admission.csv - name: diagnosis_poa_6 description: > Present on admission code for the 6th diagnosis on the claim. meta: - terminology: /terminology/administrative-codes/present-on-admission + terminology: https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__present_on_admission.csv - name: diagnosis_poa_7 description: > Present on admission code for the 7th diagnosis on the claim. meta: - terminology: /terminology/administrative-codes/present-on-admission + terminology: https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__present_on_admission.csv - name: diagnosis_poa_8 description: > Present on admission code for the 8th diagnosis on the claim. meta: - terminology: /terminology/administrative-codes/present-on-admission + terminology: https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__present_on_admission.csv - name: diagnosis_poa_9 description: > Present on admission code for the 9th diagnosis on the claim. meta: - terminology: /terminology/administrative-codes/present-on-admission + terminology: https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__present_on_admission.csv - name: diagnosis_poa_10 description: > Present on admission code for the 10th diagnosis on the claim. meta: - terminology: /terminology/administrative-codes/present-on-admission + terminology: https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__present_on_admission.csv - name: diagnosis_poa_11 description: > Present on admission code for the 11th diagnosis on the claim. meta: - terminology: /terminology/administrative-codes/present-on-admission + terminology: https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__present_on_admission.csv - name: diagnosis_poa_12 description: > Present on admission code for the 12th diagnosis on the claim. meta: - terminology: /terminology/administrative-codes/present-on-admission + terminology: https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__present_on_admission.csv - name: diagnosis_poa_13 description: > Present on admission code for the 13th diagnosis on the claim. meta: - terminology: /terminology/administrative-codes/present-on-admission + terminology: https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__present_on_admission.csv - name: diagnosis_poa_14 description: > Present on admission code for the 14th diagnosis on the claim. meta: - terminology: /terminology/administrative-codes/present-on-admission + terminology: https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__present_on_admission.csv - name: diagnosis_poa_15 description: > Present on admission code for the 15th diagnosis on the claim. meta: - terminology: /terminology/administrative-codes/present-on-admission + terminology: https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__present_on_admission.csv - name: diagnosis_poa_16 description: > Present on admission code for the 16th diagnosis on the claim. meta: - terminology: /terminology/administrative-codes/present-on-admission + terminology: https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__present_on_admission.csv - name: diagnosis_poa_17 description: > Present on admission code for the 17th diagnosis on the claim. meta: - terminology: /terminology/administrative-codes/present-on-admission + terminology: https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__present_on_admission.csv - name: diagnosis_poa_18 description: > Present on admission code for the 18th diagnosis on the claim. meta: - terminology: /terminology/administrative-codes/present-on-admission + terminology: https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__present_on_admission.csv - name: diagnosis_poa_19 description: > Present on admission code for the 19th diagnosis on the claim. meta: - terminology: /terminology/administrative-codes/present-on-admission + terminology: https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__present_on_admission.csv - name: diagnosis_poa_20 description: > Present on admission code for the 20th diagnosis on the claim. meta: - terminology: /terminology/administrative-codes/present-on-admission + terminology: https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__present_on_admission.csv - name: diagnosis_poa_21 description: > Present on admission code for the 21st diagnosis on the claim. meta: - terminology: /terminology/administrative-codes/present-on-admission + terminology: https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__present_on_admission.csv - name: diagnosis_poa_22 description: > Present on admission code for the 22nd diagnosis on the claim. meta: - terminology: /terminology/administrative-codes/present-on-admission + terminology: https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__present_on_admission.csv - name: diagnosis_poa_23 description: > Present on admission code for the 23rd diagnosis on the claim. meta: - terminology: /terminology/administrative-codes/present-on-admission + terminology: https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__present_on_admission.csv - name: diagnosis_poa_24 description: > Present on admission code for the 24th diagnosis on the claim. meta: - terminology: /terminology/administrative-codes/present-on-admission + terminology: https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__present_on_admission.csv - name: diagnosis_poa_25 description: > Present on admission code for the 25th diagnosis on the claim. meta: - terminology: /terminology/administrative-codes/present-on-admission + terminology: https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__present_on_admission.csv - name: procedure_code_type description: Indicates the type of procedure code (e.g. ICD-10-PCS). meta: - terminology: /terminology/tuva-concepts/code-type + terminology: https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__code_type.csv - name: procedure_code_1 description: 1st ICD (9 or 10) procedure code on the claim. meta: - terminology: /terminology/conditions-and-procedures/icd-10-pcs + terminology: https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__icd_10_pcs.csv + terminology_note: "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters." - name: procedure_code_2 description: 2nd ICD (9 or 10) procedure code on the claim. meta: - terminology: /terminology/conditions-and-procedures/icd-10-pcs + terminology: https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__icd_10_pcs.csv + terminology_note: "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters." - name: procedure_code_3 description: 3rd ICD (9 or 10) procedure code on the claim. meta: - terminology: /terminology/conditions-and-procedures/icd-10-pcs + terminology: https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__icd_10_pcs.csv + terminology_note: "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters." - name: procedure_code_4 description: 4th ICD (9 or 10) procedure code on the claim. meta: - terminology: /terminology/conditions-and-procedures/icd-10-pcs + terminology: https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__icd_10_pcs.csv + terminology_note: "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters." - name: procedure_code_5 description: 5th ICD (9 or 10) procedure code on the claim. meta: - terminology: /terminology/conditions-and-procedures/icd-10-pcs + terminology: https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__icd_10_pcs.csv + terminology_note: "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters." - name: procedure_code_6 description: 6th ICD (9 or 10) procedure code on the claim. meta: - terminology: /terminology/conditions-and-procedures/icd-10-pcs + terminology: https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__icd_10_pcs.csv + terminology_note: "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters." - name: procedure_code_7 description: 7th ICD (9 or 10) procedure code on the claim. meta: - terminology: /terminology/conditions-and-procedures/icd-10-pcs + terminology: https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__icd_10_pcs.csv + terminology_note: "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters." - name: procedure_code_8 description: 8th ICD (9 or 10) procedure code on the claim. meta: - terminology: /terminology/conditions-and-procedures/icd-10-pcs + terminology: https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__icd_10_pcs.csv + terminology_note: "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters." - name: procedure_code_9 description: 9th ICD (9 or 10) procedure code on the claim. meta: - terminology: /terminology/conditions-and-procedures/icd-10-pcs + terminology: https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__icd_10_pcs.csv + terminology_note: "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters." - name: procedure_code_10 description: 10th ICD (9 or 10) procedure code on the claim. meta: - terminology: /terminology/conditions-and-procedures/icd-10-pcs + terminology: https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__icd_10_pcs.csv + terminology_note: "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters." - name: procedure_code_11 description: 11th ICD (9 or 10) procedure code on the claim. meta: - terminology: /terminology/conditions-and-procedures/icd-10-pcs + terminology: https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__icd_10_pcs.csv + terminology_note: "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters." - name: procedure_code_12 description: 12th ICD (9 or 10) procedure code on the claim. meta: - terminology: /terminology/conditions-and-procedures/icd-10-pcs + terminology: https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__icd_10_pcs.csv + terminology_note: "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters." - name: procedure_code_13 description: 13th ICD (9 or 10) procedure code on the claim. meta: - terminology: /terminology/conditions-and-procedures/icd-10-pcs + terminology: https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__icd_10_pcs.csv + terminology_note: "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters." - name: procedure_code_14 description: 14th ICD (9 or 10) procedure code on the claim. meta: - terminology: /terminology/conditions-and-procedures/icd-10-pcs + terminology: https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__icd_10_pcs.csv + terminology_note: "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters." - name: procedure_code_15 description: 15th ICD (9 or 10) procedure code on the claim. meta: - terminology: /terminology/conditions-and-procedures/icd-10-pcs + terminology: https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__icd_10_pcs.csv + terminology_note: "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters." - name: procedure_code_16 description: 16th ICD (9 or 10) procedure code on the claim. meta: - terminology: /terminology/conditions-and-procedures/icd-10-pcs + terminology: https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__icd_10_pcs.csv + terminology_note: "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters." - name: procedure_code_17 description: 17th ICD (9 or 10) procedure code on the claim. meta: - terminology: /terminology/conditions-and-procedures/icd-10-pcs + terminology: https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__icd_10_pcs.csv + terminology_note: "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters." - name: procedure_code_18 description: 18th ICD (9 or 10) procedure code on the claim. meta: - terminology: /terminology/conditions-and-procedures/icd-10-pcs + terminology: https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__icd_10_pcs.csv + terminology_note: "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters." - name: procedure_code_19 description: 19th ICD (9 or 10) procedure code on the claim. meta: - terminology: /terminology/conditions-and-procedures/icd-10-pcs + terminology: https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__icd_10_pcs.csv + terminology_note: "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters." - name: procedure_code_20 description: 20th ICD (9 or 10) procedure code on the claim. meta: - terminology: /terminology/conditions-and-procedures/icd-10-pcs + terminology: https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__icd_10_pcs.csv + terminology_note: "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters." - name: procedure_code_21 description: 21st ICD (9 or 10) procedure code on the claim. meta: - terminology: /terminology/conditions-and-procedures/icd-10-pcs + terminology: https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__icd_10_pcs.csv + terminology_note: "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters." - name: procedure_code_22 description: 22nd ICD (9 or 10) procedure code on the claim. meta: - terminology: /terminology/conditions-and-procedures/icd-10-pcs + terminology: https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__icd_10_pcs.csv + terminology_note: "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters." - name: procedure_code_23 description: 23rd ICD (9 or 10) procedure code on the claim. meta: - terminology: /terminology/conditions-and-procedures/icd-10-pcs + terminology: https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__icd_10_pcs.csv + terminology_note: "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters." - name: procedure_code_24 description: 24th ICD (9 or 10) procedure code on the claim. meta: - terminology: /terminology/conditions-and-procedures/icd-10-pcs + terminology: https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__icd_10_pcs.csv + terminology_note: "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters." - name: procedure_code_25 description: 25th ICD (9 or 10) procedure code on the claim. meta: - terminology: /terminology/conditions-and-procedures/icd-10-pcs + terminology: https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__icd_10_pcs.csv + terminology_note: "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters." - name: procedure_date_1 description: Date of the 1st procedure on the claim. - name: procedure_date_2 @@ -646,18 +699,20 @@ models: NPI for the provider that wrote the prescription (e.g. priamry care physician). meta: - terminology: /terminology/providers/provider + terminology: https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__provider.csv + terminology_note: "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters." - name: dispensing_provider_npi description: > NPI for the provider that dispensed the prescription (e.g. pharmacy). meta: - terminology: /terminology/providers/provider + terminology: https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__provider.csv + terminology_note: "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters." - name: dispensing_date description: Date the prescription was filled. - name: ndc_code description: National drug code on the claim. meta: - terminology: /terminology/medications/ndc + terminology: https://www.fda.gov/drugs/drug-approvals-and-databases/national-drug-code-directory - name: quantity description: Number of doses. data_type: integer @@ -720,22 +775,24 @@ models: The type of condition code reported in the source system e.g. ICD-10-CM. meta: - terminology: /terminology/tuva-concepts/code-type + terminology: https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__code_type.csv - name: source_code description: > The condition code in the source system e.g. the ICD-10 code. meta: - terminology: /terminology/conditions-and-procedures/icd-10-cm + terminology: https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__icd_10_cm.csv + terminology_note: "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters." - name: source_description description: Description of the condition code in the source system. - name: normalized_code_type description: The normalized type of condition code. meta: - terminology: /terminology/tuva-concepts/code-type + terminology: https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__code_type.csv - name: normalized_code description: The normalized condition code. meta: - terminology: /terminology/conditions-and-procedures/icd-10-cm + terminology: https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__icd_10_cm.csv + terminology_note: "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters." - name: normalized_description description: Normalized description of the condition code. - name: condition_rank @@ -748,7 +805,7 @@ models: - name: present_on_admit_code description: The present_on_admit_code related to the condition. meta: - terminology: /terminology/administrative-codes/present-on-admission + terminology: https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__present_on_admission.csv - name: present_on_admit_description description: > The description of the present_on_admit_code for the condition. @@ -775,7 +832,7 @@ models: Indicates the type of encounter e.g. acute inpatient, emergency department, etc. meta: - terminology: /terminology/tuva-concepts/encounter-type + terminology: https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__encounter_type.csv - name: encounter_start_date description: Date when the encounter started. - name: encounter_end_date @@ -787,54 +844,59 @@ models: - name: admit_source_code description: Admission source code for the encounter. meta: - terminology: /terminology/administrative-codes/admit-source + terminology: https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__admit_source.csv - name: admit_source_description description: Description of the admit_source_code for the encounter. - name: admit_type_code description: Admission type code for the encounter. meta: - terminology: /terminology/administrative-codes/admit-type + terminology: https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__admit_type.csv - name: admit_type_description description: Description of the admit_type_code for the encounter. - name: discharge_disposition_code description: Discharge disposition code for the encounter. meta: - terminology: /terminology/administrative-codes/discharge-disposition + terminology: https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__discharge_disposition.csv - name: discharge_disposition_description description: > Description of the discharge_disposition_code for the encounter. - name: attending_provider_id description: attending provider for the encounter. meta: - terminology: /terminology/providers/provider + terminology: https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__provider.csv + terminology_note: "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters." - name: facility_npi description: > Facility NPI for the encounter (typically represents the facility where services were performed). meta: - terminology: /terminology/providers/provider + terminology: https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__provider.csv + terminology_note: "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters." - name: primary_diagnosis_code_type description: > The type of condition code reported in the source system e.g. ICD-10-CM. meta: - terminology: /terminology/tuva-concepts/code-type + terminology: https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__code_type.csv - name: primary_diagnosis_code description: > Primary diagnosis code for the encounter. If from claims the primary diagnosis code comes from the institutional claim. + meta: + terminology: https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__icd_10_cm.csv + terminology_note: "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters." - name: primary_diagnosis_description description: Description of the primary diagnosis code. - name: ms_drg_code description: MS-DRG code for the encounter. meta: - terminology: /terminology/conditions-and-procedures/ms-drg + terminology: https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__ms_drg.csv - name: ms_drg_description description: Description of the ms_drg_code. - name: apr_drg_code description: APR-DRG code for the encounter. meta: - terminology: /terminology/conditions-and-procedures/apr-drg + terminology: https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__apr_drg.csv - name: apr_drg_description description: Description of the APR-DRG code. - name: paid_amount @@ -872,21 +934,37 @@ models: description: The lab order number from the source system. - name: source_code_type description: The code type from the source system. + meta: + terminology: https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__code_type.csv - name: source_code description: The code for the lab from the source system. + meta: + terminology: https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__loinc.csv + terminology_note: "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters." - name: source_description description: The description for the lab test from the source system. - name: source_component description: > The description for the component of the test from the source system. + meta: + terminology: https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__loinc.csv + terminology_note: "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters." - name: normalized_code_type description: The normalized code type. + meta: + terminology: https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__code_type.csv - name: normalized_code description: The normalized code e.g. LOINC. + meta: + terminology: https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__loinc.csv + terminology_note: "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters." - name: normalized_description description: The normalized description for the code. - name: normalized_component description: The normalized component. + meta: + terminology: https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__loinc.csv + terminology_note: "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters." - name: status description: The status of the lab test. - name: result @@ -916,6 +994,9 @@ models: - name: ordering_practitioner_id description: > Unique identifier for the practitioner who ordered the lab test. + meta: + terminology: https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__provider.csv + terminology_note: "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters." - name: data_source description: Custom description of the source system e.g. Epic. @@ -933,6 +1014,9 @@ models: description: > The national provider identifier associated with the location e.g. facility_npi. + meta: + terminology: https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__provider.csv + terminology_note: "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters." - name: name description: The name of the location. - name: facility_type @@ -974,6 +1058,8 @@ models: description: Date the medication was prescribed. - name: source_code_type description: The source code type of the medication. + meta: + terminology: https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__code_type.csv - name: source_code description: The source code for the medication. - name: source_description @@ -982,12 +1068,18 @@ models: description: National drug code associated with the medication. - name: ndc_description description: Description for the NDC. + meta: + terminology: https://www.fda.gov/drugs/drug-approvals-and-databases/national-drug-code-directory - name: rxnorm_code description: RxNorm code associated with the medication. + meta: + terminology: https://www.nlm.nih.gov/research/umls/rxnorm/index.html - name: rxnorm_description description: Description for the RxNorm code. - name: atc_code description: ATC code for the medication. + meta: + terminology: https://www.who.int/tools/atc-ddd-toolkit/atc-classification - name: atc_description description: Description for the ATC code. - name: route @@ -1028,6 +1120,8 @@ models: description: Type of observation. - name: source_code_type description: Source code type of the observation. + meta: + terminology: https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__code_type.csv - name: source_code description: Source code of the observation. - name: source_description @@ -1072,11 +1166,11 @@ models: - name: sex description: The gender of the patient. meta: - terminology: /terminology/demographics/gender + terminology: https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__gender.csv - name: race description: The race of the patient. meta: - terminology: /terminology/demographics/race + terminology: https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__race.csv - name: birth_date description: The birth date of the patient. - name: death_date @@ -1116,7 +1210,8 @@ models: - name: npi description: NPI for the provider. meta: - terminology: /terminology/providers/provider + terminology: https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__provider.csv + terminology_note: "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters." - name: first_name description: First name of the provider. - name: last_name @@ -1155,37 +1250,51 @@ models: description: > Type of procedure code for the procedure in the source system. meta: - terminology: /terminology/tuva-concepts/code-type + terminology: https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__code_type.csv - name: source_code description: The procedure code in the source system. meta: - terminology: /terminology/conditions-and-procedures/icd-10-pcs + terminology: https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__icd_10_pcs.csv + terminology_note: "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters." - name: source_description description: Description of the procedure code. - name: normalized_code_type description: Normalized type of procedure code for the procedure. meta: - terminology: /terminology/tuva-concepts/code-type + terminology: https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__code_type.csv - name: normalized_code description: The normalized procedure code. meta: - terminology: /terminology/conditions-and-procedures/icd-10-pcs + terminology: https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__icd_10_pcs.csv + terminology_note: "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters." + terminology_note: "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters." - name: normalized_description description: Description of the procedure code. - name: modifier_1 description: First modifier for the procedure code. + meta: + terminology: https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__hcpcs_level_2.csv - name: modifier_2 description: Second modifier for the procedure code. + meta: + terminology: https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__hcpcs_level_2.csv - name: modifier_3 description: Third modifier for the procedure code. + meta: + terminology: https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__hcpcs_level_2.csv - name: modifier_4 description: Fourth modifier for the procedure code. + meta: + terminology: https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__hcpcs_level_2.csv - name: modifier_5 description: Fifth modifier for the procedure code. + meta: + terminology: https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__hcpcs_level_2.csv - name: practitioner_id description: ID of the provider who performed the procedure. meta: - terminology: /terminology/providers/provider + terminology: https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__provider.csv + terminology_note: "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters." - name: data_source description: > User-configured field that indicates the data source (e.g. typically diff --git a/models/ccsr/ccsr_models.yml b/models/ccsr/ccsr_models.yml index 0d6b2f121..9c3ededb0 100644 --- a/models/ccsr/ccsr_models.yml +++ b/models/ccsr/ccsr_models.yml @@ -100,6 +100,9 @@ models: description: Unique identifier for each patient. - name: normalized_code description: "The ICD-10-CM code for the diagnosis." + meta: + terminology: https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__icd_10_cm.csv + terminology_note: "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters." - name: code_description description: "The ICD-10-CM code description provided in the CCSR CSV seed file." - name: condition_rank @@ -195,6 +198,9 @@ models: description: Unique identifier for each patient. - name: normalized_code description: The ICD-10-PCS code for the procedure. + meta: + terminology: https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__icd_10_pcs.csv + terminology_note: "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters." - name: code_description description: "The ICD-10-PCS code description provided in the CCSR CSV seed file." - name: ccsr_parent_category diff --git a/models/chronic_conditions/cms_chronic_conditions_models.yml b/models/chronic_conditions/cms_chronic_conditions_models.yml index fb85bc191..b225db11d 100644 --- a/models/chronic_conditions/cms_chronic_conditions_models.yml +++ b/models/chronic_conditions/cms_chronic_conditions_models.yml @@ -284,18 +284,18 @@ models: The type of chronic condition as defined by CMS. ('Common' or 'Other chronic or potentially disabling conditions') meta: - terminology: /value-sets/chronic-conditions/cms-chronic-conditions + terminology: https://github.com/tuva-health/the_tuva_project/blob/main/seeds/value_sets/chronic_conditions/chronic_conditions__cms_chronic_conditions_hierarchy.csv - name: condition_category description: > The category of the condition (e.g. Cardiovascular Disease). meta: - terminology: /value-sets/chronic-conditions/cms-chronic-conditions + terminology: https://github.com/tuva-health/the_tuva_project/blob/main/seeds/value_sets/chronic_conditions/chronic_conditions__cms_chronic_conditions_hierarchy.csv - name: condition description: The name of the chronic condition. tests: - not_null meta: - terminology: /value-sets/chronic-conditions/cms-chronic-conditions + terminology: https://github.com/tuva-health/the_tuva_project/blob/main/seeds/value_sets/chronic_conditions/chronic_conditions__cms_chronic_conditions_hierarchy.csv - name: data_source description: > Indicates the name of the source dataset (e.g. Medicare Claims). diff --git a/models/chronic_conditions/tuva_chronic_conditions_models.yml b/models/chronic_conditions/tuva_chronic_conditions_models.yml index e790a0ad9..fe772c3f2 100644 --- a/models/chronic_conditions/tuva_chronic_conditions_models.yml +++ b/models/chronic_conditions/tuva_chronic_conditions_models.yml @@ -29,12 +29,12 @@ models: A higher level rollup grouping of conditions from the condition column meta: - terminology: /value-sets/chronic-conditions/tuva-chronic-conditions + terminology: https://github.com/tuva-health/the_tuva_project/blob/main/seeds/value_sets/chronic_conditions/chronic_conditions__tuva_chronic_conditions_hierarchy.csv - name: condition description: > The name of the condition that each diagnosis code rolls up to meta: - terminology: /value-sets/chronic-conditions/tuva-chronic-conditions + terminology: https://github.com/tuva-health/the_tuva_project/blob/main/seeds/value_sets/chronic_conditions/chronic_conditions__tuva_chronic_conditions_hierarchy.csv - name: first_diagnosis_date description: > The first date when a diagnosis code that rolls up to this condition diff --git a/models/claims_preprocessing/claims_preprocessing_models.yml b/models/claims_preprocessing/claims_preprocessing_models.yml index f17c851e7..49767189d 100644 --- a/models/claims_preprocessing/claims_preprocessing_models.yml +++ b/models/claims_preprocessing/claims_preprocessing_models.yml @@ -30,11 +30,11 @@ models: - name: gender description: The gender of the patient. meta: - terminology: /terminology/demographics/gender + terminology: https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__gender.csv - name: race description: The race of the patient. meta: - terminology: /terminology/demographics/race + terminology: https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__race.csv - name: facility_npi description: The NPI for the facility where the encounter occurred. - name: provider_first_name @@ -44,47 +44,37 @@ models: - name: ms_drg_code description: The MS-DRG code associted with the inpatient visit meta: - terminology: /terminology/conditions-and-procedures/ms-drg + terminology: https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__ms_drg.csv - name: ms_drg_description description: The MS-DRG description associted with the inpatient visit - meta: - terminology: /terminology/conditions-and-procedures/ms-drg - name: medical_surgical description: Indicates whether the MS-DRG is medical or surgical in nature. meta: - terminology: /terminology/conditions-and-procedures/ms-drg + terminology: https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__ms_drg.csv - name: apr_drg_code description: The APR-DRG code associted with the inpatient visit meta: - terminology: /terminology/conditions-and-procedures/apr-drg + terminology: https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__apr_drg.csv - name: apr_drg_description description: The APR-DRG description associted with the inpatient visit - meta: - terminology: /terminology/conditions-and-procedures/apr-drg - name: admit_source_code description: Admission source code for the encounter. meta: - terminology: /terminology/administrative-codes/admit-source + terminology: https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__admit_source.csv - name: admit_source_description description: Admission source description for the encounter. - meta: - terminology: /terminology/administrative-codes/admit-source - name: admit_type_code description: Admission type code for the encounter. meta: - terminology: /terminology/administrative-codes/admit-type + terminology: https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__admit_type.csv - name: admit_type_description description: Admission type description for the encounter. - meta: - terminology: /terminology/administrative-codes/admit-type - name: discharge_disposition_code description: Discharge disposition code for the encounter. meta: - terminology: /terminology/administrative-codes/discharge-disposition + terminology: https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__discharge_disposition.csv - name: discharge_disposition_description description: Discharge disposition description for the encounter. - meta: - terminology: /terminology/administrative-codes/discharge-disposition - name: total_paid_amount description: The total paid amount across all claims for the encounter. - name: total_allowed_amount @@ -92,7 +82,7 @@ models: - name: total_charge_amount description: The total charge amount across all claims for the encounter. - name: length_of_stay - description: The length of stay for the encoujnter. + description: The length of stay for the encounter. - name: mortality_flag description: 1 if a patient died during the encounter, 0 otherwise. - name: data_source diff --git a/models/cms_hcc/cms_hcc_models.yml b/models/cms_hcc/cms_hcc_models.yml index 5aedd0ad6..60ad83bf9 100644 --- a/models/cms_hcc/cms_hcc_models.yml +++ b/models/cms_hcc/cms_hcc_models.yml @@ -21,9 +21,13 @@ models: description: The type of condition. - name: icd_10_cm_code description: The ICD-10-CM condition code. + meta: + terminology: https://github.com/tuva-health/the_tuva_project/blob/main/seeds/value_sets/cms_hcc/cms_hcc__icd_10_cm_mappings.csv - name: hcc_code description: > HCC code from the latest CMS HCC model available in the mart. + meta: + terminology: https://github.com/tuva-health/the_tuva_project/blob/main/seeds/value_sets/cms_hcc/cms_hcc__icd_10_cm_mappings.csv - name: hcc_description description: > HCC description from the latest CMS HCC model available in the mart. diff --git a/models/core/core_models.yml b/models/core/core_models.yml index 5da89c309..23eb8110d 100644 --- a/models/core/core_models.yml +++ b/models/core/core_models.yml @@ -38,22 +38,24 @@ models: The type of condition code reported in the source system e.g. ICD-10-CM. meta: - terminology: /terminology/tuva-concepts/code-type + terminology: https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__code_type.csv - name: source_code description: > The condition code in the source system e.g. the ICD-10 code. meta: - terminology: /terminology/conditions-and-procedures/icd-10-cm + terminology: https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__icd_10_cm.csv + terminology_note: "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters." - name: source_description description: Description of the condition code in the source system. - name: normalized_code_type description: The normalized type of condition code. meta: - terminology: /terminology/tuva-concepts/code-type + terminology: https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__code_type.csv - name: normalized_code description: The normalized condition code. meta: - terminology: /terminology/conditions-and-procedures/icd-10-cm + terminology: https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__icd_10_cm.csv + terminology_note: "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters." - name: normalized_description description: Normalized description of the condition code. - name: condition_rank @@ -66,7 +68,7 @@ models: - name: present_on_admit_code description: The present_on_admit_code related to the condition. meta: - terminology: /terminology/administrative-codes/present-on-admission + terminology: https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__present_on_admission.csv - name: present_on_admit_description description: > The description of the present_on_admit_code for the condition. @@ -112,23 +114,23 @@ models: - name: payer_type description: Type of payer (e.g. commercial, medicare, medicaid, etc.). meta: - terminology: /terminology/tuva-concepts/payer-type + terminology: https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__payer_type.csv - name: plan description: Name of the plan (i.e. sub contract) providing coverage. - name: original_reason_entitlement_code description: Original reason for Medicare entitlement code. meta: - terminology: /terminology/administrative-codes/medicare-orec + terminology: https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__medicare_orec.csv - name: dual_status_code description: > Indicates whether the patient is dually eligible for Medicare and Medicaid. meta: - terminology: /terminology/administrative-codes/medicare-dual-eligibility + terminology: https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__medicare_dual_eligibility.csv - name: medicare_status_code description: Indicates how the patient became eligible for Medicare. meta: - terminology: /terminology/administrative-codes/medicare-status + terminology: https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__medicare_status.csv - name: data_source description: > User-configured field that indicates the data source (e.g. typically @@ -161,7 +163,7 @@ models: Indicates the type of encounter e.g. acute inpatient, emergency department, etc. meta: - terminology: /terminology/tuva-concepts/encounter-type + terminology: https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__encounter_type.csv - name: encounter_start_date description: Date when the encounter started. - name: encounter_end_date @@ -173,54 +175,59 @@ models: - name: admit_source_code description: Admission source code for the encounter. meta: - terminology: /terminology/administrative-codes/admit-source + terminology: https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__admit_source.csv - name: admit_source_description description: Description of the admit_source_code for the encounter. - name: admit_type_code description: Admission type code for the encounter. meta: - terminology: /terminology/administrative-codes/admit-type + terminology: https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__admit_type.csv - name: admit_type_description description: Description of the admit_type_code for the encounter. - name: discharge_disposition_code description: Discharge disposition code for the encounter. meta: - terminology: /terminology/administrative-codes/discharge-disposition + terminology: https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__discharge_disposition.csv - name: discharge_disposition_description description: > Description of the discharge_disposition_code for the encounter. - name: attending_provider_id description: attending provider for the encounter. meta: - terminology: /terminology/providers/provider + terminology: https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__provider.csv + terminology_note: "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters." - name: facility_npi description: > Facility NPI for the encounter (typically represents the facility where services were performed). meta: - terminology: /terminology/providers/provider + terminology: https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__provider.csv + terminology_note: "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters." - name: primary_diagnosis_code_type description: > The type of condition code reported in the source system e.g. ICD-10-CM. meta: - terminology: /terminology/tuva-concepts/code-type + terminology: https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__code_type.csv - name: primary_diagnosis_code description: > Primary diagnosis code for the encounter. If from claims the primary diagnosis code comes from the institutional claim. + meta: + terminology: https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__icd_10_cm.csv + terminology_note: "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters." - name: primary_diagnosis_description description: Description of the primary diagnosis code. - name: ms_drg_code description: MS-DRG code for the encounter. meta: - terminology: /terminology/conditions-and-procedures/ms-drg + terminology: https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__ms_drg.csv - name: ms_drg_description description: Description of the ms_drg_code. - name: apr_drg_code description: APR-DRG code for the encounter. meta: - terminology: /terminology/conditions-and-procedures/apr-drg + terminology: https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__apr_drg.csv - name: apr_drg_description description: Description of the APR-DRG code. - name: paid_amount @@ -266,21 +273,37 @@ models: description: The lab order number from the source system. - name: source_code_type description: The code type from the source system. + meta: + terminology: https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__code_type.csv - name: source_code description: The code for the lab from the source system. + meta: + terminology: https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__loinc.csv + terminology_note: "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters." - name: source_description description: The description for the lab test from the source system. - name: source_component description: > The description for the component of the test from the source system. + meta: + terminology: https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__loinc.csv + terminology_note: "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters." - name: normalized_code_type description: The normalized code type. + meta: + terminology: https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__code_type.csv - name: normalized_code description: The normalized code e.g. LOINC. + meta: + terminology: https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__loinc.csv + terminology_note: "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters." - name: normalized_description description: The normalized description for the code. - name: normalized_component description: The normalized component. + meta: + terminology: https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__loinc.csv + terminology_note: "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters." - name: status description: The status of the lab test. - name: result @@ -310,6 +333,9 @@ models: - name: ordering_practitioner_id description: > Unique identifier for the practitioner who ordered the lab test. + meta: + terminology: https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__provider.csv + terminology_note: "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters." - name: data_source description: Custom description of the source system e.g. Epic. - name: tuva_last_run @@ -336,6 +362,9 @@ models: description: > The national provider identifier associated with the location e.g. facility_npi. + meta: + terminology: https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__provider.csv + terminology_note: "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters." - name: name description: The name of the location. - name: facility_type @@ -388,7 +417,7 @@ models: Indicates whether the claim is professional (CMS-1500), institutional (UB-04), dental, or vision. meta: - terminology: /terminology/tuva-concepts/claim-type + terminology: https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__claim_type.csv - name: patient_id description: Unique identifier for each patient in the dataset. - name: member_id @@ -417,84 +446,87 @@ models: Indicates where the patient was before the healthcare encounter (inpatient claims only). meta: - terminology: /terminology/administrative-codes/admit-source + terminology: https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__admit_source.csv - name: admit_type_code description: Indicates the type of admission (inpatient claims only). meta: - terminology: /terminology/administrative-codes/admit-type + terminology: https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__admit_type.csv - 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 + terminology: https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__discharge_disposition.csv - name: place_of_service_code description: Place of service for the claim (professional claims only). meta: - terminology: /terminology/administrative-codes/place-of-service + terminology: https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__place_of_service.csv - name: bill_type_code description: Bill type code for the claim (institutional claims only). meta: - terminology: /terminology/administrative-codes/bill-type + terminology: https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__bill_type.csv - name: ms_drg_code description: MS-DRG for the claim (inpatient claims only). meta: - terminology: /terminology/conditions-and-procedures/ms-drg + terminology: https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__ms_drg.csv - name: apr_drg_code description: APR-DRG for the claim (inpatient claims only). meta: - terminology: /terminology/conditions-and-procedures/apr-drg + terminology: https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__apr_drg.csv - 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 + terminology: https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__revenue_center.csv - name: service_unit_quantity description: The number of units for the particular revenue center code. data_type: integer - name: hcpcs_code description: HCPCS level 1 or level 2 code for the claim line. meta: - terminology: /terminology/conditions-and-procedures/hcpcs-level-2 + terminology: https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__hcpcs_level_2.csv - name: hcpcs_modifier_1 description: 1st modifier for HCPCS code. meta: - terminology: /terminology/conditions-and-procedures/hcpcs-level-2 + terminology: https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__hcpcs_level_2.csv - name: hcpcs_modifier_2 description: 2nd modifier for HCPCS code. meta: - terminology: /terminology/conditions-and-procedures/hcpcs-level-2 + terminology: https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__hcpcs_level_2.csv - name: hcpcs_modifier_3 description: 3rd modifier for HCPCS code. meta: - terminology: /terminology/conditions-and-procedures/hcpcs-level-2 + terminology: https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__hcpcs_level_2.csv - name: hcpcs_modifier_4 description: 4th modifier for HCPCS code. meta: - terminology: /terminology/conditions-and-procedures/hcpcs-level-2 + terminology: https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__hcpcs_level_2.csv - name: hcpcs_modifier_5 description: 5th modifier for HCPCS code. meta: - terminology: /terminology/conditions-and-procedures/hcpcs-level-2 + terminology: https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__hcpcs_level_2.csv - name: rendering_npi description: > Rendering NPI for the claim (typically represents the physician or entity providing services). meta: - terminology: /terminology/providers/provider + terminology: https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__provider.csv + terminology_note: "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters." - name: billing_npi description: > Billing NPI for the claim (typically represents organization billing the claim). meta: - terminology: /terminology/providers/provider + terminology: https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__provider.csv + terminology_note: "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters." - name: facility_npi description: > Facility NPI for the claim (typically represents the facility where services were performed). meta: - terminology: /terminology/providers/provider + terminology: https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__provider.csv + terminology_note: "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters." - name: paid_date description: The date the claim was paid. - name: paid_amount @@ -521,10 +553,10 @@ models: - name: service_category_1 description: The broader service category this claim belongs to. meta: - terminology: /value-sets/service-category + terminology: https://github.com/tuva-health/the_tuva_project/blob/main/seeds/value_sets/service_categories/service_category__service_categories.csv - name: service_category_2 meta: - terminology: /value-sets/service-category + terminology: https://github.com/tuva-health/the_tuva_project/blob/main/seeds/value_sets/service_categories/service_category__service_categories.csv description: The more specific service category this claim belongs to. - name: data_source description: > @@ -560,20 +592,30 @@ models: description: Date the medication was prescribed. - name: source_code_type description: The source code type of the medication. + meta: + terminology: https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__code_type.csv - name: source_code description: The source code for the medication. + meta: + terminology: https://www.nlm.nih.gov/research/umls/rxnorm/index.html - name: source_description description: The source description of the medication. - name: ndc_code description: National drug code associated with the medication. + meta: + terminology: https://www.fda.gov/drugs/drug-approvals-and-databases/national-drug-code-directory - name: ndc_description description: Description for the NDC. - name: rxnorm_code description: RxNorm code associated with the medication. + meta: + terminology: https://www.nlm.nih.gov/research/umls/rxnorm/index.html - name: rxnorm_description description: Description for the RxNorm code. - name: atc_code description: ATC code for the medication. + meta: + terminology: https://www.who.int/tools/atc-ddd-toolkit/atc-classification - name: atc_description description: Description for the ATC code. - name: route @@ -589,6 +631,9 @@ models: - name: practitioner_id description: > Unique identifier for the practitioner who ordered the medication. + meta: + terminology: https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__provider.csv + terminology_note: "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters." - name: data_source description: Custom description of the source system e.g. Epic. - name: tuva_last_run @@ -623,6 +668,8 @@ models: description: Type of observation. - name: source_code_type description: Source code type of the observation. + meta: + terminology: https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__code_type.csv - name: source_code description: Source code of the observation. - name: source_description @@ -672,11 +719,11 @@ models: - name: sex description: The gender of the patient. meta: - terminology: /terminology/demographics/gender + terminology: https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__gender.csv - name: race description: The race of the patient. meta: - terminology: /terminology/demographics/race + terminology: https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__race.csv - name: birth_date description: The birth date of the patient. - name: death_date @@ -747,16 +794,20 @@ models: NPI for the provider that wrote the prescription (e.g. priamry care physician). meta: - terminology: /terminology/providers/provider + terminology: https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__provider.csv + terminology_note: "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters." - name: dispensing_provider_npi description: > NPI for the provider that dispensed the prescription (e.g. pharmacy). meta: - terminology: /terminology/providers/provider + terminology: https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__provider.csv + terminology_note: "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters." - name: dispensing_date description: Date the prescription was filled. - name: ndc_code description: National drug code on the claim. + meta: + terminology: https://www.fda.gov/drugs/drug-approvals-and-databases/national-drug-code-directory - name: quantity description: Number of doses. data_type: integer @@ -806,7 +857,8 @@ models: - name: npi description: NPI for the provider. meta: - terminology: /terminology/providers/provider + terminology: https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__provider.csv + terminology_note: "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters." - name: provider_first_name description: First name of the provider. - name: provider_last_name @@ -854,37 +906,52 @@ models: description: > Type of procedure code for the procedure in the source system. meta: - terminology: /terminology/tuva-concepts/code-type + terminology: https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__code_type.csv - name: source_code description: The procedure code in the source system. meta: - terminology: /terminology/conditions-and-procedures/icd-10-pcs + terminology: https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__icd_10_pcs.csv + terminology_note: "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters." - name: source_description description: Description of the procedure code. - name: normalized_code_type description: Normalized type of procedure code for the procedure. meta: - terminology: /terminology/tuva-concepts/code-type + terminology: https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__code_type.csv - name: normalized_code description: The normalized procedure code. meta: - terminology: /terminology/conditions-and-procedures/icd-10-pcs + terminology: https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__icd_10_pcs.csv + terminology_note: "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters." - name: normalized_description description: Description of the procedure code. + meta: + terminology: https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__hcpcs_level_2.csv - name: modifier_1 description: First modifier for the procedure code. + meta: + terminology: https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__hcpcs_level_2.csv - name: modifier_2 description: Second modifier for the procedure code. + meta: + terminology: https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__hcpcs_level_2.csv - name: modifier_3 description: Third modifier for the procedure code. + meta: + terminology: https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__hcpcs_level_2.csv - name: modifier_4 description: Fourth modifier for the procedure code. + meta: + terminology: https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__hcpcs_level_2.csv - name: modifier_5 description: Fifth modifier for the procedure code. + meta: + terminology: https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__hcpcs_level_2.csv - name: practitioner_id description: ID of the provider who performed the procedure. meta: - terminology: /terminology/providers/provider + terminology: https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__provider.csv + terminology_note: "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters." - name: data_source description: > User-configured field that indicates the data source (e.g. typically diff --git a/models/ed_classification/ed_classification_models.yml b/models/ed_classification/ed_classification_models.yml index 7f4d2784a..b47e6b88f 100644 --- a/models/ed_classification/ed_classification_models.yml +++ b/models/ed_classification/ed_classification_models.yml @@ -18,7 +18,7 @@ models: - name: classification description: ED classification categories - name: claim_id - description: Unique identifer for each claim + description: Unique identifier for each claim - name: patient_id description: Unique identifier for each person across all datasets - name: recorded_date diff --git a/models/quality_measures/quality_measures_models.yml b/models/quality_measures/quality_measures_models.yml index 86a31e691..b3b67f3db 100644 --- a/models/quality_measures/quality_measures_models.yml +++ b/models/quality_measures/quality_measures_models.yml @@ -13,10 +13,16 @@ models: columns: - name: measure_id description: Unique measure identification number. + meta: + terminology: https://github.com/tuva-health/the_tuva_project/blob/main/seeds/value_sets/quality_measures/quality_measures__measures.csv - name: measure_name description: Name of the measure. + meta: + terminology: https://github.com/tuva-health/the_tuva_project/blob/main/seeds/value_sets/quality_measures/quality_measures__measures.csv - name: measure_version description: Version of the measure. + meta: + terminology: https://github.com/tuva-health/the_tuva_project/blob/main/seeds/value_sets/quality_measures/quality_measures__measures.csv - name: performance_period_begin description: Beginning date of the performance or measurement period. - name: performance_period_end @@ -86,10 +92,16 @@ models: description: Ending date of the performance or measurement period. - name: measure_id description: Unique measure identification number. + meta: + terminology: https://github.com/tuva-health/the_tuva_project/blob/main/seeds/value_sets/quality_measures/quality_measures__measures.csv - name: measure_name description: Name of the measure. + meta: + terminology: https://github.com/tuva-health/the_tuva_project/blob/main/seeds/value_sets/quality_measures/quality_measures__measures.csv - name: measure_version description: Version of the measure. + meta: + terminology: https://github.com/tuva-health/the_tuva_project/blob/main/seeds/value_sets/quality_measures/quality_measures__measures.csv - name: tuva_last_run description: The date and timestamp of the dbt run. diff --git a/models/readmissions/readmissions_models.yml b/models/readmissions/readmissions_models.yml index 394a05616..c54fa6a62 100644 --- a/models/readmissions/readmissions_models.yml +++ b/models/readmissions/readmissions_models.yml @@ -23,16 +23,17 @@ models: - name: discharge_disposition_code description: "The valid 2-digit discharge status for the inpatient visit" meta: - terminology: /terminology/administrative-codes/discharge-disposition + terminology: https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__discharge_disposition.csv - name: facility_npi description: "A name or ID for the facility where the inpatient visit occured" meta: - terminology: /terminology/providers/provider + terminology: https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__provider.csv + terminology_note: "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters." - name: ms_drg_code description: "The MS-DRG associted with the inpatient visit" meta: - terminology: /terminology/conditions-and-procedures/ms-drg - - name: total_paid_amount + terminology: https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__ms_drg.csv + - name: paid_amount description: "The number of dollars paid on the encounter" - name: length_of_stay description: "Integer representing the length of stay of the inpatient visit in days" @@ -46,12 +47,14 @@ models: - name: specialty_cohort description: "Specialty cohort the encounter belongs to" meta: - terminology: /value-sets/readmissions/specialty-cohort + terminology: https://github.com/tuva-health/the_tuva_project/blob/main/seeds/value_sets/readmissions/readmissions__specialty_cohort.csv - name: died_flag description: "Flag to indicate of the patient died in this encounter" data_type: boolean - name: diagnosis_ccs description: "CCS code associated with the primary diagnosis for the encounter" + meta: + terminology: https://github.com/tuva-health/the_tuva_project/blob/main/seeds/value_sets/readmissions/readmissions__acute_diagnosis_ccs.csv - 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." data_type: boolean @@ -116,15 +119,16 @@ models: - name: discharge_disposition_code description: "The valid 2-digit discharge status for the inpatient visit" meta: - terminology: /terminology/administrative-codes/discharge-disposition + terminology: https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__discharge_disposition.csv - name: facility_npi description: "A name or ID for the facility where the inpatient visit occured" meta: - terminology: /terminology/providers/provider + terminology: https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__provider.csv + terminology_note: "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters." - name: ms_drg_code description: "The MS-DRG associted with the inpatient visit" meta: - terminology: /terminology/conditions-and-procedures/ms-drg + terminology: https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__ms_drg.csv - name: total_paid_amount description: "The amount paid for the visit" - name: length_of_stay @@ -139,12 +143,14 @@ models: - name: specialty_cohort description: "Specialty cohort the encounter belongs to" meta: - terminology: /value-sets/readmissions/specialty-cohort + terminology: https://github.com/tuva-health/the_tuva_project/blob/main/seeds/value_sets/readmissions/readmissions__specialty_cohort.csv - name: died_flag description: "Flag to indicate of the patient died in this encounter" data_type: boolean - name: diagnosis_ccs description: "CCS code associated with the primary diagnosis for the encounter" + meta: + terminology: https://github.com/tuva-health/the_tuva_project/blob/main/seeds/value_sets/readmissions/readmissions__acute_diagnosis_ccs.csv - name: had_readmission_flag description: "A flag to indicate whether the encounter had a readmission any number of days after discharge" data_type: boolean @@ -168,15 +174,16 @@ models: - name: readmission_discharge_disposition_code description: "The valid 2-digit discharge status for the readmission inpatient visit" meta: - terminology: /terminology/administrative-codes/discharge-disposition + terminology: https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__discharge_disposition.csv - name: readmission_facility description: "A name or ID for the facility where the readmission inpatient visit occured" meta: - terminology: /terminology/providers/provider + terminology: https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__provider.csv + terminology_note: "**Note: this terminology set is too large to be loaded as a seed and is instead loaded from public cloud storage for supported adapters." - name: readmission_ms_drg description: "The MS-DRG associted with the readmission inpatient visit" meta: - terminology: /terminology/conditions-and-procedures/ms-drg + terminology: https://github.com/tuva-health/the_tuva_project/blob/main/seeds/terminology/terminology__ms_drg.csv - name: readmission_length_of_stay description: "Integer representing the length of stay of the readmission inpatient visit in days" data_type: integer @@ -189,12 +196,14 @@ models: - name: readmission_specialty_cohort description: "Specialty cohort the readmission encounter belongs to" meta: - terminology: /value-sets/readmissions/specialty-cohort + terminology: https://github.com/tuva-health/the_tuva_project/blob/main/seeds/value_sets/readmissions/readmissions__specialty_cohort.csv - name: readmission_died_flag description: "Flag to indicate of the patient died in the readmission encounter" data_type: boolean - name: readmission_diagnosis_ccs description: "CCS code associated with the primary diagnosis for the readmission encounter" + meta: + terminology: https://github.com/tuva-health/the_tuva_project/blob/main/seeds/value_sets/readmissions/readmissions__acute_diagnosis_ccs.csv - 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.