Skip to content

Commit

Permalink
Fixes issue with payer and plan causing financial_pmpm joins to miss
Browse files Browse the repository at this point in the history
  • Loading branch information
evan-tetzlaff-harbor committed Dec 26, 2023
1 parent d4eccf6 commit 24398cb
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
6 changes: 3 additions & 3 deletions models/intermediate/dme_claims.sql
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ select
, 'professional' as claim_type
, cast(bene_mbi_id as {{ dbt.type_string() }} ) as patient_id
, cast(bene_mbi_id as {{ dbt.type_string() }} ) as member_id
, cast(NULL as {{ dbt.type_string() }} ) as payer
, cast(NULL as {{ dbt.type_string() }} ) as plan
, 'medicare' as payer
, 'medicare' as plan
, {{ try_to_cast_date('clm_from_dt', 'YYYY-MM-DD') }} as claim_start_date
, {{ try_to_cast_date('clm_thru_dt', 'YYYY-MM-DD') }} as claim_end_date
, {{ try_to_cast_date('clm_line_from_dt', 'YYYY-MM-DD') }} as claim_line_start_date
Expand Down Expand Up @@ -141,4 +141,4 @@ select
, cast(NULL as date) as procedure_date_24
, cast(NULL as date) as procedure_date_25
, 'medicare cclf' as data_source
from {{ source('medicare_cclf','partb_dme')}}
from {{ source('medicare_cclf','partb_dme')}}
6 changes: 3 additions & 3 deletions models/intermediate/institutional_claims.sql
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ select
, 'institutional' as claim_type
, cast(h.bene_mbi_id as {{ dbt.type_string() }} ) as patient_id
, cast(h.bene_mbi_id as {{ dbt.type_string() }} ) as member_id
, cast(NULL as {{ dbt.type_string() }} ) as payer
, cast(NULL as {{ dbt.type_string() }} ) as plan
, 'medicare' as payer
, 'medicare' as plan
, {{ try_to_cast_date('h.clm_from_dt', 'YYYY-MM-DD') }} as claim_start_date
, {{ try_to_cast_date('h.clm_thru_dt', 'YYYY-MM-DD') }} as claim_end_date
, cast(NULL as date) as claim_line_start_date
Expand Down Expand Up @@ -194,4 +194,4 @@ left join {{ source('medicare_cclf','parta_claims_revenue_center_detail')}} d
left join {{ ref('procedure_pivot')}} px
on cast(a.claim_id as {{ dbt.type_string() }} ) = cast(px.cur_clm_uniq_id as {{ dbt.type_string() }} )
left join {{ ref('diagnosis_pivot')}} dx
on cast(a.claim_id as {{ dbt.type_string() }} ) = cast(dx.cur_clm_uniq_id as {{ dbt.type_string() }} )
on cast(a.claim_id as {{ dbt.type_string() }} ) = cast(dx.cur_clm_uniq_id as {{ dbt.type_string() }} )
6 changes: 3 additions & 3 deletions models/intermediate/physician_claims.sql
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ select
, 'professional' as claim_type
, cast(bene_mbi_id as {{ dbt.type_string() }} ) as patient_id
, cast(bene_mbi_id as {{ dbt.type_string() }} ) as member_id
, cast(NULL as {{ dbt.type_string() }} ) as payer
, cast(NULL as {{ dbt.type_string() }} ) as plan
, 'medicare' as payer
, 'medicare' as plan
, {{ try_to_cast_date('clm_from_dt', 'YYYY-MM-DD') }} as claim_start_date
, {{ try_to_cast_date('clm_thru_dt', 'YYYY-MM-DD') }} as claim_end_date
, {{ try_to_cast_date('clm_line_from_dt', 'YYYY-MM-DD') }} as claim_line_start_date
Expand Down Expand Up @@ -144,4 +144,4 @@ select
, cast(NULL as date) as procedure_date_24
, cast(NULL as date) as procedure_date_25
, 'medicare cclf' as data_source
from {{ source('medicare_cclf','partb_physicians')}}
from {{ source('medicare_cclf','partb_physicians')}}

0 comments on commit 24398cb

Please sign in to comment.