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:
# Now type the following commands in python:
conn = pyRserve.connect()
# Analyse a text
conn.r.doseconvert('2 tablets daily')
# Shut down R session
Example python code for a faster way to run a conversion service (by preloading lookup dictionaries).
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/
doseconvert('take 2 puffs twice daily')
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.