Skip to content

Commit 60e9aa6

Browse files
andreas-homewardamartinson193aneiderhiser
authored
Adding warning for missing/blank facility NPI fields (tuva-health#1217)
* Adding warning for facility NPI * Adding missing eligibility layer docs --------- Co-authored-by: Andreas Martinson <amartinson193@gmail.com> Co-authored-by: Aaron Neiderhiser <anneiderhiser@gmail.com>
1 parent 58d9672 commit 60e9aa6

2 files changed

Lines changed: 43 additions & 0 deletions

File tree

models/input_layer/input_layer__eligibility.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -635,6 +635,36 @@ models:
635635
tags: ['tuva_dqi_sev_3', 'dqi', 'dqi_cms_hccs']
636636
arguments:
637637
values: ['Continuing', 'New', 'Institutional', 'ESRD', null]
638+
- name: hospice_flag
639+
description: Whether the patient is in hospice.
640+
tests:
641+
- the_tuva_project.expect_column_to_exist:
642+
config:
643+
severity: error
644+
enabled: '{{ (var(''enable_input_layer_testing'', true)) | as_bool }}'
645+
tags:
646+
- tuva_dqi_sev_1
647+
- dqi
648+
- name: institutional_snp_flag
649+
description: Whether the patient is in a special needs plan (SNP) and required to be in nursing home level care.
650+
tests:
651+
- the_tuva_project.expect_column_to_exist:
652+
config:
653+
severity: error
654+
enabled: '{{ (var(''enable_input_layer_testing'', true)) | as_bool }}'
655+
tags:
656+
- tuva_dqi_sev_1
657+
- dqi
658+
- name: long_term_institutional_flag
659+
description: Whether the patient is in an institutional setting for longer than 30 days.
660+
tests:
661+
- the_tuva_project.expect_column_to_exist:
662+
config:
663+
severity: error
664+
enabled: '{{ (var(''enable_input_layer_testing'', true)) | as_bool }}'
665+
tags:
666+
- tuva_dqi_sev_1
667+
- dqi
638668
- name: group_id
639669
description: The group id which multiple members are enrolled for health coverage. This field is a string that can correspond to the particular group under which multiple members are enrolled for health coverage. This could be an identifier that is specific to an employers health plan.
640670
tests:

models/input_layer/input_layer__medical_claim.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1209,6 +1209,19 @@ models:
12091209
- name: facility_npi
12101210
description: 'Facility NPI for the claim (typically represents the facility where services were performed). This field is a string that contains NPI (National Provider Identifier) values. facility_npi typically represents the location where specific services were delivered. NPIs are composed of numbers and are ten characters in length. DQI ensures that this field matches the expected length and character pattern. Source data may only include a single NPI field without specifying whether the provided identifier corresponds to a rendering, billing, or facility NPI. In that case, look for the NPI in Tuvas provider terminology file to determine whether it corresponds to a person or place. * If its a person, then the NPI should be mapped to rendering_npi. * If its a person and also a professional claim, then also map to billing_npi. * If its a location and the claim type is institutional, then map to facility_npi That logic could look like this: ```sql select ... , case when p.entity_type_code = 1 then npi else null end as rendering_npi , case when p.entity_type_code = 1 and claim_type = professional then p.npi end as billing_npi , case when p.entity_type_code = 2 and claim_type = institutional then p.npi end as facility_npi from source_data as sd left join terminology__provider as p on p.npi = sd.npi ```'
12111211
tests:
1212+
- not_null:
1213+
description: >
1214+
The encounter grouper depends on this field and will not work as intended if this is not provided.
1215+
If you have an NPI field and are unsure if the NPI is a facility NPI (i.e. level 2 org NPI), then
1216+
join to terminology.provider and filter to level 2 NPIs only.
1217+
1218+
If left as null, then encounters will under-merge since encounter merging depends on the facility ID field.
1219+
There are two primary options if facility NPIs (i.e. level 2 NPIs) are not available:
1220+
- Leave null: This mean claims will not merge based on encounter grouping logic since all claims are assumed to be in different facilities.
1221+
- Add a blank string: This will over-merge, but will apply encounter grouping logic and assumes all encounters are at the same facility.
1222+
config:
1223+
severity: warn
1224+
enabled: '{{ (var(''enable_input_layer_testing'', true)) | as_bool }}'
12121225
- the_tuva_project.expect_column_to_exist:
12131226
config:
12141227
severity: warn

0 commit comments

Comments
 (0)