match_MRNs: Match MRNs from two EMRs

Description Usage Arguments Details Value Examples

View source: R/match_MRNs.R

Description

Takes two data.frame objects with patient information and matches them

Usage

1
match_MRNs(x, y)

Arguments

x, y

Two data frames with columns 'mrn', 'first_name', 'last_name', and 'birth_date' (yyyy-mm-dd)

Details

The function cleans up the last names slightly and then matches exactly on the cleaned up last names and the birth dates. Then fuzzy matching is done on the first name, using the stringdist package.

Value

A data.frame with column names with suffixes '_x' and '_y' corresponding to the x and y inputs. The dist column gives the string distance between the two first names.

Examples

1
2
3
4
data(x_EMR)
data(y_EMR)

match_MRNs(x_EMR, y_EMR)

NateByers/IUHhelpers documentation built on Feb. 25, 2020, 8:43 p.m.