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.
- You have claims data (e.g. medicare, medicaid, or commercial) in a data warehouse
- 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
- You have dbt installed and configured (i.e. connected to your data warehouse)
Here are instructions for installing dbt.
Complete the following steps to configure the package to run in your environment.
- Clone this repo to your local machine or environment
- Create a database called 'tuva' in your data warehouse
- Note: this is optional, see step 4 for further detail
- 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
- Fill in vars (variables):
- 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
- Execute
dbt build
to load seed files, run models, and perform tests.
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}'
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.
This package has been written for Snowflake. Redshift is available here