eds_scikit.emergency.emergency_visit
tag_emergency_visit
tag_emergency_visit(visit_detail: DataFrame, care_site: Optional[DataFrame] = None, visit_occurrence: Optional[DataFrame] = None, algo: str = 'from_mapping') -> DataFrame
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:
|
Source code in eds_scikit/emergency/emergency_visit.py
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 |
|
from_vo_visit_source_value
from_vo_visit_source_value(visit_detail: DataFrame, visit_occurrence: DataFrame) -> DataFrame
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:
|
Source code in eds_scikit/emergency/emergency_visit.py
81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 |
|