Skip to content

Commit

Permalink
Update input layer mapping
Browse files Browse the repository at this point in the history
  • Loading branch information
sarah-tuva committed Dec 18, 2024
1 parent 7d7c63f commit 1a831d3
Show file tree
Hide file tree
Showing 8 changed files with 19 additions and 19 deletions.
6 changes: 3 additions & 3 deletions models/_models.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ models:
- enrollment_start_date
- enrollment_end_date
columns:
- name: patient_id
- name: person_id
tests:
- not_null
- name: member_id
Expand Down Expand Up @@ -50,7 +50,7 @@ models:
- name: claim_line_number
tests:
- not_null
- name: patient_id
- name: person_id
tests:
- not_null
- name: member_id
Expand Down Expand Up @@ -116,7 +116,7 @@ models:
- name: claim_line_number
tests:
- not_null
- name: patient_id
- name: person_id
tests:
- not_null
- name: member_id
Expand Down
4 changes: 2 additions & 2 deletions models/final/eligibility.sql
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -138,7 +138,7 @@ with demographics as (
)

select
patient_id
person_id
, member_id
, subscriber_id
, gender
Expand Down
2 changes: 1 addition & 1 deletion models/final/medical_claim.sql
Original file line number Diff line number Diff line change
Expand Up @@ -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') }}
Expand Down
4 changes: 2 additions & 2 deletions models/final/pharmacy_claim.sql
Original file line number Diff line number Diff line change
Expand Up @@ -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') }}
Expand Down Expand Up @@ -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') }}
Expand Down
6 changes: 3 additions & 3 deletions models/intermediate/int_dme_claim_deduped.sql
Original file line number Diff line number Diff line change
Expand Up @@ -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') }}
Expand Down Expand Up @@ -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') }}
Expand Down Expand Up @@ -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') }}
Expand Down
6 changes: 3 additions & 3 deletions models/intermediate/int_institutional_claim_deduped.sql
Original file line number Diff line number Diff line change
Expand Up @@ -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') }}
Expand Down Expand Up @@ -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') }}
Expand Down Expand Up @@ -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') }}
Expand Down
4 changes: 2 additions & 2 deletions models/intermediate/int_pharmacy_claim_deduped.sql
Original file line number Diff line number Diff line change
Expand Up @@ -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') }}
Expand Down Expand Up @@ -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') }}
Expand Down
6 changes: 3 additions & 3 deletions models/intermediate/int_physician_claim_deduped.sql
Original file line number Diff line number Diff line change
Expand Up @@ -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') }}
Expand Down Expand Up @@ -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') }}
Expand Down Expand Up @@ -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') }}
Expand Down

0 comments on commit 1a831d3

Please sign in to comment.