Skip to content

OMOP Teva - Quick use

This tutorial demonstrates how the OMOP teva module can be quickly used to generate OMOP tables dashboard.

Simply apply generate_omop_teva function after loading the data. It will create a directory with one HTML per OMOP table.

Avoid Jupyter Notebook

Koalas framework with high volumetry processing in Jupyter Notebook might cause computationnal delay and memory issues. Prefer spark-submit script to run OMOP Teva.

Loading dataset
from eds_scikit.io.hive import HiveData

data = HiveData(
    spark_session=spark,
    database_name="project_xxxxxxxx",
    tables_to_load=[
        "care_site",
        "visit_occurrence",
        "concept",
        "concept_relationship",
        "note",
        "procedure_occurrence",
        "condition_occurrence",
        "drug_exposure_prescription",
        "drug_exposure_administration",
    ],
)
from eds_scikit.plot import generate_omop_teva

start_date, end_date = "2021-01-01", "2021-12-01"
generate_omop_teva(data=data, start_date=start_date, end_date=end_date)

05001,0001,5002,0002,5003,000Sum of countJan 2011Jan 2012Jan 2013Jan 2014Jan 2015Jan 2016Jan 2017Jan 2018Jan 2019datetime (year-month)050Sum of countnot NaNvisit_occurrence_idvisit_occurrence_id05001,0001,5002,0002,5003,000Sum of countJan 2011Jan 2012Jan 2013Jan 2014Jan 2015Jan 2016Jan 2017Jan 2018Jan 2019datetime (year-month)020Sum of countHôpital-2Hôpital-3Hôpital-1care_site_short_namecare_site_short_name05001,0001,5002,0002,5003,000Sum of countJan 2011Jan 2012Jan 2013Jan 2014Jan 2015Jan 2016Jan 2017Jan 2018Jan 2019datetime (year-month)02040Sum of countMCOPsychiatrieSLDSSRstay_source_valuestay_source_value05001,0001,5002,0002,5003,000Sum of countJan 2011Jan 2012Jan 2013Jan 2014Jan 2015Jan 2016Jan 2017Jan 2018Jan 2019datetime (year-month)02040Sum of counturgencesconsultationhospitalisésvisit_source_valuevisit_source_value

05001,0001,5002,0002,5003,0003,5004,000Sum of countJan 2012Jan 2013Jan 2014Jan 2015Jan 2016Jan 2017Jan 2018Jan 2019datetime (year-month)050100Sum of countnot NaNvisit_occurrence_idvisit_occurrence_id05001,0001,5002,0002,5003,0003,5004,000Sum of countJan 2012Jan 2013Jan 2014Jan 2015Jan 2016Jan 2017Jan 2018Jan 2019datetime (year-month)050Sum of countHôpital-3Hôpital-1Hôpital-2care_site_short_namecare_site_short_name05001,0001,5002,0002,5003,0003,5004,000Sum of countJan 2012Jan 2013Jan 2014Jan 2015Jan 2016Jan 2017Jan 2018Jan 2019datetime (year-month)0204060Sum of countLTOtherCRHnote_class_source_valuenote_class_source_value05001,0001,5002,0002,5003,0003,5004,000Sum of countJan 2012Jan 2013Jan 2014Jan 2015Jan 2016Jan 2017Jan 2018Jan 2019datetime (year-month)050100Sum of countORBIScdm_sourcecdm_source

01,0002,0003,0004,0005,0006,0007,0008,0009,00010,00011,000Sum of countJan 2012Jan 2013Jan 2014Jan 2015Jan 2016Jan 2017Jan 2018Jan 2019datetime (year-month)0100200Sum of countnot NaNvisit_occurrence_idvisit_occurrence_id01,0002,0003,0004,0005,0006,0007,0008,0009,00010,00011,000Sum of countJan 2012Jan 2013Jan 2014Jan 2015Jan 2016Jan 2017Jan 2018Jan 2019datetime (year-month)050100Sum of countHôpital-3Hôpital-2Hôpital-1care_site_short_namecare_site_short_name01,0002,0003,0004,0005,0006,0007,0008,0009,00010,00011,000Sum of countJan 2012Jan 2013Jan 2014Jan 2015Jan 2016Jan 2017Jan 2018Jan 2019datetime (year-month)0100200Sum of countnot NaNcondition_source_valuecondition_source_value01,0002,0003,0004,0005,0006,0007,0008,0009,00010,00011,000Sum of countJan 2012Jan 2013Jan 2014Jan 2015Jan 2016Jan 2017Jan 2018Jan 2019datetime (year-month)0100Sum of countAREMORBIScdm_sourcecdm_source

In this example condition_source_value is splited between diabetic and non-diabetic conditions.

You can modify dashboard configuration by importing eds_scikit.plot.default_omop_teva_config and customizing it. See next section for details on how to do it.

01,0002,0003,0004,0005,0006,0007,0008,0009,00010,00011,000Sum of countJan 2012Jan 2013Jan 2014Jan 2015Jan 2016Jan 2017Jan 2018Jan 2019datetime (year-month)0100200Sum of countnot NaNvisit_occurrence_idvisit_occurrence_id01,0002,0003,0004,0005,0006,0007,0008,0009,00010,00011,000Sum of countJan 2012Jan 2013Jan 2014Jan 2015Jan 2016Jan 2017Jan 2018Jan 2019datetime (year-month)050100Sum of countHôpital-3Hôpital-2Hôpital-1care_site_short_namecare_site_short_name01,0002,0003,0004,0005,0006,0007,0008,0009,00010,00011,000Sum of countJan 2012Jan 2013Jan 2014Jan 2015Jan 2016Jan 2017Jan 2018Jan 2019datetime (year-month)050100Sum of countOtherhas_diabetecondition_source_valuecondition_source_value01,0002,0003,0004,0005,0006,0007,0008,0009,00010,00011,000Sum of countJan 2012Jan 2013Jan 2014Jan 2015Jan 2016Jan 2017Jan 2018Jan 2019datetime (year-month)0100Sum of countAREMORBIScdm_sourcecdm_source

Back to top