as.drugdose_patterns: Import or Convert a drugdose_patterns Table

Description Usage Arguments Details Value Author(s) References See Also Examples

View source: R/importexport.R

Description

Converts its argument into an object of the class drugdose_patterns for use by the dose conversion algorithm.

Usage

1

Arguments

patterns

Either a drugdose_patterns object (in which case it is returned unchanged), a data.frame, data.table or filename of a csv file in the appropriate format, see 'Details' below.

Details

The data.frame, data.table or file should have the following columns:

words

character; pattern phrase

qty

character; dose quantity or regular expression component for extracting quantity from the matched text.

units

a character vector

freq

a character vector

tot

a character vector

priority

a numeric vector

max

a character vector

time

a character vector

change

a logical vector

choice

a character vector

doubledose

a character vector

duration

a character vector

comment

a character vector

category

a character vector

order

a numeric vector

Value

A data.frame with class 'drugdose_patterns'.

Author(s)

Anoop Shah

References

Shah AD, Martinez C. An algorithm to derive a numerical daily dose from unstructured text dosage instructions. Pharmacoepidemiol Drug Saf 2006; 15(3): 161-166. doi: 10.1002/pds.1151 http://onlinelibrary.wiley.com/doi/10.1002/pds.1151/

See Also

as.drugdose_singlewords, as.drugdose_multiwords as.drugdose_patterns, as.drugdose_lookups, export, addterm

Examples

1
2
3
4
data(patterns)

# Convert to patterns dictionary for analysis
patterns <- as.drugdose_patterns(patterns)

CALIBERdrugdose documentation built on May 21, 2017, 4:06 a.m.

Search within the CALIBERdrugdose package
Search all R packages, documentation and source code

Questions? Problems? Suggestions? Tweet to @rdrrHQ or email at ian@mutexlabs.com.

Please suggest features or report bugs in the GitHub issue tracker.

All documentation is copyright its authors; we didn't write any of that.