From 1a831d3a5b09bc95d7ff1641864f65c9941f911c Mon Sep 17 00:00:00 2001 From: sarah-tuva Date: Wed, 18 Dec 2024 11:46:57 -0700 Subject: [PATCH] Update input layer mapping --- models/_models.yml | 6 +++--- models/final/eligibility.sql | 4 ++-- models/final/medical_claim.sql | 2 +- models/final/pharmacy_claim.sql | 4 ++-- models/intermediate/int_dme_claim_deduped.sql | 6 +++--- models/intermediate/int_institutional_claim_deduped.sql | 6 +++--- models/intermediate/int_pharmacy_claim_deduped.sql | 4 ++-- models/intermediate/int_physician_claim_deduped.sql | 6 +++--- 8 files changed, 19 insertions(+), 19 deletions(-) diff --git a/models/_models.yml b/models/_models.yml index a9e8fbf1..f8c574af 100644 --- a/models/_models.yml +++ b/models/_models.yml @@ -16,7 +16,7 @@ models: - enrollment_start_date - enrollment_end_date columns: - - name: patient_id + - name: person_id tests: - not_null - name: member_id @@ -50,7 +50,7 @@ models: - name: claim_line_number tests: - not_null - - name: patient_id + - name: person_id tests: - not_null - name: member_id @@ -116,7 +116,7 @@ models: - name: claim_line_number tests: - not_null - - name: patient_id + - name: person_id tests: - not_null - name: member_id diff --git a/models/final/eligibility.sql b/models/final/eligibility.sql index 874a5ac3..ca62888c 100644 --- a/models/final/eligibility.sql +++ b/models/final/eligibility.sql @@ -69,7 +69,7 @@ with demographics as ( , joined as ( select - cast(demographics.current_bene_mbi_id as {{ dbt.type_string() }} ) as patient_id + cast(demographics.current_bene_mbi_id as {{ dbt.type_string() }} ) as person_id , cast(demographics.current_bene_mbi_id as {{ dbt.type_string() }} ) as member_id , cast(null as {{ dbt.type_string() }} ) as subscriber_id , case demographics.bene_sex_cd @@ -138,7 +138,7 @@ with demographics as ( ) select - patient_id + person_id , member_id , subscriber_id , gender diff --git a/models/final/medical_claim.sql b/models/final/medical_claim.sql index a9632e26..30af2706 100644 --- a/models/final/medical_claim.sql +++ b/models/final/medical_claim.sql @@ -16,7 +16,7 @@ select claim_id , claim_line_number , claim_type - , patient_id + , person_id , member_id , payer , {{ the_tuva_project.quote_column('plan') }} diff --git a/models/final/pharmacy_claim.sql b/models/final/pharmacy_claim.sql index 7380cd9a..085446fe 100644 --- a/models/final/pharmacy_claim.sql +++ b/models/final/pharmacy_claim.sql @@ -9,7 +9,7 @@ with deduped_claims as ( select cast(claim_id as {{ dbt.type_string() }}) as claim_id , cast(claim_line_number as integer) as claim_line_number - , cast(patient_id as {{ dbt.type_string() }}) as patient_id + , cast(person_id as {{ dbt.type_string() }}) as person_id , cast(member_id as {{ dbt.type_string() }}) as member_id , cast(payer as {{ dbt.type_string() }}) as payer , cast({{ the_tuva_project.quote_column('plan') }} as {{ dbt.type_string() }}) as {{ the_tuva_project.quote_column('plan') }} @@ -38,7 +38,7 @@ with deduped_claims as ( select claim_id , claim_line_number - , patient_id + , person_id , member_id , payer , {{ the_tuva_project.quote_column('plan') }} diff --git a/models/intermediate/int_dme_claim_deduped.sql b/models/intermediate/int_dme_claim_deduped.sql index 9d14ee2d..152503e4 100644 --- a/models/intermediate/int_dme_claim_deduped.sql +++ b/models/intermediate/int_dme_claim_deduped.sql @@ -110,7 +110,7 @@ with sort_adjusted_claims as ( cur_clm_uniq_id as claim_id , clm_line_num as claim_line_number , cast('professional' as {{ dbt.type_string() }} ) as claim_type - , current_bene_mbi_id as patient_id + , current_bene_mbi_id as person_id , current_bene_mbi_id as member_id , cast('medicare' as {{ dbt.type_string() }} ) as payer , cast('medicare'as {{ dbt.type_string() }} ) as {{ the_tuva_project.quote_column('plan') }} @@ -279,7 +279,7 @@ with sort_adjusted_claims as ( cast(claim_id as {{ dbt.type_string() }} ) as claim_id , cast(claim_line_number as integer) as claim_line_number , cast(claim_type as {{ dbt.type_string() }} ) as claim_type - , cast(patient_id as {{ dbt.type_string() }} ) as patient_id + , cast(person_id as {{ dbt.type_string() }} ) as person_id , cast(member_id as {{ dbt.type_string() }} ) as member_id , cast(payer as {{ dbt.type_string() }} ) as payer , cast({{ the_tuva_project.quote_column('plan') }} as {{ dbt.type_string() }} ) as {{ the_tuva_project.quote_column('plan') }} @@ -431,7 +431,7 @@ select claim_id , claim_line_number , claim_type - , patient_id + , person_id , member_id , payer , {{ the_tuva_project.quote_column('plan') }} diff --git a/models/intermediate/int_institutional_claim_deduped.sql b/models/intermediate/int_institutional_claim_deduped.sql index fa47b89a..bad62148 100644 --- a/models/intermediate/int_institutional_claim_deduped.sql +++ b/models/intermediate/int_institutional_claim_deduped.sql @@ -344,7 +344,7 @@ with sort_adjusted_claims as ( /* fill in line number for claims with no revenue center details */ , coalesce(cast(clm_line_num as integer), 1) as claim_line_number , cast('institutional' as {{ dbt.type_string() }} ) as claim_type - , current_bene_mbi_id as patient_id + , current_bene_mbi_id as person_id , current_bene_mbi_id as member_id , cast('medicare' as {{ dbt.type_string() }} ) as payer , cast('medicare'as {{ dbt.type_string() }} ) as {{ the_tuva_project.quote_column('plan') }} @@ -545,7 +545,7 @@ with sort_adjusted_claims as ( cast(claim_id as {{ dbt.type_string() }} ) as claim_id , cast(claim_line_number as integer) as claim_line_number , cast(claim_type as {{ dbt.type_string() }} ) as claim_type - , cast(patient_id as {{ dbt.type_string() }} ) as patient_id + , cast(person_id as {{ dbt.type_string() }} ) as person_id , cast(member_id as {{ dbt.type_string() }} ) as member_id , cast(payer as {{ dbt.type_string() }} ) as payer , cast({{ the_tuva_project.quote_column('plan') }} as {{ dbt.type_string() }} ) as {{ the_tuva_project.quote_column('plan') }} @@ -697,7 +697,7 @@ select claim_id , claim_line_number , claim_type - , patient_id + , person_id , member_id , payer , {{ the_tuva_project.quote_column('plan') }} diff --git a/models/intermediate/int_pharmacy_claim_deduped.sql b/models/intermediate/int_pharmacy_claim_deduped.sql index 0f2eec8b..e0f3a8b7 100644 --- a/models/intermediate/int_pharmacy_claim_deduped.sql +++ b/models/intermediate/int_pharmacy_claim_deduped.sql @@ -89,7 +89,7 @@ with sort_adjusted_claims as ( select cur_clm_uniq_id as claim_id , 1 as claim_line_number - , current_bene_mbi_id as patient_id + , current_bene_mbi_id as person_id , current_bene_mbi_id as member_id , cast('medicare' as {{ dbt.type_string() }} ) as payer , cast('medicare'as {{ dbt.type_string() }} ) as {{ the_tuva_project.quote_column('plan') }} @@ -126,7 +126,7 @@ with sort_adjusted_claims as ( select claim_id , claim_line_number - , patient_id + , person_id , member_id , payer , {{ the_tuva_project.quote_column('plan') }} diff --git a/models/intermediate/int_physician_claim_deduped.sql b/models/intermediate/int_physician_claim_deduped.sql index 2195d058..39d8b9fa 100644 --- a/models/intermediate/int_physician_claim_deduped.sql +++ b/models/intermediate/int_physician_claim_deduped.sql @@ -148,7 +148,7 @@ with sort_adjusted_claims as ( cur_clm_uniq_id as claim_id , clm_line_num as claim_line_number , cast('professional' as {{ dbt.type_string() }} ) as claim_type - , current_bene_mbi_id as patient_id + , current_bene_mbi_id as person_id , current_bene_mbi_id as member_id , cast('medicare' as {{ dbt.type_string() }} ) as payer , cast('medicare' as {{ dbt.type_string() }} ) as {{ the_tuva_project.quote_column('plan') }} @@ -321,7 +321,7 @@ with sort_adjusted_claims as ( cast(claim_id as {{ dbt.type_string() }} ) as claim_id , cast(claim_line_number as integer) as claim_line_number , cast(claim_type as {{ dbt.type_string() }} ) as claim_type - , cast(patient_id as {{ dbt.type_string() }} ) as patient_id + , cast(person_id as {{ dbt.type_string() }} ) as person_id , cast(member_id as {{ dbt.type_string() }} ) as member_id , cast(payer as {{ dbt.type_string() }} ) as payer , cast({{ the_tuva_project.quote_column('plan') }} as {{ dbt.type_string() }} ) as {{ the_tuva_project.quote_column('plan') }} @@ -473,7 +473,7 @@ select claim_id , claim_line_number , claim_type - , patient_id + , person_id , member_id , payer , {{ the_tuva_project.quote_column('plan') }}