Pro-Med-NLP

This tutorial describes how to build longitudinal medication dose data from the raw output of an NLP system using the Pro-Med-NLP module.

Elizabeth McNeer, Hannah L. Weeks

Introduction

This tutorial describes how to use the Pro-Med-NLP module to generate longitudinal medication dose data from the raw output of an NLP system. The module is divided into two parts. Part I parses the raw output and pairs entities together, and Part II calculates dose intake and daily dose and removes redundant information (see Choi et al.\(^{1}\) and McNeer et al.\(^{2}\) for details).

To begin we load the EHR package.

# load EHR package
library(EHR)

Part I

Two main functions are used in this part of the module, a parse function and buildDose.

Parse functions

Parse functions are available for the medExtractR, MedXN, CLAMP, and MedEx systems (parseMedExtractR, parseMedXN, parseCLAMP, parseMedEx). If the user has output from another NLP system, the user can write code to standardize the output before calling the buildDose function.

In this tutorial, we will demonstrate the process using the parseMedExtractR function. See “1. EHR Vignette for Extract-Med and Pro-Med-NLP” in the EHR package for details on the other parse functions.

The parse functions output a standardized form of the data that includes a row for each drug mention and columns for all entities anchored to that drug mention.

Running parseMedExtractR

First, we create variables for the filenames of our raw NLP system data. In the EHR package, we have example medExtractR data for tacrolimus and lamotrigine.

tac_mxr_fn <- system.file("examples", "tac_mxr.csv", package = "EHR")
lam_mxr_fn <- system.file("examples", "lam_mxr.csv", package = "EHR")

Below is the example medExtractR output for tacrolimus:

(tac_mxr <- read.csv(file.path(tac_mxr_fn),stringsAsFactors = FALSE))
                         filename     entity        expr       pos
1  tacpid1_2008-06-26_note1_1.txt   DrugName     Prograf   930:937
2  tacpid1_2008-06-26_note1_1.txt   Strength        1 mg   951:955
3  tacpid1_2008-06-26_note1_1.txt    DoseAmt           3   956:957
4  tacpid1_2008-06-26_note1_1.txt  Frequency twice a day   976:987
5  tacpid1_2008-06-26_note1_1.txt   DrugName     prograf 2709:2716
6  tacpid1_2008-06-26_note1_1.txt       Dose         3mg 2717:2720
7  tacpid1_2008-06-26_note1_1.txt  Frequency         bid 2721:2724
8  tacpid1_2008-06-26_note1_1.txt   LastDose      8:30pm 2740:2746
9  tacpid1_2008-06-26_note2_1.txt   DrugName     Prograf   618:625
10 tacpid1_2008-06-26_note2_1.txt   Strength        1 mg   639:643
11 tacpid1_2008-06-26_note2_1.txt    DoseAmt           3   644:645
12 tacpid1_2008-06-26_note2_1.txt  Frequency twice a day   664:675
13 tacpid1_2008-06-26_note2_1.txt   LastDose       14 hr   678:683
14 tacpid1_2008-12-16_note3_1.txt   DrugName  Tacrolimus   722:732
15 tacpid1_2008-12-16_note3_1.txt   DrugName     Prograf   761:768
16 tacpid1_2008-12-16_note3_1.txt   Strength        1 mg   770:774
17 tacpid1_2008-12-16_note3_1.txt    DoseAmt           3   775:776
18 tacpid1_2008-12-16_note3_1.txt  Frequency twice a day   795:806
19 tacpid1_2008-12-16_note3_1.txt DoseChange    decrease 2170:2178
20 tacpid1_2008-12-16_note3_1.txt   DrugName     Prograf 2179:2186
21 tacpid1_2008-12-16_note3_1.txt       Dose         2mg 2190:2193
22 tacpid1_2008-12-16_note3_1.txt  Frequency         bid 2194:2197
23 tacpid1_2008-12-16_note3_1.txt   DrugName     Prograf 2205:2212
24 tacpid1_2008-12-16_note3_1.txt   LastDose    10:30 pm 2231:2239

Here we demonstrate how to run parseMedExtractR using the raw medExtractR output from above.

tac_mxr_parsed <- parseMedExtractR(tac_mxr_fn)
lam_mxr_parsed <- parseMedExtractR(lam_mxr_fn)

The output from all systems, once parsed, has the same structure as the example parsed medExtractR output below.

tac_mxr_parsed
                         filename             drugname       strength        dose route                  freq         dosestr
1: tacpid1_2008-06-26_note1_1.txt    Prograf::930::937 1 mg::951::955 3::956::957       twice a day::976::987                
2: tacpid1_2008-06-26_note1_1.txt  prograf::2709::2716                                        bid::2721::2724 3mg::2717::2720
3: tacpid1_2008-06-26_note2_1.txt    Prograf::618::625 1 mg::639::643 3::644::645       twice a day::664::675                
4: tacpid1_2008-12-16_note3_1.txt Tacrolimus::722::732                                                                       
5: tacpid1_2008-12-16_note3_1.txt    Prograf::761::768 1 mg::770::774 3::775::776       twice a day::795::806                
6: tacpid1_2008-12-16_note3_1.txt  Prograf::2179::2186                                        bid::2194::2197 2mg::2190::2193
7: tacpid1_2008-12-16_note3_1.txt  Prograf::2205::2212                                                                       
             dosechange             lastdose
1:                                          
2:                        8:30pm::2740::2746
3:                           14 hr::678::683
4:                                          
5:                                          
6: decrease::2170::2178                     
7:                      10:30 pm::2231::2239
lam_mxr_parsed
                          filename                 drugname         strength                        dose route
 1: lampid1_2016-02-05_note4_1.txt       Lamictal::810::818                                                   
 2: lampid1_2016-02-05_note4_1.txt    Lamotrigine::847::858  200mg::859::864               1.5::865::868      
 3: lampid1_2016-02-05_note4_1.txt Lamotrigine XR::954::968 100 mg::969::975 3::1000::1001`2::1037::1038      
 4: lampid1_2016-02-05_note5_1.txt            ltg::442::445 200 mg::446::452               1.5::454::457      
 5: lampid1_2016-02-05_note5_1.txt         ltg xr::465::471 100 mg::472::478     3::479::480`2::488::489      
 6: lampid2_2008-07-20_note6_1.txt  lamotrigine::1267::1278                                                   
 7: lampid2_2008-07-20_note6_1.txt     lamictal::1280::1288                                                   
 8: lampid2_2008-07-20_note6_1.txt     Lamictal::2273::2281                                                   
 9: lampid2_2012-04-15_note7_1.txt    lamotrigine::103::114 150 mg::115::121                                  
10: lampid2_2012-04-15_note7_1.txt       Lamictal::141::149                                  1::151::152      
                                       freq            dosestr           dosechange lastdose
 1:                           BID::826::829   300 mg::819::825                              
 2:                   twice daily::873::884                                                 
 3: morning::1025::1032`evening::1062::1069                                                 
 4:                         daily::459::464                                                 
 5:         in am::481::486`in pm::490::495                                                 
 6:                                                                                         
 7:                        q12h::1299::1303 150 mg::1289::1295                              
 8:                         BID::2294::2297  200mg::2285::2290 Increase::2264::2272         
 9:                                                                                         
10:                   twice a day::169::180                                                 

We now have a single row for each drug mention, but we need to pair appropriate entities together. For example, the third lamotrigine mention has two different doses and two different frequencies. The dose of “3” should be paired with the frequency “morning”, and the dose of “2” should be paired with the frequency “evening”. In the next section, we describe how to use the buildDose function to process this parsed data.

buildDose

After the NLP output is parsed, the buildDose function is run to pair the parsed entities. The main buildDose function arguments are as follows:

The output of the buildDose function is a dataset with a column for each entity and a row for each pairing.

Running buildDose

In our medExtractR example from above, the output of the buildDose function is the following:

(tac_part_i_out <- buildDose(tac_mxr_parsed))
                        filename   drugname strength dose route        freq dosestr dosechange lastdose drugname_start
1 tacpid1_2008-06-26_note1_1.txt    Prograf     1 mg    3    NA twice a day    <NA>       <NA>     <NA>            930
2 tacpid1_2008-06-26_note1_1.txt    prograf     <NA> <NA>    NA         bid     3mg       <NA>   8:30pm           2709
3 tacpid1_2008-06-26_note2_1.txt    Prograf     1 mg    3    NA twice a day    <NA>       <NA>    14 hr            618
4 tacpid1_2008-12-16_note3_1.txt Tacrolimus     <NA> <NA>    NA        <NA>    <NA>       <NA>     <NA>            722
5 tacpid1_2008-12-16_note3_1.txt    Prograf     1 mg    3    NA twice a day    <NA>       <NA>     <NA>            761
6 tacpid1_2008-12-16_note3_1.txt    Prograf     <NA> <NA>    NA         bid     2mg   decrease     <NA>           2179
7 tacpid1_2008-12-16_note3_1.txt    Prograf     <NA> <NA>    NA        <NA>    <NA>       <NA> 10:30 pm           2205
(lam_part_i_out <- buildDose(lam_mxr_parsed))
                         filename       drugname strength dose route        freq dosestr dosechange lastdose drugname_start
1  lampid1_2016-02-05_note4_1.txt       Lamictal     <NA> <NA>  <NA>         BID  300 mg       <NA>     <NA>            810
2  lampid1_2016-02-05_note4_1.txt    Lamotrigine    200mg  1.5  <NA> twice daily    <NA>       <NA>     <NA>            847
3  lampid1_2016-02-05_note4_1.txt Lamotrigine XR   100 mg    3  <NA>     morning    <NA>       <NA>     <NA>            954
4  lampid1_2016-02-05_note4_1.txt Lamotrigine XR   100 mg    2  <NA>     evening    <NA>       <NA>     <NA>            954
5  lampid1_2016-02-05_note5_1.txt            ltg   200 mg  1.5  <NA>       daily    <NA>       <NA>     <NA>            442
6  lampid1_2016-02-05_note5_1.txt         ltg xr   100 mg    3  <NA>       in am    <NA>       <NA>     <NA>            465
7  lampid1_2016-02-05_note5_1.txt         ltg xr   100 mg    2  <NA>       in pm    <NA>       <NA>     <NA>            465
8  lampid2_2008-07-20_note6_1.txt    lamotrigine     <NA> <NA>  <NA>        <NA>    <NA>       <NA>     <NA>           1267
9  lampid2_2008-07-20_note6_1.txt       lamictal     <NA> <NA>  <NA>        q12h  150 mg       <NA>     <NA>           1280
10 lampid2_2008-07-20_note6_1.txt       Lamictal     <NA> <NA>  <NA>         BID   200mg   Increase     <NA>           2273
11 lampid2_2012-04-15_note7_1.txt    lamotrigine   150 mg <NA>  <NA>        <NA>    <NA>       <NA>     <NA>            103
12 lampid2_2012-04-15_note7_1.txt       Lamictal     <NA>    1  <NA> twice a day    <NA>       <NA>     <NA>            141

We see that the third mention in the lamotrigine dataset now has two rows (rows 3 and 4), one with a dose of “3” and a frequency of “morning” and one with a dose of “2” and a frequency of “evening”. The “drugname_start” column gives us the start position for the drug name, which tells us that these two rows come from the same mention.

If the checkForRare argument is set to TRUE, any extracted expressions with a proportion of occurrence less than 0.2 are returned as rare values. When rare values are identified, a warning is printed to notify the user. The var column indicates the entity (note that dose in this output refers to dose amount, while dosestr would indicate dose given intake). This can be used as a quick check for potentially inaccurate information and allow the user to remove incorrect extractions before applying the Pro-Med-NLP module as incorrect extractions would reduce accuracy of the dose building data. Note that these values may still be correct extractions even though they are rare, as is the case for our output below.

lam_checkForRare <- buildDose(lam_mxr_parsed, checkForRare=TRUE)
       var   val Freq       Prop
1 drugname   ltg    1 0.08333333
2 strength 150mg    1 0.14285714
3     dose     1    1 0.14285714

Part II

In Part II of the module, we form the final analysis datasets containing computed dosing information at the note and date level for each patient. This process requires more detailed meta data associated with each clinical note file, the format of which is described below.

noteMetaData

The meta data argument is required by the functions collapseDose and processLastDose, and requires four columns: filename, pid, date, note. In our example data, pid (patient ID), date, and note can all be extracted from the filename. Take the filename “tacpid1_2008-06-26_note1_1.txt” for example. It contains information in the form “[PID]_[date]_[note]”, where PID = “tacpid1”, date = “2008-06-26” and note = “note1”. The function below can build our meta data from each of the filenames.

bmd <- function(x) {
  fns <- strsplit(x, '_')
  pid <- sapply(fns, `[`, 1)
  date <- as.Date(sapply(fns, `[`, 2), format = '%Y-%m-%d')
  note <- sapply(fns, `[`, 3)
  data.frame(filename = x, pid, date, note, stringsAsFactors = FALSE)
}
bmd("tacpid1_2008-06-26_note1_1.txt")
                        filename     pid       date  note
1 tacpid1_2008-06-26_note1_1.txt tacpid1 2008-06-26 note1
(tac_metadata <- bmd(tac_part_i_out[['filename']]))
                        filename     pid       date  note
1 tacpid1_2008-06-26_note1_1.txt tacpid1 2008-06-26 note1
2 tacpid1_2008-06-26_note1_1.txt tacpid1 2008-06-26 note1
3 tacpid1_2008-06-26_note2_1.txt tacpid1 2008-06-26 note2
4 tacpid1_2008-12-16_note3_1.txt tacpid1 2008-12-16 note3
5 tacpid1_2008-12-16_note3_1.txt tacpid1 2008-12-16 note3
6 tacpid1_2008-12-16_note3_1.txt tacpid1 2008-12-16 note3
7 tacpid1_2008-12-16_note3_1.txt tacpid1 2008-12-16 note3

collapseDose

The main function used in Part II of the module is the collapseDose function. The output of this function is the final dose data with entities standardized, missing values imputed, dose intake and daily dose calculated, and redundancies removed. Two data.frames are generated one with redundancies removed at the note level and one at the date level (see McNeer et al. (2020) for details).

collapseDose allows the user to split the data using drug names given by regular expressions (...). For example, if the data includes multiple drugs, regular expressions can be specified for each drug. Another use of this function is to split the data by different formulations of the drug, such as separating immediate release formulations from extended release formulations, which are often written using “XR” or “ER” in the drug name.

The collapseDose function requires the following arguments:

Running collapseDose

Below, we demonstrate collapseDose using our lamotrigine example. In the function call, we supply an additional argument 'xr|er' to indicate that we want to separately consider extended release formulations of lamotrigine, (usually denoted by “XR” or “ER”). This prevents regular lamotrigine mentions from being collapsed with lamotrigine XR mentions, even if the dosage is identical.

data(lam_metadata, package = 'EHR')
lam_part_ii <- collapseDose(lam_part_i_out, lam_metadata, naFreq = 'most', 'xr|er')

Note level collapsing:

lam_part_ii$note
                        filename       drugname strength dose  route  freq dosestr dosechange lastdose drugname_start dosestr.num
1 lampid1_2016-02-05_note4_1.txt       Lamictal     <NA> <NA> orally   bid  300 mg       <NA>     <NA>            810         300
2 lampid1_2016-02-05_note4_1.txt Lamotrigine XR   100 mg    3 orally    am    <NA>       <NA>     <NA>            954          NA
3 lampid1_2016-02-05_note4_1.txt Lamotrigine XR   100 mg    2 orally    pm    <NA>       <NA>     <NA>            954          NA
4 lampid1_2016-02-05_note5_1.txt            ltg   200 mg  1.5 orally daily    <NA>       <NA>     <NA>            442          NA
5 lampid1_2016-02-05_note5_1.txt         ltg xr   100 mg    3 orally    am    <NA>       <NA>     <NA>            465          NA
6 lampid1_2016-02-05_note5_1.txt         ltg xr   100 mg    2 orally    pm    <NA>       <NA>     <NA>            465          NA
7 lampid2_2008-07-20_note6_1.txt       lamictal     <NA> <NA> orally   bid  150 mg       <NA>     <NA>           1280         150
8 lampid2_2008-07-20_note6_1.txt       Lamictal     <NA> <NA> orally   bid   200mg   Increase     <NA>           2273         200
9 lampid2_2012-04-15_note7_1.txt       Lamictal     <NA>    1 orally   bid    <NA>       <NA>     <NA>            141          NA
  strength.num doseamt.num freq.num dose.intake intaketime dose.seq dose.daily
1           NA          NA        2         300       <NA>       NA        600
2          100         3.0        1         300         am        1        500
3          100         2.0        1         200         pm        2        500
4          200         1.5        1         300       <NA>       NA        300
5          100         3.0        1         300         am        1        500
6          100         2.0        1         200         pm        2        500
7           NA          NA        2         150       <NA>       NA        300
8           NA          NA        2         200       <NA>       NA        400
9          150         1.0        2         150       <NA>       NA        300

Date level collapsing:

lam_part_ii$date
                        filename       drugname strength dose  route  freq dosestr dosechange lastdose drugname_start dosestr.num
1 lampid1_2016-02-05_note4_1.txt       Lamictal     <NA> <NA> orally   bid  300 mg       <NA>     <NA>            810         300
2 lampid1_2016-02-05_note4_1.txt Lamotrigine XR   100 mg    3 orally    am    <NA>       <NA>     <NA>            954          NA
3 lampid1_2016-02-05_note4_1.txt Lamotrigine XR   100 mg    2 orally    pm    <NA>       <NA>     <NA>            954          NA
4 lampid1_2016-02-05_note5_1.txt            ltg   200 mg  1.5 orally daily    <NA>       <NA>     <NA>            442          NA
5 lampid2_2008-07-20_note6_1.txt       lamictal     <NA> <NA> orally   bid  150 mg       <NA>     <NA>           1280         150
6 lampid2_2008-07-20_note6_1.txt       Lamictal     <NA> <NA> orally   bid   200mg   Increase     <NA>           2273         200
7 lampid2_2012-04-15_note7_1.txt       Lamictal     <NA>    1 orally   bid    <NA>       <NA>     <NA>            141          NA
  strength.num doseamt.num freq.num dose.intake intaketime dose.seq dose.daily
1           NA          NA        2         300       <NA>       NA        600
2          100         3.0        1         300         am        1        500
3          100         2.0        1         200         pm        2        500
4          200         1.5        1         300       <NA>       NA        300
5           NA          NA        2         150       <NA>       NA        300
6           NA          NA        2         200       <NA>       NA        400
7          150         1.0        2         150       <NA>       NA        300

In the final datasets above, we see that a daily dose has been calculated and redundant daily doses have been removed at either the note or date level.

Handling lastdose

In this section, we cover how incorporation of the last dose entity should be handled if it was extracted using medExtractR. In the Running buildDose section above, we see the raw last dose time extractions for the tacrolimus dataset. Using the functions processLastDose and addLastDose, we convert the extracted times into a processed and standardized datetime variable, and add the processed times to the buildDose output.

The processLastDose function requires the following arguments:

Extracted last dose times can fall into two categories: a time expression (e.g., “10am”, “22:00”, “7 last night”) or a duration expression (e.g. “14 hour” level), where the “time” of last dose indicates the number of hours since the last dose was taken relative to the time of the clinical visit. In the latter case, the lab time (from the labData argument) is needed in order to convert the extracted duration expression into a datetime variable. Below is an example lab dataset for our sample tacrolimus data.

data(tac_lab, package = 'EHR')
tac_lab
      pid       date             labtime
1 tacpid1 2008-06-26 2008-06-26 10:42:00
2 tacpid1 2008-12-16 2008-12-16 12:11:00

Within processLastDose, extracted times are converted to time expressions of the format “HH:MM:SS” and assigned a date based on the date of the corresponding note. When the last dose time is after 12pm, it is assumed to have been taken on the previous date.

(tac_ld <- processLastDose(mxrData = tac_mxr, noteMetaData = tac_metadata, labData = tac_lab))
                        filename            lastdose    ld_pos     pid       date raw_time ld_start time_type             labtime
1 tacpid1_2008-06-26_note1_1.txt 2008-06-25 20:30:00 2740:2746 tacpid1 2008-06-26   8:30pm     2740      time 2008-06-26 10:42:00
2 tacpid1_2008-06-26_note2_1.txt 2008-06-25 20:42:00   678:683 tacpid1 2008-06-26    14 hr      678  duration 2008-06-26 10:42:00
3 tacpid1_2008-12-16_note3_1.txt 2008-12-15 22:30:00 2231:2239 tacpid1 2008-12-16 10:30 pm     2231      time 2008-12-16 12:11:00

The function output contains the processed and standardized last dose time (lastdose), the original extracted expression (raw_time), whether the raw expression was a time or duration (time_type), as well as position information for the last dose time (ld_start) for appropriate pairing with dosing information in addLastDose. The labtime column in the output above corresponds to the information provided in the labData argument.

The addLastDose function requires the following arguments:

In the case where last dose information was extracted from clinical notes using medExtractR, the lastdoseData input should be output from the processLastDose function containing the last dose start positions, as demonstrated below. It is possible for multiple times to be extracted from a clinical note. For extracted times within a 2 hour window of one another, addLastDose treats these as equivalent and extracts the last dose time. Note that this may be context-dependent, and this rule was determined based on drugs administered every 12 hours and assuming a trough drug level. For time differences of more than two hours, the last dose start position is used to pair the extracted time with the closest drug mention. Alternatively, if the user has a separate dataset with validated last dose times, they can provide their own dataset. When providing a validated dataset, there should be only one last dose time per patient ID and date.

(tac_part_i_out_lastdose <- addLastDose(buildData = tac_part_i_out, lastdoseData = tac_ld))
                        filename   drugname strength dose route        freq dosestr dosechange            lastdose drugname_start
1 tacpid1_2008-06-26_note1_1.txt    Prograf     1 mg    3    NA twice a day    <NA>       <NA>                <NA>            930
2 tacpid1_2008-06-26_note1_1.txt    prograf     <NA> <NA>    NA         bid     3mg       <NA> 2008-06-25 20:30:00           2709
3 tacpid1_2008-06-26_note2_1.txt    Prograf     1 mg    3    NA twice a day    <NA>       <NA> 2008-06-25 20:42:00            618
4 tacpid1_2008-12-16_note3_1.txt Tacrolimus     <NA> <NA>    NA        <NA>    <NA>       <NA>                <NA>            722
5 tacpid1_2008-12-16_note3_1.txt    Prograf     1 mg    3    NA twice a day    <NA>       <NA>                <NA>            761
6 tacpid1_2008-12-16_note3_1.txt    Prograf     <NA> <NA>    NA         bid     2mg   decrease                <NA>           2179
7 tacpid1_2008-12-16_note3_1.txt    Prograf     <NA> <NA>    NA        <NA>    <NA>       <NA> 2008-12-15 22:30:00           2205

Note that in the lastdose columns, we now have standardized datetime objects instead of the raw extracted expressions.

Running collapseDose with last dose present

For our tacrolimus example above, the output of collapseDose is below. Note that we use the output from addLastDose rather than directly from buildDose.

tac_part_ii <- collapseDose(tac_part_i_out_lastdose, tac_metadata, naFreq = 'most')

Note level collapsing:

tac_part_ii$note
                        filename drugname strength dose  route freq dosestr dosechange            lastdose drugname_start dosestr.num
1 tacpid1_2008-06-26_note1_1.txt  Prograf     1 mg    3 orally  bid    <NA>       <NA> 2008-06-25 20:30:00            930          NA
2 tacpid1_2008-06-26_note2_1.txt  Prograf     1 mg    3 orally  bid    <NA>       <NA> 2008-06-25 20:42:00            618          NA
3 tacpid1_2008-12-16_note3_1.txt  Prograf     1 mg    3 orally  bid    <NA>       <NA> 2008-12-15 22:30:00            761          NA
4 tacpid1_2008-12-16_note3_1.txt  Prograf     <NA> <NA> orally  bid     2mg   decrease 2008-12-15 22:30:00           2179           2
  strength.num doseamt.num freq.num dose.intake intaketime dose.seq dose.daily
1            1           3        2           3       <NA>       NA          6
2            1           3        2           3       <NA>       NA          6
3            1           3        2           3       <NA>       NA          6
4           NA          NA        2           2       <NA>       NA          4

Date level collapsing:

tac_part_ii$date
                        filename drugname strength dose  route freq dosestr dosechange            lastdose drugname_start dosestr.num
1 tacpid1_2008-06-26_note1_1.txt  Prograf     1 mg    3 orally  bid    <NA>       <NA> 2008-06-25 20:30:00            930          NA
2 tacpid1_2008-06-26_note2_1.txt  Prograf     1 mg    3 orally  bid    <NA>       <NA> 2008-06-25 20:42:00            618          NA
3 tacpid1_2008-12-16_note3_1.txt  Prograf     1 mg    3 orally  bid    <NA>       <NA> 2008-12-15 22:30:00            761          NA
4 tacpid1_2008-12-16_note3_1.txt  Prograf     <NA> <NA> orally  bid     2mg   decrease 2008-12-15 22:30:00           2179           2
  strength.num doseamt.num freq.num dose.intake intaketime dose.seq dose.daily
1            1           3        2           3       <NA>       NA          6
2            1           3        2           3       <NA>       NA          6
3            1           3        2           3       <NA>       NA          6
4           NA          NA        2           2       <NA>       NA          4

References

  1. Choi L, Beck C, McNeer E, Weeks HL, Williams ML, James NT, Niu X, Abou-Khalil BW, Birdwell KA, Roden DM, Stein CM. Development of a System for Post-marketing Population Pharmacokinetic and Pharmacodynamic Studies using Real-World Data from Electronic Health Records. Clinical Pharmacology & Therapeutics. 2020 Apr;107(4):934-43. doi: 10.1002/cpt.1787.

  2. McNeer E, Beck C, Weeks HL, Williams ML, James NT, Bejan CA, Choi L. Building Longitudinal Medication Dose Data Using Medication Information Extracted from Clinical Notes in Electronic Health Records. J Am Med Inform Assoc. 2021 Mar 18;28(4):782-790. doi: 10.1093/jamia/ocaa291.

Corrections

If you see mistakes or want to suggest changes, please create an issue on the source repository.