Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

replacing patient_id with person_id #37

Merged
merged 2 commits into from
Dec 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions models/final/eligibility.sql
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ with eligibility_unpivot as (
, joined as (

select
cast(enrollment_span.desy_sort_key as {{ dbt.type_string() }} ) as patient_id
cast(enrollment_span.desy_sort_key as {{ dbt.type_string() }} ) as person_id
, cast(enrollment_span.desy_sort_key as {{ dbt.type_string() }} ) as member_id
, cast(enrollment_span.desy_sort_key as {{ dbt.type_string() }} ) as subscriber_id
, case eligibility_unpivot.sex_code
Expand Down Expand Up @@ -195,7 +195,7 @@ with eligibility_unpivot as (
)

select
patient_id
person_id
, member_id
, subscriber_id
, gender
Expand Down
6 changes: 3 additions & 3 deletions models/final/medical_claim.sql
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ with unioned as (
, member_months as (

select distinct
a.patient_id
a.person_id
, year_nbr
, month_nbr
, a.payer
Expand All @@ -46,7 +46,7 @@ select
c.claim_id
, c.claim_line_number
, c.claim_type
, c.patient_id
, c.person_id
, c.member_id
, c.payer
, c.plan
Expand Down Expand Up @@ -192,6 +192,6 @@ select
, c.ingest_datetime
from unioned as c
inner join member_months as mm
on c.patient_id = mm.patient_id
on c.person_id = mm.person_id
and extract(year from c.claim_start_date) = mm.year_nbr
and extract(month from c.claim_start_date) = mm.month_nbr
2 changes: 1 addition & 1 deletion models/final/pharmacy_claim.sql
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
select
cast(null as {{ dbt.type_string() }}) as claim_id
, cast(null as {{ dbt.type_string() }}) as claim_line_number
, cast(null as {{ dbt.type_string() }}) as patient_id
, cast(null as {{ dbt.type_string() }}) as person_id
, cast(null as {{ dbt.type_string() }}) as member_id
, cast(null as {{ dbt.type_string() }}) as payer
, cast(null as {{ dbt.type_string() }}) as plan
Expand Down
2 changes: 1 addition & 1 deletion models/intermediate/carrier_claim.sql
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ select
as claim_id
, cast(l.line_num as integer) as claim_line_number
, 'professional' as claim_type
, cast(b.desy_sort_key as {{ dbt.type_string() }} ) as patient_id
, cast(b.desy_sort_key as {{ dbt.type_string() }} ) as person_id
, cast(b.desy_sort_key as {{ dbt.type_string() }} ) as member_id
, cast('medicare' as {{ dbt.type_string() }} ) as payer
, cast('medicare' as {{ dbt.type_string() }} ) as plan
Expand Down
2 changes: 1 addition & 1 deletion models/intermediate/dme_claim.sql
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ select
as claim_id
, cast(l.clm_line_num as integer) as claim_line_number
, 'professional' as claim_type
, cast(b.desy_sort_key as {{ dbt.type_string() }} ) as patient_id
, cast(b.desy_sort_key as {{ dbt.type_string() }} ) as person_id
, cast(b.desy_sort_key as {{ dbt.type_string() }} ) as member_id
, cast('medicare' as {{ dbt.type_string() }} ) as payer
, cast('medicare' as {{ dbt.type_string() }} ) as plan
Expand Down
2 changes: 1 addition & 1 deletion models/intermediate/home_health_claim.sql
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ select
as claim_id
, cast(l.clm_line_num as integer) as claim_line_number
, 'institutional' as claim_type
, cast(b.desy_sort_key as {{ dbt.type_string() }} ) as patient_id
, cast(b.desy_sort_key as {{ dbt.type_string() }} ) as person_id
, cast(b.desy_sort_key as {{ dbt.type_string() }} ) as member_id
, cast('medicare' as {{ dbt.type_string() }} ) as payer
, cast('medicare' as {{ dbt.type_string() }} ) as plan
Expand Down
2 changes: 1 addition & 1 deletion models/intermediate/hospice_claim.sql
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ select
as claim_id
, cast(l.clm_line_num as integer) as claim_line_number
, 'institutional' as claim_type
, cast(b.desy_sort_key as {{ dbt.type_string() }} ) as patient_id
, cast(b.desy_sort_key as {{ dbt.type_string() }} ) as person_id
, cast(b.desy_sort_key as {{ dbt.type_string() }} ) as member_id
, cast('medicare' as {{ dbt.type_string() }} ) as payer
, cast('medicare' as {{ dbt.type_string() }} ) as plan
Expand Down
2 changes: 1 addition & 1 deletion models/intermediate/inpatient_claim.sql
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ select
b.claim_id
, cast(l.clm_line_num as integer) as claim_line_number
, 'institutional' as claim_type
, cast(b.desy_sort_key as {{ dbt.type_string() }} ) as patient_id
, cast(b.desy_sort_key as {{ dbt.type_string() }} ) as person_id
, cast(b.desy_sort_key as {{ dbt.type_string() }} ) as member_id
, cast('medicare' as {{ dbt.type_string() }} ) as payer
, cast('medicare' as {{ dbt.type_string() }} ) as plan
Expand Down
2 changes: 1 addition & 1 deletion models/intermediate/outpatient_claim.sql
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ select
as claim_id
, cast(l.clm_line_num as integer) as claim_line_number
, 'institutional' as claim_type
, cast(b.desy_sort_key as {{ dbt.type_string() }} ) as patient_id
, cast(b.desy_sort_key as {{ dbt.type_string() }} ) as person_id
, cast(b.desy_sort_key as {{ dbt.type_string() }} ) as member_id
, cast('medicare' as {{ dbt.type_string() }} ) as payer
, cast('medicare' as {{ dbt.type_string() }} ) as plan
Expand Down
2 changes: 1 addition & 1 deletion models/intermediate/snf_claim.sql
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ select
b.claim_id
, cast(l.clm_line_num as integer) as claim_line_number
, 'institutional' as claim_type
, cast(b.desy_sort_key as {{ dbt.type_string() }}) as patient_id
, cast(b.desy_sort_key as {{ dbt.type_string() }}) as person_id
, cast(b.desy_sort_key as {{ dbt.type_string() }}) as member_id
, cast('medicare' as {{ dbt.type_string() }} ) as payer
, cast('medicare' as {{ dbt.type_string() }} ) as plan
Expand Down
2 changes: 1 addition & 1 deletion packages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ packages:
- package: dbt-labs/dbt_utils
version: [">=0.9.2","<1.3.0"]
- package: tuva-health/the_tuva_project
version: [">=0.10.0","<0.11.0"]
version: [">=0.13.0","<0.14.0"]
Loading