find_patients: Find Patients who see PCP's of interest within past year

Description Usage Arguments Value Examples

Description

This function allows you to find the patients who see PCP's of interest and who have had visits within one year of the cutoff date.

Usage

1
find_patients(df, cutoff_date, vec_of_pcps, pcp_var, pat_mrn, enc_date_var)

Arguments

df

EHR dataset which has had dates properly formatted by format_ehr_date function

cutoff_date

End date of interest in month-day-4digityear format (ie. 11012018 is Nov 1, 2018)

vec_of_pcps

A vector listing names of PCP's in format found in EHR

pcp_var

The variable name which includes the names of the PCP's

pat_mrn

The variable name which includes the Patient MRN information

enc_date_var

The variable name which includes information pertaining to visit/encounter dates

Value

A subsetted data frame which includes patients with PCP's of interest and within date range

Examples

1
2
3
4
5
## Not run: 
find_patients(df, cutoff_date, vec_of_pcps = pcp_vec, pcp_var = Patient.PCP,
pat_mrn = Patient.MRN, enc_date_var = Encounter.Date)

## End(Not run)

jjwillard/wfbmcr documentation built on May 7, 2019, 9:21 p.m.