medExtractR_tapering {medExtractR} | R Documentation |
Extract Medication Entities From Clinical Note - Extension of medExtractR
for Tapering applications
Description
This function identifies medication entities of interest and returns found expressions with start and stop positions.
Usage
medExtractR_tapering(
note,
drug_names,
unit,
max_dist = 0,
drug_list = "rxnorm",
lastdose = FALSE,
strength_sep = NULL,
...
)
Arguments
note |
Text to search. |
drug_names |
Vector of drug names of interest to locate. |
unit |
Strength unit to look for (e.g., ‘mg’). |
max_dist |
Numeric - edit distance to use when searching for |
drug_list |
Vector of known drugs that may end search window. By default calls
|
lastdose |
Logical - whether or not last dose time entity should be extracted. See ‘Details’ section below for more information. |
strength_sep |
Delimiter for contiguous medication strengths (e.g., ‘-’ for “LTG 200-300”). |
... |
Parameter settings used in dictionary-based entities. For each dictionary-based
entity, the user can supply the optional arguments |
Details
This function uses a combination of regular expressions, rule-based
approaches, and dictionaries to identify various drug entities of interest, with a
particular focus on drugs administered with a tapering schedule.
Specific medications to be found are specified with drug_names
, which
is not case-sensitive or space-sensitive (e.g., ‘lamotrigine XR’ is treated
the same as ‘lamotrigineXR’). Entities to be extracted include drug name, strength,
dose amount, dose strength, frequency, intake time, route, duration, dose schedule,
time keyword, preposition, transition, dispense amount, refill, and time of last dose.
While it is still an optional entity in medExtractR_tapering
, if lastdose=TRUE
then medExtractR_tapering
will search for time of last dose in the same search window used for all
other entities. As a result, there is no need for the lastdose_window_ext
argument. See
extract_entities_tapering
and extract_lastdose
for more details.
When searching for medication names of interest, fuzzy matching may be used.
The max_dist
argument determines the maximum edit distance allowed for
such matches. If using fuzzy matching, any drug name with less than 7 characters
will force an exact match, regardless of the value of max_dist
. The default value of 7 was
selected based on a set of training notes for the drug prednisone, and differs slightly from the default
values of 5 for medExtractR
. The tapering extension does not use the window_length
argument
to define the search window, since tapering schedules can be much longer than a static regimens.
Instead, medExtractR_tapering
dynamically generates the search window based on competing drug names or
phrases, and the distance between consecutive entities. The stength_sep
argument is NULL
by
default, and operates in the same manner as it does in medExtractR
.
By default, the drug_list
argument is “rxnorm” which calls data(rxnorm_druglist)
.
A custom drug list in the form of a character string can be supplied instead, or can be appended
to rxnorm_druglist
by specifying drug_list = c("rxnorm", custom_drug_list)
. This uses
publicly available data courtesy of the U.S. National Library of Medicine (NLM), National
Institutes of Health, Department of Health and Human Services; NLM is not responsible for the product and
does not endorse or recommend this or any other product. See rxnorm_druglist
documentation for details.
Value
data.frame with entity information. If no dosing
information for the drug of interest is found, the following output will be returned:
entity | expr | pos |
NA | NA | NA |
The “entity” column of the output contains the formatted label for that entity, according to
the following mapping.
drug name: “DrugName”
strength: “Strength”
dose amount: “DoseAmt”
dose strength: “DoseStrength”
frequency: “Frequency”
intake time: “IntakeTime”
duration: “Duration”
route: “Route”
dose change: “DoseChange”
dose schedule: “DoseScheule”
time keyword: “TimeKeyword”
transition: “Transition”
preposition: “Preposition”
dispense amount: “DispenseAmt”
refill: “Refill”
time of last dose: “LastDose”
Sample output:
entity | expr | pos |
DoseChange | decrease | 66:74 |
DrugName | Prograf | 78:85 |
Strength | 2 mg | 86:90 |
DoseAmt | 1 | 91:92 |
Frequency | bid | 101:104 |
LastDose | 2100 | 121:125 |
References
Nelson SJ, Zeng K, Kilbourne J, Powell T, Moore R. Normalized names for clinical drugs: RxNorm at 6 years. J Am Med Inform Assoc. 2011 Jul-Aug;18(4)441-8. doi: 10.1136/amiajnl-2011-000116. Epub 2011 Apr 21. PubMed PMID: 21515544; PubMed Central PMCID: PMC3128404.