Skip to content

ICU

eds-scikit provides a function to tag care sites as being Intensive Care Units. It also provides a higher-level function to directly tag visits.

from eds_scikit.io import HiveData
data = HiveData(DBNAME)

Tagging care sites

Tagging is done using the tag_icu_care_site function:

from eds_scikit.icu import tag_icu_care_site

Tag care sites that correspond to ICU units.

The tagging is done by adding a "IS_ICU" column to the provided DataFrame.

PARAMETER DESCRIPTION
care_site

TYPE: DataFrame

algo

Possible values are:

TYPE: str DEFAULT: 'from_mapping'

RETURNS DESCRIPTION
care_site

Dataframe with 1 added column corresponding to the following concept:

  • "IS_ICU"

TYPE: DataFrame

Simply call the function by providing the necessary data (see below) and by picking the algo

care_site = tag_icu_care_site(
    care_site=data.care_site,
    algo="from_authorisation_type",
)

Availables algorithms (values for "algo")

This algo uses the care_site.place_of_service_source_value columns to retrieve Intensive Care Units.

The following values are used to tag a care site as ICU:

  • "REA PED"
  • "REA"
  • "REA ADULTE"
  • "REA NEONAT"
  • "USI"
  • "USI ADULTE"
  • "USI NEONAT"
  • "SC PED"
  • "SC"
  • "SC ADULTE"
PARAMETER DESCRIPTION
care_site

Should at least contains the place_of_service_source_value column

TYPE: DataFrame

RETURNS DESCRIPTION
care_site

Dataframe with 1 added column corresponding to the following concepts:

  • "IS_ICU"

TYPE: DataFrame

Source code in eds_scikit/icu/icu_care_site.py

Use regular expressions on care_site_name to decide if it an ICU care site.

This relies on this function. The regular expression used to detect ICU is r"USI|REA[N\s]|REA|USC|SOINS.*INTENSIF|SURV.{0,15}CONT|SI|SC".

Keeping only 'UDS'

At AP-HP, all ICU are UDS (Unité De Soins). Therefore, this function filters care sites by default to only keep UDS.

PARAMETER DESCRIPTION
care_site

Should at least contains the care_site_name and care_site_type_source_value columns

TYPE: DataFrame

subset_care_site_type_source_value

Acceptable values for care_site_type_source_value

TYPE: Union[list, set] DEFAULT: {'UDS'}

RETURNS DESCRIPTION
care_site

Dataframe with 1 added column corresponding to the following concept:

  • "IS_ICU"

TYPE: DataFrame

Source code in eds_scikit/icu/icu_care_site.py

Tagging visits

Tagging is done using the tag_icu_visit function:

from eds_scikit.icu import tag_icu_visit

Tag care_sites that correspond to ICU units.

The tagging is done by adding a "IS_ICU" column to the provided DataFrame.

It works by tagging each visit detail's care site.

PARAMETER DESCRIPTION
visit_detail

TYPE: DataFrame

care_site

TYPE: DataFrame

algo

Possible values are:

TYPE: str DEFAULT: 'from_authorisation_type'

RETURNS DESCRIPTION
visit_detail

Dataframe with 1 added column corresponding to the following concept:

  • "IS_ICU"

TYPE: DataFrame

Simply call the function by providing the necessary data (see below) and by picking the algo

visit_detail = tag_icu_visit(
    visit_detail=data.visit_detail,
    algo="from_mapping",
)

Availables algorithms (values for "algo")

Those are the same as tag_icu_care_site