Prepare Electronic Prescription Record Data to Estimate Drug Exposure
Replace missing or implausible prescription durations
Replace implausible or missing numerical daily doses (NDD)
Find implausible entries Replace implausible or missing prescription q...
Decision 9: handle overlapping prescription periods
Run drug preparation algorithm
Example electronic prescription dataset
Get the mode (most common value) of a vector
Impute missing or implausible values
Clean implausibly-long prescription durations
Close small gaps between successive prescriptions
Compute numerical daily dose from free-text prescribing instructions
Decision 1: impute implausible total quantities
Decision 10: close small gaps between successive prescriptions
Decision 2: impute missing total quantities
Decision 3: impute implausible daily doses
Decision 4: impute missing daily doses
Decision 5: impute implausible prescription durations
Decision 6: choose method of calculating prescription duration
Decision 7: impute missing prescription durations
Decision 8: disambiguate prescriptions with the same start date
Separating overlapping prescription periods
Human-friendly interface to the drug prep algorithm
Do values fall outside a specified 'plausible' range?
Shift time intervals until they no longer overlap
Prepare prescription data (such as from the Clinical Practice Research Datalink) into an analysis-ready format, with start and stop dates for each patient's prescriptions. Based on Pye et al (2018) <doi:10.1002/pds.4440>.