Learn R Programming

rEHR (version 1.0)

patients_per_medcode: Produce a dataset of CPRD medcodes with frequencies of patients in the clinical table

Description

This function aggregates all distinct patients matching each CPRD medcode in the clinical table

Usage

patients_per_medcode(db, clinical_table = "Clinical", patid = "patid", medcode = "medcode")

Arguments

db
a database connection
clinical_table
name of the clinical table in the database
patid
name of the patid field
medcode
name of the medcode field

Details

Note that this does not translate to Read/OXMIS codes. This function should be fast because all of the heavy lifting happens in SQLite before the data is exported to R

Examples

Run this code
## Not run: 
# medcode_counts <- patients_per_medcode(db)
# head(medcode_counts)
# ## End(Not run) 

Run the code above in your browser using DataLab