CALIBERdrugdose-package | R Documentation |
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).
Package: | CALIBERdrugdose |
Type: | Package |
Version: | 0.1-5 |
Date: | 2024-06-06 |
License: | GPL-3 |
Anoop Shah
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
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]))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.