Learn R Programming

rEHR (version 1.0)

patients_in_window: Select patients alive and registered between certain dates

Description

This function selects patients from the patient table of a CPRD database who are alive and registered within a supplied window

Usage

patients_in_window(db, startdate, enddate, qs = TRUE, registration_buffer = 0, patient_tablename = "Patient")

Arguments

db
a database connection
startdate
character for the start of the window. format %Y-%m-%d
enddate
character for the end of the window. format %Y-%m-%d
qs
logical should only patients deemed to be of acceptable quality standard be selected? Most downloaded cohorts will be up to standard by default
registration_buffer
numeric how many days must patients be registered for prior to the startdate to be included? Setting a posive value can reduce information bias
patient_tablename
The name of the patient table. default is Patient

Details

criteria are that crd is before start of window, tod is after end of window deathdate is after end of window