
AFP free-text diagnosis lookup shipped with the package
Source:R/clean_afp_diagnosis.R
polis_afp_diagnosis_lookup.RdReturns 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().
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…