Skip to contents

Returns the packaged free-text keyword lookup that maps a normalised diagnosis string (English, French, Portuguese and other national-language variants, plus common misspellings) to a canonical diagnosis label. The first matching pattern wins, so the rows are ordered specific-before-broad. Consumed by clean_afp_diagnosis().

Usage

polis_afp_diagnosis_lookup()

Value

A tibble with columns pattern (a case-insensitive regular expression, matched against normalised text) and diagnosis (the canonical label, itself a key of polis_afp_diagnosis_class()).

Examples

head(polis_afp_diagnosis_lookup())
#> # A tibble: 6 × 2
#>   pattern                                                              diagnosis
#>   <chr>                                                                <chr>    
#> 1 "guillain|gullain|guillian|gb syndrome|g b s|\\bgbs\\b|\\bsgb\\b|ba… Guillain…
#> 2 "diphther|dipther|dipther|difteri|diphteri|post dip|palat|paltal|pa… Diphther…
#> 3 "polyneuropath|polyneurit|polynevrit|neuropathie|neuro pathy|neurop… Peripher…
#> 4 "injection neur|injection pals|post injection|postinjection|\\bt n\… Traumati…
#> 5 "transverse myel|transverse myl|transverse mil|myelit|myelite|myelo… Transver…
#> 6 "hypokal|hypo kal|hipokal|hypokl|hipokl|electroli|electrolyt|dysele… Hypokala…