-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
adding generate_omop_teva, reduce_table and visualize_table
- Loading branch information
Showing
13 changed files
with
30,514 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
# OMOP Teva - Config | ||
|
||
All plots generated by ```generate_omop_teva``` are based on the configuration file ```eds_scikit.plot.default_omop_teva_config```. | ||
|
||
## Table configuration | ||
|
||
A table configuration is defined by 3 parameters : | ||
|
||
- __category columns__ list | ||
- __date column__ | ||
- category columns __mapping__ | ||
|
||
Here is two possible configurations for OMOP condition table : | ||
|
||
=== "Default condition teva configuration" | ||
|
||
```python | ||
"condition_occurrence": { | ||
"category_columns": [ | ||
"visit_occurrence_id", | ||
"care_site_short_name", | ||
"condition_source_value", | ||
"stay_source_value", | ||
"visit_source_value", | ||
"admission_reason_source_value", | ||
"visit_type_source_value", | ||
"destination_source_value", | ||
"cdm_source", | ||
], | ||
"date_column": "condition_start_datetime", | ||
"mapper": { | ||
"visit_occurrence_id": {"not NaN": ".*"}, | ||
"condition_source_value": {"not NaN": ".*"}, | ||
}, | ||
}, | ||
``` | ||
|
||
=== "Custom diabete condition teva configuration" | ||
|
||
```python | ||
"condition_occurrence": { | ||
# (1) Some columns were removed . | ||
"category_columns": [ | ||
"visit_occurrence_id", | ||
"care_site_short_name", | ||
"condition_source_value", | ||
"visit_source_value", | ||
"visit_type_source_value", | ||
"cdm_source", | ||
], | ||
# (2) Date column remain the same . | ||
"date_column": "condition_start_datetime", | ||
"mapper": { | ||
"visit_occurrence_id": {"not NaN": ".*"}, | ||
# (3) Mapping to diabetic conditions . | ||
"condition_source_value": {"has_diabete": r"^E10|^E11|^E12|^E13|^E14|O24"}, | ||
}, | ||
}, | ||
``` | ||
|
||
|
||
## Specifying table configuration | ||
|
||
To specify configuration, simply update ```default_omop_teva_config``` and pass it to ```generate_omop_teva```. | ||
|
||
```python | ||
from eds_scikit.plot import generate_omop_teva | ||
from eds_scikit.io.omop_teva_default_config import default_omop_teva_config | ||
|
||
omop_teva_config = default_omop_teva_config | ||
|
||
condition_mapper = { | ||
"condition_source_value": {"has_diabete": r"^E10|^E11|^E12|^E13|^E14|O24"} | ||
} | ||
|
||
omop_teva_config["condition_occurrence"]["mapper"].update(condition_mapper) | ||
|
||
start_date, end_date = "2021-01-01", "2021-12-01" | ||
generate_omop_teva(data=data, | ||
start_date=start_date, | ||
end_date=end_date, | ||
teva_config=omop_teva_config) | ||
``` | ||
|
||
!!! warning "Adding a new table in default_omop_teva_config" | ||
For now, if you want to generate a dashboard for a table which do not exists in default_omop_teva_config you must redefine and update ```generate_omop_teva```. |
Oops, something went wrong.