124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
def from_regex_on_care_site_description(care_site: DataFrame) -> DataFrame:
    """Use regular expressions on `care_site_name` to decide if it an emergency care site.

    This relies on [this function][eds_scikit.structures.attributes.add_care_site_attributes].
    The regular expression used to detect emergency status is `r"\bURG|\bSAU\b|\bUHCDb\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.add_care_site_attributes(
        care_site, only_attributes=["IS_EMERGENCY"]
    )