CALIBERdoseconvert-package: Extract Drug Dose From Unstructured Dosage Text

Description Details Author(s) References See Also Examples

Description

A program to convert unstructured dosage text into structured dosage information. It was originally designed for general practitioner dosage instructions from the Vision clinical system. The program uses a number of lookup tables of words and patterns which are built in to the package, but with the option of using custom lookup tables.

The main user function is doseconvert, which converts a vector of one or more text dosage instructions into a data.table of structured dose information. The program is designed for speed; it automatically collates identical dosage instructions prior to conversion, and can use multiple processors (using the parallel package on Linux).

The program can be run in server mode using RServe. This is an example using Python on Ubuntu to access an R service (type these commands into the terminal):

# Install required packages (command line):
sudo apt-get install r-cran-rserve
sudo apt-get install python-pip
sudo pip install pyRserve

# Start R in daemon mode:
R CMD Rserve

# Start python:
python

# Now type the following commands in python:
import pyRserve
conn = pyRserve.connect()
conn.voidEval('library(CALIBERdrugdose)')

# Analyse a text
conn.r.doseconvert('2 tablets daily')

# Shut down R session
conn.shutdown()

Example python code for a faster way to run a conversion service (by preloading lookup dictionaries).

Details

Package: CALIBERdrugdose
Type: Package
Version: 0.1-3
Date: 2020-07-21
License: GPL-3

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

doseconvert

Examples

1
2
3
4
5
doseconvert('take 2 puffs twice daily', noisy = TRUE) 

# Interpret onw text from lookups and one new
data(lookups)
doseconvert(c('2 daily', lookups$text[2]))

CALIBERdrugdose documentation built on Aug. 5, 2020, 3 p.m.