Skip to main content

Chronic Conditions

Methods

Code on Github

The Chronic Conditions data mart implements two different chronic condition groupers: one defined by CMS and the other defined by Tuva. We started defining chronic conditions in Tuva after struggling to use the CMS logic, either because certain chronic conditions were missing (e.g. non-alcoholic fatty liver disease, MASH, etc.) or because existing definitions were unsatisfactory (e.g. type 1 and type 2 diabetes are considered the same condition by CMS) even though the pathology of the two is distinctly different.

You can find the methods for CMS's methodology using the above link. You can search exact codes used in the Tuva definition in the clinical concept library in our value sets.

Data Dictionary

cms_chronic_conditions_long

This table contains one record per patient per chronic condition. For example, if a patient has 3 chronic conditions they will have 3 records in this table. Each record includes the condition category, condition, date of onset, most recent diagnosis, and the total count of diagnosis codes that were recorded that are relevant for the condition.

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:

  • person_id
  • condition

Foreign Keys:

  • claim_id
ColumnData TypeDescriptionTerminology

cms_chronic_conditions_wide

This table contains a single record per patient with separate binary (i.e. 0 or 1) columns for every chronic condition. If a patient has a particular chronic condition they will have a 1 in that particular column and 0 otherwise.

Primary Keys:

  • person_id
ColumnData TypeDescriptionTerminology

tuva_chronic_conditions_long

This table contains one record per patient per chronic condition. For example, if a patient has 3 chronic conditions they will have 3 records in this table. Each record includes the condition category, condition, date of onset, most recent diagnosis, and the total count of diagnosis codes that were recorded that are relevant for the condition.

Primary Keys:

  • person_id
  • condition
ColumnData TypeDescriptionTerminology

tuva_chronic_conditions_wide

This table contains a single record per patient with separate binary (i.e. 0 or 1) columns for every chronic condition. If a patient has a particular chronic condition they will have a 1 in that particular column and 0 otherwise.

Primary Keys:

  • person_id
ColumnData TypeDescriptionTerminology

Example SQL

Prevalence of Tuva Chronic Conditions

In this query we show how often each chronic condition occurs in the patient population.

select
condition
, 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
Prevalence of CMS Chronic Conditions

In this query we show how often each chronic condition occurs in the patient population.

select
condition_category
, condition
, 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
Distribution of Chronic Conditions

In this query we show how many patients have 0 chronic conditions, how many patients have 1 chronic condition, how many patients have 2 chronic conditions, etc.

with patients as (
select person_id
from core.patient
)

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

, condition_count as (
select
person_id
, count(distinct condition) as condition_count
from conditions
group by 1
)

select
condition_count
, count(1)
, 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