Emergency Units
eds-scikit provides a function to tag care sites as being medical emergency 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_emergency_care_site
function:
from eds_scikit.emergency import tag_emergency_care_site
Tag care sites that correspond to medical emergency units.
The tagging is done by adding a "IS_EMERGENCY"
column to the provided DataFrame.
Some algos can add an additional "EMERGENCY_TYPE"
column to the provided DataFrame,
providing a more detailled classification.
PARAMETER | DESCRIPTION |
---|---|
care_site |
TYPE:
|
algo |
Possible values are:
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
care_site
|
Dataframe with 1 to 2 added columns corresponding to the following concepts:
TYPE:
|
Simply call the function by providing the necessary data (see below) and by picking the algo
care_site = tag_emergency_care_site(
care_site=data.care_site,
algo="from_mapping",
)
Availables algorithms (values for "algo"
)
This algo uses a labelled list of 201 emergency care sites.
Those care sites were extracted and verified by Ariel COHEN, Judith LEBLANC, and an ER doctor validated them.
Those emergency care sites are further divised into different categories, as defined in the concept 'EMERGENCY_TYPE'. The different categories are:
- Urgences spécialisées
- UHCD + Post-urgences
- Urgences pédiatriques
- Urgences générales adulte
- Consultation urgences
- SAMU / SMUR
See the dataset here
PARAMETER | DESCRIPTION |
---|---|
care_site |
Should at least contains the
TYPE:
|
version |
Optional version string for the mapping
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
care_site
|
Dataframe with 2 added columns corresponding to the following concepts:
TYPE:
|
Use regular expressions on parent UF (Unité Fonctionnelle) to classify emergency care site.
This relies on this function.
The regular expression used to detect emergency status is r"URG|SAU|UHCD|ZHTCD"
PARAMETER | DESCRIPTION |
---|---|
care_site |
Should at least contains the
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
care_site
|
Dataframe with 1 added column corresponding to the following concept:
TYPE:
|
Use regular expressions on care_site_name
to decide if it an emergency care site.
This relies on this function.
The regular expression used to detect emergency status is r"URG|SAU|UHCDb|ZHTCD"
PARAMETER | DESCRIPTION |
---|---|
care_site |
Should at least contains the
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
care_site
|
Dataframe with 1 added column corresponding to the following concept:
TYPE:
|
Tagging visits
Tagging is done using the tag_emergency_visit
function:
from eds_scikit.emergency import tag_emergency_visit
Tag visits that correspond to medical emergency units.
The tagging is done by adding a "IS_EMERGENCY"
column to the provided DataFrame.
Some algos can add an additional "EMERGENCY_TYPE"
column to the provided DataFrame,
providing a more detailled classification.
It works by either tagging each visit detail's care site,
or by using the visit_occurrence's "visit_source_value"
.
PARAMETER | DESCRIPTION |
---|---|
visit_detail |
TYPE:
|
care_site |
Isn't necessary if the algo
TYPE:
|
visit_occurrence |
Is mandatory if the algo
TYPE:
|
algo |
Possible values are:
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
care_site
|
Dataframe with 1 to 2 added columns corresponding to the following concepts:
TYPE:
|
Simply call the function by providing the necessary data (see below) and by picking the algo
visit_detail = tag_emergency_visit(
visit_detail=data.visit_detail,
algo="from_mapping",
)
Availables algorithms (values for "algo"
)
This algo uses a labelled list of 201 emergency care sites.
Those care sites were extracted and verified by Ariel COHEN, Judith LEBLANC, and an ER doctor validated them.
Those emergency care sites are further divised into different categories, as defined in the concept 'EMERGENCY_TYPE'. The different categories are:
- Urgences spécialisées
- UHCD + Post-urgences
- Urgences pédiatriques
- Urgences générales adulte
- Consultation urgences
- SAMU / SMUR
See the dataset here
PARAMETER | DESCRIPTION |
---|---|
care_site |
Should at least contains the
TYPE:
|
version |
Optional version string for the mapping
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
care_site
|
Dataframe with 2 added columns corresponding to the following concepts:
TYPE:
|
Use regular expressions on parent UF (Unité Fonctionnelle) to classify emergency care site.
This relies on this function.
The regular expression used to detect emergency status is r"URG|SAU|UHCD|ZHTCD"
PARAMETER | DESCRIPTION |
---|---|
care_site |
Should at least contains the
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
care_site
|
Dataframe with 1 added column corresponding to the following concept:
TYPE:
|
Use regular expressions on care_site_name
to decide if it an emergency care site.
This relies on this function.
The regular expression used to detect emergency status is r"URG|SAU|UHCDb|ZHTCD"
PARAMETER | DESCRIPTION |
---|---|
care_site |
Should at least contains the
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
care_site
|
Dataframe with 1 added column corresponding to the following concept:
TYPE:
|
This algo uses the "Type de dossier" of each visit detail's parent visit occurrence.
Thus, a visit_detail will be tagged with IS_EMERGENCY=True
iff the visit occurrence it belongs to
is an emergency-type visit (meaning that visit_occurrence.visit_source_value=='urgence'
)
Admission through ICU
At AP-HP, when a patient is hospitalized after coming to the ICU, its visit_source_value
is set from "urgence"
to "hospitalisation complète"
. So you should keep in mind
that this method doesn't tag those visits as ICU.
PARAMETER | DESCRIPTION |
---|---|
visit_detail |
TYPE:
|
visit_occurrence |
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
visit_detail
|
Dataframe with added columns corresponding to the following conceps:
TYPE:
|