Skip to content

EtaylorSLC/tuva_claims_preprocessing

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

86 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Apache License dbt logo and version

Claims Preprocessing

Check out the Claims Preprocessing Data Model

Check out our Knowledge Base

Claims preprocessing enhances medical claims data to make it useful for analytics. It is done by:

  • Assigning encounter types to individual claim lines based on the bill type code and or revenue code of institutional claims and the place of service code of professional claims.
  • Grouping individual claims into encounters (this involves logic to, for example, merge claims with overlapping dates or adjacent dates into a single inpatient stay).
  • Crosswalking professional claims to institutional encounters.

Pre-requisites

  1. You have claims data (e.g. medicare, medicaid, or commercial) in a data warehouse
  2. You have mapped your claims data to the claim input layer
    • The claim input layer is at a claim line level and each claim id and claim line number is unique
    • The eligibility input layer is unique at the month/year grain per patient and payer
    • Revenue code is 4 digits in length
  3. You have dbt installed and configured (i.e. connected to your data warehouse)

Here are instructions for installing dbt.

Getting Started

Complete the following steps to configure the package to run in your environment.

  1. Clone this repo to your local machine or environment
  2. Create a database called 'tuva' in your data warehouse
    • Note: this is optional, see step 4 for further detail
  3. Configure dbt_project.yml
    • Fill in vars (variables):
      • source_name - description of the dataset feeding this project
      • input_database - database where sources feeding this project are stored
      • input_schema - schema where sources feeding this project is stored
      • output_database - database where output of this project should be written.
        We suggest using the Tuva database but any database will work.
      • output_schema - name of the schema where output of this project should be written
  4. Review sources.yml. The table names listed are the same as in the Tuva data model (linked above). If you decided to rename these tables:
    • Update table names in sources.yml
    • Update table name in medical_claim and eligibility jinja function
  5. Execute dbt build to load seed files, run models, and perform tests.

Usage Example

Sample dbt command specifying new variable names dynamically:

dbt build --vars '{input_database: extract_from_database, input_schema: extract_from_schema, output_database: insert_into_database, output_schema: insert_into_schema}'

Contributions

Have an opinion on the mappings? Notice any bugs when installing and running the package? If so, we highly encourage and welcome contributions!

Join the conversation on Slack! We'd love to hear from you on the #claims-preprocessing channel.

Database Support

This package has been written for Snowflake. Redshift is available here

About

tuva health collab

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published