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

Testing ci #1

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
22 changes: 0 additions & 22 deletions .github/pull_request_template.md

This file was deleted.

17 changes: 0 additions & 17 deletions .github/release.yml

This file was deleted.

48 changes: 48 additions & 0 deletions .github/workflows/dbt_v1.4.6_snowflake_build_full_refresh.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: dbt_v1.4.6_snowflake_build_full_refresh

on:
workflow_dispatch:
pull_request:
branches:
- main

env:
DBT_TUVA_SNOWFLAKE_ACCOUNT: ${{ secrets.DBT_TUVA_SNOWFLAKE_ACCOUNT }}
DBT_TUVA_CI_DATABASE: ${{ secrets.DBT_TUVA_CI_DATABASE }}
DBT_SNOWFLAKE_CI_PASSWORD: ${{ secrets.DBT_SNOWFLAKE_CI_PASSWORD }}
DBT_SNOWFLAKE_CI_ROLE: ${{ secrets.DBT_SNOWFLAKE_CI_ROLE }}
DBT_SNOWFLAKE_CI_SCHEMA: ${{ secrets.DBT_SNOWFLAKE_CI_SCHEMA }}
DBT_SNOWFLAKE_CI_USER: ${{ secrets.DBT_SNOWFLAKE_CI_USER }}
DBT_SNOWFLAKE_CI_WAREHOUSE: ${{ secrets.DBT_SNOWFLAKE_CI_WAREHOUSE }}

jobs:
action:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

- name: dbt-deps
uses: mwhitaker/dbt-action@v1.4.6
with:
dbt_command: "dbt deps --profiles-dir ./profiles/snowflake"
dbt_project_folder: "integration_tests"


- name: dbt-debug
uses: mwhitaker/dbt-action@v1.4.6
with:
dbt_command: "dbt debug --profiles-dir ./profiles/snowflake"
dbt_project_folder: "integration_tests"

- name: dbt-build
uses: mwhitaker/dbt-action@v1.4.6
with:
dbt_command: 'dbt build --full-refresh --profiles-dir ./profiles/snowflake --vars {"tuva_database":"dev_ci_testing","input_database":"dev_ci_testing","input_schema":"claims_common"}'
dbt_project_folder: "integration_tests"


- name: Get the result
if: ${{ always() }}
run: echo "${{ steps.dbt-build.outputs.result }}"
shell: bash
72 changes: 72 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
# 👋 Welcome

Hello and welcome! Thank you so much for taking the time to contribute to the Tuva Project. People like you are helping to build a community of healthcare data practitioners that shares knowledge and tools. Whether it’s fixing a bug, submitting an idea, updating the docs, or sharing your healthcare knowledge, you can make an impact!

In this guide, you will get an overview of the contribution workflow, from how to contribute, setting up your development environment, testing, and creating a pull request.

# 🤝 How to contribute

There are many different ways to contribute to the Tuva Project. The goal of this section is to help you get started.

The Tuva Project is organized across a few different [repositories](https://github.com/orgs/tuva-health/repositories) on GitHub:

- **[The Tuva Project](https://github.com/tuva-health/the_tuva_project):** main repository with a dbt package that contains data marts, terminology codes set, and data quality tests for transforming healthcare data.
- **[The Tuva Project Demo](https://github.com/tuva-health/the_tuva_project_demo):** starter dbt project with synthetic claims data for trying out the Tuva Project.
- **[Connectors](https://github.com/orgs/tuva-health/repositories?q=connector&type=all&language=&sort=):** connectors that map healthcare data to the Tuva claims data model so you can easily run the Tuva Project. (e.g. [medicare_cclf_connector](https://github.com/tuva-health/medicare_cclf_connector), [medicare_lds_connector](https://github.com/tuva-health/medicare_lds_connector), [fhir_connector](https://github.com/tuva-health/FHIR_connector))
- **[Docs](https://github.com/tuva-health/docs):** contains all of the [thetuvaproject.com](https://thetuvaproject.com/) code, including documentation on how to map your data, run the Tuva Project, and deep-dives into advanced healthcare concepts.
- **[Provider](https://github.com/tuva-health/provider):** dbt project that transforms messy public provider datasets into usable data for the Tuva Project. This is how the provider terminology seed files that come with the Tuva Project are created.

### Work on an existing issue

You can choose an existing issue to work on from the main [repository](https://github.com/tuva-health/the_tuva_project/issues). This is where we track bugs and feature requests. Make sure to comment on the issue so we know you’re working on it and can help if you have questions.

### File a bug report or request a new feature

Let us know if something is not working or request a new feature. Go to the [issues](https://github.com/tuva-health/the_tuva_project/issues) of the main repository and create a new issue.

You can also take a look at the roadmap on our [Docs](https://thetuvaproject.com/) to see what else we have planned. If a planned feature is interesting to you, you can create a new issue where we can collaborate on it!

### Update documentation

One of the tenets of the Tuva Project is sharing healthcare data knowledge, and part of that is posting this knowledge on the **[Docs](https://github.com/tuva-health/docs)** website. There are many ways to contribute here; you do not have to know markdown language. We can help with any tricky formatting. You can go to an existing page on the docs website and click “Edit this page.” This will take you to GitHub, where you can fork the repo and create a PR with your changes.

### Share your knowledge

Another great way to contribute is to join our growing community of healthcare data practitioners in [Slack](https://join.slack.com/t/thetuvaproject/shared_invite/zt-16iz61187-G522Mc2WGA2mHF57e0il0Q)! Here, we are trying to foster an open environment where we can share ideas and collaborate.

### Use the Tuva Project

Lastly, using the Tuva Project and sending your feedback is one of the most valuable ways to contribute.

### Not sure where to start?

Join our [Slack](https://join.slack.com/t/thetuvaproject/shared_invite/zt-16iz61187-G522Mc2WGA2mHF57e0il0Q) community, and we will help you get started! You can also help by giving us a ⭐ on [GitHub](https://github.com/tuva-health/the_tuva_project) and telling your friends and colleagues about the Tuva Project.

# 🛠️ Getting started with development

### How to setup your environment

1. In order to run the Tuva Project, you need to have dbt installed and healthcare data loaded inside a data warehouse that we support.
1. If you’re new to dbt, check out their [Quickstart guides](https://docs.getdbt.com/quickstarts). We currently support version 1.3.X or greater. You can use either [dbt cloud](https://cloud.getdbt.com/) or [dbt CLI](https://docs.getdbt.com/dbt-cli/cli-overview).
2. We currently support BiqQuery, Redshift, and Snowflake.
3. If you do not have access to healthcare data, feel free to use [The Tuva Project Demo](https://github.com/tuva-health/the_tuva_project_demo).
2. [Fork](https://github.com/tuva-health/the_tuva_project/fork) the repository you would like to contribute to and begin developing.

### How to test the package

The easiest way to test your changes is to use the dbt project inside the package called [integration_tests](https://github.com/tuva-health/the_tuva_project/tree/main/integration_tests).

1. Set the project subdirectory to “integration_tests” if using dbt cloud or change directory (`cd integration_tests`) if using CLI.
2. *(Optional)* The project will run by default with synthetic demo data. To use your own data sources, update the vars in [integration_tests/dbt_project.yml](https://github.com/tuva-health/the_tuva_project/blob/main/integration_tests/dbt_project.yml):
1. Set `test_data_override` to false
2. Set `input_database` and `input_schema` to your testing sources
3. Run `dbt deps`.
4. Run `dbt build`.

You only need to test your changes in one data warehouse. When you submit your pull request, we will use our automated CI testing workflows to test all of our supported data warehouses.

### Submitting your changes

When you are ready, create a pull request in GitHub using our template. See GitHub’s [guide](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/creating-a-pull-request-from-a-fork) for help with creating pull requests from a fork. We will work with you if anything comes up during our review and testing. Once your PR is merged, your contributions will be publicly visible on the Tuva Project repositories.

👏 That’s it; you just contributed to your first open-source project! If you need any help, please reach out to us on [Slack](https://join.slack.com/t/thetuvaproject/shared_invite/zt-16iz61187-G522Mc2WGA2mHF57e0il0Q).
136 changes: 136 additions & 0 deletions QUICKSTART.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,136 @@
# 🏁 Quickstart

There are 3 main ways to use the Tuva Project in your healthcare data warehouse.

- All Data Marts
- Single Data Mart
- Terminology Only


## Installing the dbt package

*Pre-requisite: In order to run the Tuva Project you need dbt installed and
healthcare data loaded inside a data warehouse that we support. See the README
for details.*

1. Add the Tuva Project to your `packages.yml`, or create a packages.yml if you
do not already have one. This should be created in the root of your dbt
project.
```yml
packages:
- package: tuva-health/the_tuva_project
version: [">=0.5.0","<1.0.0"]
```
2. Import the package.
```console
dbt deps
```

## All Data Marts
The main difference between running a single data mart and all data marts is
the mapping. To run all data marts you need to map to the entire
[Claims Data Model](https://tuva-health.github.io/the_tuva_project/#!/overview/input_layer).
*Stay tuned for details on the Clinical Data Model.*

The process of mapping an entire data model can be tricky. If you need help mapping your data,
feel free to post in [#buildersask](https://thetuvaproject.slack.com/archives/C03DET9ETK3) on Slack.

1. **Map to the input layer:** Map your data to the Claims Data Model.
The package expects you to have the following models in your dbt project:
`eligibility`, `medical_claim`, and `pharmacy_claim`. These will be referenced
by the Core staging layer to run the Tuva Project.
2. **Set the variables:** You need to enable all models related to the type of
healthcare
data being used. Do this by adding the data source type variable to your
`dbt_project.yml` file and set the value to "true". Example:
```yml
vars:
claims_enabled: true
3. Run the package to create all the models.
```console
dbt build --select the_tuva_project
```

### Other Variables
The Tuva Project relies on variables to set default behavior for the data marts.
These defaults can be found in the package's [dbt_project.yml](./dbt_project.yml).
You can change these values here or set them in the `dbt_project.yml` of your project.

* **tuva_last_run:** The date and timestamp of the dbt run that will populate
the tuva_last_run column in all models. Default timezone is UTC.
* **cms_hcc_payment_year:** The payment year for the CMS HCC mart. Defaults to
the current year.
* **cms_hcc_model_version:** The risk model used for the CMS HCC mart.
* **quality_measures_period_end:** The reporting date used to calculate the
performance periods for Quality Measures. Defaults to the current date.
* **snapshots_enabled:** Some data marts use the [dbt snapshot](https://docs.getdbt.com/docs/build/snapshots)
feature. These are disabled by default. To enable them add this variable and
set the value to true (`snapshots_enabled: true`).

Alternatively, you can set these in the CLI. Example:
```console
dbt build --select the_tuva_project --vars '{cms_hcc_payment_year: 2020}'
```

### Connectors
If your data source is a standard format that we have a connector
for, you can use a connector to map your data. A connector is just a dbt package
that maps a standard data format to the Claims Data Model. We currently have
connectors for the following standard data formats:
- [Medicare LDS](https://github.com/tuva-health/medicare_saf_connector)
- [Medicare CCLF](https://github.com/tuva-health/medicare_cclf_connector)

## Single Data Mart
Every data mart in the Tuva Project can be run individually. To run a single
data mart complete the following steps.

1. **Map to staging:** Each data mart has its own staging layer. The staging
layer is the set of models you need to create in order to run the data mart.
You can find this in the `staging` folder under the data mart.
2. **Set the variables:** You need to enable the data mart you want to run. Do this by
adding the variable for that data mart to your `dbt_project.yml` file and set
the value to "true".
Example:
```yml
vars:
cms_chronic_conditions_enabled: true
```
3. Run the package to build the marts you enabled.
```console
dbt build --select the_tuva_project
```

See [integration_tests](./integration_tests/dbt_project.yml)
for more data mart variable examples.

## Terminology Only
You can disable the data marts and just load the terminology seeds by completing
the following steps.

1. Add the variable `tuva_marts_enabled` to your `dbt_project.yml` file and set
the value to "false".
```yml
vars:
tuva_marts_enabled: false
```
2. Run the package to build the seeds.
```console
dbt seed
```

Alternatively, you can load all the terminology sets via SQL directly to your
database. Check out the SQL for doing this [here](terminology_sql).
<br/><br/>

## Tutorial

We created this [demo project](https://github.com/tuva-health/the_tuva_project_demo)
to make it easy for people to explore the Tuva Project, even if you don't have
access to healthcare data.

The demo includes:

- A 1,000 patient synthetic claims dataset based on Medicare claims data.
- All the data marts in the Tuva project.
- All the terminology sets in the Tuva Project.
<br/><br/>
Loading
Loading