Title

rxdose -- Find patients who are on drug therapy, based on amount of drug

Syntax

rxdose dose/window [options]

from(date) earliest date at which to begin a window

to(date) latest date at which to end a window

ptid(varname) patient ids

drugid(varname) drug ids

prdate(varname) prescription dates

prdays(varname) prescription durations (ie, days supply)

ddose(varname) daily dose

Description

rxdose identifies patients with a minimum amount of drug (dose) in a specified number of days (window). It requires 5 variables in the datafile: patient-id, drug-id, prescription-date,
prescription-duration (days supply), and daily dose.

If the variables are the first 5 in the dataset, and ordered as above, they don't need to be explicitly specified.

NOTE that the command replaces the data in memory.

Options

from(date) specifies the earliest date at which a patient can be found to be 'on therapy'. Earlier records will be used to calculate any existing carryover at from(date).

It needs to be specified in month-day-year order.

to(date) specifies the latest date on which to consider drug supply. If to() is not specifed, windows for each patient will run to the end of their data.
When to() is specified, all patients have their final window ending on to(), which may make it shorter than the window specified on the command line.

It needs to be specified in month-day-year order.

ptid(varname) specifies the patient-id variable.

drugid(varname) specifies the drug-id variable.

prdate(varname) specifies the prescription-date (fill date) variable. It needs to formatted as a Stata date (ie, an integer representing a number of days).

prdays(varname) specifies the prescription-duration (days supply) variable.

ddose(varname) specifies the quantity of drug prescribed each day.

Remarks

The ddose() variable may have to be created before running this command. Pharmacy data may typically be supplied as quantity and strength, with:

ddose = quantity * strength / days

where strength is verified or converted to be in the units of the main dose parameter.

The data in memory will be replaced. The new dataset will have 3 variables: those specified in ptid() and drugid(), and asof,
which will hold the first date on which the patient both had the drug and had the required dose during the following window.

The data in memory will have one record for every combination of patient and drug in the original dataset. asof will be missing for combinations which never had the minimum dose/window.