make_decisions {drugprepr}R Documentation

Human-friendly interface to the drug prep algorithm

Description

A helper function that allows specifying decision rules using English words rather than alphanumeric codes. Translates the rules into the corresponding codes and then passes them to drug_prep functions.

Usage

make_decisions(
  implausible_qty,
  missing_qty,
  implausible_ndd,
  missing_ndd,
  implausible_duration,
  calculate_duration,
  missing_duration,
  clash_start,
  overlapping,
  small_gaps
)

Arguments

implausible_qty

implausible total drug quantities

missing_qty

missing total drug quantities

implausible_ndd

implausible daily dosage

missing_ndd

missing daily dosage

implausible_duration

overly-long prescription durations

calculate_duration

formula or variable to compute prescription duration

missing_duration

missing prescription duration

clash_start

how to disambiguate prescriptions that start on the same date

overlapping

how to handle prescription periods that overlap with one another

small_gaps

how to handle short gaps between successive prescriptions

The argument decision_phrases may contain the following terms (without brackets, separated with spaces). Additional or incorrectly-named elements will be ignored.

implausible_qty

(ignore|missing|mean|median|mode|next|previous) (individual|practice|population)

implausible_ndd

(ignore|missing|mean|median|mode|next|previous) (individual|practice|population)

implausible_duration

(ignore|missing|truncate) (6|12|24)

missing_qty

(ignore|mean|median|mode|next|previous) (individual|practice|population)

missing_ndd

(ignore|mean|median|mode|next|previous) (individual|practice|population)

missing_duration

(ignore|mean) (individual|population|both)

calculate_duration

(numdays|dose_duration|qty/ndd)

clash_start

(ignore|mean|shortest|longest|sum)

overlapping

(allow|shift)

small_gaps

(ignore|close) (15|30|60)

Value

A character vector suitable for passing to the decisions argument of the drug_prep function.

Examples

make_decisions('ignore',
               'mean population',
               'missing',
               'mean practice',
               'truncate 6',
               'qty / ndd',
               'mean individual',
               'mean',
               'allow',
               'close 15')


[Package drugprepr version 0.0.4 Index]