compute_ndd {drugprepr}R Documentation

Compute numerical daily dose from free-text prescribing instructions

Description

The function calls the R package doseminer to extract dose information from free-text prescribing instructions, then computes the average numerical daily dose according to a given decision rule.

Usage

compute_ndd(data, dose_fn = mean, freq_fn = mean, interval_fn = mean)

Arguments

data

a data frame containing free-text prescribing instructions in a column called text.

dose_fn

function to summarise range of numbers by a single value

freq_fn

function to summarise range of frequencies by a single value

interval_fn

function to summarise range of intervals by a single value

Details

The general formula for computing numerical daily dose (ndd) is given by

\mbox{ndd} = \mbox{DF} \times \mbox{DN} / \mbox{DI},

where

DF

is dose frequency, the number of dose 'events' per day

DN

is dose number, or number of units of drug taken during each dose 'event'

DI

is dose interval, or the number of days between 'dose days', where an interval of 1 means every day

Prescriptions can have a variable dose frequency or dose number, such as '2-4 tablets up to 3 times per day'. In this case, the user can choose to reduce these ranges to single values by taking the minimum, maximum or average of these endpoints.

Value

A data frame mapping the raw text to structured dosage information.

Examples

compute_ndd(dataset1, min, min, mean)


[Package drugprepr version 0.0.4 Index]