@concept_checker(concepts=["IS_ICU"])
def from_authorisation_type(care_site: DataFrame) -> DataFrame:
"""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"`
Parameters
----------
care_site: DataFrame
Should at least contains the `place_of_service_source_value` column
Returns
-------
care_site: DataFrame
Dataframe with 1 added column corresponding to the following concepts:
- `"IS_ICU"`
"""
icu_units = set(
[
"REA PED",
"USI",
"SC PED",
"SC",
"REA",
"SC ADULTE",
"USI ADULTE",
"REA ADULTE",
"USI NEONAT",
"REA NEONAT",
]
)
care_site["IS_ICU"] = care_site["place_of_service_source_value"].isin(icu_units)
return care_site