help for cprdhesoputil(Roger Newson)

Inputting Clinical Practice Research Datalink (CPRD) HES/OP linkage datasets into Stata

cprdhesop_patient_pathway using filename [ , clear nokey delimiters("chars"[, collapse|asstring]) ]

cprdhesop_appointment using filename [ , clear nokey delimiters("chars"[, collapse|asstring]) ]

cprdhesop_clinical using filename [ , clear nokey delimiters("chars"[, collapse|asstring]) ]

Description

The cprdhesoputil package is designed for use with the cprdutil package,
which creates Stata datasets from text data files
produced by the Clinical Practice Research Datalink (CPRD).
cprdhesoputil is a suite of utility programs for inputting linkage text data files produced by CPRD
to contain data on the same patients from the Hospital Episode System outpatient events (HES/OP) data warehouse,
and creating equivalent Stata datasets in the memory.
cprdhesoputil uses the SSC packages keyby, chardef and lablist,
which need to be installed for cprdhesoputil to work.

Options

clear specifies that any existing dataset in memory will be replaced.

nokey specifies that the dataset produced will not be sorted by a primary key of variables.
If nokey is not specified for a command that has a nokey option,
then the dataset will be sorted by a primary key of variables,
whose values will normally identify the observations uniquely,
with each value combination present in only one observation.

delimiters("chars"[, collapse|asstring])
specifies the delimiters used in the input text file.
This option functions as the option of the same name for import delimited.

Remarks

The Clinical Practice Research Datalink (CPRD) is a database of information
from primary-care practices in the British Health Service.
Tab-delimited text data files of various types can be produed by CPRD,
containing data on things known to these practices,
such as practices, patients, staff members, clinical events, additional details on clinical events,
consultations, immunisations, referrals, tests, and prescribed therapies.
These text datafiles can then be converted to Stata datasets using the SSC package cprdutil.

Researchers sometimes aim to answer questions about the incidence of events experienced by CPRD patients,
but recorded by data sources other than CPRD, such as the Hospital Episode System Outpatient Events (HES/OP).
The cprdhesoputil package allows users to do this.
It should be used in combination with the cprdhesutil and cprdlinkutil packages,
also downloadable from SSC.
In particular, if the user wants to input a HES/OP patient dataset,
then the user should use the cprdhes_patient module of the cprdhesutil package.

Datasets created by cprdhesoputil modules

Each module of the cprdhesoputil package inputs a text file on disk and creates a Stata dataset in memory,
with 1 observation per row of the input text file.
If the nokey option is not specified,
then the observations in the dataset will be keyed
(sorted and uniquely identified)
by the values of a list of variables, known as a primary key.
These variables, in each observation, identify a thing,
belonging to a class of things such as patients or hospital outpatient attendances.

The modules of cprdhesoputil create datasets in memory,
whose primary keys are as follows:

Module Primary key

cprdhesop_patient_pathway patid attendkey

cprdhesop_appointment patid attendkey

cprdhesop_clinical patid attendkey

The key variable patid is an anonymised CPRD patient ID variable,
and the key variable attendkey is a hospital outpatient attendance ID variable.
CPRD-linked HES outpatient data are provided mostly as records identified by patient
and outpatient attendance.

Examples

The following examples assume that the current folder has a sister folder ../cprdhesopdata,
containing tab-delimited data files for each data type,
with the correct variables.

. cprdhesop_patient_pathway using "../cprdhesopdata/hesop_patient_pathway_18_109_Request4.txt", clear

. cprdhesop_appointment using "../cprdhesopdata/hesop_appointment_18_109_Request4.txt", clear

. cprdhesop_clinical using "../cprdhesopdata/hesop_clinical_18_109_Request4.txt", clear

Author

Roger Newson, Imperial College London, UK.

Email: r.newson@imperial.ac.uk

Also see

Help: Clinical Practice Research Datalink (CPRD)

cprdutil, cprdlinkutil, cprdhesutil, keyby, chardef, lablist if installed