@concept_checker(concepts=["IS_EMERGENCY"])
def from_regex_on_parent_UF(care_site: DataFrame) -> DataFrame:
"""Use regular expressions on parent UF (Unité Fonctionnelle) to classify emergency care site.
This relies on [this function][eds_scikit.structures.attributes.get_parent_attributes].
The regular expression used to detect emergency status is `r"\bURG|\bSAU\b|\bUHCD\b|\bZHTCD\b"`
Parameters
----------
care_site: DataFrame
Should at least contains the `care_site_name` column
Returns
-------
care_site: DataFrame
Dataframe with 1 added column corresponding to the following concept:
- 'IS_EMERGENCY'
"""
return attributes.get_parent_attributes(
care_site,
only_attributes=["IS_EMERGENCY"],
parent_type="Unité Fonctionnelle (UF)",
)