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

Tuva Data Model Changes for person_id #358

Merged
merged 5 commits into from
Dec 12, 2024
Merged
Show file tree
Hide file tree
Changes from 3 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
29 changes: 23 additions & 6 deletions docs/connectors/input-layer.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,13 @@ The `Input Layer` is designed to accomodate both claims and clinical data source
The eligibility table includes information about a patient's health insurance coverage and demographics (note: we use the word patient as a synonym for member). Every claims dataset should include some sort of eligibility data, otherwise it's impossible to calculate member months, which are needed to calculate measures like PMPM. Each record in the table is intended to represent a unique eligibility (i.e. enrollment) span for a patient with a specific health plan.

**Primary Key:**
* patient_id
* plan
* enrollment_start_date
* enrollment_end_date
* person_id
* member_id
* enrollment_start_date
* enrollment_end_date
* payer
* plan
* data_source

<JsonDataTable jsonPath="nodes.model\.input_layer\.eligibility.columns" />

Expand All @@ -32,7 +35,7 @@ The medical_claim table contains information on healthcare services and supplies
* claim_line_number

**Foreign Keys:**
* patient_id
* person_id
* member_id

<JsonDataTable jsonPath="nodes.model\.input_layer\.medical_claim.columns" />
Expand All @@ -46,11 +49,15 @@ The pharmacy_claim table includes information about retail and specialty drug pr
* claim_line_number

**Foreign Keys:**
* patient_id
* person_id
* member_id

<JsonDataTable jsonPath="nodes.model\.input_layer\.pharmacy_claim.columns" />

### person_id
A new patient identifier field named `person_id` has been added to the Tuva data model for both claims and clinical sources. This is a required field and cannot be null. If you bought the Tuva MPI Engine or have your own patient matching solution, this field should be populated with the UUID (Universally Unique Identifier). If you do not have a UUID, we recommend mapping the source patient identifier to this field (`member_id` for claims, patient_id for `clincal`).


## Clinical Input

### condition
Expand All @@ -62,6 +69,7 @@ The condition table contains information related to medical conditions patients

**Foreign Keys:**
* patient_id
* person_id
* encounter_id

<JsonDataTable jsonPath="nodes.model\.input_layer\.condition.columns" />
Expand All @@ -75,6 +83,7 @@ The encounter table contains information about patients visits (i.e. encounters)

**Foreign Keys:**
* patient_id
* person_id

<JsonDataTable jsonPath="nodes.model\.input_layer\.encounter.columns" />

Expand All @@ -87,6 +96,7 @@ The lab result table contains information about lab test results, including the

**Foreign Keys:**
* patient_id
* person_id
* encounter_id

<JsonDataTable jsonPath="nodes.model\.input_layer\.lab_result.columns" />
Expand All @@ -109,6 +119,7 @@ The medication table contains information on medications ordered and/or administ

**Foreign Keys:**
* patient_id
* person_id
* encounter_id

<JsonDataTable jsonPath="nodes.model\.input_layer\.medication.columns" />
Expand All @@ -122,6 +133,7 @@ The observation table contains information on measurements other than lab tests

**Foreign Keys:**
* patient_id
* person_id
* encounter_id

<JsonDataTable jsonPath="nodes.model\.input_layer\.observation.columns" />
Expand All @@ -132,6 +144,7 @@ The patient table contains demographic and geographic information on patients.

**Primary Key:**
* patient_id
* person_id

<JsonDataTable jsonPath="nodes.model\.input_layer\.patient.columns" />

Expand All @@ -153,7 +166,11 @@ The procedure table contains information on procedures that were performed on pa

**Foreign Keys:**
* patient_id
* person_id
* encounter_id
* practitioner_id

<JsonDataTable jsonPath="nodes.model\.input_layer\.procedure.columns" />

### person_id
A new patient identifier field named `person_id` has been added to the Tuva data model for both claims and clinical sources. This is a required field and cannot be null. If you bought the Tuva MPI Engine or have your own patient matching solution, this field should be populated with the UUID (Universally Unique Identifier). If you do not have a UUID, we recommend mapping the source patient identifier to this field (`member_id` for claims, patient_id for `clincal`).
2 changes: 2 additions & 0 deletions docs/core-data-model/condition.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ have an encounter_id).
* condition_id

**Foreign Keys:**
* person_id
* member_id
* patient_id
* encounter_id

Expand Down
5 changes: 4 additions & 1 deletion docs/core-data-model/eligibility.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,12 @@ otherwise it's impossible to calculate member months, which are needed to
calculate measures like PMPM.

**Primary Keys:**
* patient_id
* person_id
* member_id
* enrollment_start_date
* enrollment_end_date
* payer
* plan
* data_source

<JsonDataTable jsonPath="nodes.model\.the_tuva_project\.core__eligibility.columns" />
2 changes: 1 addition & 1 deletion docs/core-data-model/encounter.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,6 @@ this important information in a single table.
* encounter_id

**Foreign Keys:**
* patient_id
* person_id

<JsonDataTable jsonPath="nodes.model\.the_tuva_project\.core__encounter.columns" />
1 change: 1 addition & 0 deletions docs/core-data-model/lab-result.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ result.
* lab_result_id

**Foreign Keys:**
* person_id
* patient_id
* encounter_id

Expand Down
3 changes: 2 additions & 1 deletion docs/core-data-model/medical-claim.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,10 @@ category and encounter that are useful for analytics.
**Primary Keys:**
* claim_id
* claim_line_number
* data_source

**Foreign Keys:**
* patient_id
* person_id
* member_id
* encounter_id

Expand Down
1 change: 1 addition & 0 deletions docs/core-data-model/medication.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ administered during a patient encounter.
* medication_id

**Foreign Keys:**
* person_id
* patient_id
* encounter_id

Expand Down
1 change: 1 addition & 0 deletions docs/core-data-model/observation.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ tests e.g. blood pressure, height, and weight.
* observation_id

**Foreign Keys:**
* person_id
* patient_id
* encounter_id

Expand Down
2 changes: 1 addition & 1 deletion docs/core-data-model/patient.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@ analytics use cases involve analyzing things that happen to patients, so it's
critical to have a clean patient table that contains this information.

**Primary Keys:**
* patient_id
* person_id

<JsonDataTable jsonPath="nodes.model\.the_tuva_project\.core__patient.columns" />
19 changes: 19 additions & 0 deletions docs/core-data-model/person_id_crosswalk.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
---
thutuva marked this conversation as resolved.
Show resolved Hide resolved
id: patient
title: "Patient"
---

import { JsonDataTable } from '@site/src/components/JsonDataTable';

The person_id_crosswalk table contains all source patient identifiers from
the input layer for claims and/or clinical.

**Primary Keys:**
* person_id
* patient_id
* member_id
* payer
* plan
* data_source

<JsonDataTable jsonPath="nodes.model\.the_tuva_project\.core__person_id_crosswalk.columns" />
3 changes: 2 additions & 1 deletion docs/core-data-model/pharmacy-claim.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,10 @@ paid by an insurer. The pharmacy_claim table is at the claim-line grain.
**Primary Keys:**
* claim_id
* claim_line_number
* data_source

**Foreign Keys:**
* patient_id
* person_id
* member_id

<JsonDataTable jsonPath="nodes.model\.the_tuva_project\.core__pharmacy_claim.columns" />
2 changes: 2 additions & 0 deletions docs/core-data-model/procedure.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ ICD-10-PCS and HCPCS.
* procedure_id

**Foreign Keys:**
* person_id
* member_id
* patient_id
* encounter_id
* practitioner_id
Expand Down
6 changes: 3 additions & 3 deletions docs/data-marts/ahrq-measures.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ This data mart computes the PQIs. The individual measures and definitions as of
This model contains a row for each patient and data_source combination that is eligible for each pqi each year.

**Primary Key:**
* patient_id
* person_id
* data_source
* pqi_number
* year_number
Expand All @@ -109,7 +109,7 @@ This model contains a list of all the exclusions an encounter qualified for. An

### pqi_num_long

This model contains a list of all encounters that qualified for a pqi. The patient_id and data_source are brought in for reference as well.
This model contains a list of all encounters that qualified for a pqi. The person_id and data_source are brought in for reference as well.

**Primary Key:**
* data_source
Expand Down Expand Up @@ -241,7 +241,7 @@ with num as (
data_source
, year_number
, pqi_number
, count(patient_id) as denom_count
, count(person_id) as denom_count
from ahrq_measures.pqi_denom_long
group by
data_source
Expand Down
6 changes: 3 additions & 3 deletions docs/data-marts/ccsr.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ rows than the Tuva condition model. The model is equivalent to the CCSR's Output
Option 1 - Vertical File Output.

**Primary Keys:**
* patient_id
* person_id
* normalized_code
* ccsr_category

Expand All @@ -40,7 +40,7 @@ mapping of an ICD-10 code to a CCSR category. The model is equivalent to the
CCSR's Output Option 1 - Vertical File Output.

**Primary Keys:**
* patient_id
* person_id
* normalized_code
* ccsr_category

Expand All @@ -55,7 +55,7 @@ This model contains only the CCSR's default category assignment for the
ICD-10 code, and only for the first-listed ICD-10 code (`diagnosis_code = 1`).

**Primary Keys:**
* patient_id
* person_id
* ccsr_category

**Foreign Keys:**
Expand Down
26 changes: 13 additions & 13 deletions docs/data-marts/chronic-conditions.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ This table is created by running the CMS chronic conditions data mart on data
that's been mapped to the core data model.

**Primary Keys:**
* patient_id
* person_id
* condition

**Foreign Keys:**
Expand All @@ -43,7 +43,7 @@ particular chronic condition they will have a 1 in that particular column and
0 otherwise.

**Primary Keys:**
* patient_id
* person_id

<JsonDataTable jsonPath="nodes.model\.the_tuva_project\.chronic_conditions__cms_chronic_conditions_wide.columns" />

Expand All @@ -56,7 +56,7 @@ recent diagnosis, and the total count of diagnosis codes that were recorded
that are relevant for the condition.

**Primary Keys:**
* patient_id
* person_id
* condition

<JsonDataTable jsonPath="nodes.model\.the_tuva_project\.chronic_conditions__tuva_chronic_conditions_long.columns" />
Expand All @@ -69,7 +69,7 @@ particular chronic condition they will have a 1 in that particular column and
0 otherwise.

**Primary Keys:**
* patient_id
* person_id

<JsonDataTable jsonPath="nodes.model\.the_tuva_project\.chronic_conditions__tuva_chronic_conditions_wide.columns" />

Expand All @@ -83,8 +83,8 @@ In this query we show how often each chronic condition occurs in the patient pop
```sql
select
condition
, count(distinct patient_id) as total_patients
, cast(count(distinct patient_id) * 100.0 / (select count(distinct patient_id) from core.patient) as numeric(38,2)) as percent_of_patients
, count(distinct person_id) as total_patients
, cast(count(distinct person_id) * 100.0 / (select count(distinct person_id) from core.patient) as numeric(38,2)) as percent_of_patients
from chronic_conditions.tuva_chronic_conditions_long
group by 1
order by 3 desc
Expand All @@ -101,8 +101,8 @@ In this query we show how often each chronic condition occurs in the patient pop
select
condition_category
, condition
, count(distinct patient_id) as total_patients
, cast(count(distinct patient_id) * 100.0 / (select count(distinct patient_id) from core.patient) as numeric(38,2)) as percent_of_patients
, count(distinct person_id) as total_patients
, cast(count(distinct person_id) * 100.0 / (select count(distinct person_id) from core.patient) as numeric(38,2)) as percent_of_patients
from chronic_conditions.cms_chronic_conditions_long
group by 1,2
order by 4 desc
Expand All @@ -117,22 +117,22 @@ In this query we show how many patients have 0 chronic conditions, how many pati

```sql
with patients as (
select patient_id
select person_id
from core.patient
)

, conditions as (
select distinct
a.patient_id
a.person_id
, b.condition
from patients a
left join chronic_conditions.tuva_chronic_conditions_long b
on a.patient_id = b.patient_id
on a.person_id = b.person_id
)

, condition_count as (
select
patient_id
person_id
, count(distinct condition) as condition_count
from conditions
group by 1
Expand All @@ -141,7 +141,7 @@ group by 1
select
condition_count
, count(1)
, cast(100 * count(distinct patient_id)/sum(count(distinct patient_id)) over() as numeric(38,1)) as percent
, cast(100 * count(distinct person_id)/sum(count(distinct person_id)) over() as numeric(38,1)) as percent
from condition_count
group by 1
order by 1
Expand Down
Loading