id sid tid token lemma pos 10_1101-2021_01_08_425952 1 1 rdrugtrajectory rdrugtrajectory NN 10_1101-2021_01_08_425952 1 2 : : : 10_1101-2021_01_08_425952 1 3 An an DT 10_1101-2021_01_08_425952 1 4 R r NN 10_1101-2021_01_08_425952 1 5 Package package NN 10_1101-2021_01_08_425952 1 6 for for IN 10_1101-2021_01_08_425952 1 7 the the DT 10_1101-2021_01_08_425952 1 8 Analysis Analysis NNP 10_1101-2021_01_08_425952 1 9 of of IN 10_1101-2021_01_08_425952 1 10 Drug Drug NNP 10_1101-2021_01_08_425952 1 11 Prescriptions Prescriptions NNPS 10_1101-2021_01_08_425952 1 12 in in IN 10_1101-2021_01_08_425952 1 13 Electronic Electronic NNP 10_1101-2021_01_08_425952 1 14 Health Health NNP 10_1101-2021_01_08_425952 1 15 Care Care NNP 10_1101-2021_01_08_425952 1 16 Records Records NNPS 10_1101-2021_01_08_425952 1 17 JSS JSS NNP 10_1101-2021_01_08_425952 1 18 Journal Journal NNP 10_1101-2021_01_08_425952 1 19 of of IN 10_1101-2021_01_08_425952 1 20 Statistical Statistical NNP 10_1101-2021_01_08_425952 1 21 Software Software NNP 10_1101-2021_01_08_425952 1 22 MMMMMM MMMMMM NNS 10_1101-2021_01_08_425952 1 23 YYYY YYYY NNP 10_1101-2021_01_08_425952 1 24 , , , 10_1101-2021_01_08_425952 1 25 Volume volume NN 10_1101-2021_01_08_425952 1 26 VV VV NNP 10_1101-2021_01_08_425952 1 27 , , , 10_1101-2021_01_08_425952 1 28 Issue Issue NNP 10_1101-2021_01_08_425952 1 29 II II NNP 10_1101-2021_01_08_425952 1 30 . . . 10_1101-2021_01_08_425952 2 1 Reddoi reddoi NN 10_1101-2021_01_08_425952 2 2 : : : 10_1101-2021_01_08_425952 2 3 10.18637 10.18637 CD 10_1101-2021_01_08_425952 2 4 / / SYM 10_1101-2021_01_08_425952 2 5 jss.v000.i00 jss.v000.i00 NNP 10_1101-2021_01_08_425952 2 6 rdrugtrajectory rdrugtrajectory NN 10_1101-2021_01_08_425952 2 7 : : : 10_1101-2021_01_08_425952 2 8 An an DT 10_1101-2021_01_08_425952 2 9 R r NN 10_1101-2021_01_08_425952 2 10 Package package NN 10_1101-2021_01_08_425952 2 11 for for IN 10_1101-2021_01_08_425952 2 12 the the DT 10_1101-2021_01_08_425952 2 13 Analysis Analysis NNP 10_1101-2021_01_08_425952 2 14 of of IN 10_1101-2021_01_08_425952 2 15 Drug Drug NNP 10_1101-2021_01_08_425952 2 16 Prescriptions Prescriptions NNPS 10_1101-2021_01_08_425952 2 17 in in IN 10_1101-2021_01_08_425952 2 18 Electronic Electronic NNP 10_1101-2021_01_08_425952 2 19 Health Health NNP 10_1101-2021_01_08_425952 2 20 Care Care NNP 10_1101-2021_01_08_425952 2 21 Records Records NNPS 10_1101-2021_01_08_425952 2 22 Anthony Anthony NNP 10_1101-2021_01_08_425952 2 23 Nash Nash NNP 10_1101-2021_01_08_425952 2 24 University University NNP 10_1101-2021_01_08_425952 2 25 of of IN 10_1101-2021_01_08_425952 2 26 Oxford Oxford NNP 10_1101-2021_01_08_425952 2 27 Tingyee Tingyee NNP 10_1101-2021_01_08_425952 2 28 E. E. NNP 10_1101-2021_01_08_425952 2 29 Chang Chang NNP 10_1101-2021_01_08_425952 2 30 University University NNP 10_1101-2021_01_08_425952 2 31 of of IN 10_1101-2021_01_08_425952 2 32 Oxford Oxford NNP 10_1101-2021_01_08_425952 2 33 Benjamin Benjamin NNP 10_1101-2021_01_08_425952 2 34 Wan Wan NNP 10_1101-2021_01_08_425952 2 35 Kings Kings NNP 10_1101-2021_01_08_425952 2 36 College College NNP 10_1101-2021_01_08_425952 2 37 London London NNP 10_1101-2021_01_08_425952 2 38 M. M. NNP 10_1101-2021_01_08_425952 2 39 Zameel Zameel NNP 10_1101-2021_01_08_425952 2 40 Cader Cader NNP 10_1101-2021_01_08_425952 2 41 University University NNP 10_1101-2021_01_08_425952 2 42 of of IN 10_1101-2021_01_08_425952 2 43 Oxford Oxford NNP 10_1101-2021_01_08_425952 2 44 Abstract Abstract NNP 10_1101-2021_01_08_425952 2 45 Primary Primary NNP 10_1101-2021_01_08_425952 2 46 care care VB 10_1101-2021_01_08_425952 2 47 electronic electronic JJ 10_1101-2021_01_08_425952 2 48 health health NN 10_1101-2021_01_08_425952 2 49 care care NN 10_1101-2021_01_08_425952 2 50 records record NNS 10_1101-2021_01_08_425952 2 51 are be VBP 10_1101-2021_01_08_425952 2 52 rich rich JJ 10_1101-2021_01_08_425952 2 53 with with IN 10_1101-2021_01_08_425952 2 54 patient patient JJ 10_1101-2021_01_08_425952 2 55 and and CC 10_1101-2021_01_08_425952 2 56 clinical clinical JJ 10_1101-2021_01_08_425952 2 57 infor- infor- XX 10_1101-2021_01_08_425952 2 58 mation mation NN 10_1101-2021_01_08_425952 2 59 . . . 10_1101-2021_01_08_425952 3 1 Studying study VBG 10_1101-2021_01_08_425952 3 2 electronic electronic JJ 10_1101-2021_01_08_425952 3 3 health health NN 10_1101-2021_01_08_425952 3 4 care care NN 10_1101-2021_01_08_425952 3 5 records record NNS 10_1101-2021_01_08_425952 3 6 has have VBZ 10_1101-2021_01_08_425952 3 7 resulted result VBN 10_1101-2021_01_08_425952 3 8 in in IN 10_1101-2021_01_08_425952 3 9 marked mark VBN 10_1101-2021_01_08_425952 3 10 improvements improvement NNS 10_1101-2021_01_08_425952 3 11 to to IN 10_1101-2021_01_08_425952 3 12 national national JJ 10_1101-2021_01_08_425952 3 13 health health NN 10_1101-2021_01_08_425952 3 14 care care NN 10_1101-2021_01_08_425952 3 15 processes process NNS 10_1101-2021_01_08_425952 3 16 and and CC 10_1101-2021_01_08_425952 3 17 patient patient JJ 10_1101-2021_01_08_425952 3 18 - - HYPH 10_1101-2021_01_08_425952 3 19 care care NN 10_1101-2021_01_08_425952 3 20 decision decision NN 10_1101-2021_01_08_425952 3 21 making making NN 10_1101-2021_01_08_425952 3 22 , , , 10_1101-2021_01_08_425952 3 23 and and CC 10_1101-2021_01_08_425952 3 24 is be VBZ 10_1101-2021_01_08_425952 3 25 a a DT 10_1101-2021_01_08_425952 3 26 powerful powerful JJ 10_1101-2021_01_08_425952 3 27 supple- supple- NN 10_1101-2021_01_08_425952 3 28 mentary mentary NNP 10_1101-2021_01_08_425952 3 29 source source NN 10_1101-2021_01_08_425952 3 30 of of IN 10_1101-2021_01_08_425952 3 31 data datum NNS 10_1101-2021_01_08_425952 3 32 for for IN 10_1101-2021_01_08_425952 3 33 drug drug NN 10_1101-2021_01_08_425952 3 34 discovery discovery NN 10_1101-2021_01_08_425952 3 35 effort effort NN 10_1101-2021_01_08_425952 3 36 . . . 10_1101-2021_01_08_425952 4 1 We -PRON- PRP 10_1101-2021_01_08_425952 4 2 present present VBP 10_1101-2021_01_08_425952 4 3 the the DT 10_1101-2021_01_08_425952 4 4 R r NN 10_1101-2021_01_08_425952 4 5 package package NN 10_1101-2021_01_08_425952 4 6 rdrugtrajec- rdrugtrajec- XX 10_1101-2021_01_08_425952 4 7 tory tory NN 10_1101-2021_01_08_425952 4 8 , , , 10_1101-2021_01_08_425952 4 9 designed design VBN 10_1101-2021_01_08_425952 4 10 to to TO 10_1101-2021_01_08_425952 4 11 yield yield VB 10_1101-2021_01_08_425952 4 12 demographic demographic JJ 10_1101-2021_01_08_425952 4 13 and and CC 10_1101-2021_01_08_425952 4 14 patient patient JJ 10_1101-2021_01_08_425952 4 15 - - HYPH 10_1101-2021_01_08_425952 4 16 level level NN 10_1101-2021_01_08_425952 4 17 characteristics characteristic NNS 10_1101-2021_01_08_425952 4 18 of of IN 10_1101-2021_01_08_425952 4 19 drug drug NN 10_1101-2021_01_08_425952 4 20 prescriptions prescription NNS 10_1101-2021_01_08_425952 4 21 in in IN 10_1101-2021_01_08_425952 4 22 the the DT 10_1101-2021_01_08_425952 4 23 UK UK NNP 10_1101-2021_01_08_425952 4 24 Clinical Clinical NNP 10_1101-2021_01_08_425952 4 25 Practice Practice NNP 10_1101-2021_01_08_425952 4 26 Research Research NNP 10_1101-2021_01_08_425952 4 27 Datalink Datalink NNP 10_1101-2021_01_08_425952 4 28 dataset dataset NN 10_1101-2021_01_08_425952 4 29 . . . 10_1101-2021_01_08_425952 5 1 The the DT 10_1101-2021_01_08_425952 5 2 package package NN 10_1101-2021_01_08_425952 5 3 operates operate VBZ 10_1101-2021_01_08_425952 5 4 over over IN 10_1101-2021_01_08_425952 5 5 Clin- clin- RB 10_1101-2021_01_08_425952 5 6 ical ical JJ 10_1101-2021_01_08_425952 5 7 Practice Practice NNP 10_1101-2021_01_08_425952 5 8 Research Research NNP 10_1101-2021_01_08_425952 5 9 Datalink Datalink NNP 10_1101-2021_01_08_425952 5 10 Gold Gold NNP 10_1101-2021_01_08_425952 5 11 clinical clinical JJ 10_1101-2021_01_08_425952 5 12 , , , 10_1101-2021_01_08_425952 5 13 referral referral NN 10_1101-2021_01_08_425952 5 14 and and CC 10_1101-2021_01_08_425952 5 15 therapy therapy NN 10_1101-2021_01_08_425952 5 16 datasets dataset NNS 10_1101-2021_01_08_425952 5 17 and and CC 10_1101-2021_01_08_425952 5 18 includes include VBZ 10_1101-2021_01_08_425952 5 19 features feature NNS 10_1101-2021_01_08_425952 5 20 such such JJ 10_1101-2021_01_08_425952 5 21 as as IN 10_1101-2021_01_08_425952 5 22 first first JJ 10_1101-2021_01_08_425952 5 23 drug drug NN 10_1101-2021_01_08_425952 5 24 prescriptions prescription NNS 10_1101-2021_01_08_425952 5 25 analysis analysis NN 10_1101-2021_01_08_425952 5 26 , , , 10_1101-2021_01_08_425952 5 27 cohort cohort NN 10_1101-2021_01_08_425952 5 28 - - HYPH 10_1101-2021_01_08_425952 5 29 wide wide JJ 10_1101-2021_01_08_425952 5 30 prescription prescription NN 10_1101-2021_01_08_425952 5 31 information information NN 10_1101-2021_01_08_425952 5 32 , , , 10_1101-2021_01_08_425952 5 33 cu- cu- VBP 10_1101-2021_01_08_425952 5 34 mulative mulative JJ 10_1101-2021_01_08_425952 5 35 drug drug NN 10_1101-2021_01_08_425952 5 36 prescription prescription NN 10_1101-2021_01_08_425952 5 37 events event NNS 10_1101-2021_01_08_425952 5 38 , , , 10_1101-2021_01_08_425952 5 39 the the DT 10_1101-2021_01_08_425952 5 40 longitudinal longitudinal JJ 10_1101-2021_01_08_425952 5 41 trajectory trajectory NN 10_1101-2021_01_08_425952 5 42 of of IN 10_1101-2021_01_08_425952 5 43 drug drug NN 10_1101-2021_01_08_425952 5 44 prescriptions prescription NNS 10_1101-2021_01_08_425952 5 45 , , , 10_1101-2021_01_08_425952 5 46 and and CC 10_1101-2021_01_08_425952 5 47 a a DT 10_1101-2021_01_08_425952 5 48 survival survival NN 10_1101-2021_01_08_425952 5 49 analysis analysis NN 10_1101-2021_01_08_425952 5 50 timeline timeline NN 10_1101-2021_01_08_425952 5 51 builder builder NN 10_1101-2021_01_08_425952 5 52 to to TO 10_1101-2021_01_08_425952 5 53 identify identify VB 10_1101-2021_01_08_425952 5 54 risks risk NNS 10_1101-2021_01_08_425952 5 55 related relate VBN 10_1101-2021_01_08_425952 5 56 to to IN 10_1101-2021_01_08_425952 5 57 drug drug NN 10_1101-2021_01_08_425952 5 58 prescription prescription NN 10_1101-2021_01_08_425952 5 59 switching switching NN 10_1101-2021_01_08_425952 5 60 . . . 10_1101-2021_01_08_425952 6 1 The the DT 10_1101-2021_01_08_425952 6 2 rdrugtrajectory rdrugtrajectory JJ 10_1101-2021_01_08_425952 6 3 package package NN 10_1101-2021_01_08_425952 6 4 has have VBZ 10_1101-2021_01_08_425952 6 5 been be VBN 10_1101-2021_01_08_425952 6 6 made make VBN 10_1101-2021_01_08_425952 6 7 freely freely RB 10_1101-2021_01_08_425952 6 8 available available JJ 10_1101-2021_01_08_425952 6 9 via via IN 10_1101-2021_01_08_425952 6 10 the the DT 10_1101-2021_01_08_425952 6 11 GitHub GitHub NNP 10_1101-2021_01_08_425952 6 12 repository repository NN 10_1101-2021_01_08_425952 6 13 . . . 10_1101-2021_01_08_425952 7 1 Keywords keyword NNS 10_1101-2021_01_08_425952 7 2 : : : 10_1101-2021_01_08_425952 7 3 EHR ehr NN 10_1101-2021_01_08_425952 7 4 , , , 10_1101-2021_01_08_425952 7 5 electronic electronic JJ 10_1101-2021_01_08_425952 7 6 health health NN 10_1101-2021_01_08_425952 7 7 care care NN 10_1101-2021_01_08_425952 7 8 records record NNS 10_1101-2021_01_08_425952 7 9 , , , 10_1101-2021_01_08_425952 7 10 CPRD CPRD NNP 10_1101-2021_01_08_425952 7 11 , , , 10_1101-2021_01_08_425952 7 12 Clinical Clinical NNP 10_1101-2021_01_08_425952 7 13 Practice Practice NNP 10_1101-2021_01_08_425952 7 14 Research Research NNP 10_1101-2021_01_08_425952 7 15 Datalink Datalink NNP 10_1101-2021_01_08_425952 7 16 , , , 10_1101-2021_01_08_425952 7 17 prescriptions prescription NNS 10_1101-2021_01_08_425952 7 18 , , , 10_1101-2021_01_08_425952 7 19 R r NN 10_1101-2021_01_08_425952 7 20 , , , 10_1101-2021_01_08_425952 7 21 therapeutics therapeutic NNS 10_1101-2021_01_08_425952 7 22 , , , 10_1101-2021_01_08_425952 7 23 drug drug NN 10_1101-2021_01_08_425952 7 24 discovery discovery NN 10_1101-2021_01_08_425952 7 25 , , , 10_1101-2021_01_08_425952 7 26 clinical clinical JJ 10_1101-2021_01_08_425952 7 27 epidemiology epidemiology NN 10_1101-2021_01_08_425952 7 28 . . . 10_1101-2021_01_08_425952 8 1 1 1 LS 10_1101-2021_01_08_425952 8 2 . . . 10_1101-2021_01_08_425952 9 1 Introduction introduction NN 10_1101-2021_01_08_425952 9 2 The the DT 10_1101-2021_01_08_425952 9 3 UK UK NNP 10_1101-2021_01_08_425952 9 4 Clinical Clinical NNP 10_1101-2021_01_08_425952 9 5 Practice Practice NNP 10_1101-2021_01_08_425952 9 6 Research Research NNP 10_1101-2021_01_08_425952 9 7 Datalink Datalink NNP 10_1101-2021_01_08_425952 9 8 ( ( -LRB- 10_1101-2021_01_08_425952 9 9 CPRD CPRD NNP 10_1101-2021_01_08_425952 9 10 ) ) -RRB- 10_1101-2021_01_08_425952 9 11 service service NN 10_1101-2021_01_08_425952 9 12 offers offer VBZ 10_1101-2021_01_08_425952 9 13 high high JJ 10_1101-2021_01_08_425952 9 14 quality quality NN 10_1101-2021_01_08_425952 9 15 longitudinal longitudinal JJ 10_1101-2021_01_08_425952 9 16 data datum NNS 10_1101-2021_01_08_425952 9 17 on on IN 10_1101-2021_01_08_425952 9 18 50 50 CD 10_1101-2021_01_08_425952 9 19 million million CD 10_1101-2021_01_08_425952 9 20 patients patient NNS 10_1101-2021_01_08_425952 9 21 with with IN 10_1101-2021_01_08_425952 9 22 up up IN 10_1101-2021_01_08_425952 9 23 to to TO 10_1101-2021_01_08_425952 9 24 20 20 CD 10_1101-2021_01_08_425952 9 25 years year NNS 10_1101-2021_01_08_425952 9 26 of of IN 10_1101-2021_01_08_425952 9 27 follow follow NN 10_1101-2021_01_08_425952 9 28 - - HYPH 10_1101-2021_01_08_425952 9 29 up up NN 10_1101-2021_01_08_425952 9 30 for for IN 10_1101-2021_01_08_425952 9 31 25 25 CD 10_1101-2021_01_08_425952 9 32 % % NN 10_1101-2021_01_08_425952 9 33 of of IN 10_1101-2021_01_08_425952 9 34 those those DT 10_1101-2021_01_08_425952 9 35 patients patient NNS 10_1101-2021_01_08_425952 9 36 . . . 10_1101-2021_01_08_425952 10 1 The the DT 10_1101-2021_01_08_425952 10 2 service service NN 10_1101-2021_01_08_425952 10 3 provides provide VBZ 10_1101-2021_01_08_425952 10 4 drug drug NN 10_1101-2021_01_08_425952 10 5 treatment treatment NN 10_1101-2021_01_08_425952 10 6 patterns pattern NNS 10_1101-2021_01_08_425952 10 7 , , , 10_1101-2021_01_08_425952 10 8 feasibility feasibility NN 10_1101-2021_01_08_425952 10 9 studies study NNS 10_1101-2021_01_08_425952 10 10 and and CC 10_1101-2021_01_08_425952 10 11 health health NN 10_1101-2021_01_08_425952 10 12 care care NN 10_1101-2021_01_08_425952 10 13 resource resource NN 10_1101-2021_01_08_425952 10 14 use use NN 10_1101-2021_01_08_425952 10 15 stud- stud- NNP 10_1101-2021_01_08_425952 10 16 ies ies NNP 10_1101-2021_01_08_425952 10 17 . . . 10_1101-2021_01_08_425952 11 1 Patient patient JJ 10_1101-2021_01_08_425952 11 2 electronic electronic JJ 10_1101-2021_01_08_425952 11 3 health health NN 10_1101-2021_01_08_425952 11 4 care care NN 10_1101-2021_01_08_425952 11 5 records record NNS 10_1101-2021_01_08_425952 11 6 ( ( -LRB- 10_1101-2021_01_08_425952 11 7 EHR ehr NN 10_1101-2021_01_08_425952 11 8 ) ) -RRB- 10_1101-2021_01_08_425952 11 9 are be VBP 10_1101-2021_01_08_425952 11 10 stored store VBN 10_1101-2021_01_08_425952 11 11 as as IN 10_1101-2021_01_08_425952 11 12 coded code VBN 10_1101-2021_01_08_425952 11 13 and and CC 10_1101-2021_01_08_425952 11 14 anonymised anonymise VBN 10_1101-2021_01_08_425952 11 15 data datum NNS 10_1101-2021_01_08_425952 11 16 and and CC 10_1101-2021_01_08_425952 11 17 sourced source VBN 10_1101-2021_01_08_425952 11 18 from from IN 10_1101-2021_01_08_425952 11 19 over over IN 10_1101-2021_01_08_425952 11 20 1,800 1,800 CD 10_1101-2021_01_08_425952 11 21 primary primary JJ 10_1101-2021_01_08_425952 11 22 care care NN 10_1101-2021_01_08_425952 11 23 practices practice NNS 10_1101-2021_01_08_425952 11 24 across across IN 10_1101-2021_01_08_425952 11 25 England England NNP 10_1101-2021_01_08_425952 11 26 . . . 10_1101-2021_01_08_425952 12 1 CPRD CPRD NNP 10_1101-2021_01_08_425952 12 2 holds hold VBZ 10_1101-2021_01_08_425952 12 3 informa- informa- JJ 10_1101-2021_01_08_425952 12 4 tion tion NN 10_1101-2021_01_08_425952 12 5 on on IN 10_1101-2021_01_08_425952 12 6 consultation consultation NN 10_1101-2021_01_08_425952 12 7 events event NNS 10_1101-2021_01_08_425952 12 8 , , , 10_1101-2021_01_08_425952 12 9 medical medical JJ 10_1101-2021_01_08_425952 12 10 diagnoses diagnosis NNS 10_1101-2021_01_08_425952 12 11 , , , 10_1101-2021_01_08_425952 12 12 symptoms symptom NNS 10_1101-2021_01_08_425952 12 13 , , , 10_1101-2021_01_08_425952 12 14 prescriptions prescription NNS 10_1101-2021_01_08_425952 12 15 , , , 10_1101-2021_01_08_425952 12 16 vaccination vaccination NN 10_1101-2021_01_08_425952 12 17 history history NN 10_1101-2021_01_08_425952 12 18 , , , 10_1101-2021_01_08_425952 12 19 laboratory laboratory NN 10_1101-2021_01_08_425952 12 20 tests test NNS 10_1101-2021_01_08_425952 12 21 , , , 10_1101-2021_01_08_425952 12 22 and and CC 10_1101-2021_01_08_425952 12 23 referrals referral NNS 10_1101-2021_01_08_425952 12 24 . . . 10_1101-2021_01_08_425952 13 1 CPRD CPRD NNP 10_1101-2021_01_08_425952 13 2 can can MD 10_1101-2021_01_08_425952 13 3 provide provide VB 10_1101-2021_01_08_425952 13 4 routine routine JJ 10_1101-2021_01_08_425952 13 5 linkage linkage NN 10_1101-2021_01_08_425952 13 6 to to IN 10_1101-2021_01_08_425952 13 7 other other JJ 10_1101-2021_01_08_425952 13 8 health health NN 10_1101-2021_01_08_425952 13 9 - - HYPH 10_1101-2021_01_08_425952 13 10 related relate VBN 10_1101-2021_01_08_425952 13 11 patient patient JJ 10_1101-2021_01_08_425952 13 12 datasets dataset NNS 10_1101-2021_01_08_425952 13 13 , , , 10_1101-2021_01_08_425952 13 14 for for IN 10_1101-2021_01_08_425952 13 15 example example NN 10_1101-2021_01_08_425952 13 16 : : : 10_1101-2021_01_08_425952 13 17 Small small JJ 10_1101-2021_01_08_425952 13 18 area area NN 10_1101-2021_01_08_425952 13 19 level level NN 10_1101-2021_01_08_425952 13 20 data datum NNS 10_1101-2021_01_08_425952 13 21 , , , 10_1101-2021_01_08_425952 13 22 such such JJ 10_1101-2021_01_08_425952 13 23 as as IN 10_1101-2021_01_08_425952 13 24 patient patient NN 10_1101-2021_01_08_425952 13 25 and/or and/or CC 10_1101-2021_01_08_425952 13 26 practice practice NN 10_1101-2021_01_08_425952 13 27 postcode postcode NN 10_1101-2021_01_08_425952 13 28 .CC .CC , 10_1101-2021_01_08_425952 13 29 - - : 10_1101-2021_01_08_425952 13 30 BY by IN 10_1101-2021_01_08_425952 13 31 - - HYPH 10_1101-2021_01_08_425952 13 32 ND ND NNP 10_1101-2021_01_08_425952 13 33 4.0 4.0 CD 10_1101-2021_01_08_425952 13 34 International international JJ 10_1101-2021_01_08_425952 13 35 licensemade licensemade NN 10_1101-2021_01_08_425952 13 36 available available JJ 10_1101-2021_01_08_425952 13 37 under under IN 10_1101-2021_01_08_425952 13 38 a a DT 10_1101-2021_01_08_425952 13 39 ( ( -LRB- 10_1101-2021_01_08_425952 13 40 which which WDT 10_1101-2021_01_08_425952 13 41 was be VBD 10_1101-2021_01_08_425952 13 42 not not RB 10_1101-2021_01_08_425952 13 43 certified certify VBN 10_1101-2021_01_08_425952 13 44 by by IN 10_1101-2021_01_08_425952 13 45 peer peer NN 10_1101-2021_01_08_425952 13 46 review review NN 10_1101-2021_01_08_425952 13 47 ) ) -RRB- 10_1101-2021_01_08_425952 13 48 is be VBZ 10_1101-2021_01_08_425952 13 49 the the DT 10_1101-2021_01_08_425952 13 50 author author NN 10_1101-2021_01_08_425952 13 51 / / SYM 10_1101-2021_01_08_425952 13 52 funder funder NN 10_1101-2021_01_08_425952 13 53 , , , 10_1101-2021_01_08_425952 13 54 who who WP 10_1101-2021_01_08_425952 13 55 has have VBZ 10_1101-2021_01_08_425952 13 56 granted grant VBN 10_1101-2021_01_08_425952 13 57 bioRxiv biorxiv IN 10_1101-2021_01_08_425952 13 58 a a DT 10_1101-2021_01_08_425952 13 59 license license NN 10_1101-2021_01_08_425952 13 60 to to TO 10_1101-2021_01_08_425952 13 61 display display VB 10_1101-2021_01_08_425952 13 62 the the DT 10_1101-2021_01_08_425952 13 63 preprint preprint NN 10_1101-2021_01_08_425952 13 64 in in IN 10_1101-2021_01_08_425952 13 65 perpetuity perpetuity NN 10_1101-2021_01_08_425952 13 66 . . . 10_1101-2021_01_08_425952 14 1 It -PRON- PRP 10_1101-2021_01_08_425952 14 2 is be VBZ 10_1101-2021_01_08_425952 14 3 The the DT 10_1101-2021_01_08_425952 14 4 copyright copyright NN 10_1101-2021_01_08_425952 14 5 holder holder NN 10_1101-2021_01_08_425952 14 6 for for IN 10_1101-2021_01_08_425952 14 7 this this DT 10_1101-2021_01_08_425952 14 8 preprintthis preprintthis NN 10_1101-2021_01_08_425952 14 9 version version NN 10_1101-2021_01_08_425952 14 10 posted post VBD 10_1101-2021_01_08_425952 14 11 January January NNP 10_1101-2021_01_08_425952 14 12 9 9 CD 10_1101-2021_01_08_425952 14 13 , , , 10_1101-2021_01_08_425952 14 14 2021 2021 CD 10_1101-2021_01_08_425952 14 15 . . . 10_1101-2021_01_08_425952 14 16 ; ; : 10_1101-2021_01_08_425952 14 17 https://doi.org/10.1101/2021.01.08.425952doi https://doi.org/10.1101/2021.01.08.425952doi ADD 10_1101-2021_01_08_425952 14 18 : : : 10_1101-2021_01_08_425952 14 19 bioRxiv biorxiv IN 10_1101-2021_01_08_425952 14 20 preprint preprint NN 10_1101-2021_01_08_425952 14 21 http://dx.doi.org/10.18637/jss.v000.i00 http://dx.doi.org/10.18637/jss.v000.i00 NNP 10_1101-2021_01_08_425952 14 22 https://doi.org/10.1101/2021.01.08.425952 https://doi.org/10.1101/2021.01.08.425952 NNP 10_1101-2021_01_08_425952 14 23 http://creativecommons.org/licenses/by-nd/4.0/ http://creativecommons.org/licenses/by-nd/4.0/ NNP 10_1101-2021_01_08_425952 14 24 2 2 CD 10_1101-2021_01_08_425952 14 25 rdrugtrajectory rdrugtrajectory NN 10_1101-2021_01_08_425952 14 26 : : : 10_1101-2021_01_08_425952 14 27 Analysing Analysing NNP 10_1101-2021_01_08_425952 14 28 Drug Drug NNP 10_1101-2021_01_08_425952 14 29 Prescriptions Prescriptions NNPS 10_1101-2021_01_08_425952 14 30 in in IN 10_1101-2021_01_08_425952 14 31 Electronic Electronic NNP 10_1101-2021_01_08_425952 14 32 Health Health NNP 10_1101-2021_01_08_425952 14 33 Care Care NNP 10_1101-2021_01_08_425952 14 34 Records Records NNPS 10_1101-2021_01_08_425952 14 35 linked link VBD 10_1101-2021_01_08_425952 14 36 deprivation deprivation NN 10_1101-2021_01_08_425952 14 37 measures measure NNS 10_1101-2021_01_08_425952 14 38 ; ; : 10_1101-2021_01_08_425952 14 39 data datum NNS 10_1101-2021_01_08_425952 14 40 from from IN 10_1101-2021_01_08_425952 14 41 NHS NHS NNP 10_1101-2021_01_08_425952 14 42 digital digital NNP 10_1101-2021_01_08_425952 14 43 which which WDT 10_1101-2021_01_08_425952 14 44 includes include VBZ 10_1101-2021_01_08_425952 14 45 hospital hospital NN 10_1101-2021_01_08_425952 14 46 episode episode NNP 10_1101-2021_01_08_425952 14 47 statistic statistic NNP 10_1101-2021_01_08_425952 14 48 , , , 10_1101-2021_01_08_425952 14 49 outpatient outpatient NN 10_1101-2021_01_08_425952 14 50 and and CC 10_1101-2021_01_08_425952 14 51 accident accident NN 10_1101-2021_01_08_425952 14 52 and and CC 10_1101-2021_01_08_425952 14 53 emergency emergency NN 10_1101-2021_01_08_425952 14 54 data datum NNS 10_1101-2021_01_08_425952 14 55 ; ; : 10_1101-2021_01_08_425952 14 56 and and CC 10_1101-2021_01_08_425952 14 57 cancer cancer NN 10_1101-2021_01_08_425952 14 58 data datum NNS 10_1101-2021_01_08_425952 14 59 from from IN 10_1101-2021_01_08_425952 14 60 Public Public NNP 10_1101-2021_01_08_425952 14 61 Health Health NNP 10_1101-2021_01_08_425952 14 62 England England NNP 10_1101-2021_01_08_425952 14 63 . . . 10_1101-2021_01_08_425952 15 1 Evidence evidence NN 10_1101-2021_01_08_425952 15 2 from from IN 10_1101-2021_01_08_425952 15 3 EHRs EHRs NNPS 10_1101-2021_01_08_425952 15 4 is be VBZ 10_1101-2021_01_08_425952 15 5 making make VBG 10_1101-2021_01_08_425952 15 6 an an DT 10_1101-2021_01_08_425952 15 7 impact impact NN 10_1101-2021_01_08_425952 15 8 on on IN 10_1101-2021_01_08_425952 15 9 primary primary JJ 10_1101-2021_01_08_425952 15 10 care care NN 10_1101-2021_01_08_425952 15 11 decision decision NN 10_1101-2021_01_08_425952 15 12 - - HYPH 10_1101-2021_01_08_425952 15 13 making making NN 10_1101-2021_01_08_425952 15 14 and and CC 10_1101-2021_01_08_425952 15 15 best good JJS 10_1101-2021_01_08_425952 15 16 prac- prac- NN 10_1101-2021_01_08_425952 15 17 tice tice RB 10_1101-2021_01_08_425952 15 18 Oyinlola Oyinlola NNP 10_1101-2021_01_08_425952 15 19 et et FW 10_1101-2021_01_08_425952 15 20 al al NNP 10_1101-2021_01_08_425952 15 21 . . . 10_1101-2021_01_08_425952 16 1 ( ( -LRB- 10_1101-2021_01_08_425952 16 2 2016 2016 CD 10_1101-2021_01_08_425952 16 3 ) ) -RRB- 10_1101-2021_01_08_425952 16 4 . . . 10_1101-2021_01_08_425952 17 1 With with IN 10_1101-2021_01_08_425952 17 2 nationwide nationwide JJ 10_1101-2021_01_08_425952 17 3 longitudinal longitudinal JJ 10_1101-2021_01_08_425952 17 4 datasets dataset NNS 10_1101-2021_01_08_425952 17 5 more more RBR 10_1101-2021_01_08_425952 17 6 readily readily RB 10_1101-2021_01_08_425952 17 7 available available JJ 10_1101-2021_01_08_425952 17 8 , , , 10_1101-2021_01_08_425952 17 9 the the DT 10_1101-2021_01_08_425952 17 10 evaluation evaluation NN 10_1101-2021_01_08_425952 17 11 of of IN 10_1101-2021_01_08_425952 17 12 treatments treatment NNS 10_1101-2021_01_08_425952 17 13 over over IN 10_1101-2021_01_08_425952 17 14 long long JJ 10_1101-2021_01_08_425952 17 15 timescales timescale NNS 10_1101-2021_01_08_425952 17 16 can can MD 10_1101-2021_01_08_425952 17 17 contribute contribute VB 10_1101-2021_01_08_425952 17 18 to to IN 10_1101-2021_01_08_425952 17 19 clinical clinical JJ 10_1101-2021_01_08_425952 17 20 decision decision NN 10_1101-2021_01_08_425952 17 21 - - HYPH 10_1101-2021_01_08_425952 17 22 making make VBG 10_1101-2021_01_08_425952 17 23 Hepp Hepp NNP 10_1101-2021_01_08_425952 17 24 et et FW 10_1101-2021_01_08_425952 17 25 al al NNP 10_1101-2021_01_08_425952 17 26 . . . 10_1101-2021_01_08_425952 18 1 ( ( -LRB- 10_1101-2021_01_08_425952 18 2 2017 2017 CD 10_1101-2021_01_08_425952 18 3 ) ) -RRB- 10_1101-2021_01_08_425952 18 4 . . . 10_1101-2021_01_08_425952 19 1 For for IN 10_1101-2021_01_08_425952 19 2 example example NN 10_1101-2021_01_08_425952 19 3 , , , 10_1101-2021_01_08_425952 19 4 adverse adverse JJ 10_1101-2021_01_08_425952 19 5 events event NNS 10_1101-2021_01_08_425952 19 6 caused cause VBN 10_1101-2021_01_08_425952 19 7 by by IN 10_1101-2021_01_08_425952 19 8 prescription prescription NN 10_1101-2021_01_08_425952 19 9 medication medication NN 10_1101-2021_01_08_425952 19 10 can can MD 10_1101-2021_01_08_425952 19 11 be be VB 10_1101-2021_01_08_425952 19 12 studied study VBN 10_1101-2021_01_08_425952 19 13 using use VBG 10_1101-2021_01_08_425952 19 14 retrospective retrospective JJ 10_1101-2021_01_08_425952 19 15 data datum NNS 10_1101-2021_01_08_425952 19 16 in in IN 10_1101-2021_01_08_425952 19 17 situations situation NNS 10_1101-2021_01_08_425952 19 18 where where WRB 10_1101-2021_01_08_425952 19 19 randomized randomized JJ 10_1101-2021_01_08_425952 19 20 clinical clinical JJ 10_1101-2021_01_08_425952 19 21 trials trial NNS 10_1101-2021_01_08_425952 19 22 may may MD 10_1101-2021_01_08_425952 19 23 prove prove VB 10_1101-2021_01_08_425952 19 24 impracti- impracti- NN 10_1101-2021_01_08_425952 19 25 cal cal NNP 10_1101-2021_01_08_425952 19 26 Ghosh Ghosh NNP 10_1101-2021_01_08_425952 19 27 et et NNP 10_1101-2021_01_08_425952 19 28 al al NNP 10_1101-2021_01_08_425952 19 29 . . . 10_1101-2021_01_08_425952 20 1 ( ( -LRB- 10_1101-2021_01_08_425952 20 2 2019 2019 CD 10_1101-2021_01_08_425952 20 3 ) ) -RRB- 10_1101-2021_01_08_425952 20 4 ; ; : 10_1101-2021_01_08_425952 20 5 Bally Bally NNP 10_1101-2021_01_08_425952 20 6 et et NNP 10_1101-2021_01_08_425952 20 7 al al NNP 10_1101-2021_01_08_425952 20 8 . . . 10_1101-2021_01_08_425952 21 1 ( ( -LRB- 10_1101-2021_01_08_425952 21 2 2017 2017 CD 10_1101-2021_01_08_425952 21 3 ) ) -RRB- 10_1101-2021_01_08_425952 21 4 . . . 10_1101-2021_01_08_425952 22 1 This this DT 10_1101-2021_01_08_425952 22 2 publication publication NN 10_1101-2021_01_08_425952 22 3 serves serve VBZ 10_1101-2021_01_08_425952 22 4 as as IN 10_1101-2021_01_08_425952 22 5 an an DT 10_1101-2021_01_08_425952 22 6 introduction introduction NN 10_1101-2021_01_08_425952 22 7 to to IN 10_1101-2021_01_08_425952 22 8 the the DT 10_1101-2021_01_08_425952 22 9 rdrugtrajectory rdrugtrajectory JJ 10_1101-2021_01_08_425952 22 10 R r NN 10_1101-2021_01_08_425952 22 11 package package NN 10_1101-2021_01_08_425952 22 12 and and CC 10_1101-2021_01_08_425952 22 13 whilst whilst IN 10_1101-2021_01_08_425952 22 14 this this DT 10_1101-2021_01_08_425952 22 15 publication publication NN 10_1101-2021_01_08_425952 22 16 is be VBZ 10_1101-2021_01_08_425952 22 17 by by IN 10_1101-2021_01_08_425952 22 18 no no DT 10_1101-2021_01_08_425952 22 19 means means NN 10_1101-2021_01_08_425952 22 20 a a DT 10_1101-2021_01_08_425952 22 21 complete complete JJ 10_1101-2021_01_08_425952 22 22 tutorial tutorial NN 10_1101-2021_01_08_425952 22 23 , , , 10_1101-2021_01_08_425952 22 24 we -PRON- PRP 10_1101-2021_01_08_425952 22 25 will will MD 10_1101-2021_01_08_425952 22 26 expand expand VB 10_1101-2021_01_08_425952 22 27 on on IN 10_1101-2021_01_08_425952 22 28 some some DT 10_1101-2021_01_08_425952 22 29 of of IN 10_1101-2021_01_08_425952 22 30 the the DT 10_1101-2021_01_08_425952 22 31 main main JJ 10_1101-2021_01_08_425952 22 32 pack- pack- NN 10_1101-2021_01_08_425952 22 33 age age NN 10_1101-2021_01_08_425952 22 34 features feature NNS 10_1101-2021_01_08_425952 22 35 , , , 10_1101-2021_01_08_425952 22 36 such such JJ 10_1101-2021_01_08_425952 22 37 as as IN 10_1101-2021_01_08_425952 22 38 , , , 10_1101-2021_01_08_425952 22 39 how how WRB 10_1101-2021_01_08_425952 22 40 to to TO 10_1101-2021_01_08_425952 22 41 : : : 10_1101-2021_01_08_425952 22 42 Isolate isolate VB 10_1101-2021_01_08_425952 22 43 patients patient NNS 10_1101-2021_01_08_425952 22 44 by by IN 10_1101-2021_01_08_425952 22 45 first first JJ 10_1101-2021_01_08_425952 22 46 drug drug NN 10_1101-2021_01_08_425952 22 47 prescriptions prescription NNS 10_1101-2021_01_08_425952 22 48 at at IN 10_1101-2021_01_08_425952 22 49 given give VBN 10_1101-2021_01_08_425952 22 50 clinical clinical JJ 10_1101-2021_01_08_425952 22 51 events event NNS 10_1101-2021_01_08_425952 22 52 ; ; : 10_1101-2021_01_08_425952 22 53 calculate calculate VBP 10_1101-2021_01_08_425952 22 54 time time NN 10_1101-2021_01_08_425952 22 55 - - HYPH 10_1101-2021_01_08_425952 22 56 invariant invariant JJ 10_1101-2021_01_08_425952 22 57 prescriptions prescription NNS 10_1101-2021_01_08_425952 22 58 ; ; : 10_1101-2021_01_08_425952 22 59 construct construct VB 10_1101-2021_01_08_425952 22 60 survival survival NN 10_1101-2021_01_08_425952 22 61 analysis analysis NN 10_1101-2021_01_08_425952 22 62 timelines timeline NNS 10_1101-2021_01_08_425952 22 63 ( ( -LRB- 10_1101-2021_01_08_425952 22 64 compati- compati- NNP 10_1101-2021_01_08_425952 22 65 ble ble NNP 10_1101-2021_01_08_425952 22 66 with with IN 10_1101-2021_01_08_425952 22 67 Cox Cox NNP 10_1101-2021_01_08_425952 22 68 proportional proportional JJ 10_1101-2021_01_08_425952 22 69 hazard hazard NN 10_1101-2021_01_08_425952 22 70 regression regression NN 10_1101-2021_01_08_425952 22 71 and and CC 10_1101-2021_01_08_425952 22 72 Kaplan Kaplan NNP 10_1101-2021_01_08_425952 22 73 Meier Meier NNP 10_1101-2021_01_08_425952 22 74 curves curve NNS 10_1101-2021_01_08_425952 22 75 ) ) -RRB- 10_1101-2021_01_08_425952 22 76 , , , 10_1101-2021_01_08_425952 22 77 and and CC 10_1101-2021_01_08_425952 22 78 ; ; : 10_1101-2021_01_08_425952 22 79 visualise visualise VB 10_1101-2021_01_08_425952 22 80 patient patient JJ 10_1101-2021_01_08_425952 22 81 prescription prescription NN 10_1101-2021_01_08_425952 22 82 switching switching NN 10_1101-2021_01_08_425952 22 83 . . . 10_1101-2021_01_08_425952 23 1 For for IN 10_1101-2021_01_08_425952 23 2 a a DT 10_1101-2021_01_08_425952 23 3 comprehensive comprehensive JJ 10_1101-2021_01_08_425952 23 4 list list NN 10_1101-2021_01_08_425952 23 5 of of IN 10_1101-2021_01_08_425952 23 6 functions function NNS 10_1101-2021_01_08_425952 23 7 please please UH 10_1101-2021_01_08_425952 23 8 visit visit VB 10_1101-2021_01_08_425952 23 9 the the DT 10_1101-2021_01_08_425952 23 10 Github Github NNP 10_1101-2021_01_08_425952 23 11 reposi- reposi- NN 10_1101-2021_01_08_425952 23 12 tory tory NN 10_1101-2021_01_08_425952 23 13 https://github.com/acnash/rdrugtrajectory https://github.com/acnash/rdrugtrajectory NN 10_1101-2021_01_08_425952 23 14 . . . 10_1101-2021_01_08_425952 24 1 Almost almost RB 10_1101-2021_01_08_425952 24 2 all all DT 10_1101-2021_01_08_425952 24 3 features feature NNS 10_1101-2021_01_08_425952 24 4 can can MD 10_1101-2021_01_08_425952 24 5 be be VB 10_1101-2021_01_08_425952 24 6 controlled control VBN 10_1101-2021_01_08_425952 24 7 by by IN 10_1101-2021_01_08_425952 24 8 covariates covariate NNS 10_1101-2021_01_08_425952 24 9 or or CC 10_1101-2021_01_08_425952 24 10 stratified stratify VBN 10_1101-2021_01_08_425952 24 11 by by IN 10_1101-2021_01_08_425952 24 12 some some DT 10_1101-2021_01_08_425952 24 13 variable variable NN 10_1101-2021_01_08_425952 24 14 , , , 10_1101-2021_01_08_425952 24 15 for for IN 10_1101-2021_01_08_425952 24 16 example example NN 10_1101-2021_01_08_425952 24 17 , , , 10_1101-2021_01_08_425952 24 18 by by IN 10_1101-2021_01_08_425952 24 19 gender gender NN 10_1101-2021_01_08_425952 24 20 , , , 10_1101-2021_01_08_425952 24 21 age age NN 10_1101-2021_01_08_425952 24 22 , , , 10_1101-2021_01_08_425952 24 23 medical medical JJ 10_1101-2021_01_08_425952 24 24 codes code NNS 10_1101-2021_01_08_425952 24 25 or or CC 10_1101-2021_01_08_425952 24 26 treatment treatment NN 10_1101-2021_01_08_425952 24 27 product product NN 10_1101-2021_01_08_425952 24 28 codes code NNS 10_1101-2021_01_08_425952 24 29 . . . 10_1101-2021_01_08_425952 25 1 The the DT 10_1101-2021_01_08_425952 25 2 example example NN 10_1101-2021_01_08_425952 25 3 code code NN 10_1101-2021_01_08_425952 25 4 , , , 10_1101-2021_01_08_425952 25 5 figures figure NNS 10_1101-2021_01_08_425952 25 6 and and CC 10_1101-2021_01_08_425952 25 7 data datum NNS 10_1101-2021_01_08_425952 25 8 structures structure NNS 10_1101-2021_01_08_425952 25 9 presented present VBN 10_1101-2021_01_08_425952 25 10 here here RB 10_1101-2021_01_08_425952 25 11 mimic mimic VBP 10_1101-2021_01_08_425952 25 12 a a DT 10_1101-2021_01_08_425952 25 13 small small JJ 10_1101-2021_01_08_425952 25 14 fraction fraction NN 10_1101-2021_01_08_425952 25 15 of of IN 10_1101-2021_01_08_425952 25 16 our -PRON- PRP$ 10_1101-2021_01_08_425952 25 17 own own JJ 10_1101-2021_01_08_425952 25 18 research research NN 10_1101-2021_01_08_425952 25 19 . . . 10_1101-2021_01_08_425952 26 1 In in IN 10_1101-2021_01_08_425952 26 2 the the DT 10_1101-2021_01_08_425952 26 3 interest interest NN 10_1101-2021_01_08_425952 26 4 of of IN 10_1101-2021_01_08_425952 26 5 patient patient JJ 10_1101-2021_01_08_425952 26 6 confidentiality confidentiality NN 10_1101-2021_01_08_425952 26 7 , , , 10_1101-2021_01_08_425952 26 8 the the DT 10_1101-2021_01_08_425952 26 9 clinical clinical JJ 10_1101-2021_01_08_425952 26 10 data datum NNS 10_1101-2021_01_08_425952 26 11 used use VBN 10_1101-2021_01_08_425952 26 12 in in IN 10_1101-2021_01_08_425952 26 13 the the DT 10_1101-2021_01_08_425952 26 14 analysis analysis NN 10_1101-2021_01_08_425952 26 15 have have VBP 10_1101-2021_01_08_425952 26 16 been be VBN 10_1101-2021_01_08_425952 26 17 fabricated fabricate VBN 10_1101-2021_01_08_425952 26 18 . . . 10_1101-2021_01_08_425952 27 1 We -PRON- PRP 10_1101-2021_01_08_425952 27 2 present present VBP 10_1101-2021_01_08_425952 27 3 a a DT 10_1101-2021_01_08_425952 27 4 brief brief JJ 10_1101-2021_01_08_425952 27 5 tour tour NN 10_1101-2021_01_08_425952 27 6 of of IN 10_1101-2021_01_08_425952 27 7 some some DT 10_1101-2021_01_08_425952 27 8 of of IN 10_1101-2021_01_08_425952 27 9 the the DT 10_1101-2021_01_08_425952 27 10 functions function NNS 10_1101-2021_01_08_425952 27 11 available available JJ 10_1101-2021_01_08_425952 27 12 , , , 10_1101-2021_01_08_425952 27 13 starting start VBG 10_1101-2021_01_08_425952 27 14 with with IN 10_1101-2021_01_08_425952 27 15 a a DT 10_1101-2021_01_08_425952 27 16 discussion discussion NN 10_1101-2021_01_08_425952 27 17 on on IN 10_1101-2021_01_08_425952 27 18 the the DT 10_1101-2021_01_08_425952 27 19 CPRD CPRD NNP 10_1101-2021_01_08_425952 27 20 data data NN 10_1101-2021_01_08_425952 27 21 structure structure NN 10_1101-2021_01_08_425952 27 22 and and CC 10_1101-2021_01_08_425952 27 23 how how WRB 10_1101-2021_01_08_425952 27 24 records record NNS 10_1101-2021_01_08_425952 27 25 must must MD 10_1101-2021_01_08_425952 27 26 be be VB 10_1101-2021_01_08_425952 27 27 formatted format VBN 10_1101-2021_01_08_425952 27 28 . . . 10_1101-2021_01_08_425952 28 1 A a DT 10_1101-2021_01_08_425952 28 2 glossary glossary NN 10_1101-2021_01_08_425952 28 3 of of IN 10_1101-2021_01_08_425952 28 4 terms term NNS 10_1101-2021_01_08_425952 28 5 has have VBZ 10_1101-2021_01_08_425952 28 6 been be VBN 10_1101-2021_01_08_425952 28 7 provided provide VBN 10_1101-2021_01_08_425952 28 8 ( ( -LRB- 10_1101-2021_01_08_425952 28 9 Table table NN 10_1101-2021_01_08_425952 28 10 1 1 CD 10_1101-2021_01_08_425952 28 11 ) ) -RRB- 10_1101-2021_01_08_425952 28 12 to to TO 10_1101-2021_01_08_425952 28 13 assist assist VB 10_1101-2021_01_08_425952 28 14 the the DT 10_1101-2021_01_08_425952 28 15 reader reader NN 10_1101-2021_01_08_425952 28 16 . . . 10_1101-2021_01_08_425952 29 1 2 2 LS 10_1101-2021_01_08_425952 29 2 . . . 10_1101-2021_01_08_425952 29 3 rdrugtrajectory rdrugtrajectory JJ 10_1101-2021_01_08_425952 29 4 package package NN 10_1101-2021_01_08_425952 29 5 and and CC 10_1101-2021_01_08_425952 29 6 data data NN 10_1101-2021_01_08_425952 29 7 structures structure NNS 10_1101-2021_01_08_425952 29 8 2.1 2.1 CD 10_1101-2021_01_08_425952 29 9 . . . 10_1101-2021_01_08_425952 29 10 rdrugtrajectory rdrugtrajectory NN 10_1101-2021_01_08_425952 29 11 availability availability NN 10_1101-2021_01_08_425952 29 12 and and CC 10_1101-2021_01_08_425952 29 13 installation installation NN 10_1101-2021_01_08_425952 29 14 rdrugtrajectory rdrugtrajectory NN 10_1101-2021_01_08_425952 29 15 is be VBZ 10_1101-2021_01_08_425952 29 16 free free JJ 10_1101-2021_01_08_425952 29 17 to to TO 10_1101-2021_01_08_425952 29 18 download download VB 10_1101-2021_01_08_425952 29 19 from from IN 10_1101-2021_01_08_425952 29 20 the the DT 10_1101-2021_01_08_425952 29 21 Github Github NNP 10_1101-2021_01_08_425952 29 22 repository repository NN 10_1101-2021_01_08_425952 29 23 https://github.com/acnash/ https://github.com/acnash/ NNP 10_1101-2021_01_08_425952 29 24 rdrugtrajectory rdrugtrajectory NN 10_1101-2021_01_08_425952 29 25 and and CC 10_1101-2021_01_08_425952 29 26 holds hold VBZ 10_1101-2021_01_08_425952 29 27 an an DT 10_1101-2021_01_08_425952 29 28 MIT MIT NNP 10_1101-2021_01_08_425952 29 29 license license NN 10_1101-2021_01_08_425952 29 30 . . . 10_1101-2021_01_08_425952 30 1 Fabricated fabricated JJ 10_1101-2021_01_08_425952 30 2 CPRD cprd VBP 10_1101-2021_01_08_425952 30 3 clinical clinical JJ 10_1101-2021_01_08_425952 30 4 and and CC 10_1101-2021_01_08_425952 30 5 CPRD CPRD NNP 10_1101-2021_01_08_425952 30 6 prescrip- prescrip- JJ 10_1101-2021_01_08_425952 30 7 tion tion NN 10_1101-2021_01_08_425952 30 8 records record NNS 10_1101-2021_01_08_425952 30 9 in in IN 10_1101-2021_01_08_425952 30 10 addition addition NN 10_1101-2021_01_08_425952 30 11 to to IN 10_1101-2021_01_08_425952 30 12 age age NN 10_1101-2021_01_08_425952 30 13 , , , 10_1101-2021_01_08_425952 30 14 gender gender NN 10_1101-2021_01_08_425952 30 15 and and CC 10_1101-2021_01_08_425952 30 16 index index NN 10_1101-2021_01_08_425952 30 17 of of IN 10_1101-2021_01_08_425952 30 18 multiple multiple JJ 10_1101-2021_01_08_425952 30 19 deprivation deprivation NN 10_1101-2021_01_08_425952 30 20 scores score NNS 10_1101-2021_01_08_425952 30 21 are be VBP 10_1101-2021_01_08_425952 30 22 included include VBN 10_1101-2021_01_08_425952 30 23 for for IN 10_1101-2021_01_08_425952 30 24 test test NN 10_1101-2021_01_08_425952 30 25 and and CC 10_1101-2021_01_08_425952 30 26 tutorial tutorial JJ 10_1101-2021_01_08_425952 30 27 purposes purpose NNS 10_1101-2021_01_08_425952 30 28 . . . 10_1101-2021_01_08_425952 31 1 Before before IN 10_1101-2021_01_08_425952 31 2 installing instal VBG 10_1101-2021_01_08_425952 31 3 the the DT 10_1101-2021_01_08_425952 31 4 package package NN 10_1101-2021_01_08_425952 31 5 , , , 10_1101-2021_01_08_425952 31 6 the the DT 10_1101-2021_01_08_425952 31 7 following follow VBG 10_1101-2021_01_08_425952 31 8 R r NN 10_1101-2021_01_08_425952 31 9 dependencies dependency NNS 10_1101-2021_01_08_425952 31 10 are be VBP 10_1101-2021_01_08_425952 31 11 required require VBN 10_1101-2021_01_08_425952 31 12 : : : 10_1101-2021_01_08_425952 31 13 plyr plyr NNP 10_1101-2021_01_08_425952 31 14 , , , 10_1101-2021_01_08_425952 31 15 dplyr dplyr NNP 10_1101-2021_01_08_425952 31 16 , , , 10_1101-2021_01_08_425952 31 17 foreach foreach NNP 10_1101-2021_01_08_425952 31 18 , , , 10_1101-2021_01_08_425952 31 19 doParallel doParallel NNP 10_1101-2021_01_08_425952 31 20 , , , 10_1101-2021_01_08_425952 31 21 data.table data.table NN 10_1101-2021_01_08_425952 31 22 , , , 10_1101-2021_01_08_425952 31 23 parallel parallel NN 10_1101-2021_01_08_425952 31 24 , , , 10_1101-2021_01_08_425952 31 25 splus2R splus2r NN 10_1101-2021_01_08_425952 31 26 , , , 10_1101-2021_01_08_425952 31 27 rlist rlist NN 10_1101-2021_01_08_425952 31 28 , , , 10_1101-2021_01_08_425952 31 29 reda reda NNS 10_1101-2021_01_08_425952 31 30 , , , 10_1101-2021_01_08_425952 31 31 ggplot2 ggplot2 NN 10_1101-2021_01_08_425952 31 32 , , , 10_1101-2021_01_08_425952 31 33 ggalluvial ggalluvial NN 10_1101-2021_01_08_425952 31 34 , , , 10_1101-2021_01_08_425952 31 35 stats stat NNS 10_1101-2021_01_08_425952 31 36 , , , 10_1101-2021_01_08_425952 31 37 utils util NNS 10_1101-2021_01_08_425952 31 38 and and CC 10_1101-2021_01_08_425952 31 39 useful useful JJ 10_1101-2021_01_08_425952 31 40 . . . 10_1101-2021_01_08_425952 32 1 The the DT 10_1101-2021_01_08_425952 32 2 latest late JJS 10_1101-2021_01_08_425952 32 3 rdrugtrajectory rdrugtrajectory JJ 10_1101-2021_01_08_425952 32 4 binary binary NN 10_1101-2021_01_08_425952 32 5 is be VBZ 10_1101-2021_01_08_425952 32 6 install install NN 10_1101-2021_01_08_425952 32 7 using use VBG 10_1101-2021_01_08_425952 32 8 : : : 10_1101-2021_01_08_425952 32 9 install.packages("path install.packages("path NNP 10_1101-2021_01_08_425952 32 10 / / SYM 10_1101-2021_01_08_425952 32 11 to to IN 10_1101-2021_01_08_425952 32 12 / / SYM 10_1101-2021_01_08_425952 32 13 tar tar NN 10_1101-2021_01_08_425952 32 14 / / SYM 10_1101-2021_01_08_425952 32 15 file file NN 10_1101-2021_01_08_425952 32 16 " " '' 10_1101-2021_01_08_425952 32 17 , , , 10_1101-2021_01_08_425952 32 18 source source NN 10_1101-2021_01_08_425952 32 19 = = -RRB- 10_1101-2021_01_08_425952 32 20 TRUE TRUE NNP 10_1101-2021_01_08_425952 32 21 , , , 10_1101-2021_01_08_425952 32 22 repos repos NNP 10_1101-2021_01_08_425952 32 23 = = SYM 10_1101-2021_01_08_425952 32 24 NULL NULL NNP 10_1101-2021_01_08_425952 32 25 ) ) -RRB- 10_1101-2021_01_08_425952 32 26 rdrugtrajectory rdrugtrajectory NN 10_1101-2021_01_08_425952 32 27 was be VBD 10_1101-2021_01_08_425952 32 28 developed develop VBN 10_1101-2021_01_08_425952 32 29 and and CC 10_1101-2021_01_08_425952 32 30 tested test VBN 10_1101-2021_01_08_425952 32 31 on on IN 10_1101-2021_01_08_425952 32 32 R r NN 10_1101-2021_01_08_425952 32 33 version version NN 10_1101-2021_01_08_425952 32 34 4.0.1 4.0.1 NN 10_1101-2021_01_08_425952 32 35 . . . 10_1101-2021_01_08_425952 33 1 Please please UH 10_1101-2021_01_08_425952 33 2 consult consult VB 10_1101-2021_01_08_425952 33 3 the the DT 10_1101-2021_01_08_425952 33 4 Github Github NNP 10_1101-2021_01_08_425952 33 5 page page NN 10_1101-2021_01_08_425952 33 6 for for IN 10_1101-2021_01_08_425952 33 7 release release NN 10_1101-2021_01_08_425952 33 8 notes note NNS 10_1101-2021_01_08_425952 33 9 , , , 10_1101-2021_01_08_425952 33 10 the the DT 10_1101-2021_01_08_425952 33 11 latest late JJS 10_1101-2021_01_08_425952 33 12 version version NN 10_1101-2021_01_08_425952 33 13 and and CC 10_1101-2021_01_08_425952 33 14 up up IN 10_1101-2021_01_08_425952 33 15 to to IN 10_1101-2021_01_08_425952 33 16 date date NN 10_1101-2021_01_08_425952 33 17 installation installation NN 10_1101-2021_01_08_425952 33 18 instructions instruction NNS 10_1101-2021_01_08_425952 33 19 . . . 10_1101-2021_01_08_425952 34 1 2.2 2.2 CD 10_1101-2021_01_08_425952 34 2 . . . 10_1101-2021_01_08_425952 35 1 CPRD cprd JJ 10_1101-2021_01_08_425952 35 2 product product NN 10_1101-2021_01_08_425952 35 3 descirption descirption NN 10_1101-2021_01_08_425952 35 4 Several several JJ 10_1101-2021_01_08_425952 35 5 rdrugtrajectory rdrugtrajectory JJ 10_1101-2021_01_08_425952 35 6 functions function NNS 10_1101-2021_01_08_425952 35 7 use use VBP 10_1101-2021_01_08_425952 35 8 the the DT 10_1101-2021_01_08_425952 35 9 CPRD CPRD NNP 10_1101-2021_01_08_425952 35 10 product.txt product.txt CD 10_1101-2021_01_08_425952 35 11 file file NN 10_1101-2021_01_08_425952 35 12 for for IN 10_1101-2021_01_08_425952 35 13 assigning assign VBG 10_1101-2021_01_08_425952 35 14 a a DT 10_1101-2021_01_08_425952 35 15 text text NN 10_1101-2021_01_08_425952 35 16 descrip- descrip- VBZ 10_1101-2021_01_08_425952 35 17 tion tion NN 10_1101-2021_01_08_425952 35 18 to to IN 10_1101-2021_01_08_425952 35 19 a a DT 10_1101-2021_01_08_425952 35 20 prescription prescription NN 10_1101-2021_01_08_425952 35 21 prodcode prodcode NN 10_1101-2021_01_08_425952 35 22 . . . 10_1101-2021_01_08_425952 36 1 The the DT 10_1101-2021_01_08_425952 36 2 product.txt product.txt CD 10_1101-2021_01_08_425952 36 3 ( ( -LRB- 10_1101-2021_01_08_425952 36 4 and and CC 10_1101-2021_01_08_425952 36 5 medical.txt medical.txt NNS 10_1101-2021_01_08_425952 36 6 for for IN 10_1101-2021_01_08_425952 36 7 medcode medcode NNP 10_1101-2021_01_08_425952 36 8 description description NN 10_1101-2021_01_08_425952 36 9 ) ) -RRB- 10_1101-2021_01_08_425952 36 10 is be VBZ 10_1101-2021_01_08_425952 36 11 available available JJ 10_1101-2021_01_08_425952 36 12 in in IN 10_1101-2021_01_08_425952 36 13 the the DT 10_1101-2021_01_08_425952 36 14 CPRD CPRD NNP 10_1101-2021_01_08_425952 36 15 Data Data NNP 10_1101-2021_01_08_425952 36 16 Dictionary Dictionary NNP 10_1101-2021_01_08_425952 36 17 Windows Windows NNP 10_1101-2021_01_08_425952 36 18 software software NN 10_1101-2021_01_08_425952 36 19 . . . 10_1101-2021_01_08_425952 37 1 It -PRON- PRP 10_1101-2021_01_08_425952 37 2 is be VBZ 10_1101-2021_01_08_425952 37 3 important important JJ 10_1101-2021_01_08_425952 37 4 that that IN 10_1101-2021_01_08_425952 37 5 the the DT 10_1101-2021_01_08_425952 37 6 file file NN 10_1101-2021_01_08_425952 37 7 .CC .CC : 10_1101-2021_01_08_425952 37 8 - - : 10_1101-2021_01_08_425952 37 9 BY by IN 10_1101-2021_01_08_425952 37 10 - - HYPH 10_1101-2021_01_08_425952 37 11 ND ND NNP 10_1101-2021_01_08_425952 37 12 4.0 4.0 CD 10_1101-2021_01_08_425952 37 13 International international JJ 10_1101-2021_01_08_425952 37 14 licensemade licensemade NN 10_1101-2021_01_08_425952 37 15 available available JJ 10_1101-2021_01_08_425952 37 16 under under IN 10_1101-2021_01_08_425952 37 17 a a DT 10_1101-2021_01_08_425952 37 18 ( ( -LRB- 10_1101-2021_01_08_425952 37 19 which which WDT 10_1101-2021_01_08_425952 37 20 was be VBD 10_1101-2021_01_08_425952 37 21 not not RB 10_1101-2021_01_08_425952 37 22 certified certify VBN 10_1101-2021_01_08_425952 37 23 by by IN 10_1101-2021_01_08_425952 37 24 peer peer NN 10_1101-2021_01_08_425952 37 25 review review NN 10_1101-2021_01_08_425952 37 26 ) ) -RRB- 10_1101-2021_01_08_425952 37 27 is be VBZ 10_1101-2021_01_08_425952 37 28 the the DT 10_1101-2021_01_08_425952 37 29 author author NN 10_1101-2021_01_08_425952 37 30 / / SYM 10_1101-2021_01_08_425952 37 31 funder funder NN 10_1101-2021_01_08_425952 37 32 , , , 10_1101-2021_01_08_425952 37 33 who who WP 10_1101-2021_01_08_425952 37 34 has have VBZ 10_1101-2021_01_08_425952 37 35 granted grant VBN 10_1101-2021_01_08_425952 37 36 bioRxiv biorxiv IN 10_1101-2021_01_08_425952 37 37 a a DT 10_1101-2021_01_08_425952 37 38 license license NN 10_1101-2021_01_08_425952 37 39 to to TO 10_1101-2021_01_08_425952 37 40 display display VB 10_1101-2021_01_08_425952 37 41 the the DT 10_1101-2021_01_08_425952 37 42 preprint preprint NN 10_1101-2021_01_08_425952 37 43 in in IN 10_1101-2021_01_08_425952 37 44 perpetuity perpetuity NN 10_1101-2021_01_08_425952 37 45 . . . 10_1101-2021_01_08_425952 38 1 It -PRON- PRP 10_1101-2021_01_08_425952 38 2 is be VBZ 10_1101-2021_01_08_425952 38 3 The the DT 10_1101-2021_01_08_425952 38 4 copyright copyright NN 10_1101-2021_01_08_425952 38 5 holder holder NN 10_1101-2021_01_08_425952 38 6 for for IN 10_1101-2021_01_08_425952 38 7 this this DT 10_1101-2021_01_08_425952 38 8 preprintthis preprintthis NN 10_1101-2021_01_08_425952 38 9 version version NN 10_1101-2021_01_08_425952 38 10 posted post VBD 10_1101-2021_01_08_425952 38 11 January January NNP 10_1101-2021_01_08_425952 38 12 9 9 CD 10_1101-2021_01_08_425952 38 13 , , , 10_1101-2021_01_08_425952 38 14 2021 2021 CD 10_1101-2021_01_08_425952 38 15 . . . 10_1101-2021_01_08_425952 38 16 ; ; : 10_1101-2021_01_08_425952 38 17 https://doi.org/10.1101/2021.01.08.425952doi https://doi.org/10.1101/2021.01.08.425952doi ADD 10_1101-2021_01_08_425952 38 18 : : : 10_1101-2021_01_08_425952 38 19 bioRxiv biorxiv VB 10_1101-2021_01_08_425952 38 20 preprint preprint JJ 10_1101-2021_01_08_425952 38 21 https://github.com/acnash/rdrugtrajectory https://github.com/acnash/rdrugtrajectory NN 10_1101-2021_01_08_425952 38 22 https://github.com/acnash/rdrugtrajectory https://github.com/acnash/rdrugtrajectory NN 10_1101-2021_01_08_425952 38 23 https://github.com/acnash/rdrugtrajectory https://github.com/acnash/rdrugtrajectory NNP 10_1101-2021_01_08_425952 38 24 https://doi.org/10.1101/2021.01.08.425952 https://doi.org/10.1101/2021.01.08.425952 NNP 10_1101-2021_01_08_425952 38 25 http://creativecommons.org/licenses/by-nd/4.0/ http://creativecommons.org/licenses/by-nd/4.0/ NNP 10_1101-2021_01_08_425952 38 26 Journal Journal NNP 10_1101-2021_01_08_425952 38 27 of of IN 10_1101-2021_01_08_425952 38 28 Statistical Statistical NNP 10_1101-2021_01_08_425952 38 29 Software Software NNP 10_1101-2021_01_08_425952 38 30 3 3 CD 10_1101-2021_01_08_425952 38 31 Term term NN 10_1101-2021_01_08_425952 38 32 Description description NN 10_1101-2021_01_08_425952 38 33 rdrugtrajectory rdrugtrajectory NN 10_1101-2021_01_08_425952 38 34 An an DT 10_1101-2021_01_08_425952 38 35 R r NN 10_1101-2021_01_08_425952 38 36 packaged package VBN 10_1101-2021_01_08_425952 38 37 designed design VBN 10_1101-2021_01_08_425952 38 38 for for IN 10_1101-2021_01_08_425952 38 39 the the DT 10_1101-2021_01_08_425952 38 40 management management NN 10_1101-2021_01_08_425952 38 41 of of IN 10_1101-2021_01_08_425952 38 42 CPRD CPRD NNP 10_1101-2021_01_08_425952 38 43 prescription prescription NN 10_1101-2021_01_08_425952 38 44 data datum NNS 10_1101-2021_01_08_425952 38 45 . . . 10_1101-2021_01_08_425952 39 1 clinical clinical JJ 10_1101-2021_01_08_425952 39 2 The the DT 10_1101-2021_01_08_425952 39 3 ClinicalNNN.txt clinicalnnn.txt CD 10_1101-2021_01_08_425952 39 4 dataset dataset NN 10_1101-2021_01_08_425952 39 5 presented present VBD 10_1101-2021_01_08_425952 39 6 in in IN 10_1101-2021_01_08_425952 39 7 a a DT 10_1101-2021_01_08_425952 39 8 rdrugtrajectory rdrugtrajectory JJ 10_1101-2021_01_08_425952 39 9 dataframe dataframe NN 10_1101-2021_01_08_425952 39 10 . . . 10_1101-2021_01_08_425952 40 1 referral referral NN 10_1101-2021_01_08_425952 40 2 The the DT 10_1101-2021_01_08_425952 40 3 ReferralNNN.txt referralnnn.txt CD 10_1101-2021_01_08_425952 40 4 dataset dataset NN 10_1101-2021_01_08_425952 40 5 presented present VBD 10_1101-2021_01_08_425952 40 6 in in IN 10_1101-2021_01_08_425952 40 7 a a DT 10_1101-2021_01_08_425952 40 8 rdrugtrajectory rdrugtrajectory JJ 10_1101-2021_01_08_425952 40 9 dataframe dataframe NN 10_1101-2021_01_08_425952 40 10 . . . 10_1101-2021_01_08_425952 41 1 therapy therapy NN 10_1101-2021_01_08_425952 41 2 The the DT 10_1101-2021_01_08_425952 41 3 TherapyNNN.txt therapynnn.txt CD 10_1101-2021_01_08_425952 41 4 dataset dataset NN 10_1101-2021_01_08_425952 41 5 presented present VBD 10_1101-2021_01_08_425952 41 6 in in IN 10_1101-2021_01_08_425952 41 7 a a DT 10_1101-2021_01_08_425952 41 8 rdrugtrajectory rdrugtrajectory JJ 10_1101-2021_01_08_425952 41 9 dataframe dataframe NN 10_1101-2021_01_08_425952 41 10 . . . 10_1101-2021_01_08_425952 42 1 AdditionalNNN.txt additionalnnn.txt CD 10_1101-2021_01_08_425952 42 2 The the DT 10_1101-2021_01_08_425952 42 3 CPRD CPRD NNP 10_1101-2021_01_08_425952 42 4 dataset dataset NN 10_1101-2021_01_08_425952 42 5 of of IN 10_1101-2021_01_08_425952 42 6 additional additional JJ 10_1101-2021_01_08_425952 42 7 clinical clinical JJ 10_1101-2021_01_08_425952 42 8 information information NN 10_1101-2021_01_08_425952 42 9 , , , 10_1101-2021_01_08_425952 42 10 for for IN 10_1101-2021_01_08_425952 42 11 example example NN 10_1101-2021_01_08_425952 42 12 , , , 10_1101-2021_01_08_425952 42 13 patient patient NN 10_1101-2021_01_08_425952 42 14 smoking smoking NN 10_1101-2021_01_08_425952 42 15 status status NN 10_1101-2021_01_08_425952 42 16 and and CC 10_1101-2021_01_08_425952 42 17 alcohol alcohol NN 10_1101-2021_01_08_425952 42 18 comsumption comsumption NN 10_1101-2021_01_08_425952 42 19 . . . 10_1101-2021_01_08_425952 43 1 Data datum NNS 10_1101-2021_01_08_425952 43 2 can can MD 10_1101-2021_01_08_425952 43 3 be be VB 10_1101-2021_01_08_425952 43 4 retrieved retrieve VBN 10_1101-2021_01_08_425952 43 5 using use VBG 10_1101-2021_01_08_425952 43 6 CPRDLookups cprdlookup NNS 10_1101-2021_01_08_425952 43 7 . . . 10_1101-2021_01_08_425952 43 8 R. R. NNP 10_1101-2021_01_08_425952 44 1 modecode modecode NNP 10_1101-2021_01_08_425952 44 2 A a DT 10_1101-2021_01_08_425952 44 3 CPRD CPRD NNP 10_1101-2021_01_08_425952 44 4 identifier identifier NN 10_1101-2021_01_08_425952 44 5 that that WDT 10_1101-2021_01_08_425952 44 6 denotes denote VBZ 10_1101-2021_01_08_425952 44 7 medical medical JJ 10_1101-2021_01_08_425952 44 8 conditions condition NNS 10_1101-2021_01_08_425952 44 9 , , , 10_1101-2021_01_08_425952 44 10 diagnosis diagnosis NN 10_1101-2021_01_08_425952 44 11 and and CC 10_1101-2021_01_08_425952 44 12 com- com- NN 10_1101-2021_01_08_425952 44 13 plaints plaint NNS 10_1101-2021_01_08_425952 44 14 made make VBN 10_1101-2021_01_08_425952 44 15 by by IN 10_1101-2021_01_08_425952 44 16 a a DT 10_1101-2021_01_08_425952 44 17 patient patient NN 10_1101-2021_01_08_425952 44 18 . . . 10_1101-2021_01_08_425952 45 1 medcodes medcode NNS 10_1101-2021_01_08_425952 45 2 are be VBP 10_1101-2021_01_08_425952 45 3 recorded record VBN 10_1101-2021_01_08_425952 45 4 in in IN 10_1101-2021_01_08_425952 45 5 the the DT 10_1101-2021_01_08_425952 45 6 ClinicalNNN.txt clinicalnnn.txt NN 10_1101-2021_01_08_425952 45 7 and and CC 10_1101-2021_01_08_425952 45 8 ReferralNNN.txt referralnnn.txt CD 10_1101-2021_01_08_425952 45 9 files file NNS 10_1101-2021_01_08_425952 45 10 . . . 10_1101-2021_01_08_425952 46 1 prodcode prodcode VB 10_1101-2021_01_08_425952 46 2 A a DT 10_1101-2021_01_08_425952 46 3 CPRD CPRD NNP 10_1101-2021_01_08_425952 46 4 identifier identifier NN 10_1101-2021_01_08_425952 46 5 that that WDT 10_1101-2021_01_08_425952 46 6 denotes denote VBZ 10_1101-2021_01_08_425952 46 7 treatment treatment NN 10_1101-2021_01_08_425952 46 8 products product NNS 10_1101-2021_01_08_425952 46 9 , , , 10_1101-2021_01_08_425952 46 10 including include VBG 10_1101-2021_01_08_425952 46 11 drugs drug NNS 10_1101-2021_01_08_425952 46 12 , , , 10_1101-2021_01_08_425952 46 13 foods food NNS 10_1101-2021_01_08_425952 46 14 , , , 10_1101-2021_01_08_425952 46 15 and and CC 10_1101-2021_01_08_425952 46 16 medical medical JJ 10_1101-2021_01_08_425952 46 17 apparatus apparatus NN 10_1101-2021_01_08_425952 46 18 . . . 10_1101-2021_01_08_425952 47 1 prodcodes prodcode NNS 10_1101-2021_01_08_425952 47 2 are be VBP 10_1101-2021_01_08_425952 47 3 recorded record VBN 10_1101-2021_01_08_425952 47 4 in in IN 10_1101-2021_01_08_425952 47 5 the the DT 10_1101-2021_01_08_425952 47 6 Thera- Thera- NNP 10_1101-2021_01_08_425952 47 7 pyNNN.txt pyNNN.txt NNP 10_1101-2021_01_08_425952 47 8 files file NNS 10_1101-2021_01_08_425952 47 9 . . . 10_1101-2021_01_08_425952 48 1 patid patid VB 10_1101-2021_01_08_425952 48 2 A a DT 10_1101-2021_01_08_425952 48 3 unique unique JJ 10_1101-2021_01_08_425952 48 4 CPRD CPRD NNP 10_1101-2021_01_08_425952 48 5 patient patient NN 10_1101-2021_01_08_425952 48 6 identifier identifier NN 10_1101-2021_01_08_425952 48 7 . . . 10_1101-2021_01_08_425952 49 1 Used use VBN 10_1101-2021_01_08_425952 49 2 to to TO 10_1101-2021_01_08_425952 49 3 link link VB 10_1101-2021_01_08_425952 49 4 datasets dataset NNS 10_1101-2021_01_08_425952 49 5 . . . 10_1101-2021_01_08_425952 50 1 event event NN 10_1101-2021_01_08_425952 50 2 Any any DT 10_1101-2021_01_08_425952 50 3 procode procode NN 10_1101-2021_01_08_425952 50 4 or or CC 10_1101-2021_01_08_425952 50 5 medcode medcode VB 10_1101-2021_01_08_425952 50 6 in in IN 10_1101-2021_01_08_425952 50 7 a a DT 10_1101-2021_01_08_425952 50 8 patient patient NN 10_1101-2021_01_08_425952 50 9 ’s ’s POS 10_1101-2021_01_08_425952 50 10 EHR ehr NN 10_1101-2021_01_08_425952 50 11 . . . 10_1101-2021_01_08_425952 51 1 eventdate eventdate VB 10_1101-2021_01_08_425952 51 2 The the DT 10_1101-2021_01_08_425952 51 3 date date NN 10_1101-2021_01_08_425952 51 4 of of IN 10_1101-2021_01_08_425952 51 5 an an DT 10_1101-2021_01_08_425952 51 6 event event NN 10_1101-2021_01_08_425952 51 7 recorded record VBN 10_1101-2021_01_08_425952 51 8 by by IN 10_1101-2021_01_08_425952 51 9 a a DT 10_1101-2021_01_08_425952 51 10 general general JJ 10_1101-2021_01_08_425952 51 11 practitioner practitioner NN 10_1101-2021_01_08_425952 51 12 . . . 10_1101-2021_01_08_425952 52 1 Present present JJ 10_1101-2021_01_08_425952 52 2 in in IN 10_1101-2021_01_08_425952 52 3 all all DT 10_1101-2021_01_08_425952 52 4 three three CD 10_1101-2021_01_08_425952 52 5 datasets dataset NNS 10_1101-2021_01_08_425952 52 6 and and CC 10_1101-2021_01_08_425952 52 7 corresponding correspond VBG 10_1101-2021_01_08_425952 52 8 rdrugtrajectory rdrugtrajectory JJ 10_1101-2021_01_08_425952 52 9 dataframe dataframe NN 10_1101-2021_01_08_425952 52 10 . . . 10_1101-2021_01_08_425952 53 1 IMD IMD NNP 10_1101-2021_01_08_425952 53 2 Index Index NNP 10_1101-2021_01_08_425952 53 3 of of IN 10_1101-2021_01_08_425952 53 4 Multiple Multiple NNP 10_1101-2021_01_08_425952 53 5 Deprivation Deprivation NNP 10_1101-2021_01_08_425952 53 6 score score NN 10_1101-2021_01_08_425952 53 7 - - : 10_1101-2021_01_08_425952 53 8 a a DT 10_1101-2021_01_08_425952 53 9 UK UK NNP 10_1101-2021_01_08_425952 53 10 Government Government NNP 10_1101-2021_01_08_425952 53 11 socioeconomic socioeconomic JJ 10_1101-2021_01_08_425952 53 12 measurement measurement NN 10_1101-2021_01_08_425952 53 13 based base VBN 10_1101-2021_01_08_425952 53 14 on on IN 10_1101-2021_01_08_425952 53 15 postcode postcode NN 10_1101-2021_01_08_425952 53 16 of of IN 10_1101-2021_01_08_425952 53 17 the the DT 10_1101-2021_01_08_425952 53 18 clinic clinic NN 10_1101-2021_01_08_425952 53 19 or or CC 10_1101-2021_01_08_425952 53 20 a a DT 10_1101-2021_01_08_425952 53 21 patient patient NN 10_1101-2021_01_08_425952 53 22 ’s ’ VBZ 10_1101-2021_01_08_425952 53 23 registered registered JJ 10_1101-2021_01_08_425952 53 24 ad- ad- CC 10_1101-2021_01_08_425952 53 25 dress dress NN 10_1101-2021_01_08_425952 53 26 . . . 10_1101-2021_01_08_425952 54 1 Prescription prescription NN 10_1101-2021_01_08_425952 54 2 A a DT 10_1101-2021_01_08_425952 54 3 general general JJ 10_1101-2021_01_08_425952 54 4 time time NN 10_1101-2021_01_08_425952 54 5 for for IN 10_1101-2021_01_08_425952 54 6 any any DT 10_1101-2021_01_08_425952 54 7 prodcode prodcode NN 10_1101-2021_01_08_425952 54 8 prescribed prescribe VBN 10_1101-2021_01_08_425952 54 9 for for IN 10_1101-2021_01_08_425952 54 10 treatment treatment NN 10_1101-2021_01_08_425952 54 11 . . . 10_1101-2021_01_08_425952 55 1 medical medical JJ 10_1101-2021_01_08_425952 55 2 history history NN 10_1101-2021_01_08_425952 55 3 Indicates indicate VBZ 10_1101-2021_01_08_425952 55 4 a a DT 10_1101-2021_01_08_425952 55 5 combination combination NN 10_1101-2021_01_08_425952 55 6 of of IN 10_1101-2021_01_08_425952 55 7 one one CD 10_1101-2021_01_08_425952 55 8 or or CC 10_1101-2021_01_08_425952 55 9 more more JJR 10_1101-2021_01_08_425952 55 10 sets set NNS 10_1101-2021_01_08_425952 55 11 of of IN 10_1101-2021_01_08_425952 55 12 CPRD cprd JJ 10_1101-2021_01_08_425952 55 13 data datum NNS 10_1101-2021_01_08_425952 55 14 , , , 10_1101-2021_01_08_425952 55 15 for for IN 10_1101-2021_01_08_425952 55 16 example example NN 10_1101-2021_01_08_425952 55 17 , , , 10_1101-2021_01_08_425952 55 18 the the DT 10_1101-2021_01_08_425952 55 19 collection collection NN 10_1101-2021_01_08_425952 55 20 of of IN 10_1101-2021_01_08_425952 55 21 all all DT 10_1101-2021_01_08_425952 55 22 clinical clinical JJ 10_1101-2021_01_08_425952 55 23 and and CC 10_1101-2021_01_08_425952 55 24 therapy therapy NN 10_1101-2021_01_08_425952 55 25 EHR ehr NN 10_1101-2021_01_08_425952 55 26 for for IN 10_1101-2021_01_08_425952 55 27 patients patient NNS 10_1101-2021_01_08_425952 55 28 with with IN 10_1101-2021_01_08_425952 55 29 a a DT 10_1101-2021_01_08_425952 55 30 medcode medcode NN 10_1101-2021_01_08_425952 55 31 for for IN 10_1101-2021_01_08_425952 55 32 migraine migraine NN 10_1101-2021_01_08_425952 55 33 . . . 10_1101-2021_01_08_425952 56 1 product.txt product.txt LS 10_1101-2021_01_08_425952 56 2 A a DT 10_1101-2021_01_08_425952 56 3 plain plain JJ 10_1101-2021_01_08_425952 56 4 text text NN 10_1101-2021_01_08_425952 56 5 file file NN 10_1101-2021_01_08_425952 56 6 that that WDT 10_1101-2021_01_08_425952 56 7 contains contain VBZ 10_1101-2021_01_08_425952 56 8 all all DT 10_1101-2021_01_08_425952 56 9 prodcodes prodcode NNS 10_1101-2021_01_08_425952 56 10 with with IN 10_1101-2021_01_08_425952 56 11 a a DT 10_1101-2021_01_08_425952 56 12 description description NN 10_1101-2021_01_08_425952 56 13 and and CC 10_1101-2021_01_08_425952 56 14 comes come VBZ 10_1101-2021_01_08_425952 56 15 bundled bundle VBN 10_1101-2021_01_08_425952 56 16 with with IN 10_1101-2021_01_08_425952 56 17 the the DT 10_1101-2021_01_08_425952 56 18 CPRD CPRD NNP 10_1101-2021_01_08_425952 56 19 Data Data NNP 10_1101-2021_01_08_425952 56 20 Dictionary Dictionary NNP 10_1101-2021_01_08_425952 56 21 . . . 10_1101-2021_01_08_425952 57 1 The the DT 10_1101-2021_01_08_425952 57 2 file file NN 10_1101-2021_01_08_425952 57 3 is be VBZ 10_1101-2021_01_08_425952 57 4 used use VBN 10_1101-2021_01_08_425952 57 5 to to TO 10_1101-2021_01_08_425952 57 6 link link VB 10_1101-2021_01_08_425952 57 7 a a DT 10_1101-2021_01_08_425952 57 8 prodcode prodcode NN 10_1101-2021_01_08_425952 57 9 with with IN 10_1101-2021_01_08_425952 57 10 a a DT 10_1101-2021_01_08_425952 57 11 description description NN 10_1101-2021_01_08_425952 57 12 . . . 10_1101-2021_01_08_425952 58 1 Table table NN 10_1101-2021_01_08_425952 58 2 1 1 CD 10_1101-2021_01_08_425952 58 3 : : : 10_1101-2021_01_08_425952 58 4 Table table NN 10_1101-2021_01_08_425952 58 5 of of IN 10_1101-2021_01_08_425952 58 6 frequently frequently RB 10_1101-2021_01_08_425952 58 7 used use VBN 10_1101-2021_01_08_425952 58 8 terms term NNS 10_1101-2021_01_08_425952 58 9 . . . 10_1101-2021_01_08_425952 59 1 remains remain VBZ 10_1101-2021_01_08_425952 59 2 in in IN 10_1101-2021_01_08_425952 59 3 plain plain JJ 10_1101-2021_01_08_425952 59 4 text text NN 10_1101-2021_01_08_425952 59 5 , , , 10_1101-2021_01_08_425952 59 6 with with IN 10_1101-2021_01_08_425952 59 7 columns column NNS 10_1101-2021_01_08_425952 59 8 tab tab NNP 10_1101-2021_01_08_425952 59 9 - - HYPH 10_1101-2021_01_08_425952 59 10 delimited delimit VBN 10_1101-2021_01_08_425952 59 11 . . . 10_1101-2021_01_08_425952 60 1 The the DT 10_1101-2021_01_08_425952 60 2 files file NNS 10_1101-2021_01_08_425952 60 3 can can MD 10_1101-2021_01_08_425952 60 4 be be VB 10_1101-2021_01_08_425952 60 5 simplified simplify VBN 10_1101-2021_01_08_425952 60 6 by by IN 10_1101-2021_01_08_425952 60 7 removing remove VBG 10_1101-2021_01_08_425952 60 8 all all DT 10_1101-2021_01_08_425952 60 9 non non JJ 10_1101-2021_01_08_425952 60 10 - - JJ 10_1101-2021_01_08_425952 60 11 essential essential JJ 10_1101-2021_01_08_425952 60 12 products product NNS 10_1101-2021_01_08_425952 60 13 . . . 10_1101-2021_01_08_425952 61 1 Finally finally RB 10_1101-2021_01_08_425952 61 2 , , , 10_1101-2021_01_08_425952 61 3 all all PDT 10_1101-2021_01_08_425952 61 4 the the DT 10_1101-2021_01_08_425952 61 5 eleven eleven CD 10_1101-2021_01_08_425952 61 6 columns column NNS 10_1101-2021_01_08_425952 61 7 that that WDT 10_1101-2021_01_08_425952 61 8 make make VBP 10_1101-2021_01_08_425952 61 9 up up RP 10_1101-2021_01_08_425952 61 10 the the DT 10_1101-2021_01_08_425952 61 11 product.txt product.txt CD 10_1101-2021_01_08_425952 61 12 file file NN 10_1101-2021_01_08_425952 61 13 must must MD 10_1101-2021_01_08_425952 61 14 be be VB 10_1101-2021_01_08_425952 61 15 available available JJ 10_1101-2021_01_08_425952 61 16 , , , 10_1101-2021_01_08_425952 61 17 with with IN 10_1101-2021_01_08_425952 61 18 the the DT 10_1101-2021_01_08_425952 61 19 first first JJ 10_1101-2021_01_08_425952 61 20 column column NN 10_1101-2021_01_08_425952 61 21 containing contain VBG 10_1101-2021_01_08_425952 61 22 all all DT 10_1101-2021_01_08_425952 61 23 prodcodes prodcode NNS 10_1101-2021_01_08_425952 61 24 and and CC 10_1101-2021_01_08_425952 61 25 the the DT 10_1101-2021_01_08_425952 61 26 fourth fourth JJ 10_1101-2021_01_08_425952 61 27 column column NN 10_1101-2021_01_08_425952 61 28 containing contain VBG 10_1101-2021_01_08_425952 61 29 the the DT 10_1101-2021_01_08_425952 61 30 product product NN 10_1101-2021_01_08_425952 61 31 description description NN 10_1101-2021_01_08_425952 61 32 . . . 10_1101-2021_01_08_425952 62 1 A a DT 10_1101-2021_01_08_425952 62 2 simplified simplified JJ 10_1101-2021_01_08_425952 62 3 product.txt product.txt CD 10_1101-2021_01_08_425952 62 4 file file NN 10_1101-2021_01_08_425952 62 5 , , , 10_1101-2021_01_08_425952 62 6 presented present VBN 10_1101-2021_01_08_425952 62 7 below below IN 10_1101-2021_01_08_425952 62 8 , , , 10_1101-2021_01_08_425952 62 9 can can MD 10_1101-2021_01_08_425952 62 10 be be VB 10_1101-2021_01_08_425952 62 11 downloaded download VBN 10_1101-2021_01_08_425952 62 12 from from IN 10_1101-2021_01_08_425952 62 13 the the DT 10_1101-2021_01_08_425952 62 14 Github Github NNP 10_1101-2021_01_08_425952 62 15 page page NN 10_1101-2021_01_08_425952 62 16 . . . 10_1101-2021_01_08_425952 63 1 > > XX 10_1101-2021_01_08_425952 63 2 library(rdrugtrajectory library(rdrugtrajectory NNP 10_1101-2021_01_08_425952 63 3 ) ) -RRB- 10_1101-2021_01_08_425952 63 4 > > NFP 10_1101-2021_01_08_425952 63 5 productDF productDF NNP 10_1101-2021_01_08_425952 63 6 < < XX 10_1101-2021_01_08_425952 63 7 - - HYPH 10_1101-2021_01_08_425952 63 8 read.csv(" read.csv(" NNP 10_1101-2021_01_08_425952 63 9 .. .. NFP 10_1101-2021_01_08_425952 63 10 /RDrugTrajectory_Data /RDrugTrajectory_Data . 10_1101-2021_01_08_425952 63 11 / / SYM 10_1101-2021_01_08_425952 63 12 product.txt product.txt NNP 10_1101-2021_01_08_425952 63 13 " " '' 10_1101-2021_01_08_425952 63 14 , , , 10_1101-2021_01_08_425952 63 15 + + CC 10_1101-2021_01_08_425952 63 16 sep="\t sep="\t NN 10_1101-2021_01_08_425952 63 17 " " '' 10_1101-2021_01_08_425952 63 18 , , , 10_1101-2021_01_08_425952 63 19 + + CC 10_1101-2021_01_08_425952 63 20 header header NN 10_1101-2021_01_08_425952 63 21 = = SYM 10_1101-2021_01_08_425952 63 22 FALSE false NN 10_1101-2021_01_08_425952 63 23 ) ) -RRB- 10_1101-2021_01_08_425952 63 24 > > XX 10_1101-2021_01_08_425952 63 25 head(productDF head(productdf XX 10_1101-2021_01_08_425952 63 26 ) ) -RRB- 10_1101-2021_01_08_425952 63 27 V1 V1 NNP 10_1101-2021_01_08_425952 63 28 V2 V2 NNP 10_1101-2021_01_08_425952 63 29 V3 V3 NNP 10_1101-2021_01_08_425952 63 30 V4 V4 NNP 10_1101-2021_01_08_425952 63 31 V5 V5 NNP 10_1101-2021_01_08_425952 63 32 1 1 CD 10_1101-2021_01_08_425952 63 33 5 5 CD 10_1101-2021_01_08_425952 63 34 60153020 60153020 CD 10_1101-2021_01_08_425952 63 35 14958680 14958680 CD 10_1101-2021_01_08_425952 63 36 Atenolol atenolol NN 10_1101-2021_01_08_425952 63 37 50 50 CD 10_1101-2021_01_08_425952 63 38 mg mg NNP 10_1101-2021_01_08_425952 63 39 tablets tablet VBZ 10_1101-2021_01_08_425952 63 40 Atenolol Atenolol NNP 10_1101-2021_01_08_425952 63 41 2 2 CD 10_1101-2021_01_08_425952 63 42 24 24 CD 10_1101-2021_01_08_425952 63 43 60152020 60152020 CD 10_1101-2021_01_08_425952 63 44 5354283 5354283 CD 10_1101-2021_01_08_425952 63 45 Atenolol Atenolol NNP 10_1101-2021_01_08_425952 63 46 100 100 CD 10_1101-2021_01_08_425952 63 47 mg mg NNP 10_1101-2021_01_08_425952 63 48 tablets tablet VBZ 10_1101-2021_01_08_425952 63 49 Atenolol Atenolol NNP 10_1101-2021_01_08_425952 63 50 3 3 CD 10_1101-2021_01_08_425952 63 51 26 26 CD 10_1101-2021_01_08_425952 63 52 67920020 67920020 CD 10_1101-2021_01_08_425952 63 53 6869099 6869099 CD 10_1101-2021_01_08_425952 63 54 Atenolol Atenolol NNP 10_1101-2021_01_08_425952 63 55 25 25 CD 10_1101-2021_01_08_425952 63 56 mg mg NNP 10_1101-2021_01_08_425952 63 57 tablets tablet VBZ 10_1101-2021_01_08_425952 63 58 Atenolol atenolol NN 10_1101-2021_01_08_425952 63 59 .CC .CC NFP 10_1101-2021_01_08_425952 63 60 - - HYPH 10_1101-2021_01_08_425952 63 61 BY by IN 10_1101-2021_01_08_425952 63 62 - - HYPH 10_1101-2021_01_08_425952 63 63 ND ND NNP 10_1101-2021_01_08_425952 63 64 4.0 4.0 CD 10_1101-2021_01_08_425952 63 65 International international JJ 10_1101-2021_01_08_425952 63 66 licensemade licensemade NN 10_1101-2021_01_08_425952 63 67 available available JJ 10_1101-2021_01_08_425952 63 68 under under IN 10_1101-2021_01_08_425952 63 69 a a DT 10_1101-2021_01_08_425952 63 70 ( ( -LRB- 10_1101-2021_01_08_425952 63 71 which which WDT 10_1101-2021_01_08_425952 63 72 was be VBD 10_1101-2021_01_08_425952 63 73 not not RB 10_1101-2021_01_08_425952 63 74 certified certify VBN 10_1101-2021_01_08_425952 63 75 by by IN 10_1101-2021_01_08_425952 63 76 peer peer NN 10_1101-2021_01_08_425952 63 77 review review NN 10_1101-2021_01_08_425952 63 78 ) ) -RRB- 10_1101-2021_01_08_425952 63 79 is be VBZ 10_1101-2021_01_08_425952 63 80 the the DT 10_1101-2021_01_08_425952 63 81 author author NN 10_1101-2021_01_08_425952 63 82 / / SYM 10_1101-2021_01_08_425952 63 83 funder funder NN 10_1101-2021_01_08_425952 63 84 , , , 10_1101-2021_01_08_425952 63 85 who who WP 10_1101-2021_01_08_425952 63 86 has have VBZ 10_1101-2021_01_08_425952 63 87 granted grant VBN 10_1101-2021_01_08_425952 63 88 bioRxiv biorxiv IN 10_1101-2021_01_08_425952 63 89 a a DT 10_1101-2021_01_08_425952 63 90 license license NN 10_1101-2021_01_08_425952 63 91 to to TO 10_1101-2021_01_08_425952 63 92 display display VB 10_1101-2021_01_08_425952 63 93 the the DT 10_1101-2021_01_08_425952 63 94 preprint preprint NN 10_1101-2021_01_08_425952 63 95 in in IN 10_1101-2021_01_08_425952 63 96 perpetuity perpetuity NN 10_1101-2021_01_08_425952 63 97 . . . 10_1101-2021_01_08_425952 64 1 It -PRON- PRP 10_1101-2021_01_08_425952 64 2 is be VBZ 10_1101-2021_01_08_425952 64 3 The the DT 10_1101-2021_01_08_425952 64 4 copyright copyright NN 10_1101-2021_01_08_425952 64 5 holder holder NN 10_1101-2021_01_08_425952 64 6 for for IN 10_1101-2021_01_08_425952 64 7 this this DT 10_1101-2021_01_08_425952 64 8 preprintthis preprintthis NN 10_1101-2021_01_08_425952 64 9 version version NN 10_1101-2021_01_08_425952 64 10 posted post VBD 10_1101-2021_01_08_425952 64 11 January January NNP 10_1101-2021_01_08_425952 64 12 9 9 CD 10_1101-2021_01_08_425952 64 13 , , , 10_1101-2021_01_08_425952 64 14 2021 2021 CD 10_1101-2021_01_08_425952 64 15 . . . 10_1101-2021_01_08_425952 64 16 ; ; : 10_1101-2021_01_08_425952 64 17 https://doi.org/10.1101/2021.01.08.425952doi https://doi.org/10.1101/2021.01.08.425952doi ADD 10_1101-2021_01_08_425952 64 18 : : : 10_1101-2021_01_08_425952 64 19 bioRxiv biorxiv IN 10_1101-2021_01_08_425952 64 20 preprint preprint NN 10_1101-2021_01_08_425952 64 21 https://doi.org/10.1101/2021.01.08.425952 https://doi.org/10.1101/2021.01.08.425952 NN 10_1101-2021_01_08_425952 64 22 http://creativecommons.org/licenses/by-nd/4.0/ http://creativecommons.org/licenses/by-nd/4.0/ NN 10_1101-2021_01_08_425952 64 23 4 4 CD 10_1101-2021_01_08_425952 64 24 rdrugtrajectory rdrugtrajectory NN 10_1101-2021_01_08_425952 64 25 : : : 10_1101-2021_01_08_425952 64 26 Analysing Analysing NNP 10_1101-2021_01_08_425952 64 27 Drug Drug NNP 10_1101-2021_01_08_425952 64 28 Prescriptions Prescriptions NNPS 10_1101-2021_01_08_425952 64 29 in in IN 10_1101-2021_01_08_425952 64 30 Electronic Electronic NNP 10_1101-2021_01_08_425952 64 31 Health Health NNP 10_1101-2021_01_08_425952 64 32 Care Care NNP 10_1101-2021_01_08_425952 64 33 Records Records NNPS 10_1101-2021_01_08_425952 64 34 4 4 CD 10_1101-2021_01_08_425952 64 35 49 49 CD 10_1101-2021_01_08_425952 64 36 58950020 58950020 CD 10_1101-2021_01_08_425952 64 37 4920857 4920857 CD 10_1101-2021_01_08_425952 64 38 Amitriptyline Amitriptyline NNP 10_1101-2021_01_08_425952 64 39 25 25 CD 10_1101-2021_01_08_425952 64 40 mg mg NNP 10_1101-2021_01_08_425952 64 41 tablets tablet VBZ 10_1101-2021_01_08_425952 64 42 Amitriptyline Amitriptyline NNP 10_1101-2021_01_08_425952 64 43 hydrochloride hydrochloride NN 10_1101-2021_01_08_425952 64 44 5 5 CD 10_1101-2021_01_08_425952 64 45 65 65 CD 10_1101-2021_01_08_425952 64 46 68572020 68572020 CD 10_1101-2021_01_08_425952 64 47 4771731 4771731 CD 10_1101-2021_01_08_425952 64 48 Lisinopril Lisinopril NNP 10_1101-2021_01_08_425952 64 49 10 10 CD 10_1101-2021_01_08_425952 64 50 mg mg NNP 10_1101-2021_01_08_425952 64 51 tablets tablet VBZ 10_1101-2021_01_08_425952 64 52 Lisinopril Lisinopril NNP 10_1101-2021_01_08_425952 64 53 6 6 CD 10_1101-2021_01_08_425952 64 54 78 78 CD 10_1101-2021_01_08_425952 64 55 68571020 68571020 CD 10_1101-2021_01_08_425952 64 56 4006669 4006669 CD 10_1101-2021_01_08_425952 64 57 Lisinopril Lisinopril NNP 10_1101-2021_01_08_425952 64 58 5 5 CD 10_1101-2021_01_08_425952 64 59 mg mg NNP 10_1101-2021_01_08_425952 64 60 tablets tablet VBZ 10_1101-2021_01_08_425952 64 61 Lisinopril Lisinopril NNP 10_1101-2021_01_08_425952 64 62 V6 V6 NNP 10_1101-2021_01_08_425952 64 63 V7 V7 NNP 10_1101-2021_01_08_425952 64 64 V8 V8 NNP 10_1101-2021_01_08_425952 64 65 V9 V9 NNP 10_1101-2021_01_08_425952 64 66 1 1 CD 10_1101-2021_01_08_425952 64 67 50 50 CD 10_1101-2021_01_08_425952 64 68 mg mg NNP 10_1101-2021_01_08_425952 64 69 Tablet Tablet NNP 10_1101-2021_01_08_425952 64 70 Oral Oral NNP 10_1101-2021_01_08_425952 64 71 2040000 2040000 CD 10_1101-2021_01_08_425952 64 72 2 2 CD 10_1101-2021_01_08_425952 64 73 100 100 CD 10_1101-2021_01_08_425952 64 74 mg mg NNP 10_1101-2021_01_08_425952 64 75 Tablet Tablet NNP 10_1101-2021_01_08_425952 64 76 Oral Oral NNP 10_1101-2021_01_08_425952 64 77 2040000 2040000 CD 10_1101-2021_01_08_425952 64 78 3 3 CD 10_1101-2021_01_08_425952 64 79 25 25 CD 10_1101-2021_01_08_425952 64 80 mg mg NNP 10_1101-2021_01_08_425952 64 81 Tablet Tablet NNP 10_1101-2021_01_08_425952 64 82 Oral Oral NNP 10_1101-2021_01_08_425952 64 83 2040000 2040000 CD 10_1101-2021_01_08_425952 64 84 4 4 CD 10_1101-2021_01_08_425952 64 85 25 25 CD 10_1101-2021_01_08_425952 64 86 mg mg NNP 10_1101-2021_01_08_425952 64 87 Tablet Tablet NNP 10_1101-2021_01_08_425952 64 88 Oral Oral NNP 10_1101-2021_01_08_425952 64 89 04030100/04070300/04070402 04030100/04070300/04070402 CD 10_1101-2021_01_08_425952 64 90 5 5 CD 10_1101-2021_01_08_425952 64 91 10 10 CD 10_1101-2021_01_08_425952 64 92 mg mg NNP 10_1101-2021_01_08_425952 64 93 Tablet Tablet NNP 10_1101-2021_01_08_425952 64 94 Oral Oral NNP 10_1101-2021_01_08_425952 64 95 2050501 2050501 CD 10_1101-2021_01_08_425952 64 96 6 6 CD 10_1101-2021_01_08_425952 64 97 5 5 CD 10_1101-2021_01_08_425952 64 98 mg mg NNP 10_1101-2021_01_08_425952 64 99 Tablet Tablet NNP 10_1101-2021_01_08_425952 64 100 Oral Oral NNP 10_1101-2021_01_08_425952 64 101 2050501 2050501 CD 10_1101-2021_01_08_425952 64 102 V10 V10 NNP 10_1101-2021_01_08_425952 64 103 1 1 CD 10_1101-2021_01_08_425952 64 104 Beta beta NN 10_1101-2021_01_08_425952 64 105 - - HYPH 10_1101-2021_01_08_425952 64 106 adrenoceptor adrenoceptor NN 10_1101-2021_01_08_425952 64 107 Blocking block VBG 10_1101-2021_01_08_425952 64 108 Drugs drug NNS 10_1101-2021_01_08_425952 64 109 2 2 CD 10_1101-2021_01_08_425952 64 110 Beta beta NN 10_1101-2021_01_08_425952 64 111 - - HYPH 10_1101-2021_01_08_425952 64 112 adrenoceptor adrenoceptor NN 10_1101-2021_01_08_425952 64 113 Blocking block VBG 10_1101-2021_01_08_425952 64 114 Drugs drug NNS 10_1101-2021_01_08_425952 64 115 3 3 CD 10_1101-2021_01_08_425952 64 116 Beta beta NN 10_1101-2021_01_08_425952 64 117 - - HYPH 10_1101-2021_01_08_425952 64 118 adrenoceptor adrenoceptor NN 10_1101-2021_01_08_425952 64 119 Blocking Blocking NNP 10_1101-2021_01_08_425952 64 120 Drugs Drugs NNP 10_1101-2021_01_08_425952 64 121 4 4 CD 10_1101-2021_01_08_425952 64 122 Tricyclic Tricyclic NNP 10_1101-2021_01_08_425952 64 123 And and CC 10_1101-2021_01_08_425952 64 124 Related Related NNP 10_1101-2021_01_08_425952 64 125 Antidepressant Antidepressant NNP 10_1101-2021_01_08_425952 64 126 Drugs Drugs NNPS 10_1101-2021_01_08_425952 64 127 / / SYM 10_1101-2021_01_08_425952 64 128 Neuropathic Neuropathic NNP 10_1101-2021_01_08_425952 64 129 Pain Pain NNP 10_1101-2021_01_08_425952 64 130 / / SYM 10_1101-2021_01_08_425952 64 131 Prophylaxis Prophylaxis NNP 10_1101-2021_01_08_425952 64 132 Of of IN 10_1101-2021_01_08_425952 64 133 Migraine Migraine NNP 10_1101-2021_01_08_425952 64 134 5 5 CD 10_1101-2021_01_08_425952 64 135 Angiotensin Angiotensin NNP 10_1101-2021_01_08_425952 64 136 - - HYPH 10_1101-2021_01_08_425952 64 137 converting convert VBG 10_1101-2021_01_08_425952 64 138 Enzyme Enzyme NNP 10_1101-2021_01_08_425952 64 139 Inhibitors Inhibitors NNP 10_1101-2021_01_08_425952 64 140 6 6 CD 10_1101-2021_01_08_425952 64 141 Angiotensin Angiotensin NNP 10_1101-2021_01_08_425952 64 142 - - HYPH 10_1101-2021_01_08_425952 64 143 converting convert VBG 10_1101-2021_01_08_425952 64 144 Enzyme Enzyme NNP 10_1101-2021_01_08_425952 64 145 Inhibitors Inhibitors NNP 10_1101-2021_01_08_425952 64 146 V11 V11 NNP 10_1101-2021_01_08_425952 64 147 V12 V12 NNP 10_1101-2021_01_08_425952 64 148 1 1 CD 10_1101-2021_01_08_425952 64 149 Feb-09 feb-09 NN 10_1101-2021_01_08_425952 64 150 3059002 3059002 CD 10_1101-2021_01_08_425952 64 151 2 2 CD 10_1101-2021_01_08_425952 64 152 Feb-09 Feb-09 NNP 10_1101-2021_01_08_425952 64 153 3059001 3059001 CD 10_1101-2021_01_08_425952 64 154 3 3 CD 10_1101-2021_01_08_425952 64 155 Feb-09 Feb-09 NNP 10_1101-2021_01_08_425952 64 156 5070002 5070002 CD 10_1101-2021_01_08_425952 64 157 4 4 CD 10_1101-2021_01_08_425952 64 158 Feb-09 Feb-09 NNP 10_1101-2021_01_08_425952 64 159 2776002 2776002 CD 10_1101-2021_01_08_425952 64 160 5 5 CD 10_1101-2021_01_08_425952 64 161 Feb-09 Feb-09 NNP 10_1101-2021_01_08_425952 64 162 5250003 5250003 CD 10_1101-2021_01_08_425952 64 163 6 6 CD 10_1101-2021_01_08_425952 64 164 Feb-09 Feb-09 NNP 10_1101-2021_01_08_425952 64 165 5250002 5250002 CD 10_1101-2021_01_08_425952 64 166 2.3 2.3 CD 10_1101-2021_01_08_425952 64 167 . . . 10_1101-2021_01_08_425952 64 168 rdrugtrajectory rdrugtrajectory NN 10_1101-2021_01_08_425952 64 169 package package NN 10_1101-2021_01_08_425952 64 170 structure structure NN 10_1101-2021_01_08_425952 64 171 rdrugtrajectory rdrugtrajectory NN 10_1101-2021_01_08_425952 64 172 contains contain VBZ 10_1101-2021_01_08_425952 64 173 three three CD 10_1101-2021_01_08_425952 64 174 R r NN 10_1101-2021_01_08_425952 64 175 files file NNS 10_1101-2021_01_08_425952 64 176 : : : 10_1101-2021_01_08_425952 64 177 ( ( -LRB- 10_1101-2021_01_08_425952 64 178 1 1 LS 10_1101-2021_01_08_425952 64 179 ) ) -RRB- 10_1101-2021_01_08_425952 64 180 all all DT 10_1101-2021_01_08_425952 64 181 functions function NNS 10_1101-2021_01_08_425952 64 182 related relate VBN 10_1101-2021_01_08_425952 64 183 to to IN 10_1101-2021_01_08_425952 64 184 data datum NNS 10_1101-2021_01_08_425952 64 185 curating curate VBG 10_1101-2021_01_08_425952 64 186 and and CC 10_1101-2021_01_08_425952 64 187 search- search- JJ 10_1101-2021_01_08_425952 64 188 ing ing NN 10_1101-2021_01_08_425952 64 189 reside reside NN 10_1101-2021_01_08_425952 64 190 within within IN 10_1101-2021_01_08_425952 64 191 PRDDrugTrajectory PRDDrugTrajectory NNP 10_1101-2021_01_08_425952 64 192 . . . 10_1101-2021_01_08_425952 64 193 R r NN 10_1101-2021_01_08_425952 64 194 ; ; : 10_1101-2021_01_08_425952 64 195 ( ( -LRB- 10_1101-2021_01_08_425952 64 196 2 2 LS 10_1101-2021_01_08_425952 64 197 ) ) -RRB- 10_1101-2021_01_08_425952 64 198 analysis analysis NN 10_1101-2021_01_08_425952 64 199 tools tool NNS 10_1101-2021_01_08_425952 64 200 and and CC 10_1101-2021_01_08_425952 64 201 timeline timeline NN 10_1101-2021_01_08_425952 64 202 construction construction NN 10_1101-2021_01_08_425952 64 203 reside reside VBP 10_1101-2021_01_08_425952 64 204 within within IN 10_1101-2021_01_08_425952 64 205 CPRDDrugTrajectoryStats cprddrugtrajectorystat NNS 10_1101-2021_01_08_425952 64 206 . . . 10_1101-2021_01_08_425952 64 207 R r UH 10_1101-2021_01_08_425952 64 208 ; ; : 10_1101-2021_01_08_425952 64 209 and and CC 10_1101-2021_01_08_425952 64 210 , , , 10_1101-2021_01_08_425952 64 211 ( ( -LRB- 10_1101-2021_01_08_425952 64 212 3 3 LS 10_1101-2021_01_08_425952 64 213 ) ) -RRB- 10_1101-2021_01_08_425952 64 214 all all DT 10_1101-2021_01_08_425952 64 215 utilities utility NNS 10_1101-2021_01_08_425952 64 216 including include VBG 10_1101-2021_01_08_425952 64 217 input input NN 10_1101-2021_01_08_425952 64 218 / / SYM 10_1101-2021_01_08_425952 64 219 output output NN 10_1101-2021_01_08_425952 64 220 operations operation NNS 10_1101-2021_01_08_425952 64 221 reside reside VBP 10_1101-2021_01_08_425952 64 222 within within IN 10_1101-2021_01_08_425952 64 223 CPRDDrugTrajectoryUtils cprddrugtrajectoryutil NNS 10_1101-2021_01_08_425952 64 224 . . . 10_1101-2021_01_08_425952 64 225 R. R. NNP 10_1101-2021_01_08_425952 65 1 The the DT 10_1101-2021_01_08_425952 65 2 packages package NNS 10_1101-2021_01_08_425952 65 3 contains contain VBZ 10_1101-2021_01_08_425952 65 4 several several JJ 10_1101-2021_01_08_425952 65 5 fabricated fabricated JJ 10_1101-2021_01_08_425952 65 6 CPRD cprd NN 10_1101-2021_01_08_425952 65 7 datasets dataset NNS 10_1101-2021_01_08_425952 65 8 : : : 10_1101-2021_01_08_425952 65 9 testClinicalDF testClinicalDF NNP 10_1101-2021_01_08_425952 65 10 , , , 10_1101-2021_01_08_425952 65 11 testTherapyDF testTherapyDF NNS 10_1101-2021_01_08_425952 65 12 , , , 10_1101-2021_01_08_425952 65 13 ageGenderDF agegenderdf NN 10_1101-2021_01_08_425952 65 14 , , , 10_1101-2021_01_08_425952 65 15 imdDF imddf FW 10_1101-2021_01_08_425952 65 16 , , , 10_1101-2021_01_08_425952 65 17 and and CC 10_1101-2021_01_08_425952 65 18 drugListDF drugListDF NNP 10_1101-2021_01_08_425952 65 19 . . . 10_1101-2021_01_08_425952 66 1 A a DT 10_1101-2021_01_08_425952 66 2 de- de- JJ 10_1101-2021_01_08_425952 66 3 scription scription NN 10_1101-2021_01_08_425952 66 4 of of IN 10_1101-2021_01_08_425952 66 5 each each DT 10_1101-2021_01_08_425952 66 6 , , , 10_1101-2021_01_08_425952 66 7 along along IN 10_1101-2021_01_08_425952 66 8 with with IN 10_1101-2021_01_08_425952 66 9 information information NN 10_1101-2021_01_08_425952 66 10 on on IN 10_1101-2021_01_08_425952 66 11 data datum NNS 10_1101-2021_01_08_425952 66 12 types type NNS 10_1101-2021_01_08_425952 66 13 and and CC 10_1101-2021_01_08_425952 66 14 structures structure NNS 10_1101-2021_01_08_425952 66 15 are be VBP 10_1101-2021_01_08_425952 66 16 given give VBN 10_1101-2021_01_08_425952 66 17 below below RB 10_1101-2021_01_08_425952 66 18 . . . 10_1101-2021_01_08_425952 67 1 2.4 2.4 CD 10_1101-2021_01_08_425952 67 2 . . . 10_1101-2021_01_08_425952 68 1 The the DT 10_1101-2021_01_08_425952 68 2 CPRD CPRD NNP 10_1101-2021_01_08_425952 68 3 EHR ehr NN 10_1101-2021_01_08_425952 68 4 data datum NNS 10_1101-2021_01_08_425952 68 5 structure structure NN 10_1101-2021_01_08_425952 68 6 The the DT 10_1101-2021_01_08_425952 68 7 structure structure NN 10_1101-2021_01_08_425952 68 8 of of IN 10_1101-2021_01_08_425952 68 9 CPRD CPRD NNP 10_1101-2021_01_08_425952 68 10 Gold Gold NNP 10_1101-2021_01_08_425952 68 11 data datum NNS 10_1101-2021_01_08_425952 68 12 may may MD 10_1101-2021_01_08_425952 68 13 depend depend VB 10_1101-2021_01_08_425952 68 14 on on IN 10_1101-2021_01_08_425952 68 15 whether whether IN 10_1101-2021_01_08_425952 68 16 the the DT 10_1101-2021_01_08_425952 68 17 CPRD CPRD NNP 10_1101-2021_01_08_425952 68 18 license license NN 10_1101-2021_01_08_425952 68 19 holder holder NN 10_1101-2021_01_08_425952 68 20 per- per- NN 10_1101-2021_01_08_425952 68 21 forms form NNS 10_1101-2021_01_08_425952 68 22 intermediate intermediate JJ 10_1101-2021_01_08_425952 68 23 data data NN 10_1101-2021_01_08_425952 68 24 management management NN 10_1101-2021_01_08_425952 68 25 steps step NNS 10_1101-2021_01_08_425952 68 26 before before IN 10_1101-2021_01_08_425952 68 27 releasing release VBG 10_1101-2021_01_08_425952 68 28 data datum NNS 10_1101-2021_01_08_425952 68 29 to to IN 10_1101-2021_01_08_425952 68 30 the the DT 10_1101-2021_01_08_425952 68 31 user user NN 10_1101-2021_01_08_425952 68 32 . . . 10_1101-2021_01_08_425952 69 1 However however RB 10_1101-2021_01_08_425952 69 2 , , , 10_1101-2021_01_08_425952 69 3 typ- typ- NN 10_1101-2021_01_08_425952 69 4 ically ically RB 10_1101-2021_01_08_425952 69 5 , , , 10_1101-2021_01_08_425952 69 6 CPRD CPRD NNP 10_1101-2021_01_08_425952 69 7 Gold gold NN 10_1101-2021_01_08_425952 69 8 data datum NNS 10_1101-2021_01_08_425952 69 9 follows follow VBZ 10_1101-2021_01_08_425952 69 10 the the DT 10_1101-2021_01_08_425952 69 11 CPRD CPRD NNP 10_1101-2021_01_08_425952 69 12 Gold Gold NNP 10_1101-2021_01_08_425952 69 13 specification specification NN 10_1101-2021_01_08_425952 69 14 https://cprdcw.cprd.com/ https://cprdcw.cprd.com/ NN 10_1101-2021_01_08_425952 69 15 _ _ NNP 10_1101-2021_01_08_425952 69 16 docs docs NNP 10_1101-2021_01_08_425952 69 17 / / SYM 10_1101-2021_01_08_425952 69 18 CPRD_GOLD_Full_Data_Specification_v2.0.pdf CPRD_GOLD_Full_Data_Specification_v2.0.pdf NNP 10_1101-2021_01_08_425952 69 19 . . . 10_1101-2021_01_08_425952 70 1 Currently currently RB 10_1101-2021_01_08_425952 70 2 , , , 10_1101-2021_01_08_425952 70 3 rdrugtrajectory rdrugtrajectory JJ 10_1101-2021_01_08_425952 70 4 sup- sup- JJ 10_1101-2021_01_08_425952 70 5 ports port NNS 10_1101-2021_01_08_425952 70 6 EHR ehr NN 10_1101-2021_01_08_425952 70 7 data datum NNS 10_1101-2021_01_08_425952 70 8 from from IN 10_1101-2021_01_08_425952 70 9 the the DT 10_1101-2021_01_08_425952 70 10 flat flat JJ 10_1101-2021_01_08_425952 70 11 files file NNS 10_1101-2021_01_08_425952 70 12 ClinicalNNN.txt clinicalnnn.txt CD 10_1101-2021_01_08_425952 70 13 , , , 10_1101-2021_01_08_425952 70 14 ReferralNNN.txt referralnnn.txt CD 10_1101-2021_01_08_425952 70 15 , , , 10_1101-2021_01_08_425952 70 16 and and CC 10_1101-2021_01_08_425952 70 17 TherapyNNN.txt therapynnn.txt CD 10_1101-2021_01_08_425952 70 18 . . . 10_1101-2021_01_08_425952 71 1 The the DT 10_1101-2021_01_08_425952 71 2 Additional Additional NNP 10_1101-2021_01_08_425952 71 3 Clinical Clinical NNP 10_1101-2021_01_08_425952 71 4 Details Details NNP 10_1101-2021_01_08_425952 71 5 files file NNS 10_1101-2021_01_08_425952 71 6 ( ( -LRB- 10_1101-2021_01_08_425952 71 7 AdditionalNNN.txt AdditionalNNN.txt NNP 10_1101-2021_01_08_425952 71 8 ) ) -RRB- 10_1101-2021_01_08_425952 71 9 are be VBP 10_1101-2021_01_08_425952 71 10 currently currently RB 10_1101-2021_01_08_425952 71 11 supported support VBN 10_1101-2021_01_08_425952 71 12 using use VBG 10_1101-2021_01_08_425952 71 13 our -PRON- PRP$ 10_1101-2021_01_08_425952 71 14 re- re- JJ 10_1101-2021_01_08_425952 71 15 leased lease VBN 10_1101-2021_01_08_425952 71 16 R r NN 10_1101-2021_01_08_425952 71 17 script script NN 10_1101-2021_01_08_425952 71 18 CPRDLookups cprdlookup NNS 10_1101-2021_01_08_425952 71 19 . . . 10_1101-2021_01_08_425952 71 20 R R NNP 10_1101-2021_01_08_425952 71 21 https://github.com/acnash/CPRD_Additional_Clinical https://github.com/acnash/cprd_additional_clinical JJ 10_1101-2021_01_08_425952 71 22 ? ? . 10_1101-2021_01_08_425952 71 23 . . . 10_1101-2021_01_08_425952 72 1 Patients patient NNS 10_1101-2021_01_08_425952 72 2 are be VBP 10_1101-2021_01_08_425952 72 3 assigned assign VBN 10_1101-2021_01_08_425952 72 4 a a DT 10_1101-2021_01_08_425952 72 5 unique unique JJ 10_1101-2021_01_08_425952 72 6 numerical numerical JJ 10_1101-2021_01_08_425952 72 7 patid patid NN 10_1101-2021_01_08_425952 72 8 value value NN 10_1101-2021_01_08_425952 72 9 . . . 10_1101-2021_01_08_425952 73 1 The the DT 10_1101-2021_01_08_425952 73 2 operations operation NNS 10_1101-2021_01_08_425952 73 3 performed perform VBN 10_1101-2021_01_08_425952 73 4 by by IN 10_1101-2021_01_08_425952 73 5 rdrugtra- rdrugtra- NNP 10_1101-2021_01_08_425952 73 6 jectory jectory NNP 10_1101-2021_01_08_425952 73 7 requires require VBZ 10_1101-2021_01_08_425952 73 8 the the DT 10_1101-2021_01_08_425952 73 9 patid patid NN 10_1101-2021_01_08_425952 73 10 to to TO 10_1101-2021_01_08_425952 73 11 identify identify VB 10_1101-2021_01_08_425952 73 12 patients patient NNS 10_1101-2021_01_08_425952 73 13 and and CC 10_1101-2021_01_08_425952 73 14 subset subset VB 10_1101-2021_01_08_425952 73 15 patient patient JJ 10_1101-2021_01_08_425952 73 16 groups group NNS 10_1101-2021_01_08_425952 73 17 . . . 10_1101-2021_01_08_425952 74 1 We -PRON- PRP 10_1101-2021_01_08_425952 74 2 recommend recommend VBP 10_1101-2021_01_08_425952 74 3 that that DT 10_1101-2021_01_08_425952 74 4 patid patid NN 10_1101-2021_01_08_425952 74 5 , , , 10_1101-2021_01_08_425952 74 6 medcode medcode NNP 10_1101-2021_01_08_425952 74 7 , , , 10_1101-2021_01_08_425952 74 8 prodcode prodcode NN 10_1101-2021_01_08_425952 74 9 are be VBP 10_1101-2021_01_08_425952 74 10 kept keep VBN 10_1101-2021_01_08_425952 74 11 as as IN 10_1101-2021_01_08_425952 74 12 character character NN 10_1101-2021_01_08_425952 74 13 data datum NNS 10_1101-2021_01_08_425952 74 14 throughout throughout IN 10_1101-2021_01_08_425952 74 15 any any DT 10_1101-2021_01_08_425952 74 16 preliminary preliminary JJ 10_1101-2021_01_08_425952 74 17 data datum NNS 10_1101-2021_01_08_425952 74 18 curating curate VBG 10_1101-2021_01_08_425952 74 19 .CC .CC NFP 10_1101-2021_01_08_425952 74 20 - - : 10_1101-2021_01_08_425952 74 21 BY by IN 10_1101-2021_01_08_425952 74 22 - - HYPH 10_1101-2021_01_08_425952 74 23 ND ND NNP 10_1101-2021_01_08_425952 74 24 4.0 4.0 CD 10_1101-2021_01_08_425952 74 25 International international JJ 10_1101-2021_01_08_425952 74 26 licensemade licensemade NN 10_1101-2021_01_08_425952 74 27 available available JJ 10_1101-2021_01_08_425952 74 28 under under IN 10_1101-2021_01_08_425952 74 29 a a DT 10_1101-2021_01_08_425952 74 30 ( ( -LRB- 10_1101-2021_01_08_425952 74 31 which which WDT 10_1101-2021_01_08_425952 74 32 was be VBD 10_1101-2021_01_08_425952 74 33 not not RB 10_1101-2021_01_08_425952 74 34 certified certify VBN 10_1101-2021_01_08_425952 74 35 by by IN 10_1101-2021_01_08_425952 74 36 peer peer NN 10_1101-2021_01_08_425952 74 37 review review NN 10_1101-2021_01_08_425952 74 38 ) ) -RRB- 10_1101-2021_01_08_425952 74 39 is be VBZ 10_1101-2021_01_08_425952 74 40 the the DT 10_1101-2021_01_08_425952 74 41 author author NN 10_1101-2021_01_08_425952 74 42 / / SYM 10_1101-2021_01_08_425952 74 43 funder funder NN 10_1101-2021_01_08_425952 74 44 , , , 10_1101-2021_01_08_425952 74 45 who who WP 10_1101-2021_01_08_425952 74 46 has have VBZ 10_1101-2021_01_08_425952 74 47 granted grant VBN 10_1101-2021_01_08_425952 74 48 bioRxiv biorxiv IN 10_1101-2021_01_08_425952 74 49 a a DT 10_1101-2021_01_08_425952 74 50 license license NN 10_1101-2021_01_08_425952 74 51 to to TO 10_1101-2021_01_08_425952 74 52 display display VB 10_1101-2021_01_08_425952 74 53 the the DT 10_1101-2021_01_08_425952 74 54 preprint preprint NN 10_1101-2021_01_08_425952 74 55 in in IN 10_1101-2021_01_08_425952 74 56 perpetuity perpetuity NN 10_1101-2021_01_08_425952 74 57 . . . 10_1101-2021_01_08_425952 75 1 It -PRON- PRP 10_1101-2021_01_08_425952 75 2 is be VBZ 10_1101-2021_01_08_425952 75 3 The the DT 10_1101-2021_01_08_425952 75 4 copyright copyright NN 10_1101-2021_01_08_425952 75 5 holder holder NN 10_1101-2021_01_08_425952 75 6 for for IN 10_1101-2021_01_08_425952 75 7 this this DT 10_1101-2021_01_08_425952 75 8 preprintthis preprintthis NN 10_1101-2021_01_08_425952 75 9 version version NN 10_1101-2021_01_08_425952 75 10 posted post VBD 10_1101-2021_01_08_425952 75 11 January January NNP 10_1101-2021_01_08_425952 75 12 9 9 CD 10_1101-2021_01_08_425952 75 13 , , , 10_1101-2021_01_08_425952 75 14 2021 2021 CD 10_1101-2021_01_08_425952 75 15 . . . 10_1101-2021_01_08_425952 75 16 ; ; : 10_1101-2021_01_08_425952 75 17 https://doi.org/10.1101/2021.01.08.425952doi https://doi.org/10.1101/2021.01.08.425952doi ADD 10_1101-2021_01_08_425952 75 18 : : : 10_1101-2021_01_08_425952 75 19 bioRxiv biorxiv IN 10_1101-2021_01_08_425952 75 20 preprint preprint JJ 10_1101-2021_01_08_425952 75 21 https://cprdcw.cprd.com/_docs/CPRD_GOLD_Full_Data_Specification_v2.0.pdf https://cprdcw.cprd.com/_docs/cprd_gold_full_data_specification_v2.0.pdf NN 10_1101-2021_01_08_425952 75 22 https://cprdcw.cprd.com/_docs/CPRD_GOLD_Full_Data_Specification_v2.0.pdf https://cprdcw.cprd.com/_docs/cprd_gold_full_data_specification_v2.0.pdf NN 10_1101-2021_01_08_425952 75 23 https://github.com/acnash/CPRD_Additional_Clinical https://github.com/acnash/cprd_additional_clinical JJ 10_1101-2021_01_08_425952 75 24 https://doi.org/10.1101/2021.01.08.425952 https://doi.org/10.1101/2021.01.08.425952 NNP 10_1101-2021_01_08_425952 75 25 http://creativecommons.org/licenses/by-nd/4.0/ http://creativecommons.org/licenses/by-nd/4.0/ NNP 10_1101-2021_01_08_425952 75 26 Journal Journal NNP 10_1101-2021_01_08_425952 75 27 of of IN 10_1101-2021_01_08_425952 75 28 Statistical Statistical NNP 10_1101-2021_01_08_425952 75 29 Software Software NNP 10_1101-2021_01_08_425952 75 30 5 5 CD 10_1101-2021_01_08_425952 75 31 steps step NNS 10_1101-2021_01_08_425952 75 32 . . . 10_1101-2021_01_08_425952 76 1 Medical medical JJ 10_1101-2021_01_08_425952 76 2 events event NNS 10_1101-2021_01_08_425952 76 3 are be VBP 10_1101-2021_01_08_425952 76 4 recorded record VBN 10_1101-2021_01_08_425952 76 5 as as IN 10_1101-2021_01_08_425952 76 6 codes code NNS 10_1101-2021_01_08_425952 76 7 and and CC 10_1101-2021_01_08_425952 76 8 stored store VBN 10_1101-2021_01_08_425952 76 9 in in IN 10_1101-2021_01_08_425952 76 10 the the DT 10_1101-2021_01_08_425952 76 11 ClinicalNNN.txt ClinicalNNN.txt NNP 10_1101-2021_01_08_425952 76 12 and and CC 10_1101-2021_01_08_425952 76 13 Refer- Refer- NNP 10_1101-2021_01_08_425952 76 14 ralNNN.txt ralnnn.txt NN 10_1101-2021_01_08_425952 76 15 under under IN 10_1101-2021_01_08_425952 76 16 the the DT 10_1101-2021_01_08_425952 76 17 column column NN 10_1101-2021_01_08_425952 76 18 header header NN 10_1101-2021_01_08_425952 76 19 medcode medcode NNP 10_1101-2021_01_08_425952 76 20 . . . 10_1101-2021_01_08_425952 77 1 Prescription prescription NN 10_1101-2021_01_08_425952 77 2 events event NNS 10_1101-2021_01_08_425952 77 3 , , , 10_1101-2021_01_08_425952 77 4 such such JJ 10_1101-2021_01_08_425952 77 5 as as IN 10_1101-2021_01_08_425952 77 6 drug drug NN 10_1101-2021_01_08_425952 77 7 prescriptions prescription NNS 10_1101-2021_01_08_425952 77 8 are be VBP 10_1101-2021_01_08_425952 77 9 also also RB 10_1101-2021_01_08_425952 77 10 recorded record VBN 10_1101-2021_01_08_425952 77 11 as as IN 10_1101-2021_01_08_425952 77 12 codes code NNS 10_1101-2021_01_08_425952 77 13 and and CC 10_1101-2021_01_08_425952 77 14 stored store VBN 10_1101-2021_01_08_425952 77 15 in in IN 10_1101-2021_01_08_425952 77 16 the the DT 10_1101-2021_01_08_425952 77 17 TherapyNNN.txt therapynnn.txt CD 10_1101-2021_01_08_425952 77 18 file file NN 10_1101-2021_01_08_425952 77 19 under under IN 10_1101-2021_01_08_425952 77 20 the the DT 10_1101-2021_01_08_425952 77 21 column column NN 10_1101-2021_01_08_425952 77 22 header header VBP 10_1101-2021_01_08_425952 77 23 prodcode prodcode NN 10_1101-2021_01_08_425952 77 24 and and CC 10_1101-2021_01_08_425952 77 25 the the DT 10_1101-2021_01_08_425952 77 26 sequences sequence NNS 10_1101-2021_01_08_425952 77 27 of of IN 10_1101-2021_01_08_425952 77 28 repeat repeat NN 10_1101-2021_01_08_425952 77 29 prescriptions prescription NNS 10_1101-2021_01_08_425952 77 30 are be VBP 10_1101-2021_01_08_425952 77 31 under under IN 10_1101-2021_01_08_425952 77 32 the the DT 10_1101-2021_01_08_425952 77 33 issueseq issueseq NN 10_1101-2021_01_08_425952 77 34 column column NN 10_1101-2021_01_08_425952 77 35 header header NN 10_1101-2021_01_08_425952 77 36 . . . 10_1101-2021_01_08_425952 78 1 Dates date NNS 10_1101-2021_01_08_425952 78 2 associated associate VBD 10_1101-2021_01_08_425952 78 3 medical medical JJ 10_1101-2021_01_08_425952 78 4 and and CC 10_1101-2021_01_08_425952 78 5 prescription prescription NN 10_1101-2021_01_08_425952 78 6 events event NNS 10_1101-2021_01_08_425952 78 7 , , , 10_1101-2021_01_08_425952 78 8 recorded record VBN 10_1101-2021_01_08_425952 78 9 by by IN 10_1101-2021_01_08_425952 78 10 the the DT 10_1101-2021_01_08_425952 78 11 General General NNP 10_1101-2021_01_08_425952 78 12 Practitioner Practitioner NNP 10_1101-2021_01_08_425952 78 13 , , , 10_1101-2021_01_08_425952 78 14 are be VBP 10_1101-2021_01_08_425952 78 15 stored store VBN 10_1101-2021_01_08_425952 78 16 under under IN 10_1101-2021_01_08_425952 78 17 the the DT 10_1101-2021_01_08_425952 78 18 column column NN 10_1101-2021_01_08_425952 78 19 header header NN 10_1101-2021_01_08_425952 78 20 eventdate eventdate NN 10_1101-2021_01_08_425952 78 21 . . . 10_1101-2021_01_08_425952 79 1 2.5 2.5 CD 10_1101-2021_01_08_425952 79 2 . . . 10_1101-2021_01_08_425952 80 1 Essential essential JJ 10_1101-2021_01_08_425952 80 2 data datum NNS 10_1101-2021_01_08_425952 80 3 types type NNS 10_1101-2021_01_08_425952 80 4 and and CC 10_1101-2021_01_08_425952 80 5 data datum NNS 10_1101-2021_01_08_425952 80 6 structures structure NNS 10_1101-2021_01_08_425952 80 7 rdrugtrajectory rdrugtrajectory NN 10_1101-2021_01_08_425952 80 8 can can MD 10_1101-2021_01_08_425952 80 9 operate operate VB 10_1101-2021_01_08_425952 80 10 over over IN 10_1101-2021_01_08_425952 80 11 CPRD CPRD NNP 10_1101-2021_01_08_425952 80 12 Gold Gold NNP 10_1101-2021_01_08_425952 80 13 EHR EHR NNP 10_1101-2021_01_08_425952 80 14 clinical clinical JJ 10_1101-2021_01_08_425952 80 15 , , , 10_1101-2021_01_08_425952 80 16 referral referral NN 10_1101-2021_01_08_425952 80 17 and and CC 10_1101-2021_01_08_425952 80 18 prescription prescription NN 10_1101-2021_01_08_425952 80 19 data datum NNS 10_1101-2021_01_08_425952 80 20 provided provide VBN 10_1101-2021_01_08_425952 80 21 each each DT 10_1101-2021_01_08_425952 80 22 dataset dataset JJ 10_1101-2021_01_08_425952 80 23 format format NN 10_1101-2021_01_08_425952 80 24 is be VBZ 10_1101-2021_01_08_425952 80 25 presented present VBN 10_1101-2021_01_08_425952 80 26 as as IN 10_1101-2021_01_08_425952 80 27 separate separate JJ 10_1101-2021_01_08_425952 80 28 R r NN 10_1101-2021_01_08_425952 80 29 dataframes dataframe NNS 10_1101-2021_01_08_425952 80 30 or or CC 10_1101-2021_01_08_425952 80 31 combined combine VBN 10_1101-2021_01_08_425952 80 32 into into IN 10_1101-2021_01_08_425952 80 33 a a DT 10_1101-2021_01_08_425952 80 34 rdrug- rdrug- JJ 10_1101-2021_01_08_425952 80 35 trajectory trajectory CD 10_1101-2021_01_08_425952 80 36 medical medical JJ 10_1101-2021_01_08_425952 80 37 history history NN 10_1101-2021_01_08_425952 80 38 dataframe dataframe NN 10_1101-2021_01_08_425952 80 39 . . . 10_1101-2021_01_08_425952 81 1 The the DT 10_1101-2021_01_08_425952 81 2 construction construction NN 10_1101-2021_01_08_425952 81 3 of of IN 10_1101-2021_01_08_425952 81 4 clinical clinical JJ 10_1101-2021_01_08_425952 81 5 , , , 10_1101-2021_01_08_425952 81 6 referral referral NN 10_1101-2021_01_08_425952 81 7 and and CC 10_1101-2021_01_08_425952 81 8 prescription prescription NN 10_1101-2021_01_08_425952 81 9 dataframes dataframe NNS 10_1101-2021_01_08_425952 81 10 require require VBP 10_1101-2021_01_08_425952 81 11 , , , 10_1101-2021_01_08_425952 81 12 as as IN 10_1101-2021_01_08_425952 81 13 a a DT 10_1101-2021_01_08_425952 81 14 minimum minimum NN 10_1101-2021_01_08_425952 81 15 , , , 10_1101-2021_01_08_425952 81 16 a a DT 10_1101-2021_01_08_425952 81 17 patid patid NN 10_1101-2021_01_08_425952 81 18 and and CC 10_1101-2021_01_08_425952 81 19 eventdate eventdate NN 10_1101-2021_01_08_425952 81 20 column column NN 10_1101-2021_01_08_425952 81 21 , , , 10_1101-2021_01_08_425952 81 22 and and CC 10_1101-2021_01_08_425952 81 23 either either CC 10_1101-2021_01_08_425952 81 24 medcode medcode NNP 10_1101-2021_01_08_425952 81 25 or or CC 10_1101-2021_01_08_425952 81 26 prod- prod- NNP 10_1101-2021_01_08_425952 81 27 code code NNP 10_1101-2021_01_08_425952 81 28 ( ( -LRB- 10_1101-2021_01_08_425952 81 29 for for IN 10_1101-2021_01_08_425952 81 30 therapy therapy NNP 10_1101-2021_01_08_425952 81 31 data datum NNS 10_1101-2021_01_08_425952 81 32 , , , 10_1101-2021_01_08_425952 81 33 issueseq issueseq NN 10_1101-2021_01_08_425952 81 34 is be VBZ 10_1101-2021_01_08_425952 81 35 necessary necessary JJ 10_1101-2021_01_08_425952 81 36 ) ) -RRB- 10_1101-2021_01_08_425952 81 37 , , , 10_1101-2021_01_08_425952 81 38 and and CC 10_1101-2021_01_08_425952 81 39 presented present VBN 10_1101-2021_01_08_425952 81 40 in in IN 10_1101-2021_01_08_425952 81 41 that that DT 10_1101-2021_01_08_425952 81 42 order order NN 10_1101-2021_01_08_425952 81 43 . . . 10_1101-2021_01_08_425952 82 1 Every every DT 10_1101-2021_01_08_425952 82 2 record record NN 10_1101-2021_01_08_425952 82 3 of of IN 10_1101-2021_01_08_425952 82 4 medcode medcode NN 10_1101-2021_01_08_425952 82 5 or or CC 10_1101-2021_01_08_425952 82 6 prodcode prodcode NN 10_1101-2021_01_08_425952 82 7 must must MD 10_1101-2021_01_08_425952 82 8 be be VB 10_1101-2021_01_08_425952 82 9 accompanied accompany VBN 10_1101-2021_01_08_425952 82 10 by by IN 10_1101-2021_01_08_425952 82 11 an an DT 10_1101-2021_01_08_425952 82 12 eventdate eventdate NN 10_1101-2021_01_08_425952 82 13 entry entry NN 10_1101-2021_01_08_425952 82 14 ( ( -LRB- 10_1101-2021_01_08_425952 82 15 encoded encode VBN 10_1101-2021_01_08_425952 82 16 as as IN 10_1101-2021_01_08_425952 82 17 a a DT 10_1101-2021_01_08_425952 82 18 Date Date NNP 10_1101-2021_01_08_425952 82 19 class class NN 10_1101-2021_01_08_425952 82 20 of of IN 10_1101-2021_01_08_425952 82 21 the the DT 10_1101-2021_01_08_425952 82 22 form form NN 10_1101-2021_01_08_425952 82 23 YYYY YYYY NNP 10_1101-2021_01_08_425952 82 24 - - HYPH 10_1101-2021_01_08_425952 82 25 MM MM NNP 10_1101-2021_01_08_425952 82 26 - - HYPH 10_1101-2021_01_08_425952 82 27 DD DD NNP 10_1101-2021_01_08_425952 82 28 ) ) -RRB- 10_1101-2021_01_08_425952 82 29 . . . 10_1101-2021_01_08_425952 83 1 Patients patient NNS 10_1101-2021_01_08_425952 83 2 can can MD 10_1101-2021_01_08_425952 83 3 have have VB 10_1101-2021_01_08_425952 83 4 duplicate duplicate JJ 10_1101-2021_01_08_425952 83 5 events event NNS 10_1101-2021_01_08_425952 83 6 within within IN 10_1101-2021_01_08_425952 83 7 the the DT 10_1101-2021_01_08_425952 83 8 same same JJ 10_1101-2021_01_08_425952 83 9 data data NN 10_1101-2021_01_08_425952 83 10 set set NN 10_1101-2021_01_08_425952 83 11 and and CC 10_1101-2021_01_08_425952 83 12 between between IN 10_1101-2021_01_08_425952 83 13 data data NN 10_1101-2021_01_08_425952 83 14 sets set NNS 10_1101-2021_01_08_425952 83 15 . . . 10_1101-2021_01_08_425952 84 1 Medical medical JJ 10_1101-2021_01_08_425952 84 2 and and CC 10_1101-2021_01_08_425952 84 3 prescription prescription NN 10_1101-2021_01_08_425952 84 4 codes code NNS 10_1101-2021_01_08_425952 84 5 can can MD 10_1101-2021_01_08_425952 84 6 be be VB 10_1101-2021_01_08_425952 84 7 retrieved retrieve VBN 10_1101-2021_01_08_425952 84 8 from from IN 10_1101-2021_01_08_425952 84 9 the the DT 10_1101-2021_01_08_425952 84 10 corresponding corresponding JJ 10_1101-2021_01_08_425952 84 11 medical.txt medical.txt NN 10_1101-2021_01_08_425952 84 12 and and CC 10_1101-2021_01_08_425952 84 13 product.txt product.txt CD 10_1101-2021_01_08_425952 84 14 files file NNS 10_1101-2021_01_08_425952 84 15 which which WDT 10_1101-2021_01_08_425952 84 16 come come VBP 10_1101-2021_01_08_425952 84 17 bundled bundle VBN 10_1101-2021_01_08_425952 84 18 with with IN 10_1101-2021_01_08_425952 84 19 the the DT 10_1101-2021_01_08_425952 84 20 CPRD CPRD NNP 10_1101-2021_01_08_425952 84 21 Data Data NNPS 10_1101-2021_01_08_425952 84 22 Dictionary Dictionary NNP 10_1101-2021_01_08_425952 84 23 Win- Win- NNP 10_1101-2021_01_08_425952 84 24 dows dow VBZ 10_1101-2021_01_08_425952 84 25 application application NN 10_1101-2021_01_08_425952 84 26 . . . 10_1101-2021_01_08_425952 85 1 rdrugtrajectory rdrugtrajectory NNP 10_1101-2021_01_08_425952 85 2 comes come VBZ 10_1101-2021_01_08_425952 85 3 packaged package VBN 10_1101-2021_01_08_425952 85 4 with with IN 10_1101-2021_01_08_425952 85 5 fabricated fabricated JJ 10_1101-2021_01_08_425952 85 6 EHR EHR NNP 10_1101-2021_01_08_425952 85 7 data datum NNS 10_1101-2021_01_08_425952 85 8 in in IN 10_1101-2021_01_08_425952 85 9 the the DT 10_1101-2021_01_08_425952 85 10 structure structure NN 10_1101-2021_01_08_425952 85 11 of of IN 10_1101-2021_01_08_425952 85 12 : : : 10_1101-2021_01_08_425952 85 13 > > XX 10_1101-2021_01_08_425952 85 14 library(rdrugtrajectory library(rdrugtrajectory NN 10_1101-2021_01_08_425952 85 15 ) ) -RRB- 10_1101-2021_01_08_425952 85 16 > > XX 10_1101-2021_01_08_425952 85 17 # # $ 10_1101-2021_01_08_425952 85 18 fabricated fabricate VBN 10_1101-2021_01_08_425952 85 19 clinical clinical JJ 10_1101-2021_01_08_425952 85 20 data datum NNS 10_1101-2021_01_08_425952 85 21 ( ( -LRB- 10_1101-2021_01_08_425952 85 22 referral referral JJ 10_1101-2021_01_08_425952 85 23 data datum NNS 10_1101-2021_01_08_425952 85 24 follows follow VBZ 10_1101-2021_01_08_425952 85 25 the the DT 10_1101-2021_01_08_425952 85 26 same same JJ 10_1101-2021_01_08_425952 85 27 format format NN 10_1101-2021_01_08_425952 85 28 ) ) -RRB- 10_1101-2021_01_08_425952 85 29 > > XX 10_1101-2021_01_08_425952 85 30 names(testClinicalDF names(testClinicalDF NNP 10_1101-2021_01_08_425952 85 31 ) ) -RRB- 10_1101-2021_01_08_425952 85 32 [ [ -LRB- 10_1101-2021_01_08_425952 85 33 1 1 CD 10_1101-2021_01_08_425952 85 34 ] ] -RRB- 10_1101-2021_01_08_425952 85 35 " " `` 10_1101-2021_01_08_425952 85 36 patid patid JJ 10_1101-2021_01_08_425952 85 37 " " '' 10_1101-2021_01_08_425952 85 38 " " `` 10_1101-2021_01_08_425952 85 39 eventdate eventdate NN 10_1101-2021_01_08_425952 85 40 " " '' 10_1101-2021_01_08_425952 85 41 " " `` 10_1101-2021_01_08_425952 85 42 medcode medcode NN 10_1101-2021_01_08_425952 85 43 " " '' 10_1101-2021_01_08_425952 85 44 " " `` 10_1101-2021_01_08_425952 85 45 consid consid NN 10_1101-2021_01_08_425952 85 46 " " '' 10_1101-2021_01_08_425952 85 47 > > XX 10_1101-2021_01_08_425952 85 48 # # : 10_1101-2021_01_08_425952 85 49 fabricated fabricate VBD 10_1101-2021_01_08_425952 85 50 prescription prescription NN 10_1101-2021_01_08_425952 85 51 data datum NNS 10_1101-2021_01_08_425952 85 52 > > XX 10_1101-2021_01_08_425952 85 53 names(testTherapyDF names(testTherapyDF NNS 10_1101-2021_01_08_425952 85 54 ) ) -RRB- 10_1101-2021_01_08_425952 85 55 [ [ -LRB- 10_1101-2021_01_08_425952 85 56 1 1 CD 10_1101-2021_01_08_425952 85 57 ] ] -RRB- 10_1101-2021_01_08_425952 85 58 " " `` 10_1101-2021_01_08_425952 85 59 patid patid JJ 10_1101-2021_01_08_425952 85 60 " " '' 10_1101-2021_01_08_425952 85 61 " " `` 10_1101-2021_01_08_425952 85 62 eventdate eventdate NN 10_1101-2021_01_08_425952 85 63 " " '' 10_1101-2021_01_08_425952 85 64 " " `` 10_1101-2021_01_08_425952 85 65 prodcode prodcode NN 10_1101-2021_01_08_425952 85 66 " " '' 10_1101-2021_01_08_425952 85 67 " " `` 10_1101-2021_01_08_425952 85 68 consid consid NN 10_1101-2021_01_08_425952 85 69 " " '' 10_1101-2021_01_08_425952 85 70 " " `` 10_1101-2021_01_08_425952 85 71 issueseq issueseq NN 10_1101-2021_01_08_425952 85 72 " " '' 10_1101-2021_01_08_425952 85 73 Users user NNS 10_1101-2021_01_08_425952 85 74 can can MD 10_1101-2021_01_08_425952 85 75 check check VB 10_1101-2021_01_08_425952 85 76 if if IN 10_1101-2021_01_08_425952 85 77 the the DT 10_1101-2021_01_08_425952 85 78 structure structure NN 10_1101-2021_01_08_425952 85 79 of of IN 10_1101-2021_01_08_425952 85 80 an an DT 10_1101-2021_01_08_425952 85 81 EHR EHR NNP 10_1101-2021_01_08_425952 85 82 dataframe dataframe NN 10_1101-2021_01_08_425952 85 83 meets meet VBZ 10_1101-2021_01_08_425952 85 84 the the DT 10_1101-2021_01_08_425952 85 85 requirements requirement NNS 10_1101-2021_01_08_425952 85 86 for for IN 10_1101-2021_01_08_425952 85 87 this this DT 10_1101-2021_01_08_425952 85 88 package package NN 10_1101-2021_01_08_425952 85 89 by by IN 10_1101-2021_01_08_425952 85 90 calling call VBG 10_1101-2021_01_08_425952 85 91 checkCPRDRecord checkCPRDRecord NNP 10_1101-2021_01_08_425952 85 92 ; ; : 10_1101-2021_01_08_425952 85 93 additional additional JJ 10_1101-2021_01_08_425952 85 94 columns column NNS 10_1101-2021_01_08_425952 85 95 such such JJ 10_1101-2021_01_08_425952 85 96 as as IN 10_1101-2021_01_08_425952 85 97 consultation consultation NN 10_1101-2021_01_08_425952 85 98 identification identification NN 10_1101-2021_01_08_425952 85 99 number number NN 10_1101-2021_01_08_425952 85 100 ( ( -LRB- 10_1101-2021_01_08_425952 85 101 consid consid NN 10_1101-2021_01_08_425952 85 102 ) ) -RRB- 10_1101-2021_01_08_425952 85 103 are be VBP 10_1101-2021_01_08_425952 85 104 not not RB 10_1101-2021_01_08_425952 85 105 considered consider VBN 10_1101-2021_01_08_425952 85 106 . . . 10_1101-2021_01_08_425952 86 1 In in IN 10_1101-2021_01_08_425952 86 2 the the DT 10_1101-2021_01_08_425952 86 3 following follow VBG 10_1101-2021_01_08_425952 86 4 instance instance NN 10_1101-2021_01_08_425952 86 5 , , , 10_1101-2021_01_08_425952 86 6 a a DT 10_1101-2021_01_08_425952 86 7 prescription prescription NN 10_1101-2021_01_08_425952 86 8 dataset dataset NN 10_1101-2021_01_08_425952 86 9 with with IN 10_1101-2021_01_08_425952 86 10 the the DT 10_1101-2021_01_08_425952 86 11 required require VBN 10_1101-2021_01_08_425952 86 12 columns column NNS 10_1101-2021_01_08_425952 86 13 and and CC 10_1101-2021_01_08_425952 86 14 the the DT 10_1101-2021_01_08_425952 86 15 optional optional JJ 10_1101-2021_01_08_425952 86 16 consultation consultation NN 10_1101-2021_01_08_425952 86 17 identification identification NN 10_1101-2021_01_08_425952 86 18 number number NN 10_1101-2021_01_08_425952 86 19 is be VBZ 10_1101-2021_01_08_425952 86 20 presented present VBN 10_1101-2021_01_08_425952 86 21 . . . 10_1101-2021_01_08_425952 87 1 > > XX 10_1101-2021_01_08_425952 87 2 library(rdrugtrajectory library(rdrugtrajectory NNP 10_1101-2021_01_08_425952 87 3 ) ) -RRB- 10_1101-2021_01_08_425952 87 4 > > XX 10_1101-2021_01_08_425952 87 5 # # PRP 10_1101-2021_01_08_425952 87 6 check check VBP 10_1101-2021_01_08_425952 87 7 the the DT 10_1101-2021_01_08_425952 87 8 structure structure NN 10_1101-2021_01_08_425952 87 9 of of IN 10_1101-2021_01_08_425952 87 10 testTherapy testtherapy NN 10_1101-2021_01_08_425952 87 11 , , , 10_1101-2021_01_08_425952 87 12 specify specify VBP 10_1101-2021_01_08_425952 87 13 that that IN 10_1101-2021_01_08_425952 87 14 it -PRON- PRP 10_1101-2021_01_08_425952 87 15 is be VBZ 10_1101-2021_01_08_425952 87 16 therapy therapy NN 10_1101-2021_01_08_425952 87 17 data datum NNS 10_1101-2021_01_08_425952 87 18 > > XX 10_1101-2021_01_08_425952 87 19 checkCPRDRecord(df checkCPRDRecord(df NNS 10_1101-2021_01_08_425952 87 20 = = SYM 10_1101-2021_01_08_425952 87 21 testTherapyDF testTherapyDF NNS 10_1101-2021_01_08_425952 87 22 , , , 10_1101-2021_01_08_425952 87 23 dataType="therapy dataType="therapy NNP 10_1101-2021_01_08_425952 87 24 " " '' 10_1101-2021_01_08_425952 87 25 ) ) -RRB- 10_1101-2021_01_08_425952 87 26 [ [ -LRB- 10_1101-2021_01_08_425952 87 27 1 1 CD 10_1101-2021_01_08_425952 87 28 ] ] -RRB- 10_1101-2021_01_08_425952 87 29 " " `` 10_1101-2021_01_08_425952 87 30 The the DT 10_1101-2021_01_08_425952 87 31 data.frame data.frame NN 10_1101-2021_01_08_425952 87 32 is be VBZ 10_1101-2021_01_08_425952 87 33 appropriately appropriately RB 10_1101-2021_01_08_425952 87 34 formatted format VBN 10_1101-2021_01_08_425952 87 35 . . . 10_1101-2021_01_08_425952 88 1 Returning return VBG 10_1101-2021_01_08_425952 88 2 TRUE true NN 10_1101-2021_01_08_425952 88 3 . . . 10_1101-2021_01_08_425952 88 4 " " '' 10_1101-2021_01_08_425952 89 1 [ [ -LRB- 10_1101-2021_01_08_425952 89 2 1 1 LS 10_1101-2021_01_08_425952 89 3 ] ] -RRB- 10_1101-2021_01_08_425952 89 4 TRUE true JJ 10_1101-2021_01_08_425952 89 5 > > XX 10_1101-2021_01_08_425952 89 6 # # $ 10_1101-2021_01_08_425952 89 7 display display VBP 10_1101-2021_01_08_425952 89 8 the the DT 10_1101-2021_01_08_425952 89 9 rdrugtrajectory rdrugtrajectory JJ 10_1101-2021_01_08_425952 89 10 EHR EHR NNP 10_1101-2021_01_08_425952 89 11 therapy therapy NN 10_1101-2021_01_08_425952 89 12 dataframe dataframe NN 10_1101-2021_01_08_425952 89 13 > > XX 10_1101-2021_01_08_425952 89 14 str(testTherapyDF str(testtherapydf NN 10_1101-2021_01_08_425952 89 15 , , , 10_1101-2021_01_08_425952 89 16 strict.width="wrap strict.width="wrap NN 10_1101-2021_01_08_425952 89 17 " " '' 10_1101-2021_01_08_425952 89 18 ) ) -RRB- 10_1101-2021_01_08_425952 89 19 .CC .CC NFP 10_1101-2021_01_08_425952 89 20 - - : 10_1101-2021_01_08_425952 89 21 BY by IN 10_1101-2021_01_08_425952 89 22 - - HYPH 10_1101-2021_01_08_425952 89 23 ND ND NNP 10_1101-2021_01_08_425952 89 24 4.0 4.0 CD 10_1101-2021_01_08_425952 89 25 International international JJ 10_1101-2021_01_08_425952 89 26 licensemade licensemade NN 10_1101-2021_01_08_425952 89 27 available available JJ 10_1101-2021_01_08_425952 89 28 under under IN 10_1101-2021_01_08_425952 89 29 a a DT 10_1101-2021_01_08_425952 89 30 ( ( -LRB- 10_1101-2021_01_08_425952 89 31 which which WDT 10_1101-2021_01_08_425952 89 32 was be VBD 10_1101-2021_01_08_425952 89 33 not not RB 10_1101-2021_01_08_425952 89 34 certified certify VBN 10_1101-2021_01_08_425952 89 35 by by IN 10_1101-2021_01_08_425952 89 36 peer peer NN 10_1101-2021_01_08_425952 89 37 review review NN 10_1101-2021_01_08_425952 89 38 ) ) -RRB- 10_1101-2021_01_08_425952 89 39 is be VBZ 10_1101-2021_01_08_425952 89 40 the the DT 10_1101-2021_01_08_425952 89 41 author author NN 10_1101-2021_01_08_425952 89 42 / / SYM 10_1101-2021_01_08_425952 89 43 funder funder NN 10_1101-2021_01_08_425952 89 44 , , , 10_1101-2021_01_08_425952 89 45 who who WP 10_1101-2021_01_08_425952 89 46 has have VBZ 10_1101-2021_01_08_425952 89 47 granted grant VBN 10_1101-2021_01_08_425952 89 48 bioRxiv biorxiv IN 10_1101-2021_01_08_425952 89 49 a a DT 10_1101-2021_01_08_425952 89 50 license license NN 10_1101-2021_01_08_425952 89 51 to to TO 10_1101-2021_01_08_425952 89 52 display display VB 10_1101-2021_01_08_425952 89 53 the the DT 10_1101-2021_01_08_425952 89 54 preprint preprint NN 10_1101-2021_01_08_425952 89 55 in in IN 10_1101-2021_01_08_425952 89 56 perpetuity perpetuity NN 10_1101-2021_01_08_425952 89 57 . . . 10_1101-2021_01_08_425952 90 1 It -PRON- PRP 10_1101-2021_01_08_425952 90 2 is be VBZ 10_1101-2021_01_08_425952 90 3 The the DT 10_1101-2021_01_08_425952 90 4 copyright copyright NN 10_1101-2021_01_08_425952 90 5 holder holder NN 10_1101-2021_01_08_425952 90 6 for for IN 10_1101-2021_01_08_425952 90 7 this this DT 10_1101-2021_01_08_425952 90 8 preprintthis preprintthis NN 10_1101-2021_01_08_425952 90 9 version version NN 10_1101-2021_01_08_425952 90 10 posted post VBD 10_1101-2021_01_08_425952 90 11 January January NNP 10_1101-2021_01_08_425952 90 12 9 9 CD 10_1101-2021_01_08_425952 90 13 , , , 10_1101-2021_01_08_425952 90 14 2021 2021 CD 10_1101-2021_01_08_425952 90 15 . . . 10_1101-2021_01_08_425952 90 16 ; ; : 10_1101-2021_01_08_425952 90 17 https://doi.org/10.1101/2021.01.08.425952doi https://doi.org/10.1101/2021.01.08.425952doi ADD 10_1101-2021_01_08_425952 90 18 : : : 10_1101-2021_01_08_425952 90 19 bioRxiv biorxiv IN 10_1101-2021_01_08_425952 90 20 preprint preprint NN 10_1101-2021_01_08_425952 90 21 https://doi.org/10.1101/2021.01.08.425952 https://doi.org/10.1101/2021.01.08.425952 NN 10_1101-2021_01_08_425952 90 22 http://creativecommons.org/licenses/by-nd/4.0/ http://creativecommons.org/licenses/by-nd/4.0/ NN 10_1101-2021_01_08_425952 90 23 6 6 CD 10_1101-2021_01_08_425952 90 24 rdrugtrajectory rdrugtrajectory NN 10_1101-2021_01_08_425952 90 25 : : : 10_1101-2021_01_08_425952 90 26 Analysing Analysing NNP 10_1101-2021_01_08_425952 90 27 Drug Drug NNP 10_1101-2021_01_08_425952 90 28 Prescriptions Prescriptions NNPS 10_1101-2021_01_08_425952 90 29 in in IN 10_1101-2021_01_08_425952 90 30 Electronic Electronic NNP 10_1101-2021_01_08_425952 90 31 Health Health NNP 10_1101-2021_01_08_425952 90 32 Care Care NNP 10_1101-2021_01_08_425952 90 33 Records Records NNPS 10_1101-2021_01_08_425952 90 34 ' ' POS 10_1101-2021_01_08_425952 90 35 data.frame data.frame NN 10_1101-2021_01_08_425952 90 36 ' ' '' 10_1101-2021_01_08_425952 90 37 : : : 10_1101-2021_01_08_425952 90 38 91647 91647 CD 10_1101-2021_01_08_425952 90 39 obs obs NN 10_1101-2021_01_08_425952 90 40 . . . 10_1101-2021_01_08_425952 91 1 of of IN 10_1101-2021_01_08_425952 91 2 5 5 CD 10_1101-2021_01_08_425952 91 3 variables variable NNS 10_1101-2021_01_08_425952 91 4 : : : 10_1101-2021_01_08_425952 91 5 $ $ $ 10_1101-2021_01_08_425952 91 6 patid patid NN 10_1101-2021_01_08_425952 91 7 : : : 10_1101-2021_01_08_425952 91 8 int int NN 10_1101-2021_01_08_425952 91 9 3515 3515 CD 10_1101-2021_01_08_425952 91 10 3515 3515 CD 10_1101-2021_01_08_425952 91 11 3515 3515 CD 10_1101-2021_01_08_425952 91 12 3515 3515 CD 10_1101-2021_01_08_425952 91 13 3515 3515 CD 10_1101-2021_01_08_425952 91 14 3515 3515 CD 10_1101-2021_01_08_425952 91 15 3515 3515 CD 10_1101-2021_01_08_425952 91 16 3653 3653 CD 10_1101-2021_01_08_425952 91 17 3653 3653 CD 10_1101-2021_01_08_425952 91 18 3653 3653 CD 10_1101-2021_01_08_425952 91 19 ... ... : 10_1101-2021_01_08_425952 91 20 $ $ $ 10_1101-2021_01_08_425952 91 21 eventdate eventdate NN 10_1101-2021_01_08_425952 91 22 : : : 10_1101-2021_01_08_425952 91 23 Date date NN 10_1101-2021_01_08_425952 91 24 , , , 10_1101-2021_01_08_425952 91 25 format format NN 10_1101-2021_01_08_425952 91 26 : : : 10_1101-2021_01_08_425952 91 27 " " `` 10_1101-2021_01_08_425952 91 28 2005 2005 CD 10_1101-2021_01_08_425952 91 29 - - HYPH 10_1101-2021_01_08_425952 91 30 02 02 CD 10_1101-2021_01_08_425952 91 31 - - HYPH 10_1101-2021_01_08_425952 91 32 24 24 CD 10_1101-2021_01_08_425952 91 33 " " '' 10_1101-2021_01_08_425952 91 34 " " `` 10_1101-2021_01_08_425952 91 35 2006 2006 CD 10_1101-2021_01_08_425952 91 36 - - HYPH 10_1101-2021_01_08_425952 91 37 01 01 CD 10_1101-2021_01_08_425952 91 38 - - HYPH 10_1101-2021_01_08_425952 91 39 26 26 CD 10_1101-2021_01_08_425952 91 40 " " '' 10_1101-2021_01_08_425952 91 41 ... ... : 10_1101-2021_01_08_425952 91 42 $ $ $ 10_1101-2021_01_08_425952 91 43 prodcode prodcode NN 10_1101-2021_01_08_425952 91 44 : : : 10_1101-2021_01_08_425952 91 45 int int NNP 10_1101-2021_01_08_425952 91 46 83 83 CD 10_1101-2021_01_08_425952 91 47 83 83 CD 10_1101-2021_01_08_425952 91 48 83 83 CD 10_1101-2021_01_08_425952 91 49 707 707 CD 10_1101-2021_01_08_425952 91 50 707 707 CD 10_1101-2021_01_08_425952 91 51 707 707 CD 10_1101-2021_01_08_425952 91 52 707 707 CD 10_1101-2021_01_08_425952 91 53 297 297 CD 10_1101-2021_01_08_425952 91 54 297 297 CD 10_1101-2021_01_08_425952 91 55 297 297 CD 10_1101-2021_01_08_425952 91 56 ... ... : 10_1101-2021_01_08_425952 91 57 $ $ $ 10_1101-2021_01_08_425952 91 58 consid consid NN 10_1101-2021_01_08_425952 91 59 : : : 10_1101-2021_01_08_425952 91 60 int int NN 10_1101-2021_01_08_425952 91 61 540850 540850 CD 10_1101-2021_01_08_425952 91 62 540865 540865 CD 10_1101-2021_01_08_425952 91 63 540892 540892 CD 10_1101-2021_01_08_425952 91 64 541108 541108 CD 10_1101-2021_01_08_425952 91 65 541114 541114 CD 10_1101-2021_01_08_425952 91 66 541118 541118 CD 10_1101-2021_01_08_425952 91 67 541133 541133 CD 10_1101-2021_01_08_425952 91 68 571336 571336 CD 10_1101-2021_01_08_425952 91 69 571345 571345 CD 10_1101-2021_01_08_425952 91 70 571357 571357 CD 10_1101-2021_01_08_425952 91 71 ... ... : 10_1101-2021_01_08_425952 91 72 $ $ $ 10_1101-2021_01_08_425952 91 73 issueseq issueseq NN 10_1101-2021_01_08_425952 91 74 : : : 10_1101-2021_01_08_425952 91 75 int int VB 10_1101-2021_01_08_425952 91 76 0 0 CD 10_1101-2021_01_08_425952 91 77 0 0 CD 10_1101-2021_01_08_425952 91 78 0 0 CD 10_1101-2021_01_08_425952 91 79 0 0 CD 10_1101-2021_01_08_425952 91 80 0 0 CD 10_1101-2021_01_08_425952 91 81 0 0 CD 10_1101-2021_01_08_425952 91 82 0 0 CD 10_1101-2021_01_08_425952 91 83 0 0 CD 10_1101-2021_01_08_425952 91 84 1 1 CD 10_1101-2021_01_08_425952 91 85 2 2 CD 10_1101-2021_01_08_425952 91 86 ... ... : 10_1101-2021_01_08_425952 91 87 Users user NNS 10_1101-2021_01_08_425952 91 88 can can MD 10_1101-2021_01_08_425952 91 89 combine combine VB 10_1101-2021_01_08_425952 91 90 with with IN 10_1101-2021_01_08_425952 91 91 the the DT 10_1101-2021_01_08_425952 91 92 rdrugtrajectory rdrugtrajectory JJ 10_1101-2021_01_08_425952 91 93 EHR ehr NN 10_1101-2021_01_08_425952 91 94 dataframes dataframe VBZ 10_1101-2021_01_08_425952 91 95 any any DT 10_1101-2021_01_08_425952 91 96 number number NN 10_1101-2021_01_08_425952 91 97 of of IN 10_1101-2021_01_08_425952 91 98 patient patient NN 10_1101-2021_01_08_425952 91 99 and and CC 10_1101-2021_01_08_425952 91 100 EHR EHR NNP 10_1101-2021_01_08_425952 91 101 data datum NNS 10_1101-2021_01_08_425952 91 102 to to TO 10_1101-2021_01_08_425952 91 103 act act VB 10_1101-2021_01_08_425952 91 104 as as IN 10_1101-2021_01_08_425952 91 105 covariates covariate NNS 10_1101-2021_01_08_425952 91 106 and and CC 10_1101-2021_01_08_425952 91 107 stratifying stratify VBG 10_1101-2021_01_08_425952 91 108 variables variable NNS 10_1101-2021_01_08_425952 91 109 , , , 10_1101-2021_01_08_425952 91 110 typically typically RB 10_1101-2021_01_08_425952 91 111 this this DT 10_1101-2021_01_08_425952 91 112 can can MD 10_1101-2021_01_08_425952 91 113 be be VB 10_1101-2021_01_08_425952 91 114 done do VBN 10_1101-2021_01_08_425952 91 115 using use VBG 10_1101-2021_01_08_425952 91 116 the the DT 10_1101-2021_01_08_425952 91 117 R r NN 10_1101-2021_01_08_425952 91 118 cbind cbind NN 10_1101-2021_01_08_425952 91 119 operation operation NN 10_1101-2021_01_08_425952 91 120 . . . 10_1101-2021_01_08_425952 92 1 For for IN 10_1101-2021_01_08_425952 92 2 example example NN 10_1101-2021_01_08_425952 92 3 , , , 10_1101-2021_01_08_425952 92 4 BMI bmi NN 10_1101-2021_01_08_425952 92 5 and and CC 10_1101-2021_01_08_425952 92 6 smoking smoking NN 10_1101-2021_01_08_425952 92 7 status status NN 10_1101-2021_01_08_425952 92 8 , , , 10_1101-2021_01_08_425952 92 9 both both DT 10_1101-2021_01_08_425952 92 10 of of IN 10_1101-2021_01_08_425952 92 11 which which WDT 10_1101-2021_01_08_425952 92 12 can can MD 10_1101-2021_01_08_425952 92 13 be be VB 10_1101-2021_01_08_425952 92 14 retrieved retrieve VBN 10_1101-2021_01_08_425952 92 15 from from IN 10_1101-2021_01_08_425952 92 16 the the DT 10_1101-2021_01_08_425952 92 17 AdditionalNNN.txt AdditionalNNN.txt NNP 10_1101-2021_01_08_425952 92 18 dataset dataset NN 10_1101-2021_01_08_425952 92 19 files file NNS 10_1101-2021_01_08_425952 92 20 using use VBG 10_1101-2021_01_08_425952 92 21 CPRDLookups cprdlookup NNS 10_1101-2021_01_08_425952 92 22 . . . 10_1101-2021_01_08_425952 92 23 R r NN 10_1101-2021_01_08_425952 92 24 , , , 10_1101-2021_01_08_425952 92 25 can can MD 10_1101-2021_01_08_425952 92 26 be be VB 10_1101-2021_01_08_425952 92 27 linked link VBN 10_1101-2021_01_08_425952 92 28 by by IN 10_1101-2021_01_08_425952 92 29 searching search VBG 10_1101-2021_01_08_425952 92 30 for for IN 10_1101-2021_01_08_425952 92 31 and and CC 10_1101-2021_01_08_425952 92 32 binding bind VBG 10_1101-2021_01_08_425952 92 33 with with IN 10_1101-2021_01_08_425952 92 34 the the DT 10_1101-2021_01_08_425952 92 35 record record NN 10_1101-2021_01_08_425952 92 36 patid patid JJ 10_1101-2021_01_08_425952 92 37 values value NNS 10_1101-2021_01_08_425952 92 38 . . . 10_1101-2021_01_08_425952 93 1 The the DT 10_1101-2021_01_08_425952 93 2 rdrugtrajectory rdrugtrajectory JJ 10_1101-2021_01_08_425952 93 3 package package NN 10_1101-2021_01_08_425952 93 4 contains contain VBZ 10_1101-2021_01_08_425952 93 5 several several JJ 10_1101-2021_01_08_425952 93 6 utility utility NN 10_1101-2021_01_08_425952 93 7 functions function NNS 10_1101-2021_01_08_425952 93 8 to to TO 10_1101-2021_01_08_425952 93 9 retrieve retrieve VB 10_1101-2021_01_08_425952 93 10 CPRD CPRD NNP 10_1101-2021_01_08_425952 93 11 data datum NNS 10_1101-2021_01_08_425952 93 12 , , , 10_1101-2021_01_08_425952 93 13 including include VBG 10_1101-2021_01_08_425952 93 14 , , , 10_1101-2021_01_08_425952 93 15 patient patient JJ 10_1101-2021_01_08_425952 93 16 year year NN 10_1101-2021_01_08_425952 93 17 of of IN 10_1101-2021_01_08_425952 93 18 birth birth NN 10_1101-2021_01_08_425952 93 19 , , , 10_1101-2021_01_08_425952 93 20 gender gender NN 10_1101-2021_01_08_425952 93 21 ( ( -LRB- 10_1101-2021_01_08_425952 93 22 male male JJ 10_1101-2021_01_08_425952 93 23 or or CC 10_1101-2021_01_08_425952 93 24 female female JJ 10_1101-2021_01_08_425952 93 25 ) ) -RRB- 10_1101-2021_01_08_425952 93 26 and and CC 10_1101-2021_01_08_425952 93 27 either either CC 10_1101-2021_01_08_425952 93 28 patient patient JJ 10_1101-2021_01_08_425952 93 29 - - HYPH 10_1101-2021_01_08_425952 93 30 level level NN 10_1101-2021_01_08_425952 93 31 or or CC 10_1101-2021_01_08_425952 93 32 clinical clinical JJ 10_1101-2021_01_08_425952 93 33 - - HYPH 10_1101-2021_01_08_425952 93 34 level level NN 10_1101-2021_01_08_425952 93 35 index index NN 10_1101-2021_01_08_425952 93 36 of of IN 10_1101-2021_01_08_425952 93 37 multiple multiple JJ 10_1101-2021_01_08_425952 93 38 deprivation deprivation NN 10_1101-2021_01_08_425952 93 39 score score NN 10_1101-2021_01_08_425952 93 40 ( ( -LRB- 10_1101-2021_01_08_425952 93 41 IMD IMD NNP 10_1101-2021_01_08_425952 93 42 ) ) -RRB- 10_1101-2021_01_08_425952 93 43 . . . 10_1101-2021_01_08_425952 94 1 The the DT 10_1101-2021_01_08_425952 94 2 patient patient NN 10_1101-2021_01_08_425952 94 3 age age NN 10_1101-2021_01_08_425952 94 4 can can MD 10_1101-2021_01_08_425952 94 5 be be VB 10_1101-2021_01_08_425952 94 6 determined determine VBN 10_1101-2021_01_08_425952 94 7 by by IN 10_1101-2021_01_08_425952 94 8 adding add VBG 10_1101-2021_01_08_425952 94 9 1800 1800 CD 10_1101-2021_01_08_425952 94 10 to to IN 10_1101-2021_01_08_425952 94 11 the the DT 10_1101-2021_01_08_425952 94 12 value value NN 10_1101-2021_01_08_425952 94 13 in in IN 10_1101-2021_01_08_425952 94 14 yob yob NNP 10_1101-2021_01_08_425952 94 15 column column NN 10_1101-2021_01_08_425952 94 16 in in IN 10_1101-2021_01_08_425952 94 17 the the DT 10_1101-2021_01_08_425952 94 18 Patient Patient NNP 10_1101-2021_01_08_425952 94 19 CPRD CPRD NNP 10_1101-2021_01_08_425952 94 20 EHR EHR NNP 10_1101-2021_01_08_425952 94 21 dataset dataset NN 10_1101-2021_01_08_425952 94 22 and and CC 10_1101-2021_01_08_425952 94 23 then then RB 10_1101-2021_01_08_425952 94 24 subtracting subtract VBG 10_1101-2021_01_08_425952 94 25 that that DT 10_1101-2021_01_08_425952 94 26 value value NN 10_1101-2021_01_08_425952 94 27 ( ( -LRB- 10_1101-2021_01_08_425952 94 28 birth birth NN 10_1101-2021_01_08_425952 94 29 year year NN 10_1101-2021_01_08_425952 94 30 ) ) -RRB- 10_1101-2021_01_08_425952 94 31 from from IN 10_1101-2021_01_08_425952 94 32 the the DT 10_1101-2021_01_08_425952 94 33 year year NN 10_1101-2021_01_08_425952 94 34 of of IN 10_1101-2021_01_08_425952 94 35 the the DT 10_1101-2021_01_08_425952 94 36 CPRD CPRD NNP 10_1101-2021_01_08_425952 94 37 database database NN 10_1101-2021_01_08_425952 94 38 release release NN 10_1101-2021_01_08_425952 94 39 . . . 10_1101-2021_01_08_425952 95 1 This this DT 10_1101-2021_01_08_425952 95 2 data data NN 10_1101-2021_01_08_425952 95 3 requires require VBZ 10_1101-2021_01_08_425952 95 4 preliminary preliminary JJ 10_1101-2021_01_08_425952 95 5 treatment treatment NN 10_1101-2021_01_08_425952 95 6 before before IN 10_1101-2021_01_08_425952 95 7 presenting present VBG 10_1101-2021_01_08_425952 95 8 to to IN 10_1101-2021_01_08_425952 95 9 the the DT 10_1101-2021_01_08_425952 95 10 rdrugtrajectory rdrugtrajectory JJ 10_1101-2021_01_08_425952 95 11 package package NN 10_1101-2021_01_08_425952 95 12 . . . 10_1101-2021_01_08_425952 96 1 Patient patient JJ 10_1101-2021_01_08_425952 96 2 age age NN 10_1101-2021_01_08_425952 96 3 , , , 10_1101-2021_01_08_425952 96 4 gender gender NN 10_1101-2021_01_08_425952 96 5 and and CC 10_1101-2021_01_08_425952 96 6 IMD IMD NNP 10_1101-2021_01_08_425952 96 7 score score NN 10_1101-2021_01_08_425952 96 8 must must MD 10_1101-2021_01_08_425952 96 9 be be VB 10_1101-2021_01_08_425952 96 10 presented present VBN 10_1101-2021_01_08_425952 96 11 in in IN 10_1101-2021_01_08_425952 96 12 a a DT 10_1101-2021_01_08_425952 96 13 dataframe dataframe NN 10_1101-2021_01_08_425952 96 14 with with IN 10_1101-2021_01_08_425952 96 15 the the DT 10_1101-2021_01_08_425952 96 16 linked link VBN 10_1101-2021_01_08_425952 96 17 patient patient NN 10_1101-2021_01_08_425952 96 18 column column NN 10_1101-2021_01_08_425952 96 19 patid patid NNS 10_1101-2021_01_08_425952 96 20 , , , 10_1101-2021_01_08_425952 96 21 along along IN 10_1101-2021_01_08_425952 96 22 with with IN 10_1101-2021_01_08_425952 96 23 the the DT 10_1101-2021_01_08_425952 96 24 columns column NNS 10_1101-2021_01_08_425952 96 25 age age NN 10_1101-2021_01_08_425952 96 26 , , , 10_1101-2021_01_08_425952 96 27 gender gender NN 10_1101-2021_01_08_425952 96 28 , , , 10_1101-2021_01_08_425952 96 29 and and CC 10_1101-2021_01_08_425952 96 30 score score NN 10_1101-2021_01_08_425952 96 31 . . . 10_1101-2021_01_08_425952 97 1 Providing provide VBG 10_1101-2021_01_08_425952 97 2 the the DT 10_1101-2021_01_08_425952 97 3 patid patid JJ 10_1101-2021_01_08_425952 97 4 column column NN 10_1101-2021_01_08_425952 97 5 is be VBZ 10_1101-2021_01_08_425952 97 6 preserved preserve VBN 10_1101-2021_01_08_425952 97 7 , , , 10_1101-2021_01_08_425952 97 8 patient patient JJ 10_1101-2021_01_08_425952 97 9 characteristics characteristic NNS 10_1101-2021_01_08_425952 97 10 can can MD 10_1101-2021_01_08_425952 97 11 be be VB 10_1101-2021_01_08_425952 97 12 presented present VBN 10_1101-2021_01_08_425952 97 13 in in IN 10_1101-2021_01_08_425952 97 14 separate separate JJ 10_1101-2021_01_08_425952 97 15 dataframe dataframe NN 10_1101-2021_01_08_425952 97 16 , , , 10_1101-2021_01_08_425952 97 17 for for IN 10_1101-2021_01_08_425952 97 18 example example NN 10_1101-2021_01_08_425952 97 19 : : : 10_1101-2021_01_08_425952 97 20 > > XX 10_1101-2021_01_08_425952 97 21 library(rdrugtrajectory library(rdrugtrajectory NN 10_1101-2021_01_08_425952 97 22 ) ) -RRB- 10_1101-2021_01_08_425952 97 23 > > XX 10_1101-2021_01_08_425952 97 24 # # $ 10_1101-2021_01_08_425952 97 25 patient patient JJ 10_1101-2021_01_08_425952 97 26 age age NN 10_1101-2021_01_08_425952 97 27 and and CC 10_1101-2021_01_08_425952 97 28 gender gender NN 10_1101-2021_01_08_425952 97 29 as as IN 10_1101-2021_01_08_425952 97 30 one one CD 10_1101-2021_01_08_425952 97 31 dataframe dataframe NN 10_1101-2021_01_08_425952 97 32 > > XX 10_1101-2021_01_08_425952 97 33 str(ageGenderDF str(agegenderdf NN 10_1101-2021_01_08_425952 97 34 , , , 10_1101-2021_01_08_425952 97 35 strict.width="wrap strict.width="wrap NN 10_1101-2021_01_08_425952 97 36 " " '' 10_1101-2021_01_08_425952 97 37 ) ) -RRB- 10_1101-2021_01_08_425952 97 38 ' ' `` 10_1101-2021_01_08_425952 97 39 data.frame data.frame NN 10_1101-2021_01_08_425952 97 40 ' ' '' 10_1101-2021_01_08_425952 97 41 : : : 10_1101-2021_01_08_425952 97 42 3838 3838 CD 10_1101-2021_01_08_425952 97 43 obs obs NN 10_1101-2021_01_08_425952 97 44 . . . 10_1101-2021_01_08_425952 98 1 of of IN 10_1101-2021_01_08_425952 98 2 3 3 CD 10_1101-2021_01_08_425952 98 3 variables variable NNS 10_1101-2021_01_08_425952 98 4 : : : 10_1101-2021_01_08_425952 98 5 $ $ $ 10_1101-2021_01_08_425952 98 6 patid patid NN 10_1101-2021_01_08_425952 98 7 : : : 10_1101-2021_01_08_425952 98 8 int int NN 10_1101-2021_01_08_425952 98 9 1 1 CD 10_1101-2021_01_08_425952 98 10 2 2 CD 10_1101-2021_01_08_425952 98 11 3 3 CD 10_1101-2021_01_08_425952 98 12 4 4 CD 10_1101-2021_01_08_425952 98 13 5 5 CD 10_1101-2021_01_08_425952 98 14 6 6 CD 10_1101-2021_01_08_425952 98 15 7 7 CD 10_1101-2021_01_08_425952 98 16 8 8 CD 10_1101-2021_01_08_425952 98 17 9 9 CD 10_1101-2021_01_08_425952 98 18 10 10 CD 10_1101-2021_01_08_425952 98 19 ... ... . 10_1101-2021_01_08_425952 98 20 $ $ $ 10_1101-2021_01_08_425952 98 21 yob yob NN 10_1101-2021_01_08_425952 98 22 : : : 10_1101-2021_01_08_425952 98 23 num num NNP 10_1101-2021_01_08_425952 98 24 45 45 CD 10_1101-2021_01_08_425952 98 25 35 35 CD 10_1101-2021_01_08_425952 98 26 33 33 CD 10_1101-2021_01_08_425952 98 27 42 42 CD 10_1101-2021_01_08_425952 98 28 63 63 CD 10_1101-2021_01_08_425952 98 29 57 57 CD 10_1101-2021_01_08_425952 98 30 34 34 CD 10_1101-2021_01_08_425952 98 31 51 51 CD 10_1101-2021_01_08_425952 98 32 51 51 CD 10_1101-2021_01_08_425952 98 33 22 22 CD 10_1101-2021_01_08_425952 98 34 ... ... : 10_1101-2021_01_08_425952 98 35 $ $ $ 10_1101-2021_01_08_425952 98 36 gender gender NN 10_1101-2021_01_08_425952 98 37 : : : 10_1101-2021_01_08_425952 98 38 int int NN 10_1101-2021_01_08_425952 98 39 2 2 CD 10_1101-2021_01_08_425952 98 40 2 2 CD 10_1101-2021_01_08_425952 98 41 1 1 CD 10_1101-2021_01_08_425952 98 42 2 2 CD 10_1101-2021_01_08_425952 98 43 2 2 CD 10_1101-2021_01_08_425952 98 44 1 1 CD 10_1101-2021_01_08_425952 98 45 2 2 CD 10_1101-2021_01_08_425952 98 46 2 2 CD 10_1101-2021_01_08_425952 98 47 2 2 CD 10_1101-2021_01_08_425952 98 48 1 1 CD 10_1101-2021_01_08_425952 98 49 ... ... NFP 10_1101-2021_01_08_425952 98 50 > > XX 10_1101-2021_01_08_425952 98 51 # # $ 10_1101-2021_01_08_425952 98 52 clinic clinic NN 10_1101-2021_01_08_425952 98 53 - - HYPH 10_1101-2021_01_08_425952 98 54 level level NN 10_1101-2021_01_08_425952 98 55 IMD IMD NNP 10_1101-2021_01_08_425952 98 56 score score NN 10_1101-2021_01_08_425952 98 57 as as IN 10_1101-2021_01_08_425952 98 58 one one CD 10_1101-2021_01_08_425952 98 59 datafrmae datafrmae NN 10_1101-2021_01_08_425952 98 60 > > XX 10_1101-2021_01_08_425952 98 61 str(imdDF str(imddf NN 10_1101-2021_01_08_425952 98 62 , , , 10_1101-2021_01_08_425952 98 63 strict.width="wrap strict.width="wrap NN 10_1101-2021_01_08_425952 98 64 " " '' 10_1101-2021_01_08_425952 98 65 ) ) -RRB- 10_1101-2021_01_08_425952 98 66 ' ' `` 10_1101-2021_01_08_425952 98 67 data.frame data.frame NN 10_1101-2021_01_08_425952 98 68 ' ' '' 10_1101-2021_01_08_425952 98 69 : : : 10_1101-2021_01_08_425952 98 70 2126 2126 CD 10_1101-2021_01_08_425952 98 71 obs obs NN 10_1101-2021_01_08_425952 98 72 . . . 10_1101-2021_01_08_425952 99 1 of of IN 10_1101-2021_01_08_425952 99 2 3 3 CD 10_1101-2021_01_08_425952 99 3 variables variable NNS 10_1101-2021_01_08_425952 99 4 : : : 10_1101-2021_01_08_425952 99 5 $ $ $ 10_1101-2021_01_08_425952 99 6 patid patid NN 10_1101-2021_01_08_425952 99 7 : : : 10_1101-2021_01_08_425952 99 8 int int DT 10_1101-2021_01_08_425952 99 9 6 6 CD 10_1101-2021_01_08_425952 99 10 11 11 CD 10_1101-2021_01_08_425952 99 11 16 16 CD 10_1101-2021_01_08_425952 99 12 34 34 CD 10_1101-2021_01_08_425952 99 13 42 42 CD 10_1101-2021_01_08_425952 99 14 44 44 CD 10_1101-2021_01_08_425952 99 15 54 54 CD 10_1101-2021_01_08_425952 99 16 60 60 CD 10_1101-2021_01_08_425952 99 17 63 63 CD 10_1101-2021_01_08_425952 99 18 79 79 CD 10_1101-2021_01_08_425952 99 19 ... ... : 10_1101-2021_01_08_425952 99 20 $ $ $ 10_1101-2021_01_08_425952 99 21 pracid pracid NN 10_1101-2021_01_08_425952 99 22 : : : 10_1101-2021_01_08_425952 99 23 int int NN 10_1101-2021_01_08_425952 99 24 184 184 CD 10_1101-2021_01_08_425952 99 25 31 31 CD 10_1101-2021_01_08_425952 99 26 66 66 CD 10_1101-2021_01_08_425952 99 27 344 344 CD 10_1101-2021_01_08_425952 99 28 66 66 CD 10_1101-2021_01_08_425952 99 29 47 47 CD 10_1101-2021_01_08_425952 99 30 18 18 CD 10_1101-2021_01_08_425952 99 31 90 90 CD 10_1101-2021_01_08_425952 99 32 379 379 CD 10_1101-2021_01_08_425952 99 33 317 317 CD 10_1101-2021_01_08_425952 99 34 ... ... : 10_1101-2021_01_08_425952 99 35 $ $ $ 10_1101-2021_01_08_425952 99 36 score score NN 10_1101-2021_01_08_425952 99 37 : : : 10_1101-2021_01_08_425952 99 38 int int NN 10_1101-2021_01_08_425952 99 39 1 1 CD 10_1101-2021_01_08_425952 99 40 3 3 CD 10_1101-2021_01_08_425952 99 41 1 1 CD 10_1101-2021_01_08_425952 99 42 4 4 CD 10_1101-2021_01_08_425952 99 43 1 1 CD 10_1101-2021_01_08_425952 99 44 2 2 CD 10_1101-2021_01_08_425952 99 45 1 1 CD 10_1101-2021_01_08_425952 99 46 5 5 CD 10_1101-2021_01_08_425952 99 47 1 1 CD 10_1101-2021_01_08_425952 99 48 2 2 CD 10_1101-2021_01_08_425952 99 49 ... ... . 10_1101-2021_01_08_425952 100 1 The the DT 10_1101-2021_01_08_425952 100 2 patid patid JJ 10_1101-2021_01_08_425952 100 3 patient patient NN 10_1101-2021_01_08_425952 100 4 identifier identifier NN 10_1101-2021_01_08_425952 100 5 is be VBZ 10_1101-2021_01_08_425952 100 6 fundamental fundamental JJ 10_1101-2021_01_08_425952 100 7 in in IN 10_1101-2021_01_08_425952 100 8 every every DT 10_1101-2021_01_08_425952 100 9 operation operation NN 10_1101-2021_01_08_425952 100 10 performed perform VBN 10_1101-2021_01_08_425952 100 11 by by IN 10_1101-2021_01_08_425952 100 12 rdrugtrajectory rdrugtrajectory NN 10_1101-2021_01_08_425952 100 13 . . . 10_1101-2021_01_08_425952 101 1 The the DT 10_1101-2021_01_08_425952 101 2 examples example NNS 10_1101-2021_01_08_425952 101 3 presented present VBN 10_1101-2021_01_08_425952 101 4 here here RB 10_1101-2021_01_08_425952 101 5 and and CC 10_1101-2021_01_08_425952 101 6 those those DT 10_1101-2021_01_08_425952 101 7 in in IN 10_1101-2021_01_08_425952 101 8 the the DT 10_1101-2021_01_08_425952 101 9 reference reference NN 10_1101-2021_01_08_425952 101 10 manual manual NN 10_1101-2021_01_08_425952 101 11 rely rely VBP 10_1101-2021_01_08_425952 101 12 on on IN 10_1101-2021_01_08_425952 101 13 searching search VBG 10_1101-2021_01_08_425952 101 14 and and CC 10_1101-2021_01_08_425952 101 15 subset- subset- JJ 10_1101-2021_01_08_425952 101 16 ting ting NNP 10_1101-2021_01_08_425952 101 17 EHR EHR NNP 10_1101-2021_01_08_425952 101 18 data datum NNS 10_1101-2021_01_08_425952 101 19 using use VBG 10_1101-2021_01_08_425952 101 20 a a DT 10_1101-2021_01_08_425952 101 21 list list NN 10_1101-2021_01_08_425952 101 22 or or CC 10_1101-2021_01_08_425952 101 23 vector vector NN 10_1101-2021_01_08_425952 101 24 of of IN 10_1101-2021_01_08_425952 101 25 patient patient JJ 10_1101-2021_01_08_425952 101 26 identifier identifier NN 10_1101-2021_01_08_425952 101 27 . . . 10_1101-2021_01_08_425952 102 1 The the DT 10_1101-2021_01_08_425952 102 2 function function NN 10_1101-2021_01_08_425952 102 3 getUniquePatidList getuniquepatidlist NN 10_1101-2021_01_08_425952 102 4 will will MD 10_1101-2021_01_08_425952 102 5 retrieve retrieve VB 10_1101-2021_01_08_425952 102 6 an an DT 10_1101-2021_01_08_425952 102 7 R R NNP 10_1101-2021_01_08_425952 102 8 List list NN 10_1101-2021_01_08_425952 102 9 of of IN 10_1101-2021_01_08_425952 102 10 patient patient JJ 10_1101-2021_01_08_425952 102 11 identification identification NN 10_1101-2021_01_08_425952 102 12 numbers number NNS 10_1101-2021_01_08_425952 102 13 from from IN 10_1101-2021_01_08_425952 102 14 any any DT 10_1101-2021_01_08_425952 102 15 dataframe dataframe NN 10_1101-2021_01_08_425952 102 16 with with IN 10_1101-2021_01_08_425952 102 17 a a DT 10_1101-2021_01_08_425952 102 18 patid patid JJ 10_1101-2021_01_08_425952 102 19 column column NN 10_1101-2021_01_08_425952 102 20 . . . 10_1101-2021_01_08_425952 103 1 The the DT 10_1101-2021_01_08_425952 103 2 aforementioned aforementioned JJ 10_1101-2021_01_08_425952 103 3 rdrugtrajectory rdrugtrajectory NN 10_1101-2021_01_08_425952 103 4 EHR ehr NN 10_1101-2021_01_08_425952 103 5 dataframes dataframe NNS 10_1101-2021_01_08_425952 103 6 , , , 10_1101-2021_01_08_425952 103 7 clinical clinical JJ 10_1101-2021_01_08_425952 103 8 , , , 10_1101-2021_01_08_425952 103 9 referral referral NN 10_1101-2021_01_08_425952 103 10 and and CC 10_1101-2021_01_08_425952 103 11 therapy therapy NN 10_1101-2021_01_08_425952 103 12 , , , 10_1101-2021_01_08_425952 103 13 can can MD 10_1101-2021_01_08_425952 103 14 be be VB 10_1101-2021_01_08_425952 103 15 combined combine VBN 10_1101-2021_01_08_425952 103 16 into into IN 10_1101-2021_01_08_425952 103 17 a a DT 10_1101-2021_01_08_425952 103 18 single single JJ 10_1101-2021_01_08_425952 103 19 dataframe dataframe NN 10_1101-2021_01_08_425952 103 20 . . . 10_1101-2021_01_08_425952 104 1 We -PRON- PRP 10_1101-2021_01_08_425952 104 2 refer refer VBP 10_1101-2021_01_08_425952 104 3 to to IN 10_1101-2021_01_08_425952 104 4 this this DT 10_1101-2021_01_08_425952 104 5 dataset dataset JJ 10_1101-2021_01_08_425952 104 6 instance instance NN 10_1101-2021_01_08_425952 104 7 as as IN 10_1101-2021_01_08_425952 104 8 the the DT 10_1101-2021_01_08_425952 104 9 patient patient NN 10_1101-2021_01_08_425952 104 10 ’s ’s POS 10_1101-2021_01_08_425952 104 11 medical medical JJ 10_1101-2021_01_08_425952 104 12 .CC .CC : 10_1101-2021_01_08_425952 104 13 - - HYPH 10_1101-2021_01_08_425952 104 14 BY BY NNP 10_1101-2021_01_08_425952 104 15 - - HYPH 10_1101-2021_01_08_425952 104 16 ND ND NNP 10_1101-2021_01_08_425952 104 17 4.0 4.0 CD 10_1101-2021_01_08_425952 104 18 International international JJ 10_1101-2021_01_08_425952 104 19 licensemade licensemade NN 10_1101-2021_01_08_425952 104 20 available available JJ 10_1101-2021_01_08_425952 104 21 under under IN 10_1101-2021_01_08_425952 104 22 a a DT 10_1101-2021_01_08_425952 104 23 ( ( -LRB- 10_1101-2021_01_08_425952 104 24 which which WDT 10_1101-2021_01_08_425952 104 25 was be VBD 10_1101-2021_01_08_425952 104 26 not not RB 10_1101-2021_01_08_425952 104 27 certified certify VBN 10_1101-2021_01_08_425952 104 28 by by IN 10_1101-2021_01_08_425952 104 29 peer peer NN 10_1101-2021_01_08_425952 104 30 review review NN 10_1101-2021_01_08_425952 104 31 ) ) -RRB- 10_1101-2021_01_08_425952 104 32 is be VBZ 10_1101-2021_01_08_425952 104 33 the the DT 10_1101-2021_01_08_425952 104 34 author author NN 10_1101-2021_01_08_425952 104 35 / / SYM 10_1101-2021_01_08_425952 104 36 funder funder NN 10_1101-2021_01_08_425952 104 37 , , , 10_1101-2021_01_08_425952 104 38 who who WP 10_1101-2021_01_08_425952 104 39 has have VBZ 10_1101-2021_01_08_425952 104 40 granted grant VBN 10_1101-2021_01_08_425952 104 41 bioRxiv biorxiv IN 10_1101-2021_01_08_425952 104 42 a a DT 10_1101-2021_01_08_425952 104 43 license license NN 10_1101-2021_01_08_425952 104 44 to to TO 10_1101-2021_01_08_425952 104 45 display display VB 10_1101-2021_01_08_425952 104 46 the the DT 10_1101-2021_01_08_425952 104 47 preprint preprint NN 10_1101-2021_01_08_425952 104 48 in in IN 10_1101-2021_01_08_425952 104 49 perpetuity perpetuity NN 10_1101-2021_01_08_425952 104 50 . . . 10_1101-2021_01_08_425952 105 1 It -PRON- PRP 10_1101-2021_01_08_425952 105 2 is be VBZ 10_1101-2021_01_08_425952 105 3 The the DT 10_1101-2021_01_08_425952 105 4 copyright copyright NN 10_1101-2021_01_08_425952 105 5 holder holder NN 10_1101-2021_01_08_425952 105 6 for for IN 10_1101-2021_01_08_425952 105 7 this this DT 10_1101-2021_01_08_425952 105 8 preprintthis preprintthis NN 10_1101-2021_01_08_425952 105 9 version version NN 10_1101-2021_01_08_425952 105 10 posted post VBD 10_1101-2021_01_08_425952 105 11 January January NNP 10_1101-2021_01_08_425952 105 12 9 9 CD 10_1101-2021_01_08_425952 105 13 , , , 10_1101-2021_01_08_425952 105 14 2021 2021 CD 10_1101-2021_01_08_425952 105 15 . . . 10_1101-2021_01_08_425952 105 16 ; ; : 10_1101-2021_01_08_425952 105 17 https://doi.org/10.1101/2021.01.08.425952doi https://doi.org/10.1101/2021.01.08.425952doi ADD 10_1101-2021_01_08_425952 105 18 : : : 10_1101-2021_01_08_425952 105 19 bioRxiv biorxiv IN 10_1101-2021_01_08_425952 105 20 preprint preprint NN 10_1101-2021_01_08_425952 105 21 https://doi.org/10.1101/2021.01.08.425952 https://doi.org/10.1101/2021.01.08.425952 XX 10_1101-2021_01_08_425952 105 22 http://creativecommons.org/licenses/by-nd/4.0/ http://creativecommons.org/licenses/by-nd/4.0/ NNP 10_1101-2021_01_08_425952 105 23 Journal Journal NNP 10_1101-2021_01_08_425952 105 24 of of IN 10_1101-2021_01_08_425952 105 25 Statistical Statistical NNP 10_1101-2021_01_08_425952 105 26 Software Software NNP 10_1101-2021_01_08_425952 105 27 7 7 CD 10_1101-2021_01_08_425952 105 28 history history NN 10_1101-2021_01_08_425952 105 29 and and CC 10_1101-2021_01_08_425952 105 30 can can MD 10_1101-2021_01_08_425952 105 31 be be VB 10_1101-2021_01_08_425952 105 32 constructed construct VBN 10_1101-2021_01_08_425952 105 33 using use VBG 10_1101-2021_01_08_425952 105 34 constructMedicalHistory constructmedicalhistory NN 10_1101-2021_01_08_425952 105 35 . . . 10_1101-2021_01_08_425952 106 1 This this DT 10_1101-2021_01_08_425952 106 2 dataframe dataframe NN 10_1101-2021_01_08_425952 106 3 expects expect VBZ 10_1101-2021_01_08_425952 106 4 events event NNS 10_1101-2021_01_08_425952 106 5 to to TO 10_1101-2021_01_08_425952 106 6 be be VB 10_1101-2021_01_08_425952 106 7 in in IN 10_1101-2021_01_08_425952 106 8 chronological chronological JJ 10_1101-2021_01_08_425952 106 9 order order NN 10_1101-2021_01_08_425952 106 10 , , , 10_1101-2021_01_08_425952 106 11 and and CC 10_1101-2021_01_08_425952 106 12 will will MD 10_1101-2021_01_08_425952 106 13 introduce introduce VB 10_1101-2021_01_08_425952 106 14 a a DT 10_1101-2021_01_08_425952 106 15 new new JJ 10_1101-2021_01_08_425952 106 16 column column NN 10_1101-2021_01_08_425952 106 17 , , , 10_1101-2021_01_08_425952 106 18 code code NN 10_1101-2021_01_08_425952 106 19 and and CC 10_1101-2021_01_08_425952 106 20 codetype codetype VB 10_1101-2021_01_08_425952 106 21 to to TO 10_1101-2021_01_08_425952 106 22 denote denote VB 10_1101-2021_01_08_425952 106 23 each each DT 10_1101-2021_01_08_425952 106 24 of of IN 10_1101-2021_01_08_425952 106 25 the the DT 10_1101-2021_01_08_425952 106 26 combined combine VBN 10_1101-2021_01_08_425952 106 27 events event NNS 10_1101-2021_01_08_425952 106 28 . . . 10_1101-2021_01_08_425952 107 1 The the DT 10_1101-2021_01_08_425952 107 2 code code NN 10_1101-2021_01_08_425952 107 3 ( ( -LRB- 10_1101-2021_01_08_425952 107 4 medcode medcode NNP 10_1101-2021_01_08_425952 107 5 and/or and/or CC 10_1101-2021_01_08_425952 107 6 prodcode prodcode NN 10_1101-2021_01_08_425952 107 7 ) ) -RRB- 10_1101-2021_01_08_425952 107 8 can can MD 10_1101-2021_01_08_425952 107 9 be be VB 10_1101-2021_01_08_425952 107 10 distinguished distinguish VBN 10_1101-2021_01_08_425952 107 11 by by IN 10_1101-2021_01_08_425952 107 12 a a DT 10_1101-2021_01_08_425952 107 13 codetype codetype NN 10_1101-2021_01_08_425952 107 14 value value NN 10_1101-2021_01_08_425952 107 15 of of IN 10_1101-2021_01_08_425952 107 16 c c NN 10_1101-2021_01_08_425952 107 17 ( ( -LRB- 10_1101-2021_01_08_425952 107 18 clinical clinical JJ 10_1101-2021_01_08_425952 107 19 events event NNS 10_1101-2021_01_08_425952 107 20 ) ) -RRB- 10_1101-2021_01_08_425952 107 21 , , , 10_1101-2021_01_08_425952 107 22 r r NN 10_1101-2021_01_08_425952 107 23 ( ( -LRB- 10_1101-2021_01_08_425952 107 24 referral referral JJ 10_1101-2021_01_08_425952 107 25 events event NNS 10_1101-2021_01_08_425952 107 26 ) ) -RRB- 10_1101-2021_01_08_425952 107 27 , , , 10_1101-2021_01_08_425952 107 28 and and CC 10_1101-2021_01_08_425952 107 29 t t NN 10_1101-2021_01_08_425952 107 30 ( ( -LRB- 10_1101-2021_01_08_425952 107 31 prescription prescription NN 10_1101-2021_01_08_425952 107 32 events event NNS 10_1101-2021_01_08_425952 107 33 ) ) -RRB- 10_1101-2021_01_08_425952 107 34 . . . 10_1101-2021_01_08_425952 108 1 Events event NNS 10_1101-2021_01_08_425952 108 2 are be VBP 10_1101-2021_01_08_425952 108 3 returned return VBN 10_1101-2021_01_08_425952 108 4 in in IN 10_1101-2021_01_08_425952 108 5 chronological chronological JJ 10_1101-2021_01_08_425952 108 6 order order NN 10_1101-2021_01_08_425952 108 7 using use VBG 10_1101-2021_01_08_425952 108 8 the the DT 10_1101-2021_01_08_425952 108 9 eventdate eventdate NN 10_1101-2021_01_08_425952 108 10 data datum NNS 10_1101-2021_01_08_425952 108 11 . . . 10_1101-2021_01_08_425952 109 1 The the DT 10_1101-2021_01_08_425952 109 2 following follow VBG 10_1101-2021_01_08_425952 109 3 code code NN 10_1101-2021_01_08_425952 109 4 demonstrates demonstrate VBZ 10_1101-2021_01_08_425952 109 5 how how WRB 10_1101-2021_01_08_425952 109 6 to to TO 10_1101-2021_01_08_425952 109 7 retrieve retrieve VB 10_1101-2021_01_08_425952 109 8 a a DT 10_1101-2021_01_08_425952 109 9 list list NN 10_1101-2021_01_08_425952 109 10 of of IN 10_1101-2021_01_08_425952 109 11 patient patient JJ 10_1101-2021_01_08_425952 109 12 identifier identifier NNP 10_1101-2021_01_08_425952 109 13 from from IN 10_1101-2021_01_08_425952 109 14 a a DT 10_1101-2021_01_08_425952 109 15 prescription prescription NN 10_1101-2021_01_08_425952 109 16 dataframe dataframe NN 10_1101-2021_01_08_425952 109 17 and and CC 10_1101-2021_01_08_425952 109 18 from from IN 10_1101-2021_01_08_425952 109 19 a a DT 10_1101-2021_01_08_425952 109 20 medical medical JJ 10_1101-2021_01_08_425952 109 21 history history NN 10_1101-2021_01_08_425952 109 22 dataframe dataframe NN 10_1101-2021_01_08_425952 109 23 , , , 10_1101-2021_01_08_425952 109 24 followed follow VBN 10_1101-2021_01_08_425952 109 25 by by IN 10_1101-2021_01_08_425952 109 26 how how WRB 10_1101-2021_01_08_425952 109 27 to to TO 10_1101-2021_01_08_425952 109 28 subset subset VB 10_1101-2021_01_08_425952 109 29 using use VBG 10_1101-2021_01_08_425952 109 30 base base NN 10_1101-2021_01_08_425952 109 31 R r NN 10_1101-2021_01_08_425952 109 32 operations operation NNS 10_1101-2021_01_08_425952 109 33 and and CC 10_1101-2021_01_08_425952 109 34 , , , 10_1101-2021_01_08_425952 109 35 finally finally RB 10_1101-2021_01_08_425952 109 36 , , , 10_1101-2021_01_08_425952 109 37 the the DT 10_1101-2021_01_08_425952 109 38 medical medical JJ 10_1101-2021_01_08_425952 109 39 history history NN 10_1101-2021_01_08_425952 109 40 dataframe dataframe NN 10_1101-2021_01_08_425952 109 41 structure structure NN 10_1101-2021_01_08_425952 109 42 . . . 10_1101-2021_01_08_425952 110 1 > > XX 10_1101-2021_01_08_425952 110 2 library(rdrugtrajectory library(rdrugtrajectory NNP 10_1101-2021_01_08_425952 110 3 ) ) -RRB- 10_1101-2021_01_08_425952 110 4 > > XX 10_1101-2021_01_08_425952 110 5 # # $ 10_1101-2021_01_08_425952 110 6 Retrieve retrieve NN 10_1101-2021_01_08_425952 110 7 patids patid NNS 10_1101-2021_01_08_425952 110 8 from from IN 10_1101-2021_01_08_425952 110 9 therapy therapy NN 10_1101-2021_01_08_425952 110 10 data datum NNS 10_1101-2021_01_08_425952 110 11 . . . 10_1101-2021_01_08_425952 111 1 > > XX 10_1101-2021_01_08_425952 111 2 idList idList NNP 10_1101-2021_01_08_425952 111 3 < < NNP 10_1101-2021_01_08_425952 111 4 - - HYPH 10_1101-2021_01_08_425952 111 5 getUniquePatidList(testClinicalDF getUniquePatidList(testClinicalDF NNP 10_1101-2021_01_08_425952 111 6 ) ) -RRB- 10_1101-2021_01_08_425952 111 7 > > XX 10_1101-2021_01_08_425952 111 8 medHistoryDF medHistoryDF NNP 10_1101-2021_01_08_425952 111 9 < < XX 10_1101-2021_01_08_425952 111 10 - - HYPH 10_1101-2021_01_08_425952 111 11 constructMedicalHistory(testClinicalDF constructMedicalHistory(testClinicalDF NNP 10_1101-2021_01_08_425952 111 12 , , , 10_1101-2021_01_08_425952 111 13 NULL NULL NNP 10_1101-2021_01_08_425952 111 14 , , , 10_1101-2021_01_08_425952 111 15 testTherapyDF testTherapyDF NNP 10_1101-2021_01_08_425952 111 16 ) ) -RRB- 10_1101-2021_01_08_425952 111 17 [ [ -LRB- 10_1101-2021_01_08_425952 111 18 1 1 CD 10_1101-2021_01_08_425952 111 19 ] ] -RRB- 10_1101-2021_01_08_425952 111 20 " " `` 10_1101-2021_01_08_425952 111 21 Using use VBG 10_1101-2021_01_08_425952 111 22 clinical clinical JJ 10_1101-2021_01_08_425952 111 23 data datum NNS 10_1101-2021_01_08_425952 111 24 . . . 10_1101-2021_01_08_425952 111 25 " " '' 10_1101-2021_01_08_425952 112 1 [ [ -LRB- 10_1101-2021_01_08_425952 112 2 1 1 CD 10_1101-2021_01_08_425952 112 3 ] ] -RRB- 10_1101-2021_01_08_425952 112 4 " " `` 10_1101-2021_01_08_425952 112 5 Using use VBG 10_1101-2021_01_08_425952 112 6 therapy therapy NN 10_1101-2021_01_08_425952 112 7 data datum NNS 10_1101-2021_01_08_425952 112 8 . . . 10_1101-2021_01_08_425952 112 9 " " '' 10_1101-2021_01_08_425952 113 1 [ [ -LRB- 10_1101-2021_01_08_425952 113 2 1 1 CD 10_1101-2021_01_08_425952 113 3 ] ] -RRB- 10_1101-2021_01_08_425952 113 4 " " `` 10_1101-2021_01_08_425952 113 5 Building build VBG 10_1101-2021_01_08_425952 113 6 with with IN 10_1101-2021_01_08_425952 113 7 clinical clinical JJ 10_1101-2021_01_08_425952 113 8 and and CC 10_1101-2021_01_08_425952 113 9 therapy therapy NN 10_1101-2021_01_08_425952 113 10 data datum NNS 10_1101-2021_01_08_425952 113 11 . . . 10_1101-2021_01_08_425952 113 12 " " '' 10_1101-2021_01_08_425952 114 1 > > XX 10_1101-2021_01_08_425952 114 2 # # $ 10_1101-2021_01_08_425952 114 3 Retrieve retrieve NN 10_1101-2021_01_08_425952 114 4 patid patid VBD 10_1101-2021_01_08_425952 114 5 from from IN 10_1101-2021_01_08_425952 114 6 medical medical JJ 10_1101-2021_01_08_425952 114 7 history history NN 10_1101-2021_01_08_425952 114 8 . . . 10_1101-2021_01_08_425952 115 1 > > XX 10_1101-2021_01_08_425952 115 2 medHistoryIDList medHistoryIDList NNP 10_1101-2021_01_08_425952 115 3 < < XX 10_1101-2021_01_08_425952 115 4 - - HYPH 10_1101-2021_01_08_425952 115 5 getUniquePatidList(medHistoryDF getUniquePatidList(medHistoryDF NNP 10_1101-2021_01_08_425952 115 6 ) ) -RRB- 10_1101-2021_01_08_425952 115 7 > > XX 10_1101-2021_01_08_425952 115 8 numOfPatients numofpatient NNS 10_1101-2021_01_08_425952 115 9 < < XX 10_1101-2021_01_08_425952 115 10 - - HYPH 10_1101-2021_01_08_425952 115 11 length(medHistoryIDList length(medhistoryidlist NN 10_1101-2021_01_08_425952 115 12 ) ) -RRB- 10_1101-2021_01_08_425952 115 13 > > XX 10_1101-2021_01_08_425952 115 14 # # $ 10_1101-2021_01_08_425952 115 15 Subset Subset NNP 10_1101-2021_01_08_425952 115 16 using use VBG 10_1101-2021_01_08_425952 115 17 the the DT 10_1101-2021_01_08_425952 115 18 first first JJ 10_1101-2021_01_08_425952 115 19 100 100 CD 10_1101-2021_01_08_425952 115 20 patients patient NNS 10_1101-2021_01_08_425952 115 21 . . . 10_1101-2021_01_08_425952 116 1 > > XX 10_1101-2021_01_08_425952 116 2 smallMedHistoryDF smallMedHistoryDF NNP 10_1101-2021_01_08_425952 116 3 < < XX 10_1101-2021_01_08_425952 116 4 - - HYPH 10_1101-2021_01_08_425952 116 5 subset(medHistoryDF subset(medHistoryDF NNS 10_1101-2021_01_08_425952 116 6 , , , 10_1101-2021_01_08_425952 116 7 + + CC 10_1101-2021_01_08_425952 116 8 medHistoryDF$patid medhistorydf$patid CD 10_1101-2021_01_08_425952 116 9 % % NN 10_1101-2021_01_08_425952 116 10 in% in% CD 10_1101-2021_01_08_425952 116 11 medHistoryIDList[1:100 medhistoryidlist[1:100 CD 10_1101-2021_01_08_425952 116 12 ] ] -RRB- 10_1101-2021_01_08_425952 116 13 ) ) -RRB- 10_1101-2021_01_08_425952 116 14 > > XX 10_1101-2021_01_08_425952 116 15 # # $ 10_1101-2021_01_08_425952 116 16 Separate separate VB 10_1101-2021_01_08_425952 116 17 out out RP 10_1101-2021_01_08_425952 116 18 the the DT 10_1101-2021_01_08_425952 116 19 first first JJ 10_1101-2021_01_08_425952 116 20 100 100 CD 10_1101-2021_01_08_425952 116 21 patient patient NN 10_1101-2021_01_08_425952 116 22 with with IN 10_1101-2021_01_08_425952 116 23 a a DT 10_1101-2021_01_08_425952 116 24 clinical clinical JJ 10_1101-2021_01_08_425952 116 25 record record NN 10_1101-2021_01_08_425952 116 26 . . . 10_1101-2021_01_08_425952 117 1 > > XX 10_1101-2021_01_08_425952 117 2 smallClinicalOnlyDF smallClinicalOnlyDF NNP 10_1101-2021_01_08_425952 117 3 < < XX 10_1101-2021_01_08_425952 117 4 - - HYPH 10_1101-2021_01_08_425952 117 5 subset(smallMedHistoryDF subset(smallMedHistoryDF NNP 10_1101-2021_01_08_425952 117 6 , , , 10_1101-2021_01_08_425952 117 7 + + SYM 10_1101-2021_01_08_425952 117 8 smallMedHistoryDF$codetype smallmedhistorydf$codetype NN 10_1101-2021_01_08_425952 117 9 = = SYM 10_1101-2021_01_08_425952 117 10 = = SYM 10_1101-2021_01_08_425952 117 11 " " `` 10_1101-2021_01_08_425952 117 12 c c NN 10_1101-2021_01_08_425952 117 13 " " '' 10_1101-2021_01_08_425952 117 14 ) ) -RRB- 10_1101-2021_01_08_425952 117 15 > > XX 10_1101-2021_01_08_425952 117 16 # # $ 10_1101-2021_01_08_425952 117 17 Separate separate VB 10_1101-2021_01_08_425952 117 18 out out RP 10_1101-2021_01_08_425952 117 19 the the DT 10_1101-2021_01_08_425952 117 20 first first JJ 10_1101-2021_01_08_425952 117 21 100 100 CD 10_1101-2021_01_08_425952 117 22 patient patient NN 10_1101-2021_01_08_425952 117 23 with with IN 10_1101-2021_01_08_425952 117 24 a a DT 10_1101-2021_01_08_425952 117 25 therapy therapy NN 10_1101-2021_01_08_425952 117 26 record record NN 10_1101-2021_01_08_425952 117 27 . . . 10_1101-2021_01_08_425952 118 1 > > XX 10_1101-2021_01_08_425952 118 2 smallTherapyOnlyDF smallTherapyOnlyDF NNS 10_1101-2021_01_08_425952 118 3 < < XX 10_1101-2021_01_08_425952 118 4 - - HYPH 10_1101-2021_01_08_425952 118 5 subset(smallMedHistoryDF subset(smallMedHistoryDF NNP 10_1101-2021_01_08_425952 118 6 , , , 10_1101-2021_01_08_425952 118 7 + + SYM 10_1101-2021_01_08_425952 118 8 smallMedHistoryDF$codetype smallmedhistorydf$codetype NN 10_1101-2021_01_08_425952 118 9 = = SYM 10_1101-2021_01_08_425952 118 10 = = SYM 10_1101-2021_01_08_425952 118 11 " " `` 10_1101-2021_01_08_425952 118 12 t t NN 10_1101-2021_01_08_425952 118 13 " " '' 10_1101-2021_01_08_425952 118 14 ) ) -RRB- 10_1101-2021_01_08_425952 118 15 > > XX 10_1101-2021_01_08_425952 118 16 # # NN 10_1101-2021_01_08_425952 118 17 Subset subset VBP 10_1101-2021_01_08_425952 118 18 only only RB 10_1101-2021_01_08_425952 118 19 or or CC 10_1101-2021_01_08_425952 118 20 those those DT 10_1101-2021_01_08_425952 118 21 patient patient JJ 10_1101-2021_01_08_425952 118 22 records record NNS 10_1101-2021_01_08_425952 118 23 beyond beyond IN 10_1101-2021_01_08_425952 118 24 31st 31st JJ 10_1101-2021_01_08_425952 118 25 Jan Jan NNP 10_1101-2021_01_08_425952 118 26 2010 2010 CD 10_1101-2021_01_08_425952 118 27 . . . 10_1101-2021_01_08_425952 119 1 > > XX 10_1101-2021_01_08_425952 119 2 laterMedHistoryDF laterMedHistoryDF NNP 10_1101-2021_01_08_425952 119 3 < < XX 10_1101-2021_01_08_425952 119 4 - - HYPH 10_1101-2021_01_08_425952 119 5 subset(medHistoryDF subset(medHistoryDF NNS 10_1101-2021_01_08_425952 119 6 , , , 10_1101-2021_01_08_425952 119 7 + + CC 10_1101-2021_01_08_425952 119 8 medHistoryDF$eventdate medhistorydf$eventdate NN 10_1101-2021_01_08_425952 119 9 > > XX 10_1101-2021_01_08_425952 119 10 as as IN 10_1101-2021_01_08_425952 119 11 . . . 10_1101-2021_01_08_425952 119 12 Date("2010 Date("2010 NNP 10_1101-2021_01_08_425952 119 13 - - HYPH 10_1101-2021_01_08_425952 119 14 01 01 CD 10_1101-2021_01_08_425952 119 15 - - HYPH 10_1101-2021_01_08_425952 119 16 31 31 CD 10_1101-2021_01_08_425952 119 17 " " '' 10_1101-2021_01_08_425952 119 18 ) ) -RRB- 10_1101-2021_01_08_425952 119 19 ) ) -RRB- 10_1101-2021_01_08_425952 119 20 > > XX 10_1101-2021_01_08_425952 119 21 # # $ 10_1101-2021_01_08_425952 119 22 Medical medical JJ 10_1101-2021_01_08_425952 119 23 history history NN 10_1101-2021_01_08_425952 119 24 dataframe dataframe NN 10_1101-2021_01_08_425952 119 25 structure structure NN 10_1101-2021_01_08_425952 119 26 > > XX 10_1101-2021_01_08_425952 119 27 str(medHistoryDF str(medhistorydf NN 10_1101-2021_01_08_425952 119 28 , , , 10_1101-2021_01_08_425952 119 29 strict.width="wrap strict.width="wrap NN 10_1101-2021_01_08_425952 119 30 " " '' 10_1101-2021_01_08_425952 119 31 ) ) -RRB- 10_1101-2021_01_08_425952 119 32 ' ' `` 10_1101-2021_01_08_425952 119 33 data.frame data.frame NN 10_1101-2021_01_08_425952 119 34 ' ' '' 10_1101-2021_01_08_425952 119 35 : : : 10_1101-2021_01_08_425952 119 36 103336 103336 CD 10_1101-2021_01_08_425952 119 37 obs obs NN 10_1101-2021_01_08_425952 119 38 . . . 10_1101-2021_01_08_425952 120 1 of of IN 10_1101-2021_01_08_425952 120 2 4 4 CD 10_1101-2021_01_08_425952 120 3 variables variable NNS 10_1101-2021_01_08_425952 120 4 : : : 10_1101-2021_01_08_425952 120 5 $ $ $ 10_1101-2021_01_08_425952 120 6 patid patid NN 10_1101-2021_01_08_425952 120 7 : : : 10_1101-2021_01_08_425952 120 8 int int NN 10_1101-2021_01_08_425952 120 9 1 1 CD 10_1101-2021_01_08_425952 120 10 1 1 CD 10_1101-2021_01_08_425952 120 11 1 1 CD 10_1101-2021_01_08_425952 120 12 1 1 CD 10_1101-2021_01_08_425952 120 13 1 1 CD 10_1101-2021_01_08_425952 120 14 1 1 CD 10_1101-2021_01_08_425952 120 15 1 1 CD 10_1101-2021_01_08_425952 120 16 2 2 CD 10_1101-2021_01_08_425952 120 17 2 2 CD 10_1101-2021_01_08_425952 120 18 3 3 CD 10_1101-2021_01_08_425952 120 19 ... ... : 10_1101-2021_01_08_425952 120 20 $ $ $ 10_1101-2021_01_08_425952 120 21 eventdate eventdate NN 10_1101-2021_01_08_425952 120 22 : : : 10_1101-2021_01_08_425952 120 23 Date date NN 10_1101-2021_01_08_425952 120 24 , , , 10_1101-2021_01_08_425952 120 25 format format NN 10_1101-2021_01_08_425952 120 26 : : : 10_1101-2021_01_08_425952 120 27 " " `` 10_1101-2021_01_08_425952 120 28 2002 2002 CD 10_1101-2021_01_08_425952 120 29 - - HYPH 10_1101-2021_01_08_425952 120 30 06 06 CD 10_1101-2021_01_08_425952 120 31 - - HYPH 10_1101-2021_01_08_425952 120 32 07 07 CD 10_1101-2021_01_08_425952 120 33 " " '' 10_1101-2021_01_08_425952 120 34 " " `` 10_1101-2021_01_08_425952 120 35 2005 2005 CD 10_1101-2021_01_08_425952 120 36 - - HYPH 10_1101-2021_01_08_425952 120 37 07 07 CD 10_1101-2021_01_08_425952 120 38 - - HYPH 10_1101-2021_01_08_425952 120 39 25 25 CD 10_1101-2021_01_08_425952 120 40 " " '' 10_1101-2021_01_08_425952 120 41 ... ... : 10_1101-2021_01_08_425952 120 42 $ $ $ 10_1101-2021_01_08_425952 120 43 code code NN 10_1101-2021_01_08_425952 120 44 : : : 10_1101-2021_01_08_425952 120 45 int int NN 10_1101-2021_01_08_425952 120 46 5767 5767 CD 10_1101-2021_01_08_425952 120 47 5767 5767 CD 10_1101-2021_01_08_425952 120 48 5767 5767 CD 10_1101-2021_01_08_425952 120 49 707 707 CD 10_1101-2021_01_08_425952 120 50 707 707 CD 10_1101-2021_01_08_425952 120 51 707 707 CD 10_1101-2021_01_08_425952 120 52 707 707 CD 10_1101-2021_01_08_425952 120 53 5767 5767 CD 10_1101-2021_01_08_425952 120 54 769 769 CD 10_1101-2021_01_08_425952 120 55 5767 5767 CD 10_1101-2021_01_08_425952 120 56 ... ... : 10_1101-2021_01_08_425952 120 57 $ $ $ 10_1101-2021_01_08_425952 120 58 codetype codetype NN 10_1101-2021_01_08_425952 120 59 : : : 10_1101-2021_01_08_425952 120 60 chr chr NNP 10_1101-2021_01_08_425952 120 61 " " `` 10_1101-2021_01_08_425952 120 62 c c NNP 10_1101-2021_01_08_425952 120 63 " " '' 10_1101-2021_01_08_425952 120 64 " " `` 10_1101-2021_01_08_425952 120 65 c c NN 10_1101-2021_01_08_425952 120 66 " " '' 10_1101-2021_01_08_425952 120 67 " " `` 10_1101-2021_01_08_425952 120 68 c c NN 10_1101-2021_01_08_425952 120 69 " " '' 10_1101-2021_01_08_425952 120 70 " " `` 10_1101-2021_01_08_425952 120 71 t t NN 10_1101-2021_01_08_425952 120 72 " " '' 10_1101-2021_01_08_425952 120 73 ... ... . 10_1101-2021_01_08_425952 121 1 The the DT 10_1101-2021_01_08_425952 121 2 patid patid JJ 10_1101-2021_01_08_425952 121 3 data datum NNS 10_1101-2021_01_08_425952 121 4 can can MD 10_1101-2021_01_08_425952 121 5 also also RB 10_1101-2021_01_08_425952 121 6 be be VB 10_1101-2021_01_08_425952 121 7 used use VBN 10_1101-2021_01_08_425952 121 8 to to TO 10_1101-2021_01_08_425952 121 9 retrieve retrieve VB 10_1101-2021_01_08_425952 121 10 patient patient JJ 10_1101-2021_01_08_425952 121 11 characteristics characteristic NNS 10_1101-2021_01_08_425952 121 12 , , , 10_1101-2021_01_08_425952 121 13 for for IN 10_1101-2021_01_08_425952 121 14 example example NN 10_1101-2021_01_08_425952 121 15 , , , 10_1101-2021_01_08_425952 121 16 the the DT 10_1101-2021_01_08_425952 121 17 gender gender NN 10_1101-2021_01_08_425952 121 18 of of IN 10_1101-2021_01_08_425952 121 19 the the DT 10_1101-2021_01_08_425952 121 20 patient patient NN 10_1101-2021_01_08_425952 121 21 using use VBG 10_1101-2021_01_08_425952 121 22 getGenderOfPatients getgenderofpatients NN 10_1101-2021_01_08_425952 121 23 : : : 10_1101-2021_01_08_425952 121 24 .CC .CC : 10_1101-2021_01_08_425952 121 25 - - : 10_1101-2021_01_08_425952 121 26 BY by IN 10_1101-2021_01_08_425952 121 27 - - HYPH 10_1101-2021_01_08_425952 121 28 ND ND NNP 10_1101-2021_01_08_425952 121 29 4.0 4.0 CD 10_1101-2021_01_08_425952 121 30 International international JJ 10_1101-2021_01_08_425952 121 31 licensemade licensemade NN 10_1101-2021_01_08_425952 121 32 available available JJ 10_1101-2021_01_08_425952 121 33 under under IN 10_1101-2021_01_08_425952 121 34 a a DT 10_1101-2021_01_08_425952 121 35 ( ( -LRB- 10_1101-2021_01_08_425952 121 36 which which WDT 10_1101-2021_01_08_425952 121 37 was be VBD 10_1101-2021_01_08_425952 121 38 not not RB 10_1101-2021_01_08_425952 121 39 certified certify VBN 10_1101-2021_01_08_425952 121 40 by by IN 10_1101-2021_01_08_425952 121 41 peer peer NN 10_1101-2021_01_08_425952 121 42 review review NN 10_1101-2021_01_08_425952 121 43 ) ) -RRB- 10_1101-2021_01_08_425952 121 44 is be VBZ 10_1101-2021_01_08_425952 121 45 the the DT 10_1101-2021_01_08_425952 121 46 author author NN 10_1101-2021_01_08_425952 121 47 / / SYM 10_1101-2021_01_08_425952 121 48 funder funder NN 10_1101-2021_01_08_425952 121 49 , , , 10_1101-2021_01_08_425952 121 50 who who WP 10_1101-2021_01_08_425952 121 51 has have VBZ 10_1101-2021_01_08_425952 121 52 granted grant VBN 10_1101-2021_01_08_425952 121 53 bioRxiv biorxiv IN 10_1101-2021_01_08_425952 121 54 a a DT 10_1101-2021_01_08_425952 121 55 license license NN 10_1101-2021_01_08_425952 121 56 to to TO 10_1101-2021_01_08_425952 121 57 display display VB 10_1101-2021_01_08_425952 121 58 the the DT 10_1101-2021_01_08_425952 121 59 preprint preprint NN 10_1101-2021_01_08_425952 121 60 in in IN 10_1101-2021_01_08_425952 121 61 perpetuity perpetuity NN 10_1101-2021_01_08_425952 121 62 . . . 10_1101-2021_01_08_425952 122 1 It -PRON- PRP 10_1101-2021_01_08_425952 122 2 is be VBZ 10_1101-2021_01_08_425952 122 3 The the DT 10_1101-2021_01_08_425952 122 4 copyright copyright NN 10_1101-2021_01_08_425952 122 5 holder holder NN 10_1101-2021_01_08_425952 122 6 for for IN 10_1101-2021_01_08_425952 122 7 this this DT 10_1101-2021_01_08_425952 122 8 preprintthis preprintthis NN 10_1101-2021_01_08_425952 122 9 version version NN 10_1101-2021_01_08_425952 122 10 posted post VBD 10_1101-2021_01_08_425952 122 11 January January NNP 10_1101-2021_01_08_425952 122 12 9 9 CD 10_1101-2021_01_08_425952 122 13 , , , 10_1101-2021_01_08_425952 122 14 2021 2021 CD 10_1101-2021_01_08_425952 122 15 . . . 10_1101-2021_01_08_425952 122 16 ; ; : 10_1101-2021_01_08_425952 122 17 https://doi.org/10.1101/2021.01.08.425952doi https://doi.org/10.1101/2021.01.08.425952doi ADD 10_1101-2021_01_08_425952 122 18 : : : 10_1101-2021_01_08_425952 122 19 bioRxiv biorxiv IN 10_1101-2021_01_08_425952 122 20 preprint preprint NN 10_1101-2021_01_08_425952 122 21 https://doi.org/10.1101/2021.01.08.425952 https://doi.org/10.1101/2021.01.08.425952 NN 10_1101-2021_01_08_425952 122 22 http://creativecommons.org/licenses/by-nd/4.0/ http://creativecommons.org/licenses/by-nd/4.0/ NN 10_1101-2021_01_08_425952 122 23 8 8 CD 10_1101-2021_01_08_425952 122 24 rdrugtrajectory rdrugtrajectory NN 10_1101-2021_01_08_425952 122 25 : : : 10_1101-2021_01_08_425952 122 26 Analysing Analysing NNP 10_1101-2021_01_08_425952 122 27 Drug Drug NNP 10_1101-2021_01_08_425952 122 28 Prescriptions Prescriptions NNPS 10_1101-2021_01_08_425952 122 29 in in IN 10_1101-2021_01_08_425952 122 30 Electronic Electronic NNP 10_1101-2021_01_08_425952 122 31 Health Health NNP 10_1101-2021_01_08_425952 122 32 Care Care NNP 10_1101-2021_01_08_425952 122 33 Records Records NNPS 10_1101-2021_01_08_425952 122 34 > > XX 10_1101-2021_01_08_425952 122 35 library(rdrugtrajectory library(rdrugtrajectory NN 10_1101-2021_01_08_425952 122 36 ) ) -RRB- 10_1101-2021_01_08_425952 122 37 > > XX 10_1101-2021_01_08_425952 122 38 idList idList NNP 10_1101-2021_01_08_425952 122 39 < < XX 10_1101-2021_01_08_425952 122 40 - - HYPH 10_1101-2021_01_08_425952 122 41 getUniquePatidList(testTherapyDF getUniquePatidList(testTherapyDF NNP 10_1101-2021_01_08_425952 122 42 ) ) -RRB- 10_1101-2021_01_08_425952 122 43 > > XX 10_1101-2021_01_08_425952 122 44 # # $ 10_1101-2021_01_08_425952 122 45 Only only RB 10_1101-2021_01_08_425952 122 46 use use VB 10_1101-2021_01_08_425952 122 47 half half NN 10_1101-2021_01_08_425952 122 48 of of IN 10_1101-2021_01_08_425952 122 49 the the DT 10_1101-2021_01_08_425952 122 50 cohort cohort NN 10_1101-2021_01_08_425952 122 51 . . . 10_1101-2021_01_08_425952 123 1 > > XX 10_1101-2021_01_08_425952 123 2 idList idList NNP 10_1101-2021_01_08_425952 123 3 < < XX 10_1101-2021_01_08_425952 123 4 - - HYPH 10_1101-2021_01_08_425952 123 5 idList[1:(length(idList)/2 idList[1:(length(idList)/2 NNP 10_1101-2021_01_08_425952 123 6 ) ) -RRB- 10_1101-2021_01_08_425952 123 7 ] ] -RRB- 10_1101-2021_01_08_425952 123 8 > > XX 10_1101-2021_01_08_425952 123 9 # # $ 10_1101-2021_01_08_425952 123 10 Get get VB 10_1101-2021_01_08_425952 123 11 gender gender NN 10_1101-2021_01_08_425952 123 12 data datum NNS 10_1101-2021_01_08_425952 123 13 by by IN 10_1101-2021_01_08_425952 123 14 specific specific JJ 10_1101-2021_01_08_425952 123 15 gender gender NN 10_1101-2021_01_08_425952 123 16 . . . 10_1101-2021_01_08_425952 124 1 > > XX 10_1101-2021_01_08_425952 124 2 maleCode maleCode NNP 10_1101-2021_01_08_425952 124 3 < < XX 10_1101-2021_01_08_425952 124 4 - - HYPH 10_1101-2021_01_08_425952 124 5 1 1 CD 10_1101-2021_01_08_425952 124 6 > > NN 10_1101-2021_01_08_425952 124 7 femaleCode femaleCode NNP 10_1101-2021_01_08_425952 124 8 < < XX 10_1101-2021_01_08_425952 124 9 - - HYPH 10_1101-2021_01_08_425952 124 10 2 2 NNP 10_1101-2021_01_08_425952 124 11 > > NN 10_1101-2021_01_08_425952 124 12 malePatientsDF malePatientsDF NNP 10_1101-2021_01_08_425952 124 13 < < XX 10_1101-2021_01_08_425952 124 14 - - HYPH 10_1101-2021_01_08_425952 124 15 getGenderOfPatients(idList getGenderOfPatients(idList NNP 10_1101-2021_01_08_425952 124 16 , , , 10_1101-2021_01_08_425952 124 17 ageGenderDF ageGenderDF JJR 10_1101-2021_01_08_425952 124 18 , , , 10_1101-2021_01_08_425952 124 19 maleCode malecode FW 10_1101-2021_01_08_425952 124 20 ) ) -RRB- 10_1101-2021_01_08_425952 124 21 > > XX 10_1101-2021_01_08_425952 124 22 femalePatientsDF femalePatientsDF NNP 10_1101-2021_01_08_425952 124 23 < < XX 10_1101-2021_01_08_425952 124 24 - - HYPH 10_1101-2021_01_08_425952 124 25 getGenderOfPatients(idList getGenderOfPatients(idList NNP 10_1101-2021_01_08_425952 124 26 , , , 10_1101-2021_01_08_425952 124 27 ageGenderDF ageGenderDF JJR 10_1101-2021_01_08_425952 124 28 , , , 10_1101-2021_01_08_425952 124 29 femaleCode femalecode LS 10_1101-2021_01_08_425952 124 30 ) ) -RRB- 10_1101-2021_01_08_425952 124 31 > > XX 10_1101-2021_01_08_425952 124 32 # # $ 10_1101-2021_01_08_425952 124 33 Get get VB 10_1101-2021_01_08_425952 124 34 all all DT 10_1101-2021_01_08_425952 124 35 gender gender NN 10_1101-2021_01_08_425952 124 36 data datum NNS 10_1101-2021_01_08_425952 124 37 > > XX 10_1101-2021_01_08_425952 124 38 allPatientsDF allpatientsdf NN 10_1101-2021_01_08_425952 124 39 < < XX 10_1101-2021_01_08_425952 124 40 - - HYPH 10_1101-2021_01_08_425952 124 41 getGenderOfPatients(getUniquePatidList(testTherapyDF getGenderOfPatients(getUniquePatidList(testTherapyDF NNP 10_1101-2021_01_08_425952 124 42 ) ) -RRB- 10_1101-2021_01_08_425952 124 43 , , , 10_1101-2021_01_08_425952 124 44 + + SYM 10_1101-2021_01_08_425952 124 45 ageGenderDF ageGenderDF -RRB- 10_1101-2021_01_08_425952 124 46 ) ) -RRB- 10_1101-2021_01_08_425952 124 47 > > XX 10_1101-2021_01_08_425952 124 48 # # $ 10_1101-2021_01_08_425952 124 49 Structure structure NN 10_1101-2021_01_08_425952 124 50 of of IN 10_1101-2021_01_08_425952 124 51 the the DT 10_1101-2021_01_08_425952 124 52 patient patient JJ 10_1101-2021_01_08_425952 124 53 gender gender NN 10_1101-2021_01_08_425952 124 54 data datum NNS 10_1101-2021_01_08_425952 124 55 . . . 10_1101-2021_01_08_425952 125 1 > > XX 10_1101-2021_01_08_425952 125 2 str(allPatientsDF str(allPatientsDF NNP 10_1101-2021_01_08_425952 125 3 , , , 10_1101-2021_01_08_425952 125 4 strict.width="wrap strict.width="wrap NN 10_1101-2021_01_08_425952 125 5 " " '' 10_1101-2021_01_08_425952 125 6 ) ) -RRB- 10_1101-2021_01_08_425952 125 7 ' ' `` 10_1101-2021_01_08_425952 125 8 data.frame data.frame NN 10_1101-2021_01_08_425952 125 9 ' ' '' 10_1101-2021_01_08_425952 125 10 : : : 10_1101-2021_01_08_425952 125 11 3838 3838 CD 10_1101-2021_01_08_425952 125 12 obs obs NN 10_1101-2021_01_08_425952 125 13 . . . 10_1101-2021_01_08_425952 126 1 of of IN 10_1101-2021_01_08_425952 126 2 2 2 CD 10_1101-2021_01_08_425952 126 3 variables variable NNS 10_1101-2021_01_08_425952 126 4 : : : 10_1101-2021_01_08_425952 126 5 $ $ $ 10_1101-2021_01_08_425952 126 6 patid patid NN 10_1101-2021_01_08_425952 126 7 : : : 10_1101-2021_01_08_425952 126 8 int int NN 10_1101-2021_01_08_425952 126 9 1 1 CD 10_1101-2021_01_08_425952 126 10 2 2 CD 10_1101-2021_01_08_425952 126 11 3 3 CD 10_1101-2021_01_08_425952 126 12 4 4 CD 10_1101-2021_01_08_425952 126 13 5 5 CD 10_1101-2021_01_08_425952 126 14 6 6 CD 10_1101-2021_01_08_425952 126 15 7 7 CD 10_1101-2021_01_08_425952 126 16 8 8 CD 10_1101-2021_01_08_425952 126 17 9 9 CD 10_1101-2021_01_08_425952 126 18 10 10 CD 10_1101-2021_01_08_425952 126 19 ... ... SYM 10_1101-2021_01_08_425952 126 20 $ $ $ 10_1101-2021_01_08_425952 126 21 gender gender NN 10_1101-2021_01_08_425952 126 22 : : : 10_1101-2021_01_08_425952 126 23 int int NN 10_1101-2021_01_08_425952 126 24 2 2 CD 10_1101-2021_01_08_425952 126 25 2 2 CD 10_1101-2021_01_08_425952 126 26 1 1 CD 10_1101-2021_01_08_425952 126 27 2 2 CD 10_1101-2021_01_08_425952 126 28 2 2 CD 10_1101-2021_01_08_425952 126 29 1 1 CD 10_1101-2021_01_08_425952 126 30 2 2 CD 10_1101-2021_01_08_425952 126 31 2 2 CD 10_1101-2021_01_08_425952 126 32 2 2 CD 10_1101-2021_01_08_425952 126 33 1 1 CD 10_1101-2021_01_08_425952 126 34 ... ... : 10_1101-2021_01_08_425952 126 35 IMD IMD NNP 10_1101-2021_01_08_425952 126 36 data datum NNS 10_1101-2021_01_08_425952 126 37 can can MD 10_1101-2021_01_08_425952 126 38 be be VB 10_1101-2021_01_08_425952 126 39 retrieved retrieve VBN 10_1101-2021_01_08_425952 126 40 by by IN 10_1101-2021_01_08_425952 126 41 combining combine VBG 10_1101-2021_01_08_425952 126 42 getUniquePatidList getuniquepatidlist NN 10_1101-2021_01_08_425952 126 43 and and CC 10_1101-2021_01_08_425952 126 44 getIMDOfPatients getimdofpatients CD 10_1101-2021_01_08_425952 126 45 func- func- JJ 10_1101-2021_01_08_425952 126 46 tions tion NNS 10_1101-2021_01_08_425952 126 47 : : : 10_1101-2021_01_08_425952 126 48 > > XX 10_1101-2021_01_08_425952 126 49 library(rdrugtrajectory library(rdrugtrajectory NN 10_1101-2021_01_08_425952 126 50 ) ) -RRB- 10_1101-2021_01_08_425952 126 51 > > XX 10_1101-2021_01_08_425952 126 52 idList idList NNP 10_1101-2021_01_08_425952 126 53 < < XX 10_1101-2021_01_08_425952 126 54 - - HYPH 10_1101-2021_01_08_425952 126 55 getUniquePatidList(testTherapyDF getUniquePatidList(testTherapyDF NNP 10_1101-2021_01_08_425952 126 56 ) ) -RRB- 10_1101-2021_01_08_425952 126 57 > > XX 10_1101-2021_01_08_425952 126 58 # # $ 10_1101-2021_01_08_425952 126 59 Get get VB 10_1101-2021_01_08_425952 126 60 patients patient NNS 10_1101-2021_01_08_425952 126 61 with with IN 10_1101-2021_01_08_425952 126 62 an an DT 10_1101-2021_01_08_425952 126 63 IMD IMD NNP 10_1101-2021_01_08_425952 126 64 score score NN 10_1101-2021_01_08_425952 126 65 of of IN 10_1101-2021_01_08_425952 126 66 1 1 CD 10_1101-2021_01_08_425952 126 67 or or CC 10_1101-2021_01_08_425952 126 68 2 2 CD 10_1101-2021_01_08_425952 126 69 > > XX 10_1101-2021_01_08_425952 126 70 onePatientsDF onepatientsdf FW 10_1101-2021_01_08_425952 126 71 < < XX 10_1101-2021_01_08_425952 126 72 - - HYPH 10_1101-2021_01_08_425952 126 73 getIMDOfPatients(idList getimdofpatients(idlist JJ 10_1101-2021_01_08_425952 126 74 , , , 10_1101-2021_01_08_425952 126 75 imdDF imddf FW 10_1101-2021_01_08_425952 126 76 , , , 10_1101-2021_01_08_425952 126 77 1 1 CD 10_1101-2021_01_08_425952 126 78 ) ) -RRB- 10_1101-2021_01_08_425952 126 79 > > XX 10_1101-2021_01_08_425952 126 80 twoPatientsDF twoPatientsDF '' 10_1101-2021_01_08_425952 126 81 < < XX 10_1101-2021_01_08_425952 126 82 - - HYPH 10_1101-2021_01_08_425952 126 83 getIMDOfPatients(idList getimdofpatients(idlist JJ 10_1101-2021_01_08_425952 126 84 , , , 10_1101-2021_01_08_425952 126 85 imdDF imddf XX 10_1101-2021_01_08_425952 126 86 , , , 10_1101-2021_01_08_425952 126 87 2 2 CD 10_1101-2021_01_08_425952 126 88 ) ) -RRB- 10_1101-2021_01_08_425952 126 89 > > XX 10_1101-2021_01_08_425952 126 90 # # $ 10_1101-2021_01_08_425952 126 91 Get get VB 10_1101-2021_01_08_425952 126 92 all all DT 10_1101-2021_01_08_425952 126 93 IMD IMD NNP 10_1101-2021_01_08_425952 126 94 scores score NNS 10_1101-2021_01_08_425952 126 95 for for IN 10_1101-2021_01_08_425952 126 96 all all DT 10_1101-2021_01_08_425952 126 97 patients patient NNS 10_1101-2021_01_08_425952 126 98 in in IN 10_1101-2021_01_08_425952 126 99 testTherapyDF testTherapyDF NNS 10_1101-2021_01_08_425952 126 100 > > XX 10_1101-2021_01_08_425952 126 101 allPatientsDF allpatientsdf FW 10_1101-2021_01_08_425952 126 102 < < XX 10_1101-2021_01_08_425952 126 103 - - HYPH 10_1101-2021_01_08_425952 126 104 getIMDOfPatients(getUniquePatidList(testTherapyDF getIMDOfPatients(getUniquePatidList(testTherapyDF NNP 10_1101-2021_01_08_425952 126 105 ) ) -RRB- 10_1101-2021_01_08_425952 126 106 , , , 10_1101-2021_01_08_425952 126 107 imdDF imddf ADD 10_1101-2021_01_08_425952 126 108 ) ) -RRB- 10_1101-2021_01_08_425952 126 109 > > XX 10_1101-2021_01_08_425952 126 110 # # $ 10_1101-2021_01_08_425952 126 111 Structure structure NN 10_1101-2021_01_08_425952 126 112 of of IN 10_1101-2021_01_08_425952 126 113 the the DT 10_1101-2021_01_08_425952 126 114 patient patient JJ 10_1101-2021_01_08_425952 126 115 gender gender NN 10_1101-2021_01_08_425952 126 116 data datum NNS 10_1101-2021_01_08_425952 126 117 . . . 10_1101-2021_01_08_425952 127 1 > > XX 10_1101-2021_01_08_425952 127 2 str(allPatientsDF str(allPatientsDF NNP 10_1101-2021_01_08_425952 127 3 , , , 10_1101-2021_01_08_425952 127 4 strict.width="wrap strict.width="wrap NN 10_1101-2021_01_08_425952 127 5 " " '' 10_1101-2021_01_08_425952 127 6 ) ) -RRB- 10_1101-2021_01_08_425952 127 7 ' ' `` 10_1101-2021_01_08_425952 127 8 data.frame data.frame NN 10_1101-2021_01_08_425952 127 9 ' ' '' 10_1101-2021_01_08_425952 127 10 : : : 10_1101-2021_01_08_425952 127 11 2123 2123 CD 10_1101-2021_01_08_425952 127 12 obs obs NN 10_1101-2021_01_08_425952 127 13 . . . 10_1101-2021_01_08_425952 128 1 of of IN 10_1101-2021_01_08_425952 128 2 2 2 CD 10_1101-2021_01_08_425952 128 3 variables variable NNS 10_1101-2021_01_08_425952 128 4 : : : 10_1101-2021_01_08_425952 128 5 $ $ $ 10_1101-2021_01_08_425952 128 6 patid patid NN 10_1101-2021_01_08_425952 128 7 : : : 10_1101-2021_01_08_425952 128 8 int int DT 10_1101-2021_01_08_425952 128 9 6 6 CD 10_1101-2021_01_08_425952 128 10 11 11 CD 10_1101-2021_01_08_425952 128 11 16 16 CD 10_1101-2021_01_08_425952 128 12 34 34 CD 10_1101-2021_01_08_425952 128 13 42 42 CD 10_1101-2021_01_08_425952 128 14 44 44 CD 10_1101-2021_01_08_425952 128 15 54 54 CD 10_1101-2021_01_08_425952 128 16 60 60 CD 10_1101-2021_01_08_425952 128 17 63 63 CD 10_1101-2021_01_08_425952 128 18 79 79 CD 10_1101-2021_01_08_425952 128 19 ... ... : 10_1101-2021_01_08_425952 128 20 $ $ $ 10_1101-2021_01_08_425952 128 21 score score NN 10_1101-2021_01_08_425952 128 22 : : : 10_1101-2021_01_08_425952 128 23 int int NN 10_1101-2021_01_08_425952 128 24 1 1 CD 10_1101-2021_01_08_425952 128 25 3 3 CD 10_1101-2021_01_08_425952 128 26 1 1 CD 10_1101-2021_01_08_425952 128 27 4 4 CD 10_1101-2021_01_08_425952 128 28 1 1 CD 10_1101-2021_01_08_425952 128 29 2 2 CD 10_1101-2021_01_08_425952 128 30 1 1 CD 10_1101-2021_01_08_425952 128 31 5 5 CD 10_1101-2021_01_08_425952 128 32 1 1 CD 10_1101-2021_01_08_425952 128 33 2 2 CD 10_1101-2021_01_08_425952 128 34 ... ... . 10_1101-2021_01_08_425952 129 1 The the DT 10_1101-2021_01_08_425952 129 2 final final JJ 10_1101-2021_01_08_425952 129 3 example example NN 10_1101-2021_01_08_425952 129 4 of of IN 10_1101-2021_01_08_425952 129 5 EHR EHR NNP 10_1101-2021_01_08_425952 129 6 dataframe dataframe NN 10_1101-2021_01_08_425952 129 7 manipulation manipulation NN 10_1101-2021_01_08_425952 129 8 presented present VBN 10_1101-2021_01_08_425952 129 9 here here RB 10_1101-2021_01_08_425952 129 10 demonstrates demonstrate VBZ 10_1101-2021_01_08_425952 129 11 how how WRB 10_1101-2021_01_08_425952 129 12 to to TO 10_1101-2021_01_08_425952 129 13 re- re- RB 10_1101-2021_01_08_425952 129 14 trieve trieve VB 10_1101-2021_01_08_425952 129 15 all all DT 10_1101-2021_01_08_425952 129 16 prescription prescription NN 10_1101-2021_01_08_425952 129 17 records record NNS 10_1101-2021_01_08_425952 129 18 for for IN 10_1101-2021_01_08_425952 129 19 patients patient NNS 10_1101-2021_01_08_425952 129 20 prescribed prescribe VBD 10_1101-2021_01_08_425952 129 21 a a DT 10_1101-2021_01_08_425952 129 22 specific specific JJ 10_1101-2021_01_08_425952 129 23 prescription prescription NN 10_1101-2021_01_08_425952 129 24 treatment treatment NN 10_1101-2021_01_08_425952 129 25 . . . 10_1101-2021_01_08_425952 130 1 For for IN 10_1101-2021_01_08_425952 130 2 example example NN 10_1101-2021_01_08_425952 130 3 , , , 10_1101-2021_01_08_425952 130 4 such such PDT 10_1101-2021_01_08_425952 130 5 an an DT 10_1101-2021_01_08_425952 130 6 operation operation NN 10_1101-2021_01_08_425952 130 7 can can MD 10_1101-2021_01_08_425952 130 8 be be VB 10_1101-2021_01_08_425952 130 9 used use VBN 10_1101-2021_01_08_425952 130 10 to to TO 10_1101-2021_01_08_425952 130 11 retrieve retrieve VB 10_1101-2021_01_08_425952 130 12 all all DT 10_1101-2021_01_08_425952 130 13 prescription prescription NN 10_1101-2021_01_08_425952 130 14 records record NNS 10_1101-2021_01_08_425952 130 15 for for IN 10_1101-2021_01_08_425952 130 16 any any DT 10_1101-2021_01_08_425952 130 17 patient patient NN 10_1101-2021_01_08_425952 130 18 prescribed prescribe VBN 10_1101-2021_01_08_425952 130 19 amitriptyline amitriptyline NN 10_1101-2021_01_08_425952 130 20 . . . 10_1101-2021_01_08_425952 131 1 In in IN 10_1101-2021_01_08_425952 131 2 addition addition NN 10_1101-2021_01_08_425952 131 3 , , , 10_1101-2021_01_08_425952 131 4 it -PRON- PRP 10_1101-2021_01_08_425952 131 5 is be VBZ 10_1101-2021_01_08_425952 131 6 also also RB 10_1101-2021_01_08_425952 131 7 possible possible JJ 10_1101-2021_01_08_425952 131 8 to to TO 10_1101-2021_01_08_425952 131 9 return return VB 10_1101-2021_01_08_425952 131 10 only only JJ 10_1101-2021_01_08_425952 131 11 prescription prescription NN 10_1101-2021_01_08_425952 131 12 records record NNS 10_1101-2021_01_08_425952 131 13 matching match VBG 10_1101-2021_01_08_425952 131 14 specific specific JJ 10_1101-2021_01_08_425952 131 15 prescription prescription NN 10_1101-2021_01_08_425952 131 16 treatments treatment NNS 10_1101-2021_01_08_425952 131 17 . . . 10_1101-2021_01_08_425952 132 1 Importantly importantly RB 10_1101-2021_01_08_425952 132 2 , , , 10_1101-2021_01_08_425952 132 3 prescription prescription NN 10_1101-2021_01_08_425952 132 4 prodcodes prodcode NNS 10_1101-2021_01_08_425952 132 5 can can MD 10_1101-2021_01_08_425952 132 6 be be VB 10_1101-2021_01_08_425952 132 7 grouped group VBN 10_1101-2021_01_08_425952 132 8 into into IN 10_1101-2021_01_08_425952 132 9 lists list NNS 10_1101-2021_01_08_425952 132 10 and and CC 10_1101-2021_01_08_425952 132 11 used use VBD 10_1101-2021_01_08_425952 132 12 to to TO 10_1101-2021_01_08_425952 132 13 collect collect VB 10_1101-2021_01_08_425952 132 14 those those DT 10_1101-2021_01_08_425952 132 15 patients patient NNS 10_1101-2021_01_08_425952 132 16 with with IN 10_1101-2021_01_08_425952 132 17 at at RB 10_1101-2021_01_08_425952 132 18 least least RBS 10_1101-2021_01_08_425952 132 19 one one CD 10_1101-2021_01_08_425952 132 20 record record NN 10_1101-2021_01_08_425952 132 21 that that WDT 10_1101-2021_01_08_425952 132 22 matches match VBZ 10_1101-2021_01_08_425952 132 23 an an DT 10_1101-2021_01_08_425952 132 24 element element NN 10_1101-2021_01_08_425952 132 25 of of IN 10_1101-2021_01_08_425952 132 26 that that DT 10_1101-2021_01_08_425952 132 27 list list NN 10_1101-2021_01_08_425952 132 28 . . . 10_1101-2021_01_08_425952 133 1 This this DT 10_1101-2021_01_08_425952 133 2 approach approach NN 10_1101-2021_01_08_425952 133 3 is be VBZ 10_1101-2021_01_08_425952 133 4 useful useful JJ 10_1101-2021_01_08_425952 133 5 if if IN 10_1101-2021_01_08_425952 133 6 the the DT 10_1101-2021_01_08_425952 133 7 dose dose NN 10_1101-2021_01_08_425952 133 8 is be VBZ 10_1101-2021_01_08_425952 133 9 not not RB 10_1101-2021_01_08_425952 133 10 relevant relevant JJ 10_1101-2021_01_08_425952 133 11 to to IN 10_1101-2021_01_08_425952 133 12 the the DT 10_1101-2021_01_08_425952 133 13 study study NN 10_1101-2021_01_08_425952 133 14 or or CC 10_1101-2021_01_08_425952 133 15 the the DT 10_1101-2021_01_08_425952 133 16 prescription prescription NN 10_1101-2021_01_08_425952 133 17 is be VBZ 10_1101-2021_01_08_425952 133 18 dispensed dispense VBN 10_1101-2021_01_08_425952 133 19 under under IN 10_1101-2021_01_08_425952 133 20 multiple multiple JJ 10_1101-2021_01_08_425952 133 21 product product NN 10_1101-2021_01_08_425952 133 22 names name NNS 10_1101-2021_01_08_425952 133 23 . . . 10_1101-2021_01_08_425952 134 1 .CC .CC NFP 10_1101-2021_01_08_425952 134 2 - - : 10_1101-2021_01_08_425952 134 3 BY by IN 10_1101-2021_01_08_425952 134 4 - - HYPH 10_1101-2021_01_08_425952 134 5 ND ND NNP 10_1101-2021_01_08_425952 134 6 4.0 4.0 CD 10_1101-2021_01_08_425952 134 7 International international JJ 10_1101-2021_01_08_425952 134 8 licensemade licensemade NN 10_1101-2021_01_08_425952 134 9 available available JJ 10_1101-2021_01_08_425952 134 10 under under IN 10_1101-2021_01_08_425952 134 11 a a DT 10_1101-2021_01_08_425952 134 12 ( ( -LRB- 10_1101-2021_01_08_425952 134 13 which which WDT 10_1101-2021_01_08_425952 134 14 was be VBD 10_1101-2021_01_08_425952 134 15 not not RB 10_1101-2021_01_08_425952 134 16 certified certify VBN 10_1101-2021_01_08_425952 134 17 by by IN 10_1101-2021_01_08_425952 134 18 peer peer NN 10_1101-2021_01_08_425952 134 19 review review NN 10_1101-2021_01_08_425952 134 20 ) ) -RRB- 10_1101-2021_01_08_425952 134 21 is be VBZ 10_1101-2021_01_08_425952 134 22 the the DT 10_1101-2021_01_08_425952 134 23 author author NN 10_1101-2021_01_08_425952 134 24 / / SYM 10_1101-2021_01_08_425952 134 25 funder funder NN 10_1101-2021_01_08_425952 134 26 , , , 10_1101-2021_01_08_425952 134 27 who who WP 10_1101-2021_01_08_425952 134 28 has have VBZ 10_1101-2021_01_08_425952 134 29 granted grant VBN 10_1101-2021_01_08_425952 134 30 bioRxiv biorxiv IN 10_1101-2021_01_08_425952 134 31 a a DT 10_1101-2021_01_08_425952 134 32 license license NN 10_1101-2021_01_08_425952 134 33 to to TO 10_1101-2021_01_08_425952 134 34 display display VB 10_1101-2021_01_08_425952 134 35 the the DT 10_1101-2021_01_08_425952 134 36 preprint preprint NN 10_1101-2021_01_08_425952 134 37 in in IN 10_1101-2021_01_08_425952 134 38 perpetuity perpetuity NN 10_1101-2021_01_08_425952 134 39 . . . 10_1101-2021_01_08_425952 135 1 It -PRON- PRP 10_1101-2021_01_08_425952 135 2 is be VBZ 10_1101-2021_01_08_425952 135 3 The the DT 10_1101-2021_01_08_425952 135 4 copyright copyright NN 10_1101-2021_01_08_425952 135 5 holder holder NN 10_1101-2021_01_08_425952 135 6 for for IN 10_1101-2021_01_08_425952 135 7 this this DT 10_1101-2021_01_08_425952 135 8 preprintthis preprintthis NN 10_1101-2021_01_08_425952 135 9 version version NN 10_1101-2021_01_08_425952 135 10 posted post VBD 10_1101-2021_01_08_425952 135 11 January January NNP 10_1101-2021_01_08_425952 135 12 9 9 CD 10_1101-2021_01_08_425952 135 13 , , , 10_1101-2021_01_08_425952 135 14 2021 2021 CD 10_1101-2021_01_08_425952 135 15 . . . 10_1101-2021_01_08_425952 135 16 ; ; : 10_1101-2021_01_08_425952 135 17 https://doi.org/10.1101/2021.01.08.425952doi https://doi.org/10.1101/2021.01.08.425952doi ADD 10_1101-2021_01_08_425952 135 18 : : : 10_1101-2021_01_08_425952 135 19 bioRxiv biorxiv IN 10_1101-2021_01_08_425952 135 20 preprint preprint NN 10_1101-2021_01_08_425952 135 21 https://doi.org/10.1101/2021.01.08.425952 https://doi.org/10.1101/2021.01.08.425952 XX 10_1101-2021_01_08_425952 135 22 http://creativecommons.org/licenses/by-nd/4.0/ http://creativecommons.org/licenses/by-nd/4.0/ NNP 10_1101-2021_01_08_425952 135 23 Journal Journal NNP 10_1101-2021_01_08_425952 135 24 of of IN 10_1101-2021_01_08_425952 135 25 Statistical Statistical NNP 10_1101-2021_01_08_425952 135 26 Software Software NNP 10_1101-2021_01_08_425952 135 27 9 9 CD 10_1101-2021_01_08_425952 135 28 > > NN 10_1101-2021_01_08_425952 135 29 library(rdrugtrajectory library(rdrugtrajectory NN 10_1101-2021_01_08_425952 135 30 ) ) -RRB- 10_1101-2021_01_08_425952 135 31 > > XX 10_1101-2021_01_08_425952 135 32 # # $ 10_1101-2021_01_08_425952 135 33 It -PRON- PRP 10_1101-2021_01_08_425952 135 34 is be VBZ 10_1101-2021_01_08_425952 135 35 easy easy JJ 10_1101-2021_01_08_425952 135 36 to to TO 10_1101-2021_01_08_425952 135 37 retrieve retrieve VB 10_1101-2021_01_08_425952 135 38 a a DT 10_1101-2021_01_08_425952 135 39 list list NN 10_1101-2021_01_08_425952 135 40 of of IN 10_1101-2021_01_08_425952 135 41 all all DT 10_1101-2021_01_08_425952 135 42 unique unique JJ 10_1101-2021_01_08_425952 135 43 prodcodes prodcode NNS 10_1101-2021_01_08_425952 135 44 in in IN 10_1101-2021_01_08_425952 135 45 the the DT 10_1101-2021_01_08_425952 135 46 cohort cohort NN 10_1101-2021_01_08_425952 135 47 . . . 10_1101-2021_01_08_425952 136 1 > > XX 10_1101-2021_01_08_425952 136 2 prodCodesVector prodCodesVector NNP 10_1101-2021_01_08_425952 136 3 < < XX 10_1101-2021_01_08_425952 136 4 - - HYPH 10_1101-2021_01_08_425952 136 5 unique(testTherapyDF$prodcode unique(testTherapyDF$prodcode NNP 10_1101-2021_01_08_425952 136 6 ) ) -RRB- 10_1101-2021_01_08_425952 136 7 > > XX 10_1101-2021_01_08_425952 136 8 reducedProdCodesVector reducedProdCodesVector NNP 10_1101-2021_01_08_425952 136 9 < < XX 10_1101-2021_01_08_425952 136 10 - - HYPH 10_1101-2021_01_08_425952 136 11 prodCodesVector[1:10 prodcodesvector[1:10 NN 10_1101-2021_01_08_425952 136 12 ] ] -RRB- 10_1101-2021_01_08_425952 136 13 > > NFP 10_1101-2021_01_08_425952 136 14 # # $ 10_1101-2021_01_08_425952 136 15 All all DT 10_1101-2021_01_08_425952 136 16 records record NNS 10_1101-2021_01_08_425952 136 17 are be VBP 10_1101-2021_01_08_425952 136 18 maintained maintain VBN 10_1101-2021_01_08_425952 136 19 for for IN 10_1101-2021_01_08_425952 136 20 those those DT 10_1101-2021_01_08_425952 136 21 patients patient NNS 10_1101-2021_01_08_425952 136 22 with with IN 10_1101-2021_01_08_425952 136 23 a a DT 10_1101-2021_01_08_425952 136 24 matching matching NN 10_1101-2021_01_08_425952 136 25 prodcode prodcode NN 10_1101-2021_01_08_425952 136 26 . . . 10_1101-2021_01_08_425952 137 1 > > XX 10_1101-2021_01_08_425952 137 2 therapyOfInterestDF therapyOfInterestDF NNP 10_1101-2021_01_08_425952 137 3 < < XX 10_1101-2021_01_08_425952 137 4 - - HYPH 10_1101-2021_01_08_425952 137 5 getPatientsWithProdCode(testTherapyDF getPatientsWithProdCode(testTherapyDF NNP 10_1101-2021_01_08_425952 137 6 , , , 10_1101-2021_01_08_425952 137 7 + + CC 10_1101-2021_01_08_425952 137 8 reducedProdCodesVector reducedProdCodesVector NNP 10_1101-2021_01_08_425952 137 9 ) ) -RRB- 10_1101-2021_01_08_425952 137 10 > > XX 10_1101-2021_01_08_425952 137 11 # # $ 10_1101-2021_01_08_425952 137 12 Only only RB 10_1101-2021_01_08_425952 137 13 those those DT 10_1101-2021_01_08_425952 137 14 records record NNS 10_1101-2021_01_08_425952 137 15 that that WDT 10_1101-2021_01_08_425952 137 16 match match NN 10_1101-2021_01_08_425952 137 17 are be VBP 10_1101-2021_01_08_425952 137 18 retained retain VBN 10_1101-2021_01_08_425952 137 19 . . . 10_1101-2021_01_08_425952 138 1 > > XX 10_1101-2021_01_08_425952 138 2 reducedTherapyOfInterestDF reducedTherapyOfInterestDF NNP 10_1101-2021_01_08_425952 138 3 < < XX 10_1101-2021_01_08_425952 138 4 - - HYPH 10_1101-2021_01_08_425952 138 5 getPatientsWithProdCode(testTherapyDF getPatientsWithProdCode(testTherapyDF NNP 10_1101-2021_01_08_425952 138 6 , , , 10_1101-2021_01_08_425952 138 7 + + CC 10_1101-2021_01_08_425952 138 8 reducedProdCodesVector reducedProdCodesVector NNP 10_1101-2021_01_08_425952 138 9 , , , 10_1101-2021_01_08_425952 138 10 + + CC 10_1101-2021_01_08_425952 138 11 removeExcessDrugs removeexcessdrug NNS 10_1101-2021_01_08_425952 138 12 = = SYM 10_1101-2021_01_08_425952 138 13 TRUE TRUE NNP 10_1101-2021_01_08_425952 138 14 ) ) -RRB- 10_1101-2021_01_08_425952 138 15 3 3 CD 10_1101-2021_01_08_425952 138 16 . . . 10_1101-2021_01_08_425952 139 1 EHR ehr NN 10_1101-2021_01_08_425952 139 2 drug drug NN 10_1101-2021_01_08_425952 139 3 prescription prescription NN 10_1101-2021_01_08_425952 139 4 results result NNS 10_1101-2021_01_08_425952 139 5 and and CC 10_1101-2021_01_08_425952 139 6 discussion discussion NN 10_1101-2021_01_08_425952 139 7 Having have VBG 10_1101-2021_01_08_425952 139 8 briefly briefly RB 10_1101-2021_01_08_425952 139 9 demonstrated demonstrate VBD 10_1101-2021_01_08_425952 139 10 some some DT 10_1101-2021_01_08_425952 139 11 basic basic JJ 10_1101-2021_01_08_425952 139 12 operation operation NN 10_1101-2021_01_08_425952 139 13 on on IN 10_1101-2021_01_08_425952 139 14 retrieving retrieve VBG 10_1101-2021_01_08_425952 139 15 patient patient JJ 10_1101-2021_01_08_425952 139 16 records record NNS 10_1101-2021_01_08_425952 139 17 by by IN 10_1101-2021_01_08_425952 139 18 matching match VBG 10_1101-2021_01_08_425952 139 19 EHR EHR NNP 10_1101-2021_01_08_425952 139 20 dataframes dataframe NNS 10_1101-2021_01_08_425952 139 21 against against IN 10_1101-2021_01_08_425952 139 22 sets set NNS 10_1101-2021_01_08_425952 139 23 of of IN 10_1101-2021_01_08_425952 139 24 patid patid JJ 10_1101-2021_01_08_425952 139 25 values value NNS 10_1101-2021_01_08_425952 139 26 , , , 10_1101-2021_01_08_425952 139 27 we -PRON- PRP 10_1101-2021_01_08_425952 139 28 move move VBP 10_1101-2021_01_08_425952 139 29 on on RP 10_1101-2021_01_08_425952 139 30 to to TO 10_1101-2021_01_08_425952 139 31 showcase showcase VB 10_1101-2021_01_08_425952 139 32 several several JJ 10_1101-2021_01_08_425952 139 33 operations operation NNS 10_1101-2021_01_08_425952 139 34 available available JJ 10_1101-2021_01_08_425952 139 35 to to IN 10_1101-2021_01_08_425952 139 36 the the DT 10_1101-2021_01_08_425952 139 37 user user NN 10_1101-2021_01_08_425952 139 38 . . . 10_1101-2021_01_08_425952 140 1 We -PRON- PRP 10_1101-2021_01_08_425952 140 2 begin begin VBP 10_1101-2021_01_08_425952 140 3 by by IN 10_1101-2021_01_08_425952 140 4 presenting present VBG 10_1101-2021_01_08_425952 140 5 examples example NNS 10_1101-2021_01_08_425952 140 6 of of IN 10_1101-2021_01_08_425952 140 7 cohort cohort NN 10_1101-2021_01_08_425952 140 8 prescription prescription NN 10_1101-2021_01_08_425952 140 9 summary summary NN 10_1101-2021_01_08_425952 140 10 statistics statistic NNS 10_1101-2021_01_08_425952 140 11 followed follow VBN 10_1101-2021_01_08_425952 140 12 by by IN 10_1101-2021_01_08_425952 140 13 methods method NNS 10_1101-2021_01_08_425952 140 14 of of IN 10_1101-2021_01_08_425952 140 15 dataset dataset NN 10_1101-2021_01_08_425952 140 16 curating curate VBG 10_1101-2021_01_08_425952 140 17 and and CC 10_1101-2021_01_08_425952 140 18 stratifying stratify VBG 10_1101-2021_01_08_425952 140 19 by by IN 10_1101-2021_01_08_425952 140 20 patient patient JJ 10_1101-2021_01_08_425952 140 21 groups group NNS 10_1101-2021_01_08_425952 140 22 . . . 10_1101-2021_01_08_425952 141 1 We -PRON- PRP 10_1101-2021_01_08_425952 141 2 then then RB 10_1101-2021_01_08_425952 141 3 present present VBP 10_1101-2021_01_08_425952 141 4 examples example NNS 10_1101-2021_01_08_425952 141 5 on on IN 10_1101-2021_01_08_425952 141 6 how how WRB 10_1101-2021_01_08_425952 141 7 to to TO 10_1101-2021_01_08_425952 141 8 search search VB 10_1101-2021_01_08_425952 141 9 for for IN 10_1101-2021_01_08_425952 141 10 patients patient NNS 10_1101-2021_01_08_425952 141 11 prescribed prescribe VBN 10_1101-2021_01_08_425952 141 12 with with IN 10_1101-2021_01_08_425952 141 13 a a DT 10_1101-2021_01_08_425952 141 14 first first JJ 10_1101-2021_01_08_425952 141 15 - - HYPH 10_1101-2021_01_08_425952 141 16 line line NN 10_1101-2021_01_08_425952 141 17 treatments treatment NNS 10_1101-2021_01_08_425952 141 18 , , , 10_1101-2021_01_08_425952 141 19 followed follow VBN 10_1101-2021_01_08_425952 141 20 by by IN 10_1101-2021_01_08_425952 141 21 presenting present VBG 10_1101-2021_01_08_425952 141 22 some some DT 10_1101-2021_01_08_425952 141 23 of of IN 10_1101-2021_01_08_425952 141 24 these these DT 10_1101-2021_01_08_425952 141 25 patient patient JJ 10_1101-2021_01_08_425952 141 26 groups group NNS 10_1101-2021_01_08_425952 141 27 as as IN 10_1101-2021_01_08_425952 141 28 sequences sequence NNS 10_1101-2021_01_08_425952 141 29 of of IN 10_1101-2021_01_08_425952 141 30 prescriptions prescription NNS 10_1101-2021_01_08_425952 141 31 . . . 10_1101-2021_01_08_425952 142 1 Finally finally RB 10_1101-2021_01_08_425952 142 2 , , , 10_1101-2021_01_08_425952 142 3 we -PRON- PRP 10_1101-2021_01_08_425952 142 4 demonstrate demonstrate VBP 10_1101-2021_01_08_425952 142 5 several several JJ 10_1101-2021_01_08_425952 142 6 examples example NNS 10_1101-2021_01_08_425952 142 7 of of IN 10_1101-2021_01_08_425952 142 8 building build VBG 10_1101-2021_01_08_425952 142 9 time time NN 10_1101-2021_01_08_425952 142 10 - - HYPH 10_1101-2021_01_08_425952 142 11 lines line NNS 10_1101-2021_01_08_425952 142 12 . . . 10_1101-2021_01_08_425952 143 1 For for IN 10_1101-2021_01_08_425952 143 2 futher futher NN 10_1101-2021_01_08_425952 143 3 examples example NNS 10_1101-2021_01_08_425952 143 4 , , , 10_1101-2021_01_08_425952 143 5 please please UH 10_1101-2021_01_08_425952 143 6 see see VB 10_1101-2021_01_08_425952 143 7 the the DT 10_1101-2021_01_08_425952 143 8 Github Github NNP 10_1101-2021_01_08_425952 143 9 page page NN 10_1101-2021_01_08_425952 143 10 and and CC 10_1101-2021_01_08_425952 143 11 reference reference NN 10_1101-2021_01_08_425952 143 12 manual manual NN 10_1101-2021_01_08_425952 143 13 . . . 10_1101-2021_01_08_425952 144 1 3.1 3.1 CD 10_1101-2021_01_08_425952 144 2 . . . 10_1101-2021_01_08_425952 145 1 Cohort cohort NN 10_1101-2021_01_08_425952 145 2 summmary summmary JJ 10_1101-2021_01_08_425952 145 3 statistics statistic NNS 10_1101-2021_01_08_425952 145 4 getEventdateSummaryByPatient geteventdatesummarybypatient NN 10_1101-2021_01_08_425952 145 5 rdrugtrajectory rdrugtrajectory NN 10_1101-2021_01_08_425952 145 6 can can MD 10_1101-2021_01_08_425952 145 7 return return VB 10_1101-2021_01_08_425952 145 8 summary summary NN 10_1101-2021_01_08_425952 145 9 based base VBN 10_1101-2021_01_08_425952 145 10 statistics statistic NNS 10_1101-2021_01_08_425952 145 11 on on IN 10_1101-2021_01_08_425952 145 12 patient patient NN 10_1101-2021_01_08_425952 145 13 and and CC 10_1101-2021_01_08_425952 145 14 cohort cohort NN 10_1101-2021_01_08_425952 145 15 level level NN 10_1101-2021_01_08_425952 145 16 prescription prescription NN 10_1101-2021_01_08_425952 145 17 data datum NNS 10_1101-2021_01_08_425952 145 18 with with IN 10_1101-2021_01_08_425952 145 19 getEventdateSummaryByPatient geteventdatesummarybypatient NN 10_1101-2021_01_08_425952 145 20 and and CC 10_1101-2021_01_08_425952 145 21 getPopulationDrugSummary getPopulationDrugSummary NNP 10_1101-2021_01_08_425952 145 22 , , , 10_1101-2021_01_08_425952 145 23 respectively respectively RB 10_1101-2021_01_08_425952 145 24 . . . 10_1101-2021_01_08_425952 146 1 For for IN 10_1101-2021_01_08_425952 146 2 example example NN 10_1101-2021_01_08_425952 146 3 , , , 10_1101-2021_01_08_425952 146 4 a a DT 10_1101-2021_01_08_425952 146 5 single single JJ 10_1101-2021_01_08_425952 146 6 patient patient NN 10_1101-2021_01_08_425952 146 7 ( ( -LRB- 10_1101-2021_01_08_425952 146 8 via via IN 10_1101-2021_01_08_425952 146 9 getUniquePatidList getuniquepatidlist NN 10_1101-2021_01_08_425952 146 10 and and CC 10_1101-2021_01_08_425952 146 11 [ [ -LRB- 10_1101-2021_01_08_425952 146 12 ] ] -RRB- 10_1101-2021_01_08_425952 146 13 dataframe dataframe NN 10_1101-2021_01_08_425952 146 14 subsetting subsetting NN 10_1101-2021_01_08_425952 146 15 ) ) -RRB- 10_1101-2021_01_08_425952 146 16 pre- pre- NN 10_1101-2021_01_08_425952 146 17 scription scription NN 10_1101-2021_01_08_425952 146 18 history history NN 10_1101-2021_01_08_425952 146 19 returns return VBZ 10_1101-2021_01_08_425952 146 20 the the DT 10_1101-2021_01_08_425952 146 21 patient patient NN 10_1101-2021_01_08_425952 146 22 patid patid NN 10_1101-2021_01_08_425952 146 23 , , , 10_1101-2021_01_08_425952 146 24 number number NN 10_1101-2021_01_08_425952 146 25 of of IN 10_1101-2021_01_08_425952 146 26 prescription prescription NN 10_1101-2021_01_08_425952 146 27 events event NNS 10_1101-2021_01_08_425952 146 28 , , , 10_1101-2021_01_08_425952 146 29 median median JJ 10_1101-2021_01_08_425952 146 30 number number NN 10_1101-2021_01_08_425952 146 31 of of IN 10_1101-2021_01_08_425952 146 32 days day NNS 10_1101-2021_01_08_425952 146 33 between between IN 10_1101-2021_01_08_425952 146 34 events event NNS 10_1101-2021_01_08_425952 146 35 , , , 10_1101-2021_01_08_425952 146 36 fewest few JJS 10_1101-2021_01_08_425952 146 37 number number NN 10_1101-2021_01_08_425952 146 38 of of IN 10_1101-2021_01_08_425952 146 39 days day NNS 10_1101-2021_01_08_425952 146 40 between between IN 10_1101-2021_01_08_425952 146 41 events event NNS 10_1101-2021_01_08_425952 146 42 , , , 10_1101-2021_01_08_425952 146 43 the the DT 10_1101-2021_01_08_425952 146 44 most most JJS 10_1101-2021_01_08_425952 146 45 number number NN 10_1101-2021_01_08_425952 146 46 of of IN 10_1101-2021_01_08_425952 146 47 days day NNS 10_1101-2021_01_08_425952 146 48 between between IN 10_1101-2021_01_08_425952 146 49 events event NNS 10_1101-2021_01_08_425952 146 50 ( ( -LRB- 10_1101-2021_01_08_425952 146 51 maxTime maxtime NN 10_1101-2021_01_08_425952 146 52 and and CC 10_1101-2021_01_08_425952 146 53 longestDuration longestduration NN 10_1101-2021_01_08_425952 146 54 are be VBP 10_1101-2021_01_08_425952 146 55 the the DT 10_1101-2021_01_08_425952 146 56 same same JJ 10_1101-2021_01_08_425952 146 57 ) ) -RRB- 10_1101-2021_01_08_425952 146 58 , , , 10_1101-2021_01_08_425952 146 59 and and CC 10_1101-2021_01_08_425952 146 60 record record NN 10_1101-2021_01_08_425952 146 61 duration duration NN 10_1101-2021_01_08_425952 146 62 ( ( -LRB- 10_1101-2021_01_08_425952 146 63 number number NN 10_1101-2021_01_08_425952 146 64 of of IN 10_1101-2021_01_08_425952 146 65 days day NNS 10_1101-2021_01_08_425952 146 66 between between IN 10_1101-2021_01_08_425952 146 67 the the DT 10_1101-2021_01_08_425952 146 68 first first JJ 10_1101-2021_01_08_425952 146 69 and and CC 10_1101-2021_01_08_425952 146 70 last last JJ 10_1101-2021_01_08_425952 146 71 prescription prescription NN 10_1101-2021_01_08_425952 146 72 event event NN 10_1101-2021_01_08_425952 146 73 on on IN 10_1101-2021_01_08_425952 146 74 record record NN 10_1101-2021_01_08_425952 146 75 ) ) -RRB- 10_1101-2021_01_08_425952 146 76 : : : 10_1101-2021_01_08_425952 146 77 > > XX 10_1101-2021_01_08_425952 146 78 library(rdrugtrajectory library(rdrugtrajectory NN 10_1101-2021_01_08_425952 146 79 ) ) -RRB- 10_1101-2021_01_08_425952 146 80 > > XX 10_1101-2021_01_08_425952 146 81 idList idList NNP 10_1101-2021_01_08_425952 146 82 < < XX 10_1101-2021_01_08_425952 146 83 - - HYPH 10_1101-2021_01_08_425952 146 84 getUniquePatidList(testTherapyDF getUniquePatidList(testTherapyDF NNP 10_1101-2021_01_08_425952 146 85 ) ) -RRB- 10_1101-2021_01_08_425952 146 86 > > XX 10_1101-2021_01_08_425952 146 87 resultList resultList NNP 10_1101-2021_01_08_425952 146 88 < < XX 10_1101-2021_01_08_425952 146 89 - - HYPH 10_1101-2021_01_08_425952 146 90 getEventdateSummaryByPatient getEventdateSummaryByPatient NNP 10_1101-2021_01_08_425952 146 91 ( ( -LRB- 10_1101-2021_01_08_425952 146 92 + + SYM 10_1101-2021_01_08_425952 146 93 testTherapyDF[testTherapyDF$patid==idList[[1 testtherapydf[testtherapydf$patid==idlist[[1 NN 10_1101-2021_01_08_425952 146 94 ] ] -RRB- 10_1101-2021_01_08_425952 146 95 ] ] -RRB- 10_1101-2021_01_08_425952 146 96 , , , 10_1101-2021_01_08_425952 146 97 ] ] -RRB- 10_1101-2021_01_08_425952 146 98 ) ) -RRB- 10_1101-2021_01_08_425952 146 99 > > XX 10_1101-2021_01_08_425952 146 100 str(resultList str(resultlist NN 10_1101-2021_01_08_425952 146 101 , , , 10_1101-2021_01_08_425952 146 102 strict.width="wrap strict.width="wrap NN 10_1101-2021_01_08_425952 146 103 " " '' 10_1101-2021_01_08_425952 146 104 ) ) -RRB- 10_1101-2021_01_08_425952 146 105 List list NN 10_1101-2021_01_08_425952 146 106 of of IN 10_1101-2021_01_08_425952 146 107 2 2 CD 10_1101-2021_01_08_425952 146 108 $ $ $ 10_1101-2021_01_08_425952 146 109 TimeSeriesList timeserieslist CD 10_1101-2021_01_08_425952 146 110 : : : 10_1101-2021_01_08_425952 146 111 num num NNP 10_1101-2021_01_08_425952 146 112 [ [ -LRB- 10_1101-2021_01_08_425952 146 113 1:6 1:6 CD 10_1101-2021_01_08_425952 146 114 ] ] -RRB- 10_1101-2021_01_08_425952 146 115 336 336 CD 10_1101-2021_01_08_425952 146 116 652 652 CD 10_1101-2021_01_08_425952 146 117 2540 2540 CD 10_1101-2021_01_08_425952 146 118 34 34 CD 10_1101-2021_01_08_425952 146 119 42 42 CD 10_1101-2021_01_08_425952 146 120 44 44 CD 10_1101-2021_01_08_425952 146 121 $ $ $ 10_1101-2021_01_08_425952 146 122 SummaryDF summarydf NN 10_1101-2021_01_08_425952 146 123 : : : 10_1101-2021_01_08_425952 146 124 ' ' `` 10_1101-2021_01_08_425952 146 125 data.frame data.frame NN 10_1101-2021_01_08_425952 146 126 ' ' '' 10_1101-2021_01_08_425952 146 127 : : : 10_1101-2021_01_08_425952 146 128 1 1 CD 10_1101-2021_01_08_425952 146 129 obs obs NN 10_1101-2021_01_08_425952 146 130 . . . 10_1101-2021_01_08_425952 147 1 of of IN 10_1101-2021_01_08_425952 147 2 7 7 CD 10_1101-2021_01_08_425952 147 3 variables variable NNS 10_1101-2021_01_08_425952 147 4 : : : 10_1101-2021_01_08_425952 147 5 .. .. NFP 10_1101-2021_01_08_425952 147 6 $ $ $ 10_1101-2021_01_08_425952 147 7 patid patid NN 10_1101-2021_01_08_425952 147 8 : : : 10_1101-2021_01_08_425952 147 9 int int NN 10_1101-2021_01_08_425952 147 10 3515 3515 CD 10_1101-2021_01_08_425952 147 11 .. .. NFP 10_1101-2021_01_08_425952 147 12 $ $ $ 10_1101-2021_01_08_425952 147 13 numberOfEvents numberofevent NNS 10_1101-2021_01_08_425952 147 14 : : : 10_1101-2021_01_08_425952 147 15 int int NN 10_1101-2021_01_08_425952 147 16 7 7 CD 10_1101-2021_01_08_425952 147 17 .CC .cc SYM 10_1101-2021_01_08_425952 147 18 - - HYPH 10_1101-2021_01_08_425952 147 19 BY by IN 10_1101-2021_01_08_425952 147 20 - - HYPH 10_1101-2021_01_08_425952 147 21 ND ND NNP 10_1101-2021_01_08_425952 147 22 4.0 4.0 CD 10_1101-2021_01_08_425952 147 23 International international JJ 10_1101-2021_01_08_425952 147 24 licensemade licensemade NN 10_1101-2021_01_08_425952 147 25 available available JJ 10_1101-2021_01_08_425952 147 26 under under IN 10_1101-2021_01_08_425952 147 27 a a DT 10_1101-2021_01_08_425952 147 28 ( ( -LRB- 10_1101-2021_01_08_425952 147 29 which which WDT 10_1101-2021_01_08_425952 147 30 was be VBD 10_1101-2021_01_08_425952 147 31 not not RB 10_1101-2021_01_08_425952 147 32 certified certify VBN 10_1101-2021_01_08_425952 147 33 by by IN 10_1101-2021_01_08_425952 147 34 peer peer NN 10_1101-2021_01_08_425952 147 35 review review NN 10_1101-2021_01_08_425952 147 36 ) ) -RRB- 10_1101-2021_01_08_425952 147 37 is be VBZ 10_1101-2021_01_08_425952 147 38 the the DT 10_1101-2021_01_08_425952 147 39 author author NN 10_1101-2021_01_08_425952 147 40 / / SYM 10_1101-2021_01_08_425952 147 41 funder funder NN 10_1101-2021_01_08_425952 147 42 , , , 10_1101-2021_01_08_425952 147 43 who who WP 10_1101-2021_01_08_425952 147 44 has have VBZ 10_1101-2021_01_08_425952 147 45 granted grant VBN 10_1101-2021_01_08_425952 147 46 bioRxiv biorxiv IN 10_1101-2021_01_08_425952 147 47 a a DT 10_1101-2021_01_08_425952 147 48 license license NN 10_1101-2021_01_08_425952 147 49 to to TO 10_1101-2021_01_08_425952 147 50 display display VB 10_1101-2021_01_08_425952 147 51 the the DT 10_1101-2021_01_08_425952 147 52 preprint preprint NN 10_1101-2021_01_08_425952 147 53 in in IN 10_1101-2021_01_08_425952 147 54 perpetuity perpetuity NN 10_1101-2021_01_08_425952 147 55 . . . 10_1101-2021_01_08_425952 148 1 It -PRON- PRP 10_1101-2021_01_08_425952 148 2 is be VBZ 10_1101-2021_01_08_425952 148 3 The the DT 10_1101-2021_01_08_425952 148 4 copyright copyright NN 10_1101-2021_01_08_425952 148 5 holder holder NN 10_1101-2021_01_08_425952 148 6 for for IN 10_1101-2021_01_08_425952 148 7 this this DT 10_1101-2021_01_08_425952 148 8 preprintthis preprintthis NN 10_1101-2021_01_08_425952 148 9 version version NN 10_1101-2021_01_08_425952 148 10 posted post VBD 10_1101-2021_01_08_425952 148 11 January January NNP 10_1101-2021_01_08_425952 148 12 9 9 CD 10_1101-2021_01_08_425952 148 13 , , , 10_1101-2021_01_08_425952 148 14 2021 2021 CD 10_1101-2021_01_08_425952 148 15 . . . 10_1101-2021_01_08_425952 148 16 ; ; : 10_1101-2021_01_08_425952 148 17 https://doi.org/10.1101/2021.01.08.425952doi https://doi.org/10.1101/2021.01.08.425952doi ADD 10_1101-2021_01_08_425952 148 18 : : : 10_1101-2021_01_08_425952 148 19 bioRxiv biorxiv IN 10_1101-2021_01_08_425952 148 20 preprint preprint NN 10_1101-2021_01_08_425952 148 21 https://doi.org/10.1101/2021.01.08.425952 https://doi.org/10.1101/2021.01.08.425952 NN 10_1101-2021_01_08_425952 148 22 http://creativecommons.org/licenses/by-nd/4.0/ http://creativecommons.org/licenses/by-nd/4.0/ NN 10_1101-2021_01_08_425952 148 23 10 10 CD 10_1101-2021_01_08_425952 148 24 rdrugtrajectory rdrugtrajectory NN 10_1101-2021_01_08_425952 148 25 : : : 10_1101-2021_01_08_425952 148 26 Analysing Analysing NNP 10_1101-2021_01_08_425952 148 27 Drug Drug NNP 10_1101-2021_01_08_425952 148 28 Prescriptions Prescriptions NNPS 10_1101-2021_01_08_425952 148 29 in in IN 10_1101-2021_01_08_425952 148 30 Electronic Electronic NNP 10_1101-2021_01_08_425952 148 31 Health Health NNP 10_1101-2021_01_08_425952 148 32 Care Care NNP 10_1101-2021_01_08_425952 148 33 Records Records NNPS 10_1101-2021_01_08_425952 148 34 .. .. NFP 10_1101-2021_01_08_425952 148 35 $ $ $ 10_1101-2021_01_08_425952 148 36 medianTime mediantime NN 10_1101-2021_01_08_425952 148 37 : : : 10_1101-2021_01_08_425952 148 38 num num NNP 10_1101-2021_01_08_425952 148 39 190 190 CD 10_1101-2021_01_08_425952 148 40 .. .. NFP 10_1101-2021_01_08_425952 148 41 $ $ $ 10_1101-2021_01_08_425952 148 42 minTime mintime NN 10_1101-2021_01_08_425952 148 43 : : : 10_1101-2021_01_08_425952 148 44 num num NNP 10_1101-2021_01_08_425952 148 45 34 34 CD 10_1101-2021_01_08_425952 148 46 .. .. . 10_1101-2021_01_08_425952 148 47 $ $ $ 10_1101-2021_01_08_425952 148 48 maxTime maxtime NN 10_1101-2021_01_08_425952 148 49 : : : 10_1101-2021_01_08_425952 148 50 num num NNP 10_1101-2021_01_08_425952 148 51 2540 2540 CD 10_1101-2021_01_08_425952 148 52 .. .. NFP 10_1101-2021_01_08_425952 148 53 $ $ $ 10_1101-2021_01_08_425952 148 54 longestDuration longestduration NN 10_1101-2021_01_08_425952 148 55 : : : 10_1101-2021_01_08_425952 148 56 num num NNP 10_1101-2021_01_08_425952 148 57 2540 2540 CD 10_1101-2021_01_08_425952 148 58 .. .. NFP 10_1101-2021_01_08_425952 148 59 $ $ $ 10_1101-2021_01_08_425952 148 60 recordDuration recordduration NN 10_1101-2021_01_08_425952 148 61 : : : 10_1101-2021_01_08_425952 148 62 int int DT 10_1101-2021_01_08_425952 148 63 3648 3648 CD 10_1101-2021_01_08_425952 148 64 - - HYPH 10_1101-2021_01_08_425952 148 65 attr attr NN 10_1101-2021_01_08_425952 148 66 ( ( -LRB- 10_1101-2021_01_08_425952 148 67 * * NFP 10_1101-2021_01_08_425952 148 68 , , , 10_1101-2021_01_08_425952 148 69 " " `` 10_1101-2021_01_08_425952 148 70 class")= class")= NNP 10_1101-2021_01_08_425952 148 71 chr chr NNP 10_1101-2021_01_08_425952 148 72 " " '' 10_1101-2021_01_08_425952 148 73 EventdateSummaryObj eventdatesummaryobj CD 10_1101-2021_01_08_425952 148 74 " " '' 10_1101-2021_01_08_425952 148 75 getPopulationDrugSummary getPopulationDrugSummary NNP 10_1101-2021_01_08_425952 148 76 This this DT 10_1101-2021_01_08_425952 148 77 approach approach NN 10_1101-2021_01_08_425952 148 78 can can MD 10_1101-2021_01_08_425952 148 79 be be VB 10_1101-2021_01_08_425952 148 80 extended extend VBN 10_1101-2021_01_08_425952 148 81 across across IN 10_1101-2021_01_08_425952 148 82 the the DT 10_1101-2021_01_08_425952 148 83 cohort cohort NN 10_1101-2021_01_08_425952 148 84 of of IN 10_1101-2021_01_08_425952 148 85 patients patient NNS 10_1101-2021_01_08_425952 148 86 with with IN 10_1101-2021_01_08_425952 148 87 getPopulationDrugSummary getPopulationDrugSummary NNP 10_1101-2021_01_08_425952 148 88 . . . 10_1101-2021_01_08_425952 149 1 The the DT 10_1101-2021_01_08_425952 149 2 returning return VBG 10_1101-2021_01_08_425952 149 3 PopulationEventdateSummary populationeventdatesummary NN 10_1101-2021_01_08_425952 149 4 S3 S3 NNP 10_1101-2021_01_08_425952 149 5 object object NN 10_1101-2021_01_08_425952 149 6 is be VBZ 10_1101-2021_01_08_425952 149 7 a a DT 10_1101-2021_01_08_425952 149 8 list list NN 10_1101-2021_01_08_425952 149 9 of of IN 10_1101-2021_01_08_425952 149 10 three three CD 10_1101-2021_01_08_425952 149 11 elements element NNS 10_1101-2021_01_08_425952 149 12 . . . 10_1101-2021_01_08_425952 150 1 The the DT 10_1101-2021_01_08_425952 150 2 first first JJ 10_1101-2021_01_08_425952 150 3 element element NN 10_1101-2021_01_08_425952 150 4 is be VBZ 10_1101-2021_01_08_425952 150 5 the the DT 10_1101-2021_01_08_425952 150 6 SummaryDF summarydf JJ 10_1101-2021_01_08_425952 150 7 dataframe dataframe NN 10_1101-2021_01_08_425952 150 8 derived derive VBN 10_1101-2021_01_08_425952 150 9 from from IN 10_1101-2021_01_08_425952 150 10 calling call VBG 10_1101-2021_01_08_425952 150 11 getEventdateSummaryByPatient geteventdatesummarybypatient NN 10_1101-2021_01_08_425952 150 12 per per IN 10_1101-2021_01_08_425952 150 13 patient patient NN 10_1101-2021_01_08_425952 150 14 , , , 10_1101-2021_01_08_425952 150 15 with with IN 10_1101-2021_01_08_425952 150 16 the the DT 10_1101-2021_01_08_425952 150 17 set set NN 10_1101-2021_01_08_425952 150 18 of of IN 10_1101-2021_01_08_425952 150 19 statistics statistic NNS 10_1101-2021_01_08_425952 150 20 retrievable retrievable VBP 10_1101-2021_01_08_425952 150 21 through through IN 10_1101-2021_01_08_425952 150 22 the the DT 10_1101-2021_01_08_425952 150 23 accompanied accompany VBN 10_1101-2021_01_08_425952 150 24 patid patid NN 10_1101-2021_01_08_425952 150 25 . . . 10_1101-2021_01_08_425952 151 1 The the DT 10_1101-2021_01_08_425952 151 2 second second JJ 10_1101-2021_01_08_425952 151 3 element element NN 10_1101-2021_01_08_425952 151 4 is be VBZ 10_1101-2021_01_08_425952 151 5 the the DT 10_1101-2021_01_08_425952 151 6 TimeSeriesList timeserieslist NN 10_1101-2021_01_08_425952 151 7 , , , 10_1101-2021_01_08_425952 151 8 which which WDT 10_1101-2021_01_08_425952 151 9 holds hold VBZ 10_1101-2021_01_08_425952 151 10 a a DT 10_1101-2021_01_08_425952 151 11 vector vector NN 10_1101-2021_01_08_425952 151 12 per per IN 10_1101-2021_01_08_425952 151 13 patient patient NN 10_1101-2021_01_08_425952 151 14 of of IN 10_1101-2021_01_08_425952 151 15 the the DT 10_1101-2021_01_08_425952 151 16 number number NN 10_1101-2021_01_08_425952 151 17 of of IN 10_1101-2021_01_08_425952 151 18 days day NNS 10_1101-2021_01_08_425952 151 19 between between IN 10_1101-2021_01_08_425952 151 20 consecutive consecutive JJ 10_1101-2021_01_08_425952 151 21 prescription prescription NN 10_1101-2021_01_08_425952 151 22 events event NNS 10_1101-2021_01_08_425952 151 23 . . . 10_1101-2021_01_08_425952 152 1 Vectors vector NNS 10_1101-2021_01_08_425952 152 2 can can MD 10_1101-2021_01_08_425952 152 3 be be VB 10_1101-2021_01_08_425952 152 4 accessed access VBN 10_1101-2021_01_08_425952 152 5 using use VBG 10_1101-2021_01_08_425952 152 6 the the DT 10_1101-2021_01_08_425952 152 7 patid patid JJ 10_1101-2021_01_08_425952 152 8 element element NN 10_1101-2021_01_08_425952 152 9 name name NN 10_1101-2021_01_08_425952 152 10 : : : 10_1101-2021_01_08_425952 152 11 > > XX 10_1101-2021_01_08_425952 152 12 library(rdrugtrajectory library(rdrugtrajectory NNP 10_1101-2021_01_08_425952 152 13 ) ) -RRB- 10_1101-2021_01_08_425952 152 14 > > XX 10_1101-2021_01_08_425952 152 15 resultList resultList NNP 10_1101-2021_01_08_425952 152 16 < < NNP 10_1101-2021_01_08_425952 152 17 - - HYPH 10_1101-2021_01_08_425952 152 18 getPopulationDrugSummary(df getPopulationDrugSummary(df NNP 10_1101-2021_01_08_425952 152 19 = = SYM 10_1101-2021_01_08_425952 152 20 testTherapyDF testTherapyDF NNS 10_1101-2021_01_08_425952 152 21 , , , 10_1101-2021_01_08_425952 152 22 + + CC 10_1101-2021_01_08_425952 152 23 prodCodesVector prodcodesvector NN 10_1101-2021_01_08_425952 152 24 = = SYM 10_1101-2021_01_08_425952 152 25 NULL NULL NNP 10_1101-2021_01_08_425952 152 26 ) ) -RRB- 10_1101-2021_01_08_425952 152 27 > > XX 10_1101-2021_01_08_425952 152 28 str(resultList str(resultlist NN 10_1101-2021_01_08_425952 152 29 , , , 10_1101-2021_01_08_425952 152 30 strict.width="wrap strict.width="wrap NN 10_1101-2021_01_08_425952 152 31 " " '' 10_1101-2021_01_08_425952 152 32 , , , 10_1101-2021_01_08_425952 152 33 list.len list.len ADD 10_1101-2021_01_08_425952 152 34 = = SYM 10_1101-2021_01_08_425952 152 35 5 5 LS 10_1101-2021_01_08_425952 152 36 ) ) -RRB- 10_1101-2021_01_08_425952 152 37 List list NN 10_1101-2021_01_08_425952 152 38 of of IN 10_1101-2021_01_08_425952 152 39 2 2 CD 10_1101-2021_01_08_425952 152 40 $ $ $ 10_1101-2021_01_08_425952 152 41 SummaryDF summarydf NN 10_1101-2021_01_08_425952 152 42 : : : 10_1101-2021_01_08_425952 152 43 ' ' `` 10_1101-2021_01_08_425952 152 44 data.frame data.frame NN 10_1101-2021_01_08_425952 152 45 ' ' '' 10_1101-2021_01_08_425952 152 46 : : : 10_1101-2021_01_08_425952 152 47 3838 3838 CD 10_1101-2021_01_08_425952 152 48 obs obs NN 10_1101-2021_01_08_425952 152 49 . . . 10_1101-2021_01_08_425952 153 1 of of IN 10_1101-2021_01_08_425952 153 2 7 7 CD 10_1101-2021_01_08_425952 153 3 variables variable NNS 10_1101-2021_01_08_425952 153 4 : : : 10_1101-2021_01_08_425952 153 5 .. .. NFP 10_1101-2021_01_08_425952 153 6 $ $ $ 10_1101-2021_01_08_425952 153 7 patid patid NN 10_1101-2021_01_08_425952 153 8 : : : 10_1101-2021_01_08_425952 153 9 int int NN 10_1101-2021_01_08_425952 153 10 [ [ -LRB- 10_1101-2021_01_08_425952 153 11 1:3838 1:3838 CD 10_1101-2021_01_08_425952 153 12 ] ] -RRB- 10_1101-2021_01_08_425952 153 13 3515 3515 CD 10_1101-2021_01_08_425952 153 14 3653 3653 CD 10_1101-2021_01_08_425952 153 15 3756 3756 CD 10_1101-2021_01_08_425952 153 16 3813 3813 CD 10_1101-2021_01_08_425952 153 17 435 435 CD 10_1101-2021_01_08_425952 153 18 553 553 CD 10_1101-2021_01_08_425952 153 19 731 731 CD 10_1101-2021_01_08_425952 153 20 891 891 CD 10_1101-2021_01_08_425952 153 21 1781 1781 CD 10_1101-2021_01_08_425952 153 22 1991 1991 CD 10_1101-2021_01_08_425952 153 23 ... ... NFP 10_1101-2021_01_08_425952 153 24 .. .. NFP 10_1101-2021_01_08_425952 153 25 $ $ $ 10_1101-2021_01_08_425952 153 26 numberOfEvents numberofevent NNS 10_1101-2021_01_08_425952 153 27 : : : 10_1101-2021_01_08_425952 153 28 int int NN 10_1101-2021_01_08_425952 153 29 [ [ -LRB- 10_1101-2021_01_08_425952 153 30 1:3838 1:3838 CD 10_1101-2021_01_08_425952 153 31 ] ] -RRB- 10_1101-2021_01_08_425952 153 32 7 7 CD 10_1101-2021_01_08_425952 153 33 21 21 CD 10_1101-2021_01_08_425952 153 34 1 1 CD 10_1101-2021_01_08_425952 153 35 1 1 CD 10_1101-2021_01_08_425952 153 36 13 13 CD 10_1101-2021_01_08_425952 153 37 2 2 CD 10_1101-2021_01_08_425952 153 38 15 15 CD 10_1101-2021_01_08_425952 153 39 2 2 CD 10_1101-2021_01_08_425952 153 40 23 23 CD 10_1101-2021_01_08_425952 153 41 79 79 CD 10_1101-2021_01_08_425952 153 42 ... ... NFP 10_1101-2021_01_08_425952 153 43 .. .. NFP 10_1101-2021_01_08_425952 153 44 $ $ $ 10_1101-2021_01_08_425952 153 45 medianTime mediantime NN 10_1101-2021_01_08_425952 153 46 : : : 10_1101-2021_01_08_425952 153 47 num num NNP 10_1101-2021_01_08_425952 153 48 [ [ -LRB- 10_1101-2021_01_08_425952 153 49 1:3838 1:3838 CD 10_1101-2021_01_08_425952 153 50 ] ] -RRB- 10_1101-2021_01_08_425952 153 51 190 190 CD 10_1101-2021_01_08_425952 153 52 60 60 CD 10_1101-2021_01_08_425952 153 53 0 0 CD 10_1101-2021_01_08_425952 153 54 0 0 CD 10_1101-2021_01_08_425952 153 55 28.5 28.5 CD 10_1101-2021_01_08_425952 153 56 ... ... NFP 10_1101-2021_01_08_425952 153 57 .. .. NFP 10_1101-2021_01_08_425952 153 58 $ $ $ 10_1101-2021_01_08_425952 153 59 minTime mintime NN 10_1101-2021_01_08_425952 153 60 : : : 10_1101-2021_01_08_425952 153 61 num num NNP 10_1101-2021_01_08_425952 153 62 [ [ -LRB- 10_1101-2021_01_08_425952 153 63 1:3838 1:3838 CD 10_1101-2021_01_08_425952 153 64 ] ] -RRB- 10_1101-2021_01_08_425952 153 65 34 34 CD 10_1101-2021_01_08_425952 153 66 34 34 CD 10_1101-2021_01_08_425952 153 67 0 0 CD 10_1101-2021_01_08_425952 153 68 0 0 CD 10_1101-2021_01_08_425952 153 69 11 11 CD 10_1101-2021_01_08_425952 153 70 ... ... NFP 10_1101-2021_01_08_425952 153 71 .. .. NFP 10_1101-2021_01_08_425952 153 72 $ $ $ 10_1101-2021_01_08_425952 153 73 maxTime maxtime NN 10_1101-2021_01_08_425952 153 74 : : : 10_1101-2021_01_08_425952 153 75 num num NNP 10_1101-2021_01_08_425952 153 76 [ [ -LRB- 10_1101-2021_01_08_425952 153 77 1:3838 1:3838 CD 10_1101-2021_01_08_425952 153 78 ] ] -RRB- 10_1101-2021_01_08_425952 153 79 2540 2540 CD 10_1101-2021_01_08_425952 153 80 1623 1623 CD 10_1101-2021_01_08_425952 153 81 0 0 CD 10_1101-2021_01_08_425952 153 82 0 0 CD 10_1101-2021_01_08_425952 153 83 322 322 CD 10_1101-2021_01_08_425952 153 84 ... ... NFP 10_1101-2021_01_08_425952 153 85 .. .. NFP 10_1101-2021_01_08_425952 153 86 [ [ -LRB- 10_1101-2021_01_08_425952 153 87 list list NN 10_1101-2021_01_08_425952 153 88 output output NN 10_1101-2021_01_08_425952 153 89 truncated truncate VBN 10_1101-2021_01_08_425952 153 90 ] ] -RRB- 10_1101-2021_01_08_425952 153 91 $ $ $ 10_1101-2021_01_08_425952 153 92 TimeSeriesList timeserieslist CD 10_1101-2021_01_08_425952 153 93 : : : 10_1101-2021_01_08_425952 153 94 List list NN 10_1101-2021_01_08_425952 153 95 of of IN 10_1101-2021_01_08_425952 153 96 3838 3838 CD 10_1101-2021_01_08_425952 153 97 .. .. NFP 10_1101-2021_01_08_425952 153 98 $ $ $ 10_1101-2021_01_08_425952 153 99 3515 3515 CD 10_1101-2021_01_08_425952 153 100 : : : 10_1101-2021_01_08_425952 153 101 num num NNP 10_1101-2021_01_08_425952 153 102 [ [ -LRB- 10_1101-2021_01_08_425952 153 103 1:6 1:6 CD 10_1101-2021_01_08_425952 153 104 ] ] -RRB- 10_1101-2021_01_08_425952 153 105 336 336 CD 10_1101-2021_01_08_425952 153 106 652 652 CD 10_1101-2021_01_08_425952 153 107 2540 2540 CD 10_1101-2021_01_08_425952 153 108 34 34 CD 10_1101-2021_01_08_425952 153 109 42 42 CD 10_1101-2021_01_08_425952 153 110 44 44 CD 10_1101-2021_01_08_425952 153 111 .. .. CD 10_1101-2021_01_08_425952 153 112 $ $ $ 10_1101-2021_01_08_425952 153 113 3653 3653 CD 10_1101-2021_01_08_425952 153 114 : : : 10_1101-2021_01_08_425952 153 115 num num NNP 10_1101-2021_01_08_425952 153 116 [ [ -LRB- 10_1101-2021_01_08_425952 153 117 1:20 1:20 CD 10_1101-2021_01_08_425952 153 118 ] ] -RRB- 10_1101-2021_01_08_425952 153 119 890 890 CD 10_1101-2021_01_08_425952 153 120 222 222 CD 10_1101-2021_01_08_425952 153 121 182 182 CD 10_1101-2021_01_08_425952 153 122 301 301 CD 10_1101-2021_01_08_425952 153 123 539 539 CD 10_1101-2021_01_08_425952 153 124 ... ... NFP 10_1101-2021_01_08_425952 153 125 .. .. NFP 10_1101-2021_01_08_425952 153 126 $ $ $ 10_1101-2021_01_08_425952 153 127 3756 3756 CD 10_1101-2021_01_08_425952 153 128 : : : 10_1101-2021_01_08_425952 153 129 num num NNP 10_1101-2021_01_08_425952 153 130 0 0 CD 10_1101-2021_01_08_425952 153 131 .. .. NFP 10_1101-2021_01_08_425952 153 132 $ $ $ 10_1101-2021_01_08_425952 153 133 3813 3813 CD 10_1101-2021_01_08_425952 153 134 : : : 10_1101-2021_01_08_425952 153 135 num num NNP 10_1101-2021_01_08_425952 153 136 0 0 CD 10_1101-2021_01_08_425952 153 137 .. .. NFP 10_1101-2021_01_08_425952 153 138 $ $ $ 10_1101-2021_01_08_425952 153 139 435 435 CD 10_1101-2021_01_08_425952 153 140 : : : 10_1101-2021_01_08_425952 153 141 num num NNP 10_1101-2021_01_08_425952 153 142 [ [ -LRB- 10_1101-2021_01_08_425952 153 143 1:12 1:12 CD 10_1101-2021_01_08_425952 153 144 ] ] -RRB- 10_1101-2021_01_08_425952 153 145 26 26 CD 10_1101-2021_01_08_425952 153 146 23 23 CD 10_1101-2021_01_08_425952 153 147 24 24 CD 10_1101-2021_01_08_425952 153 148 24 24 CD 10_1101-2021_01_08_425952 153 149 32 32 CD 10_1101-2021_01_08_425952 153 150 322 322 CD 10_1101-2021_01_08_425952 153 151 31 31 CD 10_1101-2021_01_08_425952 153 152 29 29 CD 10_1101-2021_01_08_425952 153 153 11 11 CD 10_1101-2021_01_08_425952 153 154 51 51 CD 10_1101-2021_01_08_425952 153 155 ... ... NFP 10_1101-2021_01_08_425952 153 156 .. .. NFP 10_1101-2021_01_08_425952 153 157 [ [ -LRB- 10_1101-2021_01_08_425952 153 158 list list NN 10_1101-2021_01_08_425952 153 159 output output NN 10_1101-2021_01_08_425952 153 160 truncated truncate VBN 10_1101-2021_01_08_425952 153 161 ] ] -RRB- 10_1101-2021_01_08_425952 153 162 - - : 10_1101-2021_01_08_425952 153 163 attr attr NN 10_1101-2021_01_08_425952 153 164 ( ( -LRB- 10_1101-2021_01_08_425952 153 165 * * NFP 10_1101-2021_01_08_425952 153 166 , , , 10_1101-2021_01_08_425952 153 167 " " `` 10_1101-2021_01_08_425952 153 168 class")= class")= NNP 10_1101-2021_01_08_425952 153 169 chr chr NNP 10_1101-2021_01_08_425952 153 170 " " '' 10_1101-2021_01_08_425952 153 171 PopulationEventdateSummary PopulationEventdateSummary . 10_1101-2021_01_08_425952 153 172 " " '' 10_1101-2021_01_08_425952 153 173 > > XX 10_1101-2021_01_08_425952 153 174 # # $ 10_1101-2021_01_08_425952 153 175 Get get VB 10_1101-2021_01_08_425952 153 176 all all DT 10_1101-2021_01_08_425952 153 177 patids patid NNS 10_1101-2021_01_08_425952 153 178 for for IN 10_1101-2021_01_08_425952 153 179 patients patient NNS 10_1101-2021_01_08_425952 153 180 younger young JJR 10_1101-2021_01_08_425952 153 181 than than IN 10_1101-2021_01_08_425952 153 182 40 40 CD 10_1101-2021_01_08_425952 153 183 . . . 10_1101-2021_01_08_425952 154 1 > > XX 10_1101-2021_01_08_425952 154 2 ageIDList ageIDList NNP 10_1101-2021_01_08_425952 154 3 < < XX 10_1101-2021_01_08_425952 154 4 - - HYPH 10_1101-2021_01_08_425952 154 5 getUniquePatidList(ageGenderDF[ageGenderDF$yob getUniquePatidList(ageGenderDF[ageGenderDF$yob NNP 10_1101-2021_01_08_425952 154 6 < < XX 10_1101-2021_01_08_425952 154 7 40 40 CD 10_1101-2021_01_08_425952 154 8 , , , 10_1101-2021_01_08_425952 154 9 ] ] -RRB- 10_1101-2021_01_08_425952 154 10 ) ) -RRB- 10_1101-2021_01_08_425952 154 11 > > XX 10_1101-2021_01_08_425952 154 12 timeSeriesList timeSeriesList NNP 10_1101-2021_01_08_425952 154 13 < < XX 10_1101-2021_01_08_425952 154 14 - - HYPH 10_1101-2021_01_08_425952 154 15 resultList[[2 resultlist[[2 NN 10_1101-2021_01_08_425952 154 16 ] ] -RRB- 10_1101-2021_01_08_425952 154 17 ] ] -RRB- 10_1101-2021_01_08_425952 154 18 > > XX 10_1101-2021_01_08_425952 154 19 # # NN 10_1101-2021_01_08_425952 154 20 Get get VB 10_1101-2021_01_08_425952 154 21 all all DT 10_1101-2021_01_08_425952 154 22 patids patid NNS 10_1101-2021_01_08_425952 154 23 of of IN 10_1101-2021_01_08_425952 154 24 available available JJ 10_1101-2021_01_08_425952 154 25 data datum NNS 10_1101-2021_01_08_425952 154 26 . . . 10_1101-2021_01_08_425952 155 1 > > XX 10_1101-2021_01_08_425952 155 2 recordPatids recordpatid NNS 10_1101-2021_01_08_425952 155 3 < < XX 10_1101-2021_01_08_425952 155 4 - - HYPH 10_1101-2021_01_08_425952 155 5 names(timeSeriesList names(timeserieslist NN 10_1101-2021_01_08_425952 155 6 ) ) -RRB- 10_1101-2021_01_08_425952 155 7 > > XX 10_1101-2021_01_08_425952 155 8 # # NN 10_1101-2021_01_08_425952 155 9 Get get VBP 10_1101-2021_01_08_425952 155 10 time time NN 10_1101-2021_01_08_425952 155 11 data datum NNS 10_1101-2021_01_08_425952 155 12 for for IN 10_1101-2021_01_08_425952 155 13 the the DT 10_1101-2021_01_08_425952 155 14 intersect intersect NN 10_1101-2021_01_08_425952 155 15 of of IN 10_1101-2021_01_08_425952 155 16 those those DT 10_1101-2021_01_08_425952 155 17 patids patid NNS 10_1101-2021_01_08_425952 155 18 of of IN 10_1101-2021_01_08_425952 155 19 patients patient NNS 10_1101-2021_01_08_425952 155 20 < < XX 10_1101-2021_01_08_425952 155 21 40 40 CD 10_1101-2021_01_08_425952 155 22 and and CC 10_1101-2021_01_08_425952 155 23 the the DT 10_1101-2021_01_08_425952 155 24 patids patid NNS 10_1101-2021_01_08_425952 155 25 > > XX 10_1101-2021_01_08_425952 155 26 # # $ 10_1101-2021_01_08_425952 155 27 of of IN 10_1101-2021_01_08_425952 155 28 available available JJ 10_1101-2021_01_08_425952 155 29 data datum NNS 10_1101-2021_01_08_425952 155 30 . . . 10_1101-2021_01_08_425952 156 1 > > XX 10_1101-2021_01_08_425952 156 2 subTimeList subtimelist NN 10_1101-2021_01_08_425952 156 3 < < XX 10_1101-2021_01_08_425952 156 4 - - HYPH 10_1101-2021_01_08_425952 156 5 timeSeriesList[intersect(ageIDList timeserieslist[intersect(ageidlist NN 10_1101-2021_01_08_425952 156 6 , , , 10_1101-2021_01_08_425952 156 7 recordPatids recordpatid NNS 10_1101-2021_01_08_425952 156 8 ) ) -RRB- 10_1101-2021_01_08_425952 156 9 ] ] -RRB- 10_1101-2021_01_08_425952 156 10 > > XX 10_1101-2021_01_08_425952 156 11 str(subTimeList str(subtimelist NN 10_1101-2021_01_08_425952 156 12 , , , 10_1101-2021_01_08_425952 156 13 strict.width="wrap strict.width="wrap NN 10_1101-2021_01_08_425952 156 14 " " '' 10_1101-2021_01_08_425952 156 15 , , , 10_1101-2021_01_08_425952 156 16 list.len list.len ADD 10_1101-2021_01_08_425952 156 17 = = SYM 10_1101-2021_01_08_425952 156 18 5 5 CD 10_1101-2021_01_08_425952 156 19 ) ) -RRB- 10_1101-2021_01_08_425952 156 20 .CC .CC : 10_1101-2021_01_08_425952 156 21 - - : 10_1101-2021_01_08_425952 156 22 BY by IN 10_1101-2021_01_08_425952 156 23 - - HYPH 10_1101-2021_01_08_425952 156 24 ND ND NNP 10_1101-2021_01_08_425952 156 25 4.0 4.0 CD 10_1101-2021_01_08_425952 156 26 International international JJ 10_1101-2021_01_08_425952 156 27 licensemade licensemade NN 10_1101-2021_01_08_425952 156 28 available available JJ 10_1101-2021_01_08_425952 156 29 under under IN 10_1101-2021_01_08_425952 156 30 a a DT 10_1101-2021_01_08_425952 156 31 ( ( -LRB- 10_1101-2021_01_08_425952 156 32 which which WDT 10_1101-2021_01_08_425952 156 33 was be VBD 10_1101-2021_01_08_425952 156 34 not not RB 10_1101-2021_01_08_425952 156 35 certified certify VBN 10_1101-2021_01_08_425952 156 36 by by IN 10_1101-2021_01_08_425952 156 37 peer peer NN 10_1101-2021_01_08_425952 156 38 review review NN 10_1101-2021_01_08_425952 156 39 ) ) -RRB- 10_1101-2021_01_08_425952 156 40 is be VBZ 10_1101-2021_01_08_425952 156 41 the the DT 10_1101-2021_01_08_425952 156 42 author author NN 10_1101-2021_01_08_425952 156 43 / / SYM 10_1101-2021_01_08_425952 156 44 funder funder NN 10_1101-2021_01_08_425952 156 45 , , , 10_1101-2021_01_08_425952 156 46 who who WP 10_1101-2021_01_08_425952 156 47 has have VBZ 10_1101-2021_01_08_425952 156 48 granted grant VBN 10_1101-2021_01_08_425952 156 49 bioRxiv biorxiv IN 10_1101-2021_01_08_425952 156 50 a a DT 10_1101-2021_01_08_425952 156 51 license license NN 10_1101-2021_01_08_425952 156 52 to to TO 10_1101-2021_01_08_425952 156 53 display display VB 10_1101-2021_01_08_425952 156 54 the the DT 10_1101-2021_01_08_425952 156 55 preprint preprint NN 10_1101-2021_01_08_425952 156 56 in in IN 10_1101-2021_01_08_425952 156 57 perpetuity perpetuity NN 10_1101-2021_01_08_425952 156 58 . . . 10_1101-2021_01_08_425952 157 1 It -PRON- PRP 10_1101-2021_01_08_425952 157 2 is be VBZ 10_1101-2021_01_08_425952 157 3 The the DT 10_1101-2021_01_08_425952 157 4 copyright copyright NN 10_1101-2021_01_08_425952 157 5 holder holder NN 10_1101-2021_01_08_425952 157 6 for for IN 10_1101-2021_01_08_425952 157 7 this this DT 10_1101-2021_01_08_425952 157 8 preprintthis preprintthis NN 10_1101-2021_01_08_425952 157 9 version version NN 10_1101-2021_01_08_425952 157 10 posted post VBD 10_1101-2021_01_08_425952 157 11 January January NNP 10_1101-2021_01_08_425952 157 12 9 9 CD 10_1101-2021_01_08_425952 157 13 , , , 10_1101-2021_01_08_425952 157 14 2021 2021 CD 10_1101-2021_01_08_425952 157 15 . . . 10_1101-2021_01_08_425952 157 16 ; ; : 10_1101-2021_01_08_425952 157 17 https://doi.org/10.1101/2021.01.08.425952doi https://doi.org/10.1101/2021.01.08.425952doi ADD 10_1101-2021_01_08_425952 157 18 : : : 10_1101-2021_01_08_425952 157 19 bioRxiv biorxiv IN 10_1101-2021_01_08_425952 157 20 preprint preprint NN 10_1101-2021_01_08_425952 157 21 https://doi.org/10.1101/2021.01.08.425952 https://doi.org/10.1101/2021.01.08.425952 XX 10_1101-2021_01_08_425952 157 22 http://creativecommons.org/licenses/by-nd/4.0/ http://creativecommons.org/licenses/by-nd/4.0/ NNP 10_1101-2021_01_08_425952 157 23 Journal Journal NNP 10_1101-2021_01_08_425952 157 24 of of IN 10_1101-2021_01_08_425952 157 25 Statistical Statistical NNP 10_1101-2021_01_08_425952 157 26 Software Software NNP 10_1101-2021_01_08_425952 157 27 11 11 CD 10_1101-2021_01_08_425952 157 28 List List NNP 10_1101-2021_01_08_425952 157 29 of of IN 10_1101-2021_01_08_425952 157 30 640 640 CD 10_1101-2021_01_08_425952 157 31 $ $ $ 10_1101-2021_01_08_425952 157 32 2 2 CD 10_1101-2021_01_08_425952 157 33 : : : 10_1101-2021_01_08_425952 157 34 num num NNP 10_1101-2021_01_08_425952 157 35 0 0 CD 10_1101-2021_01_08_425952 157 36 $ $ $ 10_1101-2021_01_08_425952 157 37 3 3 CD 10_1101-2021_01_08_425952 157 38 : : : 10_1101-2021_01_08_425952 157 39 num num NNP 10_1101-2021_01_08_425952 157 40 0 0 CD 10_1101-2021_01_08_425952 157 41 $ $ $ 10_1101-2021_01_08_425952 157 42 7 7 CD 10_1101-2021_01_08_425952 157 43 : : : 10_1101-2021_01_08_425952 157 44 num num NNP 10_1101-2021_01_08_425952 157 45 25 25 CD 10_1101-2021_01_08_425952 157 46 $ $ $ 10_1101-2021_01_08_425952 157 47 10 10 CD 10_1101-2021_01_08_425952 157 48 : : : 10_1101-2021_01_08_425952 157 49 num num JJ 10_1101-2021_01_08_425952 157 50 0 0 CD 10_1101-2021_01_08_425952 157 51 $ $ $ 10_1101-2021_01_08_425952 157 52 15 15 CD 10_1101-2021_01_08_425952 157 53 : : : 10_1101-2021_01_08_425952 157 54 num num NN 10_1101-2021_01_08_425952 157 55 0 0 CD 10_1101-2021_01_08_425952 157 56 [ [ -LRB- 10_1101-2021_01_08_425952 157 57 list list NN 10_1101-2021_01_08_425952 157 58 output output NN 10_1101-2021_01_08_425952 157 59 truncated truncate VBN 10_1101-2021_01_08_425952 157 60 ] ] -RRB- 10_1101-2021_01_08_425952 157 61 3.2 3.2 CD 10_1101-2021_01_08_425952 157 62 . . . 10_1101-2021_01_08_425952 158 1 Curating curate VBG 10_1101-2021_01_08_425952 158 2 drug drug NN 10_1101-2021_01_08_425952 158 3 prescription prescription NN 10_1101-2021_01_08_425952 158 4 records record NNS 10_1101-2021_01_08_425952 158 5 There there EX 10_1101-2021_01_08_425952 158 6 is be VBZ 10_1101-2021_01_08_425952 158 7 no no DT 10_1101-2021_01_08_425952 158 8 direct direct JJ 10_1101-2021_01_08_425952 158 9 link link NN 10_1101-2021_01_08_425952 158 10 between between IN 10_1101-2021_01_08_425952 158 11 a a DT 10_1101-2021_01_08_425952 158 12 prescription prescription NN 10_1101-2021_01_08_425952 158 13 event event NN 10_1101-2021_01_08_425952 158 14 and and CC 10_1101-2021_01_08_425952 158 15 a a DT 10_1101-2021_01_08_425952 158 16 medcode medcode NN 10_1101-2021_01_08_425952 158 17 in in IN 10_1101-2021_01_08_425952 158 18 the the DT 10_1101-2021_01_08_425952 158 19 CPRD CPRD NNP 10_1101-2021_01_08_425952 158 20 data datum NNS 10_1101-2021_01_08_425952 158 21 . . . 10_1101-2021_01_08_425952 159 1 The the DT 10_1101-2021_01_08_425952 159 2 relationship relationship NN 10_1101-2021_01_08_425952 159 3 between between IN 10_1101-2021_01_08_425952 159 4 the the DT 10_1101-2021_01_08_425952 159 5 two two CD 10_1101-2021_01_08_425952 159 6 can can MD 10_1101-2021_01_08_425952 159 7 be be VB 10_1101-2021_01_08_425952 159 8 inferred infer VBN 10_1101-2021_01_08_425952 159 9 from from IN 10_1101-2021_01_08_425952 159 10 the the DT 10_1101-2021_01_08_425952 159 11 event event NN 10_1101-2021_01_08_425952 159 12 dates date VBZ 10_1101-2021_01_08_425952 159 13 of of IN 10_1101-2021_01_08_425952 159 14 the the DT 10_1101-2021_01_08_425952 159 15 prescription prescription NN 10_1101-2021_01_08_425952 159 16 and and CC 10_1101-2021_01_08_425952 159 17 clinical clinical JJ 10_1101-2021_01_08_425952 159 18 events event NNS 10_1101-2021_01_08_425952 159 19 , , , 10_1101-2021_01_08_425952 159 20 in in IN 10_1101-2021_01_08_425952 159 21 addition addition NN 10_1101-2021_01_08_425952 159 22 , , , 10_1101-2021_01_08_425952 159 23 to to IN 10_1101-2021_01_08_425952 159 24 information information NN 10_1101-2021_01_08_425952 159 25 provided provide VBN 10_1101-2021_01_08_425952 159 26 by by IN 10_1101-2021_01_08_425952 159 27 the the DT 10_1101-2021_01_08_425952 159 28 consultation consultation NN 10_1101-2021_01_08_425952 159 29 ID ID NNP 10_1101-2021_01_08_425952 159 30 and and CC 10_1101-2021_01_08_425952 159 31 the the DT 10_1101-2021_01_08_425952 159 32 prescription prescription NN 10_1101-2021_01_08_425952 159 33 issue issue NN 10_1101-2021_01_08_425952 159 34 number number NN 10_1101-2021_01_08_425952 159 35 . . . 10_1101-2021_01_08_425952 160 1 matchDrugWithDisease matchDrugWithDisease NNP 10_1101-2021_01_08_425952 160 2 rdrugtrajectory rdrugtrajectory NN 10_1101-2021_01_08_425952 160 3 provides provide VBZ 10_1101-2021_01_08_425952 160 4 several several JJ 10_1101-2021_01_08_425952 160 5 methods method NNS 10_1101-2021_01_08_425952 160 6 for for IN 10_1101-2021_01_08_425952 160 7 curating curate VBG 10_1101-2021_01_08_425952 160 8 prescription prescription NN 10_1101-2021_01_08_425952 160 9 datasets dataset NNS 10_1101-2021_01_08_425952 160 10 with with IN 10_1101-2021_01_08_425952 160 11 the the DT 10_1101-2021_01_08_425952 160 12 aim aim NN 10_1101-2021_01_08_425952 160 13 of of IN 10_1101-2021_01_08_425952 160 14 es- es- NN 10_1101-2021_01_08_425952 160 15 tablishing tablishe VBG 10_1101-2021_01_08_425952 160 16 a a DT 10_1101-2021_01_08_425952 160 17 relationship relationship NN 10_1101-2021_01_08_425952 160 18 between between IN 10_1101-2021_01_08_425952 160 19 prescription prescription NN 10_1101-2021_01_08_425952 160 20 and and CC 10_1101-2021_01_08_425952 160 21 clinical clinical JJ 10_1101-2021_01_08_425952 160 22 events event NNS 10_1101-2021_01_08_425952 160 23 . . . 10_1101-2021_01_08_425952 161 1 The the DT 10_1101-2021_01_08_425952 161 2 matchDrugWithDisease matchDrugWithDisease NNS 10_1101-2021_01_08_425952 161 3 function function NN 10_1101-2021_01_08_425952 161 4 returns return VBZ 10_1101-2021_01_08_425952 161 5 a a DT 10_1101-2021_01_08_425952 161 6 subset subset NN 10_1101-2021_01_08_425952 161 7 of of IN 10_1101-2021_01_08_425952 161 8 all all DT 10_1101-2021_01_08_425952 161 9 prescription prescription NN 10_1101-2021_01_08_425952 161 10 events event NNS 10_1101-2021_01_08_425952 161 11 with with IN 10_1101-2021_01_08_425952 161 12 an an DT 10_1101-2021_01_08_425952 161 13 established establish VBN 10_1101-2021_01_08_425952 161 14 relationship relationship NN 10_1101-2021_01_08_425952 161 15 between between IN 10_1101-2021_01_08_425952 161 16 therapy therapy NN 10_1101-2021_01_08_425952 161 17 and and CC 10_1101-2021_01_08_425952 161 18 clinical clinical JJ 10_1101-2021_01_08_425952 161 19 event event NN 10_1101-2021_01_08_425952 161 20 . . . 10_1101-2021_01_08_425952 162 1 To to IN 10_1101-2021_01_08_425952 162 2 what what WDT 10_1101-2021_01_08_425952 162 3 degree degree NN 10_1101-2021_01_08_425952 162 4 these these DT 10_1101-2021_01_08_425952 162 5 patients patient NNS 10_1101-2021_01_08_425952 162 6 are be VBP 10_1101-2021_01_08_425952 162 7 included include VBN 10_1101-2021_01_08_425952 162 8 in in IN 10_1101-2021_01_08_425952 162 9 the the DT 10_1101-2021_01_08_425952 162 10 search search NN 10_1101-2021_01_08_425952 162 11 is be VBZ 10_1101-2021_01_08_425952 162 12 con- con- NN 10_1101-2021_01_08_425952 162 13 trolled troll VBN 10_1101-2021_01_08_425952 162 14 with with IN 10_1101-2021_01_08_425952 162 15 a a DT 10_1101-2021_01_08_425952 162 16 function function NN 10_1101-2021_01_08_425952 162 17 argument argument NN 10_1101-2021_01_08_425952 162 18 . . . 10_1101-2021_01_08_425952 163 1 There there EX 10_1101-2021_01_08_425952 163 2 are be VBP 10_1101-2021_01_08_425952 163 3 three three CD 10_1101-2021_01_08_425952 163 4 scenarios scenario NNS 10_1101-2021_01_08_425952 163 5 : : : 10_1101-2021_01_08_425952 163 6 all all DT 10_1101-2021_01_08_425952 163 7 patients patient NNS 10_1101-2021_01_08_425952 163 8 with with IN 10_1101-2021_01_08_425952 163 9 a a DT 10_1101-2021_01_08_425952 163 10 record record NN 10_1101-2021_01_08_425952 163 11 of of IN 10_1101-2021_01_08_425952 163 12 a a DT 10_1101-2021_01_08_425952 163 13 specific specific JJ 10_1101-2021_01_08_425952 163 14 prescription prescription NN 10_1101-2021_01_08_425952 163 15 event event NN 10_1101-2021_01_08_425952 163 16 and and CC 10_1101-2021_01_08_425952 163 17 specific specific JJ 10_1101-2021_01_08_425952 163 18 clinical clinical JJ 10_1101-2021_01_08_425952 163 19 event event NN 10_1101-2021_01_08_425952 163 20 , , , 10_1101-2021_01_08_425952 163 21 at at IN 10_1101-2021_01_08_425952 163 22 any any DT 10_1101-2021_01_08_425952 163 23 point point NN 10_1101-2021_01_08_425952 163 24 ; ; : 10_1101-2021_01_08_425952 163 25 all all DT 10_1101-2021_01_08_425952 163 26 patients patient NNS 10_1101-2021_01_08_425952 163 27 with with IN 10_1101-2021_01_08_425952 163 28 a a DT 10_1101-2021_01_08_425952 163 29 record record NN 10_1101-2021_01_08_425952 163 30 of of IN 10_1101-2021_01_08_425952 163 31 a a DT 10_1101-2021_01_08_425952 163 32 specific specific JJ 10_1101-2021_01_08_425952 163 33 prescription prescription NN 10_1101-2021_01_08_425952 163 34 event event NN 10_1101-2021_01_08_425952 163 35 on on IN 10_1101-2021_01_08_425952 163 36 the the DT 10_1101-2021_01_08_425952 163 37 same same JJ 10_1101-2021_01_08_425952 163 38 date date NN 10_1101-2021_01_08_425952 163 39 as as IN 10_1101-2021_01_08_425952 163 40 a a DT 10_1101-2021_01_08_425952 163 41 specific specific JJ 10_1101-2021_01_08_425952 163 42 clinical clinical JJ 10_1101-2021_01_08_425952 163 43 event event NN 10_1101-2021_01_08_425952 163 44 ; ; : 10_1101-2021_01_08_425952 163 45 and and CC 10_1101-2021_01_08_425952 163 46 , , , 10_1101-2021_01_08_425952 163 47 all all DT 10_1101-2021_01_08_425952 163 48 patients patient NNS 10_1101-2021_01_08_425952 163 49 with with IN 10_1101-2021_01_08_425952 163 50 a a DT 10_1101-2021_01_08_425952 163 51 record record NN 10_1101-2021_01_08_425952 163 52 of of IN 10_1101-2021_01_08_425952 163 53 a a DT 10_1101-2021_01_08_425952 163 54 specific specific JJ 10_1101-2021_01_08_425952 163 55 prescription prescription NN 10_1101-2021_01_08_425952 163 56 event event NN 10_1101-2021_01_08_425952 163 57 on on IN 10_1101-2021_01_08_425952 163 58 the the DT 10_1101-2021_01_08_425952 163 59 same same JJ 10_1101-2021_01_08_425952 163 60 date date NN 10_1101-2021_01_08_425952 163 61 as as IN 10_1101-2021_01_08_425952 163 62 a a DT 10_1101-2021_01_08_425952 163 63 specific specific JJ 10_1101-2021_01_08_425952 163 64 clinical clinical JJ 10_1101-2021_01_08_425952 163 65 event event NN 10_1101-2021_01_08_425952 163 66 and and CC 10_1101-2021_01_08_425952 163 67 clear clear JJ 10_1101-2021_01_08_425952 163 68 from from IN 10_1101-2021_01_08_425952 163 69 additional additional JJ 10_1101-2021_01_08_425952 163 70 clinical clinical JJ 10_1101-2021_01_08_425952 163 71 events event NNS 10_1101-2021_01_08_425952 163 72 on on IN 10_1101-2021_01_08_425952 163 73 that that DT 10_1101-2021_01_08_425952 163 74 day day NN 10_1101-2021_01_08_425952 163 75 . . . 10_1101-2021_01_08_425952 164 1 One one PRP 10_1101-2021_01_08_425952 164 2 would would MD 10_1101-2021_01_08_425952 164 3 expect expect VB 10_1101-2021_01_08_425952 164 4 fewer few JJR 10_1101-2021_01_08_425952 164 5 patients patient NNS 10_1101-2021_01_08_425952 164 6 as as IN 10_1101-2021_01_08_425952 164 7 the the DT 10_1101-2021_01_08_425952 164 8 stringency stringency NN 10_1101-2021_01_08_425952 164 9 of of IN 10_1101-2021_01_08_425952 164 10 the the DT 10_1101-2021_01_08_425952 164 11 search search NN 10_1101-2021_01_08_425952 164 12 criteria criterion NNS 10_1101-2021_01_08_425952 164 13 is be VBZ 10_1101-2021_01_08_425952 164 14 increased increase VBN 10_1101-2021_01_08_425952 164 15 : : : 10_1101-2021_01_08_425952 164 16 > > XX 10_1101-2021_01_08_425952 164 17 library(rdrugtrajectory library(rdrugtrajectory NN 10_1101-2021_01_08_425952 164 18 ) ) -RRB- 10_1101-2021_01_08_425952 164 19 > > XX 10_1101-2021_01_08_425952 164 20 prodcodes prodcode NNS 10_1101-2021_01_08_425952 164 21 < < XX 10_1101-2021_01_08_425952 164 22 - - HYPH 10_1101-2021_01_08_425952 164 23 unique(testTherapyDF$prodcode unique(testTherapyDF$prodcode NNP 10_1101-2021_01_08_425952 164 24 ) ) -RRB- 10_1101-2021_01_08_425952 164 25 > > XX 10_1101-2021_01_08_425952 164 26 amitriptylineCodes amitriptylinecode VBZ 10_1101-2021_01_08_425952 164 27 < < XX 10_1101-2021_01_08_425952 164 28 - - HYPH 10_1101-2021_01_08_425952 164 29 prodcodes[1:5 prodcodes[1:5 NNP 10_1101-2021_01_08_425952 164 30 ] ] -RRB- 10_1101-2021_01_08_425952 164 31 > > XX 10_1101-2021_01_08_425952 164 32 propranololCodes propranololcode NNS 10_1101-2021_01_08_425952 164 33 < < XX 10_1101-2021_01_08_425952 164 34 - - HYPH 10_1101-2021_01_08_425952 164 35 prodcodes[6:11 prodcodes[6:11 NNP 10_1101-2021_01_08_425952 164 36 ] ] -RRB- 10_1101-2021_01_08_425952 164 37 > > XX 10_1101-2021_01_08_425952 164 38 medcodeList medcodelist JJ 10_1101-2021_01_08_425952 164 39 < < XX 10_1101-2021_01_08_425952 164 40 - - HYPH 10_1101-2021_01_08_425952 164 41 unique(testClinicalDF$medcode unique(testclinicaldf$medcode NN 10_1101-2021_01_08_425952 164 42 ) ) -RRB- 10_1101-2021_01_08_425952 164 43 > > XX 10_1101-2021_01_08_425952 164 44 headacheCodes headachecode NNS 10_1101-2021_01_08_425952 164 45 < < XX 10_1101-2021_01_08_425952 164 46 - - : 10_1101-2021_01_08_425952 164 47 medcodeList[1:10 medcodelist[1:10 NN 10_1101-2021_01_08_425952 164 48 ] ] -RRB- 10_1101-2021_01_08_425952 164 49 > > XX 10_1101-2021_01_08_425952 164 50 amitriptylineResult1 amitriptylineresult1 FW 10_1101-2021_01_08_425952 164 51 < < XX 10_1101-2021_01_08_425952 164 52 - - HYPH 10_1101-2021_01_08_425952 164 53 matchDrugWithDisease(clinicalDF matchDrugWithDisease(clinicalDF NNP 10_1101-2021_01_08_425952 164 54 = = -RRB- 10_1101-2021_01_08_425952 164 55 testClinicalDF testClinicalDF NNP 10_1101-2021_01_08_425952 164 56 , , , 10_1101-2021_01_08_425952 164 57 + + CC 10_1101-2021_01_08_425952 164 58 therapyDF therapyDF NNP 10_1101-2021_01_08_425952 164 59 = = SYM 10_1101-2021_01_08_425952 164 60 testTherapyDF testTherapyDF NNS 10_1101-2021_01_08_425952 164 61 , , , 10_1101-2021_01_08_425952 164 62 + + CC 10_1101-2021_01_08_425952 164 63 medcodeList medcodeList NNS 10_1101-2021_01_08_425952 164 64 = = SYM 10_1101-2021_01_08_425952 164 65 headacheCodes headachecode NNS 10_1101-2021_01_08_425952 164 66 , , , 10_1101-2021_01_08_425952 164 67 + + CC 10_1101-2021_01_08_425952 164 68 drugcodeList drugcodelist NN 10_1101-2021_01_08_425952 164 69 = = NFP 10_1101-2021_01_08_425952 164 70 amitriptylineCodes amitriptylinecode NNS 10_1101-2021_01_08_425952 164 71 , , , 10_1101-2021_01_08_425952 164 72 + + CC 10_1101-2021_01_08_425952 164 73 severity severity NN 10_1101-2021_01_08_425952 164 74 = = SYM 10_1101-2021_01_08_425952 164 75 1 1 CD 10_1101-2021_01_08_425952 164 76 ) ) -RRB- 10_1101-2021_01_08_425952 164 77 > > XX 10_1101-2021_01_08_425952 164 78 amitriptylineResult2 amitriptylineResult2 NNP 10_1101-2021_01_08_425952 164 79 < < XX 10_1101-2021_01_08_425952 164 80 - - HYPH 10_1101-2021_01_08_425952 164 81 matchDrugWithDisease(clinicalDF matchDrugWithDisease(clinicalDF NNP 10_1101-2021_01_08_425952 164 82 = = -RRB- 10_1101-2021_01_08_425952 164 83 testClinicalDF testClinicalDF NNP 10_1101-2021_01_08_425952 164 84 , , , 10_1101-2021_01_08_425952 164 85 + + CC 10_1101-2021_01_08_425952 164 86 therapyDF therapyDF NNP 10_1101-2021_01_08_425952 164 87 = = SYM 10_1101-2021_01_08_425952 164 88 testTherapyDF testTherapyDF NNS 10_1101-2021_01_08_425952 164 89 , , , 10_1101-2021_01_08_425952 164 90 + + CC 10_1101-2021_01_08_425952 164 91 medcodeList medcodeList NNS 10_1101-2021_01_08_425952 164 92 = = SYM 10_1101-2021_01_08_425952 164 93 headacheCodes headachecode NNS 10_1101-2021_01_08_425952 164 94 , , , 10_1101-2021_01_08_425952 164 95 + + CC 10_1101-2021_01_08_425952 164 96 drugcodeList drugcodelist NN 10_1101-2021_01_08_425952 164 97 = = NFP 10_1101-2021_01_08_425952 164 98 amitriptylineCodes amitriptylinecode NNS 10_1101-2021_01_08_425952 164 99 , , , 10_1101-2021_01_08_425952 164 100 + + CC 10_1101-2021_01_08_425952 164 101 severity severity NN 10_1101-2021_01_08_425952 164 102 = = SYM 10_1101-2021_01_08_425952 164 103 2 2 LS 10_1101-2021_01_08_425952 164 104 ) ) -RRB- 10_1101-2021_01_08_425952 164 105 > > XX 10_1101-2021_01_08_425952 164 106 amitriptylineResult3 amitriptylineresult3 RB 10_1101-2021_01_08_425952 164 107 < < XX 10_1101-2021_01_08_425952 164 108 - - HYPH 10_1101-2021_01_08_425952 164 109 matchDrugWithDisease(clinicalDF matchDrugWithDisease(clinicalDF NNP 10_1101-2021_01_08_425952 164 110 = = -RRB- 10_1101-2021_01_08_425952 164 111 testClinicalDF testClinicalDF NNP 10_1101-2021_01_08_425952 164 112 , , , 10_1101-2021_01_08_425952 164 113 + + CC 10_1101-2021_01_08_425952 164 114 therapyDF therapyDF NNP 10_1101-2021_01_08_425952 164 115 = = SYM 10_1101-2021_01_08_425952 164 116 testTherapyDF testTherapyDF NNS 10_1101-2021_01_08_425952 164 117 , , , 10_1101-2021_01_08_425952 164 118 + + CC 10_1101-2021_01_08_425952 164 119 medcodeList medcodeList NNS 10_1101-2021_01_08_425952 164 120 = = SYM 10_1101-2021_01_08_425952 164 121 headacheCodes headachecode NNS 10_1101-2021_01_08_425952 164 122 , , , 10_1101-2021_01_08_425952 164 123 .CC .CC : 10_1101-2021_01_08_425952 164 124 - - : 10_1101-2021_01_08_425952 164 125 BY by IN 10_1101-2021_01_08_425952 164 126 - - HYPH 10_1101-2021_01_08_425952 164 127 ND ND NNP 10_1101-2021_01_08_425952 164 128 4.0 4.0 CD 10_1101-2021_01_08_425952 164 129 International international JJ 10_1101-2021_01_08_425952 164 130 licensemade licensemade NN 10_1101-2021_01_08_425952 164 131 available available JJ 10_1101-2021_01_08_425952 164 132 under under IN 10_1101-2021_01_08_425952 164 133 a a DT 10_1101-2021_01_08_425952 164 134 ( ( -LRB- 10_1101-2021_01_08_425952 164 135 which which WDT 10_1101-2021_01_08_425952 164 136 was be VBD 10_1101-2021_01_08_425952 164 137 not not RB 10_1101-2021_01_08_425952 164 138 certified certify VBN 10_1101-2021_01_08_425952 164 139 by by IN 10_1101-2021_01_08_425952 164 140 peer peer NN 10_1101-2021_01_08_425952 164 141 review review NN 10_1101-2021_01_08_425952 164 142 ) ) -RRB- 10_1101-2021_01_08_425952 164 143 is be VBZ 10_1101-2021_01_08_425952 164 144 the the DT 10_1101-2021_01_08_425952 164 145 author author NN 10_1101-2021_01_08_425952 164 146 / / SYM 10_1101-2021_01_08_425952 164 147 funder funder NN 10_1101-2021_01_08_425952 164 148 , , , 10_1101-2021_01_08_425952 164 149 who who WP 10_1101-2021_01_08_425952 164 150 has have VBZ 10_1101-2021_01_08_425952 164 151 granted grant VBN 10_1101-2021_01_08_425952 164 152 bioRxiv biorxiv IN 10_1101-2021_01_08_425952 164 153 a a DT 10_1101-2021_01_08_425952 164 154 license license NN 10_1101-2021_01_08_425952 164 155 to to TO 10_1101-2021_01_08_425952 164 156 display display VB 10_1101-2021_01_08_425952 164 157 the the DT 10_1101-2021_01_08_425952 164 158 preprint preprint NN 10_1101-2021_01_08_425952 164 159 in in IN 10_1101-2021_01_08_425952 164 160 perpetuity perpetuity NN 10_1101-2021_01_08_425952 164 161 . . . 10_1101-2021_01_08_425952 165 1 It -PRON- PRP 10_1101-2021_01_08_425952 165 2 is be VBZ 10_1101-2021_01_08_425952 165 3 The the DT 10_1101-2021_01_08_425952 165 4 copyright copyright NN 10_1101-2021_01_08_425952 165 5 holder holder NN 10_1101-2021_01_08_425952 165 6 for for IN 10_1101-2021_01_08_425952 165 7 this this DT 10_1101-2021_01_08_425952 165 8 preprintthis preprintthis NN 10_1101-2021_01_08_425952 165 9 version version NN 10_1101-2021_01_08_425952 165 10 posted post VBD 10_1101-2021_01_08_425952 165 11 January January NNP 10_1101-2021_01_08_425952 165 12 9 9 CD 10_1101-2021_01_08_425952 165 13 , , , 10_1101-2021_01_08_425952 165 14 2021 2021 CD 10_1101-2021_01_08_425952 165 15 . . . 10_1101-2021_01_08_425952 165 16 ; ; : 10_1101-2021_01_08_425952 165 17 https://doi.org/10.1101/2021.01.08.425952doi https://doi.org/10.1101/2021.01.08.425952doi ADD 10_1101-2021_01_08_425952 165 18 : : : 10_1101-2021_01_08_425952 165 19 bioRxiv biorxiv IN 10_1101-2021_01_08_425952 165 20 preprint preprint NN 10_1101-2021_01_08_425952 165 21 https://doi.org/10.1101/2021.01.08.425952 https://doi.org/10.1101/2021.01.08.425952 NN 10_1101-2021_01_08_425952 165 22 http://creativecommons.org/licenses/by-nd/4.0/ http://creativecommons.org/licenses/by-nd/4.0/ NN 10_1101-2021_01_08_425952 165 23 12 12 CD 10_1101-2021_01_08_425952 165 24 rdrugtrajectory rdrugtrajectory NN 10_1101-2021_01_08_425952 165 25 : : : 10_1101-2021_01_08_425952 165 26 Analysing Analysing NNP 10_1101-2021_01_08_425952 165 27 Drug Drug NNP 10_1101-2021_01_08_425952 165 28 Prescriptions Prescriptions NNPS 10_1101-2021_01_08_425952 165 29 in in IN 10_1101-2021_01_08_425952 165 30 Electronic Electronic NNP 10_1101-2021_01_08_425952 165 31 Health Health NNP 10_1101-2021_01_08_425952 165 32 Care Care NNP 10_1101-2021_01_08_425952 165 33 Records Records NNPS 10_1101-2021_01_08_425952 165 34 + + SYM 10_1101-2021_01_08_425952 165 35 drugcodeList drugcodelist NN 10_1101-2021_01_08_425952 165 36 = = NFP 10_1101-2021_01_08_425952 165 37 amitriptylineCodes amitriptylinecode NNS 10_1101-2021_01_08_425952 165 38 , , , 10_1101-2021_01_08_425952 165 39 + + CC 10_1101-2021_01_08_425952 165 40 severity severity NN 10_1101-2021_01_08_425952 165 41 = = SYM 10_1101-2021_01_08_425952 165 42 3 3 CD 10_1101-2021_01_08_425952 165 43 ) ) -RRB- 10_1101-2021_01_08_425952 165 44 > > NFP 10_1101-2021_01_08_425952 165 45 propranololResult1 propranololResult1 NNP 10_1101-2021_01_08_425952 165 46 < < XX 10_1101-2021_01_08_425952 165 47 - - HYPH 10_1101-2021_01_08_425952 165 48 matchDrugWithDisease(clinicalDF matchDrugWithDisease(clinicalDF NNP 10_1101-2021_01_08_425952 165 49 = = -RRB- 10_1101-2021_01_08_425952 165 50 testClinicalDF testClinicalDF NNP 10_1101-2021_01_08_425952 165 51 , , , 10_1101-2021_01_08_425952 165 52 + + CC 10_1101-2021_01_08_425952 165 53 therapyDF therapyDF NNP 10_1101-2021_01_08_425952 165 54 = = SYM 10_1101-2021_01_08_425952 165 55 testTherapyDF testTherapyDF NNS 10_1101-2021_01_08_425952 165 56 , , , 10_1101-2021_01_08_425952 165 57 + + CC 10_1101-2021_01_08_425952 165 58 medcodeList medcodeList NNS 10_1101-2021_01_08_425952 165 59 = = SYM 10_1101-2021_01_08_425952 165 60 headacheCodes headachecode NNS 10_1101-2021_01_08_425952 165 61 , , , 10_1101-2021_01_08_425952 165 62 + + CC 10_1101-2021_01_08_425952 165 63 drugcodeList drugcodeList NNS 10_1101-2021_01_08_425952 165 64 = = NFP 10_1101-2021_01_08_425952 165 65 propranololCodes propranololcode NNS 10_1101-2021_01_08_425952 165 66 , , , 10_1101-2021_01_08_425952 165 67 + + CC 10_1101-2021_01_08_425952 165 68 severity severity NN 10_1101-2021_01_08_425952 165 69 = = SYM 10_1101-2021_01_08_425952 165 70 1 1 CD 10_1101-2021_01_08_425952 165 71 ) ) -RRB- 10_1101-2021_01_08_425952 165 72 > > XX 10_1101-2021_01_08_425952 165 73 propranololResult2 propranololResult2 NNP 10_1101-2021_01_08_425952 165 74 < < XX 10_1101-2021_01_08_425952 165 75 - - HYPH 10_1101-2021_01_08_425952 165 76 matchDrugWithDisease(clinicalDF matchDrugWithDisease(clinicalDF NNP 10_1101-2021_01_08_425952 165 77 = = -RRB- 10_1101-2021_01_08_425952 165 78 testClinicalDF testClinicalDF NNP 10_1101-2021_01_08_425952 165 79 , , , 10_1101-2021_01_08_425952 165 80 + + CC 10_1101-2021_01_08_425952 165 81 therapyDF therapyDF NNP 10_1101-2021_01_08_425952 165 82 = = SYM 10_1101-2021_01_08_425952 165 83 testTherapyDF testTherapyDF NNS 10_1101-2021_01_08_425952 165 84 , , , 10_1101-2021_01_08_425952 165 85 + + CC 10_1101-2021_01_08_425952 165 86 medcodeList medcodeList NNS 10_1101-2021_01_08_425952 165 87 = = SYM 10_1101-2021_01_08_425952 165 88 headacheCodes headachecode NNS 10_1101-2021_01_08_425952 165 89 , , , 10_1101-2021_01_08_425952 165 90 + + CC 10_1101-2021_01_08_425952 165 91 drugcodeList drugcodeList NNS 10_1101-2021_01_08_425952 165 92 = = NFP 10_1101-2021_01_08_425952 165 93 propranololCodes propranololcode NNS 10_1101-2021_01_08_425952 165 94 , , , 10_1101-2021_01_08_425952 165 95 + + CC 10_1101-2021_01_08_425952 165 96 severity severity NN 10_1101-2021_01_08_425952 165 97 = = SYM 10_1101-2021_01_08_425952 165 98 2 2 CD 10_1101-2021_01_08_425952 165 99 ) ) -RRB- 10_1101-2021_01_08_425952 165 100 > > XX 10_1101-2021_01_08_425952 165 101 propranololResult3 propranololresult3 NN 10_1101-2021_01_08_425952 165 102 < < XX 10_1101-2021_01_08_425952 165 103 - - HYPH 10_1101-2021_01_08_425952 165 104 matchDrugWithDisease(clinicalDF matchDrugWithDisease(clinicalDF NNP 10_1101-2021_01_08_425952 165 105 = = -RRB- 10_1101-2021_01_08_425952 165 106 testClinicalDF testClinicalDF NNP 10_1101-2021_01_08_425952 165 107 , , , 10_1101-2021_01_08_425952 165 108 + + CC 10_1101-2021_01_08_425952 165 109 therapyDF therapyDF NNP 10_1101-2021_01_08_425952 165 110 = = SYM 10_1101-2021_01_08_425952 165 111 testTherapyDF testTherapyDF NNS 10_1101-2021_01_08_425952 165 112 , , , 10_1101-2021_01_08_425952 165 113 + + CC 10_1101-2021_01_08_425952 165 114 medcodeList medcodeList NNS 10_1101-2021_01_08_425952 165 115 = = SYM 10_1101-2021_01_08_425952 165 116 headacheCodes headachecode NNS 10_1101-2021_01_08_425952 165 117 , , , 10_1101-2021_01_08_425952 165 118 + + CC 10_1101-2021_01_08_425952 165 119 drugcodeList drugcodeList NNS 10_1101-2021_01_08_425952 165 120 = = NFP 10_1101-2021_01_08_425952 165 121 propranololCodes propranololcode NNS 10_1101-2021_01_08_425952 165 122 , , , 10_1101-2021_01_08_425952 165 123 + + CC 10_1101-2021_01_08_425952 165 124 severity severity NN 10_1101-2021_01_08_425952 165 125 = = SYM 10_1101-2021_01_08_425952 165 126 3 3 CD 10_1101-2021_01_08_425952 165 127 ) ) -RRB- 10_1101-2021_01_08_425952 165 128 getGenderOfPatients getgenderofpatients LS 10_1101-2021_01_08_425952 165 129 The the DT 10_1101-2021_01_08_425952 165 130 example example NN 10_1101-2021_01_08_425952 165 131 presented present VBD 10_1101-2021_01_08_425952 165 132 , , , 10_1101-2021_01_08_425952 165 133 demonstrates demonstrate VBZ 10_1101-2021_01_08_425952 165 134 how how WRB 10_1101-2021_01_08_425952 165 135 to to TO 10_1101-2021_01_08_425952 165 136 identify identify VB 10_1101-2021_01_08_425952 165 137 patients patient NNS 10_1101-2021_01_08_425952 165 138 prescribed prescribe VBN 10_1101-2021_01_08_425952 165 139 amitriptyline amitriptyline NN 10_1101-2021_01_08_425952 165 140 and and CC 10_1101-2021_01_08_425952 165 141 patients patient NNS 10_1101-2021_01_08_425952 165 142 prescribed prescribe VBD 10_1101-2021_01_08_425952 165 143 propranolol propranolol NNP 10_1101-2021_01_08_425952 165 144 ( ( -LRB- 10_1101-2021_01_08_425952 165 145 there there EX 10_1101-2021_01_08_425952 165 146 is be VBZ 10_1101-2021_01_08_425952 165 147 patient patient JJ 10_1101-2021_01_08_425952 165 148 overlap overlap NN 10_1101-2021_01_08_425952 165 149 , , , 10_1101-2021_01_08_425952 165 150 easily easily RB 10_1101-2021_01_08_425952 165 151 controlled control VBN 10_1101-2021_01_08_425952 165 152 for for IN 10_1101-2021_01_08_425952 165 153 by by IN 10_1101-2021_01_08_425952 165 154 subsetting subsette VBG 10_1101-2021_01_08_425952 165 155 ) ) -RRB- 10_1101-2021_01_08_425952 165 156 whilst whilst IN 10_1101-2021_01_08_425952 165 157 controlling control VBG 10_1101-2021_01_08_425952 165 158 for for IN 10_1101-2021_01_08_425952 165 159 clinical clinical JJ 10_1101-2021_01_08_425952 165 160 overlap overlap NN 10_1101-2021_01_08_425952 165 161 with with IN 10_1101-2021_01_08_425952 165 162 or or CC 10_1101-2021_01_08_425952 165 163 without without IN 10_1101-2021_01_08_425952 165 164 consideration consideration NN 10_1101-2021_01_08_425952 165 165 for for IN 10_1101-2021_01_08_425952 165 166 off off IN 10_1101-2021_01_08_425952 165 167 topic topic JJ 10_1101-2021_01_08_425952 165 168 clinical clinical JJ 10_1101-2021_01_08_425952 165 169 events event NNS 10_1101-2021_01_08_425952 165 170 . . . 10_1101-2021_01_08_425952 166 1 With with IN 10_1101-2021_01_08_425952 166 2 the the DT 10_1101-2021_01_08_425952 166 3 identified identify VBN 10_1101-2021_01_08_425952 166 4 patients patient NNS 10_1101-2021_01_08_425952 166 5 , , , 10_1101-2021_01_08_425952 166 6 we -PRON- PRP 10_1101-2021_01_08_425952 166 7 can can MD 10_1101-2021_01_08_425952 166 8 , , , 10_1101-2021_01_08_425952 166 9 for for IN 10_1101-2021_01_08_425952 166 10 example example NN 10_1101-2021_01_08_425952 166 11 , , , 10_1101-2021_01_08_425952 166 12 stratify stratify NN 10_1101-2021_01_08_425952 166 13 by by IN 10_1101-2021_01_08_425952 166 14 gender gender NN 10_1101-2021_01_08_425952 166 15 : : : 10_1101-2021_01_08_425952 166 16 > > XX 10_1101-2021_01_08_425952 166 17 library(rdrugtrajectory library(rdrugtrajectory NN 10_1101-2021_01_08_425952 166 18 ) ) -RRB- 10_1101-2021_01_08_425952 166 19 > > XX 10_1101-2021_01_08_425952 166 20 library(ggplot2 library(ggplot2 NN 10_1101-2021_01_08_425952 166 21 ) ) -RRB- 10_1101-2021_01_08_425952 166 22 > > XX 10_1101-2021_01_08_425952 166 23 ami1Gender ami1gender XX 10_1101-2021_01_08_425952 166 24 < < XX 10_1101-2021_01_08_425952 166 25 - - HYPH 10_1101-2021_01_08_425952 166 26 getGenderOfPatients(amitriptylineResult1 getgenderofpatients(amitriptylineresult1 JJ 10_1101-2021_01_08_425952 166 27 , , , 10_1101-2021_01_08_425952 166 28 ageGenderDF agegenderdf NN 10_1101-2021_01_08_425952 166 29 ) ) -RRB- 10_1101-2021_01_08_425952 166 30 > > XX 10_1101-2021_01_08_425952 166 31 ami2Gender ami2gender XX 10_1101-2021_01_08_425952 166 32 < < XX 10_1101-2021_01_08_425952 166 33 - - HYPH 10_1101-2021_01_08_425952 166 34 getGenderOfPatients(amitriptylineResult2 getGenderOfPatients(amitriptylineResult2 NNP 10_1101-2021_01_08_425952 166 35 , , , 10_1101-2021_01_08_425952 166 36 ageGenderDF agegenderdf NN 10_1101-2021_01_08_425952 166 37 ) ) -RRB- 10_1101-2021_01_08_425952 166 38 > > XX 10_1101-2021_01_08_425952 166 39 ami3Gender ami3gender XX 10_1101-2021_01_08_425952 166 40 < < XX 10_1101-2021_01_08_425952 166 41 - - HYPH 10_1101-2021_01_08_425952 166 42 getGenderOfPatients(amitriptylineResult3 getGenderOfPatients(amitriptylineResult3 NNP 10_1101-2021_01_08_425952 166 43 , , , 10_1101-2021_01_08_425952 166 44 ageGenderDF agegenderdf NN 10_1101-2021_01_08_425952 166 45 ) ) -RRB- 10_1101-2021_01_08_425952 166 46 > > XX 10_1101-2021_01_08_425952 166 47 prop1Gender prop1Gender NNP 10_1101-2021_01_08_425952 166 48 < < XX 10_1101-2021_01_08_425952 166 49 - - HYPH 10_1101-2021_01_08_425952 166 50 getGenderOfPatients(propranololResult1 getGenderOfPatients(propranololResult1 NNP 10_1101-2021_01_08_425952 166 51 , , , 10_1101-2021_01_08_425952 166 52 ageGenderDF agegenderdf NN 10_1101-2021_01_08_425952 166 53 ) ) -RRB- 10_1101-2021_01_08_425952 166 54 > > XX 10_1101-2021_01_08_425952 166 55 prop2Gender prop2Gender NNP 10_1101-2021_01_08_425952 166 56 < < XX 10_1101-2021_01_08_425952 166 57 - - HYPH 10_1101-2021_01_08_425952 166 58 getGenderOfPatients(propranololResult2 getGenderOfPatients(propranololResult2 NNP 10_1101-2021_01_08_425952 166 59 , , , 10_1101-2021_01_08_425952 166 60 ageGenderDF agegenderdf NN 10_1101-2021_01_08_425952 166 61 ) ) -RRB- 10_1101-2021_01_08_425952 166 62 > > XX 10_1101-2021_01_08_425952 166 63 prop3Gender prop3gender XX 10_1101-2021_01_08_425952 166 64 < < XX 10_1101-2021_01_08_425952 166 65 - - HYPH 10_1101-2021_01_08_425952 166 66 getGenderOfPatients(propranololResult3 getGenderOfPatients(propranololResult3 NNP 10_1101-2021_01_08_425952 166 67 , , , 10_1101-2021_01_08_425952 166 68 ageGenderDF agegenderdf NN 10_1101-2021_01_08_425952 166 69 ) ) -RRB- 10_1101-2021_01_08_425952 166 70 > > XX 10_1101-2021_01_08_425952 166 71 amiDF amiDF `` 10_1101-2021_01_08_425952 166 72 < < XX 10_1101-2021_01_08_425952 166 73 - - HYPH 10_1101-2021_01_08_425952 166 74 data.frame(Freq data.frame(Freq NNP 10_1101-2021_01_08_425952 166 75 = = SYM 10_1101-2021_01_08_425952 166 76 c(nrow(ami1Gender[ami1Gender$gender==1 c(nrow(ami1gender[ami1gender$gender==1 NN 10_1101-2021_01_08_425952 166 77 , , , 10_1101-2021_01_08_425952 166 78 ] ] -RRB- 10_1101-2021_01_08_425952 166 79 ) ) -RRB- 10_1101-2021_01_08_425952 166 80 , , , 10_1101-2021_01_08_425952 166 81 + + CC 10_1101-2021_01_08_425952 166 82 nrow(ami2Gender[ami2Gender$gender==1 nrow(ami2Gender[ami2Gender$gender==1 NNS 10_1101-2021_01_08_425952 166 83 , , , 10_1101-2021_01_08_425952 166 84 ] ] -RRB- 10_1101-2021_01_08_425952 166 85 ) ) -RRB- 10_1101-2021_01_08_425952 166 86 , , , 10_1101-2021_01_08_425952 166 87 + + CC 10_1101-2021_01_08_425952 166 88 nrow(ami3Gender[ami3Gender$gender==1 nrow(ami3Gender[ami3Gender$gender==1 NNS 10_1101-2021_01_08_425952 166 89 , , , 10_1101-2021_01_08_425952 166 90 ] ] -RRB- 10_1101-2021_01_08_425952 166 91 ) ) -RRB- 10_1101-2021_01_08_425952 166 92 , , , 10_1101-2021_01_08_425952 166 93 + + SYM 10_1101-2021_01_08_425952 166 94 nrow(ami1Gender[ami1Gender$gender==2 nrow(ami1Gender[ami1Gender$gender==2 NNP 10_1101-2021_01_08_425952 166 95 , , , 10_1101-2021_01_08_425952 166 96 ] ] -RRB- 10_1101-2021_01_08_425952 166 97 ) ) -RRB- 10_1101-2021_01_08_425952 166 98 , , , 10_1101-2021_01_08_425952 166 99 + + SYM 10_1101-2021_01_08_425952 166 100 nrow(ami2Gender[ami2Gender$gender==2 nrow(ami2Gender[ami2Gender$gender==2 NNS 10_1101-2021_01_08_425952 166 101 , , , 10_1101-2021_01_08_425952 166 102 ] ] -RRB- 10_1101-2021_01_08_425952 166 103 ) ) -RRB- 10_1101-2021_01_08_425952 166 104 , , , 10_1101-2021_01_08_425952 166 105 + + CC 10_1101-2021_01_08_425952 166 106 nrow(ami3Gender[ami3Gender$gender==2 nrow(ami3Gender[ami3Gender$gender==2 NNP 10_1101-2021_01_08_425952 166 107 , , , 10_1101-2021_01_08_425952 166 108 ] ] -RRB- 10_1101-2021_01_08_425952 166 109 ) ) -RRB- 10_1101-2021_01_08_425952 166 110 + + NFP 10_1101-2021_01_08_425952 166 111 ) ) -RRB- 10_1101-2021_01_08_425952 166 112 , , , 10_1101-2021_01_08_425952 166 113 + + NFP 10_1101-2021_01_08_425952 166 114 Search search NN 10_1101-2021_01_08_425952 166 115 = = SYM 10_1101-2021_01_08_425952 166 116 c("Prescribed","With c("Prescribed","With NNP 10_1101-2021_01_08_425952 166 117 headache","No headache","No NNP 10_1101-2021_01_08_425952 166 118 comorbidities comorbidities NNPS 10_1101-2021_01_08_425952 166 119 " " '' 10_1101-2021_01_08_425952 166 120 , , , 10_1101-2021_01_08_425952 166 121 + + CC 10_1101-2021_01_08_425952 166 122 " " `` 10_1101-2021_01_08_425952 166 123 Prescribed","With prescribed","with CD 10_1101-2021_01_08_425952 166 124 headache","No headache","no NN 10_1101-2021_01_08_425952 166 125 comorbidities comorbiditie NNS 10_1101-2021_01_08_425952 166 126 " " '' 10_1101-2021_01_08_425952 166 127 ) ) -RRB- 10_1101-2021_01_08_425952 166 128 , , , 10_1101-2021_01_08_425952 166 129 + + CC 10_1101-2021_01_08_425952 166 130 Drug="Amitriptyline drug="amitriptyline NN 10_1101-2021_01_08_425952 166 131 " " '' 10_1101-2021_01_08_425952 166 132 , , , 10_1101-2021_01_08_425952 166 133 + + CC 10_1101-2021_01_08_425952 166 134 Gender Gender NNP 10_1101-2021_01_08_425952 166 135 = = SYM 10_1101-2021_01_08_425952 166 136 c("Male","Male","Male c("Male","Male","Male NNP 10_1101-2021_01_08_425952 166 137 " " '' 10_1101-2021_01_08_425952 166 138 , , , 10_1101-2021_01_08_425952 166 139 + + CC 10_1101-2021_01_08_425952 166 140 " " `` 10_1101-2021_01_08_425952 166 141 Female","Female","Female Female","Female","Female NNP 10_1101-2021_01_08_425952 166 142 " " '' 10_1101-2021_01_08_425952 166 143 ) ) -RRB- 10_1101-2021_01_08_425952 166 144 + + SYM 10_1101-2021_01_08_425952 166 145 ) ) -RRB- 10_1101-2021_01_08_425952 166 146 .CC .CC : 10_1101-2021_01_08_425952 166 147 - - : 10_1101-2021_01_08_425952 166 148 BY by IN 10_1101-2021_01_08_425952 166 149 - - HYPH 10_1101-2021_01_08_425952 166 150 ND ND NNP 10_1101-2021_01_08_425952 166 151 4.0 4.0 CD 10_1101-2021_01_08_425952 166 152 International international JJ 10_1101-2021_01_08_425952 166 153 licensemade licensemade NN 10_1101-2021_01_08_425952 166 154 available available JJ 10_1101-2021_01_08_425952 166 155 under under IN 10_1101-2021_01_08_425952 166 156 a a DT 10_1101-2021_01_08_425952 166 157 ( ( -LRB- 10_1101-2021_01_08_425952 166 158 which which WDT 10_1101-2021_01_08_425952 166 159 was be VBD 10_1101-2021_01_08_425952 166 160 not not RB 10_1101-2021_01_08_425952 166 161 certified certify VBN 10_1101-2021_01_08_425952 166 162 by by IN 10_1101-2021_01_08_425952 166 163 peer peer NN 10_1101-2021_01_08_425952 166 164 review review NN 10_1101-2021_01_08_425952 166 165 ) ) -RRB- 10_1101-2021_01_08_425952 166 166 is be VBZ 10_1101-2021_01_08_425952 166 167 the the DT 10_1101-2021_01_08_425952 166 168 author author NN 10_1101-2021_01_08_425952 166 169 / / SYM 10_1101-2021_01_08_425952 166 170 funder funder NN 10_1101-2021_01_08_425952 166 171 , , , 10_1101-2021_01_08_425952 166 172 who who WP 10_1101-2021_01_08_425952 166 173 has have VBZ 10_1101-2021_01_08_425952 166 174 granted grant VBN 10_1101-2021_01_08_425952 166 175 bioRxiv biorxiv IN 10_1101-2021_01_08_425952 166 176 a a DT 10_1101-2021_01_08_425952 166 177 license license NN 10_1101-2021_01_08_425952 166 178 to to TO 10_1101-2021_01_08_425952 166 179 display display VB 10_1101-2021_01_08_425952 166 180 the the DT 10_1101-2021_01_08_425952 166 181 preprint preprint NN 10_1101-2021_01_08_425952 166 182 in in IN 10_1101-2021_01_08_425952 166 183 perpetuity perpetuity NN 10_1101-2021_01_08_425952 166 184 . . . 10_1101-2021_01_08_425952 167 1 It -PRON- PRP 10_1101-2021_01_08_425952 167 2 is be VBZ 10_1101-2021_01_08_425952 167 3 The the DT 10_1101-2021_01_08_425952 167 4 copyright copyright NN 10_1101-2021_01_08_425952 167 5 holder holder NN 10_1101-2021_01_08_425952 167 6 for for IN 10_1101-2021_01_08_425952 167 7 this this DT 10_1101-2021_01_08_425952 167 8 preprintthis preprintthis NN 10_1101-2021_01_08_425952 167 9 version version NN 10_1101-2021_01_08_425952 167 10 posted post VBD 10_1101-2021_01_08_425952 167 11 January January NNP 10_1101-2021_01_08_425952 167 12 9 9 CD 10_1101-2021_01_08_425952 167 13 , , , 10_1101-2021_01_08_425952 167 14 2021 2021 CD 10_1101-2021_01_08_425952 167 15 . . . 10_1101-2021_01_08_425952 167 16 ; ; : 10_1101-2021_01_08_425952 167 17 https://doi.org/10.1101/2021.01.08.425952doi https://doi.org/10.1101/2021.01.08.425952doi ADD 10_1101-2021_01_08_425952 167 18 : : : 10_1101-2021_01_08_425952 167 19 bioRxiv biorxiv IN 10_1101-2021_01_08_425952 167 20 preprint preprint NN 10_1101-2021_01_08_425952 167 21 https://doi.org/10.1101/2021.01.08.425952 https://doi.org/10.1101/2021.01.08.425952 XX 10_1101-2021_01_08_425952 167 22 http://creativecommons.org/licenses/by-nd/4.0/ http://creativecommons.org/licenses/by-nd/4.0/ NNP 10_1101-2021_01_08_425952 167 23 Journal Journal NNP 10_1101-2021_01_08_425952 167 24 of of IN 10_1101-2021_01_08_425952 167 25 Statistical Statistical NNP 10_1101-2021_01_08_425952 167 26 Software Software NNP 10_1101-2021_01_08_425952 167 27 13 13 CD 10_1101-2021_01_08_425952 167 28 > > NFP 10_1101-2021_01_08_425952 167 29 propDF propDF NNP 10_1101-2021_01_08_425952 167 30 < < XX 10_1101-2021_01_08_425952 167 31 - - HYPH 10_1101-2021_01_08_425952 167 32 data.frame(Freq data.frame(Freq NNS 10_1101-2021_01_08_425952 167 33 = = SYM 10_1101-2021_01_08_425952 167 34 c(nrow(prop1Gender[prop1Gender$gender==1 c(nrow(prop1gender[prop1gender$gender==1 NN 10_1101-2021_01_08_425952 167 35 , , , 10_1101-2021_01_08_425952 167 36 ] ] -RRB- 10_1101-2021_01_08_425952 167 37 ) ) -RRB- 10_1101-2021_01_08_425952 167 38 , , , 10_1101-2021_01_08_425952 167 39 + + SYM 10_1101-2021_01_08_425952 167 40 nrow(prop2Gender[prop2Gender$gender==1 nrow(prop2gender[prop2gender$gender==1 CD 10_1101-2021_01_08_425952 167 41 , , , 10_1101-2021_01_08_425952 167 42 ] ] -RRB- 10_1101-2021_01_08_425952 167 43 ) ) -RRB- 10_1101-2021_01_08_425952 167 44 , , , 10_1101-2021_01_08_425952 167 45 + + CC 10_1101-2021_01_08_425952 167 46 nrow(prop3Gender[prop3Gender$gender==1 nrow(prop3gender[prop3gender$gender==1 CD 10_1101-2021_01_08_425952 167 47 , , , 10_1101-2021_01_08_425952 167 48 ] ] -RRB- 10_1101-2021_01_08_425952 167 49 ) ) -RRB- 10_1101-2021_01_08_425952 167 50 , , , 10_1101-2021_01_08_425952 167 51 + + CC 10_1101-2021_01_08_425952 167 52 nrow(prop1Gender[prop1Gender$gender==2 nrow(prop1gender[prop1gender$gender==2 CD 10_1101-2021_01_08_425952 167 53 , , , 10_1101-2021_01_08_425952 167 54 ] ] -RRB- 10_1101-2021_01_08_425952 167 55 ) ) -RRB- 10_1101-2021_01_08_425952 167 56 , , , 10_1101-2021_01_08_425952 167 57 + + CC 10_1101-2021_01_08_425952 167 58 nrow(prop2Gender[prop2Gender$gender==2 nrow(prop2gender[prop2gender$gender==2 CD 10_1101-2021_01_08_425952 167 59 , , , 10_1101-2021_01_08_425952 167 60 ] ] -RRB- 10_1101-2021_01_08_425952 167 61 ) ) -RRB- 10_1101-2021_01_08_425952 167 62 , , , 10_1101-2021_01_08_425952 167 63 + + CC 10_1101-2021_01_08_425952 167 64 nrow(prop3Gender[prop3Gender$gender==2 nrow(prop3gender[prop3gender$gender==2 CD 10_1101-2021_01_08_425952 167 65 , , , 10_1101-2021_01_08_425952 167 66 ] ] -RRB- 10_1101-2021_01_08_425952 167 67 ) ) -RRB- 10_1101-2021_01_08_425952 167 68 + + NFP 10_1101-2021_01_08_425952 167 69 ) ) -RRB- 10_1101-2021_01_08_425952 167 70 , , , 10_1101-2021_01_08_425952 167 71 + + NFP 10_1101-2021_01_08_425952 167 72 Search Search NNP 10_1101-2021_01_08_425952 167 73 = = SYM 10_1101-2021_01_08_425952 167 74 c("At c("At VBZ 10_1101-2021_01_08_425952 167 75 any any DT 10_1101-2021_01_08_425952 167 76 time","With time","With NNP 10_1101-2021_01_08_425952 167 77 clinical","Clinical clinical","Clinical NNP 10_1101-2021_01_08_425952 167 78 & & CC 10_1101-2021_01_08_425952 167 79 No no DT 10_1101-2021_01_08_425952 167 80 comorbidities comorbiditie NNS 10_1101-2021_01_08_425952 167 81 " " '' 10_1101-2021_01_08_425952 167 82 , , , 10_1101-2021_01_08_425952 167 83 + + CC 10_1101-2021_01_08_425952 167 84 " " `` 10_1101-2021_01_08_425952 167 85 At at IN 10_1101-2021_01_08_425952 167 86 any any DT 10_1101-2021_01_08_425952 167 87 time","With time","With NNP 10_1101-2021_01_08_425952 167 88 clinical","Clinical clinical","Clinical NNP 10_1101-2021_01_08_425952 167 89 & & CC 10_1101-2021_01_08_425952 167 90 No no DT 10_1101-2021_01_08_425952 167 91 comorbidities comorbiditie NNS 10_1101-2021_01_08_425952 167 92 " " '' 10_1101-2021_01_08_425952 167 93 ) ) -RRB- 10_1101-2021_01_08_425952 167 94 , , , 10_1101-2021_01_08_425952 167 95 + + CC 10_1101-2021_01_08_425952 167 96 Drug="Propranolol drug="propranolol NN 10_1101-2021_01_08_425952 167 97 " " '' 10_1101-2021_01_08_425952 167 98 , , , 10_1101-2021_01_08_425952 167 99 + + CC 10_1101-2021_01_08_425952 167 100 Gender Gender NNP 10_1101-2021_01_08_425952 167 101 = = SYM 10_1101-2021_01_08_425952 167 102 c("Male","Male","Male c("Male","Male","Male NNP 10_1101-2021_01_08_425952 167 103 " " '' 10_1101-2021_01_08_425952 167 104 , , , 10_1101-2021_01_08_425952 167 105 + + CC 10_1101-2021_01_08_425952 167 106 " " `` 10_1101-2021_01_08_425952 167 107 Female","Female","Female Female","Female","Female NNP 10_1101-2021_01_08_425952 167 108 " " '' 10_1101-2021_01_08_425952 167 109 ) ) -RRB- 10_1101-2021_01_08_425952 167 110 + + NFP 10_1101-2021_01_08_425952 167 111 ) ) -RRB- 10_1101-2021_01_08_425952 167 112 > > XX 10_1101-2021_01_08_425952 167 113 drugPrescriptionDF drugPrescriptionDF NNP 10_1101-2021_01_08_425952 167 114 < < XX 10_1101-2021_01_08_425952 167 115 - - HYPH 10_1101-2021_01_08_425952 167 116 rbind(amiDF rbind(amiDF NNP 10_1101-2021_01_08_425952 167 117 , , , 10_1101-2021_01_08_425952 167 118 propDF propDF NNP 10_1101-2021_01_08_425952 167 119 ) ) -RRB- 10_1101-2021_01_08_425952 167 120 > > XX 10_1101-2021_01_08_425952 167 121 ggPrescriptionAmi ggPrescriptionAmi NNP 10_1101-2021_01_08_425952 167 122 < < XX 10_1101-2021_01_08_425952 167 123 - - HYPH 10_1101-2021_01_08_425952 167 124 ggplot(drugPrescriptionDF ggplot(drugPrescriptionDF NNP 10_1101-2021_01_08_425952 167 125 [ [ -LRB- 10_1101-2021_01_08_425952 167 126 + + CC 10_1101-2021_01_08_425952 167 127 drugPrescriptionDF$Drug=="Amitriptyline drugPrescriptionDF$Drug=="Amitriptyline NNPS 10_1101-2021_01_08_425952 167 128 " " '' 10_1101-2021_01_08_425952 167 129 , , , 10_1101-2021_01_08_425952 167 130 ] ] -RRB- 10_1101-2021_01_08_425952 167 131 , , , 10_1101-2021_01_08_425952 167 132 + + CC 10_1101-2021_01_08_425952 167 133 aes(x aes(x NN 10_1101-2021_01_08_425952 167 134 = = SYM 10_1101-2021_01_08_425952 167 135 Search Search NNP 10_1101-2021_01_08_425952 167 136 , , , 10_1101-2021_01_08_425952 167 137 y y NNP 10_1101-2021_01_08_425952 167 138 = = -RRB- 10_1101-2021_01_08_425952 167 139 Freq Freq NNP 10_1101-2021_01_08_425952 167 140 , , , 10_1101-2021_01_08_425952 167 141 fill fill VB 10_1101-2021_01_08_425952 167 142 = = -RRB- 10_1101-2021_01_08_425952 167 143 Gender gender NN 10_1101-2021_01_08_425952 167 144 ) ) -RRB- 10_1101-2021_01_08_425952 167 145 ) ) -RRB- 10_1101-2021_01_08_425952 167 146 + + CD 10_1101-2021_01_08_425952 167 147 + + SYM 10_1101-2021_01_08_425952 167 148 geom_bar(stat="identity geom_bar(stat="identity NN 10_1101-2021_01_08_425952 167 149 " " '' 10_1101-2021_01_08_425952 167 150 , , , 10_1101-2021_01_08_425952 167 151 position position NN 10_1101-2021_01_08_425952 167 152 = = SYM 10_1101-2021_01_08_425952 167 153 position_dodge position_dodge NNP 10_1101-2021_01_08_425952 167 154 ( ( -LRB- 10_1101-2021_01_08_425952 167 155 ) ) -RRB- 10_1101-2021_01_08_425952 167 156 ) ) -RRB- 10_1101-2021_01_08_425952 167 157 + + NFP 10_1101-2021_01_08_425952 167 158 + + NFP 10_1101-2021_01_08_425952 167 159 theme_bw theme_bw NNP 10_1101-2021_01_08_425952 167 160 ( ( -LRB- 10_1101-2021_01_08_425952 167 161 ) ) -RRB- 10_1101-2021_01_08_425952 167 162 + + CC 10_1101-2021_01_08_425952 167 163 xlab("Search xlab("search NN 10_1101-2021_01_08_425952 167 164 critera critera NNP 10_1101-2021_01_08_425952 167 165 ( ( -LRB- 10_1101-2021_01_08_425952 167 166 severity severity NN 10_1101-2021_01_08_425952 167 167 ) ) -RRB- 10_1101-2021_01_08_425952 167 168 " " '' 10_1101-2021_01_08_425952 167 169 ) ) -RRB- 10_1101-2021_01_08_425952 167 170 + + CC 10_1101-2021_01_08_425952 167 171 ylab("Patient ylab("patient NN 10_1101-2021_01_08_425952 167 172 count count NN 10_1101-2021_01_08_425952 167 173 " " '' 10_1101-2021_01_08_425952 167 174 ) ) -RRB- 10_1101-2021_01_08_425952 167 175 + + CD 10_1101-2021_01_08_425952 167 176 + + SYM 10_1101-2021_01_08_425952 167 177 theme(axis.text.x theme(axis.text.x XX 10_1101-2021_01_08_425952 167 178 = = SYM 10_1101-2021_01_08_425952 167 179 element_text(angle=45,hjust=1 element_text(angle=45,hjust=1 ADD 10_1101-2021_01_08_425952 167 180 ) ) -RRB- 10_1101-2021_01_08_425952 167 181 ) ) -RRB- 10_1101-2021_01_08_425952 167 182 + + CC 10_1101-2021_01_08_425952 167 183 + + CC 10_1101-2021_01_08_425952 167 184 ggtitle("Amitriptyline ggtitle("amitriptyline NN 10_1101-2021_01_08_425952 167 185 " " '' 10_1101-2021_01_08_425952 167 186 ) ) -RRB- 10_1101-2021_01_08_425952 167 187 > > XX 10_1101-2021_01_08_425952 167 188 ggPrescriptionProp ggPrescriptionProp NNP 10_1101-2021_01_08_425952 167 189 < < NNP 10_1101-2021_01_08_425952 167 190 - - HYPH 10_1101-2021_01_08_425952 167 191 ggplot(drugPrescriptionDF ggplot(drugPrescriptionDF NNP 10_1101-2021_01_08_425952 167 192 [ [ -LRB- 10_1101-2021_01_08_425952 167 193 + + CC 10_1101-2021_01_08_425952 167 194 drugPrescriptionDF$Drug=="Propranolol drugPrescriptionDF$Drug=="Propranolol NNS 10_1101-2021_01_08_425952 167 195 " " '' 10_1101-2021_01_08_425952 167 196 , , , 10_1101-2021_01_08_425952 167 197 ] ] -RRB- 10_1101-2021_01_08_425952 167 198 , , , 10_1101-2021_01_08_425952 167 199 + + CC 10_1101-2021_01_08_425952 167 200 aes(x aes(x NN 10_1101-2021_01_08_425952 167 201 = = SYM 10_1101-2021_01_08_425952 167 202 Search Search NNP 10_1101-2021_01_08_425952 167 203 , , , 10_1101-2021_01_08_425952 167 204 y y NNP 10_1101-2021_01_08_425952 167 205 = = -RRB- 10_1101-2021_01_08_425952 167 206 Freq Freq NNP 10_1101-2021_01_08_425952 167 207 , , , 10_1101-2021_01_08_425952 167 208 fill fill VB 10_1101-2021_01_08_425952 167 209 = = -RRB- 10_1101-2021_01_08_425952 167 210 Gender gender NN 10_1101-2021_01_08_425952 167 211 ) ) -RRB- 10_1101-2021_01_08_425952 167 212 ) ) -RRB- 10_1101-2021_01_08_425952 167 213 + + CD 10_1101-2021_01_08_425952 167 214 + + SYM 10_1101-2021_01_08_425952 167 215 geom_bar(stat="identity geom_bar(stat="identity NN 10_1101-2021_01_08_425952 167 216 " " '' 10_1101-2021_01_08_425952 167 217 , , , 10_1101-2021_01_08_425952 167 218 position position NN 10_1101-2021_01_08_425952 167 219 = = SYM 10_1101-2021_01_08_425952 167 220 position_dodge position_dodge NNP 10_1101-2021_01_08_425952 167 221 ( ( -LRB- 10_1101-2021_01_08_425952 167 222 ) ) -RRB- 10_1101-2021_01_08_425952 167 223 ) ) -RRB- 10_1101-2021_01_08_425952 167 224 + + NFP 10_1101-2021_01_08_425952 167 225 + + NFP 10_1101-2021_01_08_425952 167 226 theme_bw theme_bw NNP 10_1101-2021_01_08_425952 167 227 ( ( -LRB- 10_1101-2021_01_08_425952 167 228 ) ) -RRB- 10_1101-2021_01_08_425952 167 229 + + CC 10_1101-2021_01_08_425952 167 230 xlab("Search xlab("search NN 10_1101-2021_01_08_425952 167 231 critera critera NNP 10_1101-2021_01_08_425952 167 232 ( ( -LRB- 10_1101-2021_01_08_425952 167 233 severity severity NN 10_1101-2021_01_08_425952 167 234 ) ) -RRB- 10_1101-2021_01_08_425952 167 235 " " '' 10_1101-2021_01_08_425952 167 236 ) ) -RRB- 10_1101-2021_01_08_425952 167 237 + + CC 10_1101-2021_01_08_425952 167 238 ylab("Patient ylab("patient NN 10_1101-2021_01_08_425952 167 239 count count NN 10_1101-2021_01_08_425952 167 240 " " '' 10_1101-2021_01_08_425952 167 241 ) ) -RRB- 10_1101-2021_01_08_425952 167 242 + + CD 10_1101-2021_01_08_425952 167 243 + + SYM 10_1101-2021_01_08_425952 167 244 theme(axis.text.x theme(axis.text.x XX 10_1101-2021_01_08_425952 167 245 = = SYM 10_1101-2021_01_08_425952 167 246 element_text(angle=45,hjust=1 element_text(angle=45,hjust=1 ADD 10_1101-2021_01_08_425952 167 247 ) ) -RRB- 10_1101-2021_01_08_425952 167 248 ) ) -RRB- 10_1101-2021_01_08_425952 167 249 + + CC 10_1101-2021_01_08_425952 167 250 + + CC 10_1101-2021_01_08_425952 167 251 ggtitle("Propranolol ggtitle("propranolol NN 10_1101-2021_01_08_425952 167 252 " " '' 10_1101-2021_01_08_425952 167 253 ) ) -RRB- 10_1101-2021_01_08_425952 167 254 > > XX 10_1101-2021_01_08_425952 167 255 Filtering filter VBG 10_1101-2021_01_08_425952 167 256 through through IN 10_1101-2021_01_08_425952 167 257 prescription prescription NN 10_1101-2021_01_08_425952 167 258 events event NNS 10_1101-2021_01_08_425952 167 259 can can MD 10_1101-2021_01_08_425952 167 260 also also RB 10_1101-2021_01_08_425952 167 261 be be VB 10_1101-2021_01_08_425952 167 262 controlled control VBN 10_1101-2021_01_08_425952 167 263 by by IN 10_1101-2021_01_08_425952 167 264 a a DT 10_1101-2021_01_08_425952 167 265 date date NN 10_1101-2021_01_08_425952 167 266 range range NN 10_1101-2021_01_08_425952 167 267 . . . 10_1101-2021_01_08_425952 168 1 For for IN 10_1101-2021_01_08_425952 168 2 example example NN 10_1101-2021_01_08_425952 168 3 , , , 10_1101-2021_01_08_425952 168 4 if if IN 10_1101-2021_01_08_425952 168 5 one one CD 10_1101-2021_01_08_425952 168 6 was be VBD 10_1101-2021_01_08_425952 168 7 calculating calculate VBG 10_1101-2021_01_08_425952 168 8 the the DT 10_1101-2021_01_08_425952 168 9 number number NN 10_1101-2021_01_08_425952 168 10 of of IN 10_1101-2021_01_08_425952 168 11 patients patient NNS 10_1101-2021_01_08_425952 168 12 prescribed prescribe VBD 10_1101-2021_01_08_425952 168 13 amitriptyline amitriptyline NN 10_1101-2021_01_08_425952 168 14 per per IN 10_1101-2021_01_08_425952 168 15 year year NN 10_1101-2021_01_08_425952 168 16 from from IN 10_1101-2021_01_08_425952 168 17 2000 2000 CD 10_1101-2021_01_08_425952 168 18 to to IN 10_1101-2021_01_08_425952 168 19 2004 2004 CD 10_1101-2021_01_08_425952 168 20 and and CC 10_1101-2021_01_08_425952 168 21 matched match VBN 10_1101-2021_01_08_425952 168 22 to to IN 10_1101-2021_01_08_425952 168 23 a a DT 10_1101-2021_01_08_425952 168 24 headache headache NN 10_1101-2021_01_08_425952 168 25 event event NN 10_1101-2021_01_08_425952 168 26 , , , 10_1101-2021_01_08_425952 168 27 one one PRP 10_1101-2021_01_08_425952 168 28 can can MD 10_1101-2021_01_08_425952 168 29 apply apply VB 10_1101-2021_01_08_425952 168 30 a a DT 10_1101-2021_01_08_425952 168 31 date date NN 10_1101-2021_01_08_425952 168 32 range range NN 10_1101-2021_01_08_425952 168 33 : : : 10_1101-2021_01_08_425952 168 34 > > XX 10_1101-2021_01_08_425952 168 35 library(rdrugtrajectory library(rdrugtrajectory NN 10_1101-2021_01_08_425952 168 36 ) ) -RRB- 10_1101-2021_01_08_425952 168 37 > > XX 10_1101-2021_01_08_425952 168 38 library(ggplot2 library(ggplot2 NN 10_1101-2021_01_08_425952 168 39 ) ) -RRB- 10_1101-2021_01_08_425952 168 40 > > XX 10_1101-2021_01_08_425952 168 41 prodcodes prodcode NNS 10_1101-2021_01_08_425952 168 42 < < XX 10_1101-2021_01_08_425952 168 43 - - HYPH 10_1101-2021_01_08_425952 168 44 unique(testTherapyDF$prodcode unique(testTherapyDF$prodcode NNP 10_1101-2021_01_08_425952 168 45 ) ) -RRB- 10_1101-2021_01_08_425952 168 46 > > XX 10_1101-2021_01_08_425952 168 47 amitriptylineCodes amitriptylinecode VBZ 10_1101-2021_01_08_425952 168 48 < < XX 10_1101-2021_01_08_425952 168 49 - - HYPH 10_1101-2021_01_08_425952 168 50 prodcodes[1:5 prodcodes[1:5 NNP 10_1101-2021_01_08_425952 168 51 ] ] -RRB- 10_1101-2021_01_08_425952 168 52 > > NFP 10_1101-2021_01_08_425952 168 53 # # $ 10_1101-2021_01_08_425952 168 54 Clinical clinical JJ 10_1101-2021_01_08_425952 168 55 event event NN 10_1101-2021_01_08_425952 168 56 of of IN 10_1101-2021_01_08_425952 168 57 interest interest NN 10_1101-2021_01_08_425952 168 58 are be VBP 10_1101-2021_01_08_425952 168 59 headaches headache NNS 10_1101-2021_01_08_425952 168 60 . . . 10_1101-2021_01_08_425952 169 1 > > XX 10_1101-2021_01_08_425952 169 2 medcodeList medcodeList NNP 10_1101-2021_01_08_425952 169 3 < < XX 10_1101-2021_01_08_425952 169 4 - - HYPH 10_1101-2021_01_08_425952 169 5 unique(testClinicalDF$medcode unique(testclinicaldf$medcode NN 10_1101-2021_01_08_425952 169 6 ) ) -RRB- 10_1101-2021_01_08_425952 169 7 > > XX 10_1101-2021_01_08_425952 169 8 # # $ 10_1101-2021_01_08_425952 169 9 Medcodes medcode NNS 10_1101-2021_01_08_425952 169 10 can can MD 10_1101-2021_01_08_425952 169 11 be be VB 10_1101-2021_01_08_425952 169 12 refined refine VBN 10_1101-2021_01_08_425952 169 13 further far RBR 10_1101-2021_01_08_425952 169 14 . . . 10_1101-2021_01_08_425952 170 1 > > XX 10_1101-2021_01_08_425952 170 2 headacheCodes headacheCodes NNP 10_1101-2021_01_08_425952 170 3 < < XX 10_1101-2021_01_08_425952 170 4 - - : 10_1101-2021_01_08_425952 170 5 medcodeList[1:10 medcodelist[1:10 NN 10_1101-2021_01_08_425952 170 6 ] ] -RRB- 10_1101-2021_01_08_425952 170 7 > > NFP 10_1101-2021_01_08_425952 170 8 # # NN 10_1101-2021_01_08_425952 170 9 Dataframes dataframe NNS 10_1101-2021_01_08_425952 170 10 defined define VBN 10_1101-2021_01_08_425952 170 11 for for IN 10_1101-2021_01_08_425952 170 12 binned bin VBN 10_1101-2021_01_08_425952 170 13 dates date NNS 10_1101-2021_01_08_425952 170 14 are be VBP 10_1101-2021_01_08_425952 170 15 constructed construct VBN 10_1101-2021_01_08_425952 170 16 by by IN 10_1101-2021_01_08_425952 170 17 providing provide VBG 10_1101-2021_01_08_425952 170 18 all all PDT 10_1101-2021_01_08_425952 170 19 the the DT 10_1101-2021_01_08_425952 170 20 > > XX 10_1101-2021_01_08_425952 170 21 # # NN 10_1101-2021_01_08_425952 170 22 patients patient NNS 10_1101-2021_01_08_425952 170 23 to to TO 10_1101-2021_01_08_425952 170 24 consider consider VB 10_1101-2021_01_08_425952 170 25 and and CC 10_1101-2021_01_08_425952 170 26 the the DT 10_1101-2021_01_08_425952 170 27 binned bin VBN 10_1101-2021_01_08_425952 170 28 start start NN 10_1101-2021_01_08_425952 170 29 and and CC 10_1101-2021_01_08_425952 170 30 stop stop VB 10_1101-2021_01_08_425952 170 31 date date NN 10_1101-2021_01_08_425952 170 32 . . . 10_1101-2021_01_08_425952 171 1 > > XX 10_1101-2021_01_08_425952 171 2 date2000DF date2000DF NNP 10_1101-2021_01_08_425952 171 3 < < XX 10_1101-2021_01_08_425952 171 4 - - HYPH 10_1101-2021_01_08_425952 171 5 data.frame(patid data.frame(patid NNP 10_1101-2021_01_08_425952 171 6 = = SYM 10_1101-2021_01_08_425952 171 7 unlist(getUniquePatidList(testTherapyDF unlist(getUniquePatidList(testTherapyDF NNS 10_1101-2021_01_08_425952 171 8 ) ) -RRB- 10_1101-2021_01_08_425952 171 9 ) ) -RRB- 10_1101-2021_01_08_425952 171 10 , , , 10_1101-2021_01_08_425952 171 11 + + CC 10_1101-2021_01_08_425952 171 12 start start VB 10_1101-2021_01_08_425952 171 13 = = NNS 10_1101-2021_01_08_425952 171 14 as as IN 10_1101-2021_01_08_425952 171 15 . . . 10_1101-2021_01_08_425952 171 16 Date(as.character("2000 Date(as.character("2000 NNP 10_1101-2021_01_08_425952 171 17 - - HYPH 10_1101-2021_01_08_425952 171 18 01 01 CD 10_1101-2021_01_08_425952 171 19 - - HYPH 10_1101-2021_01_08_425952 171 20 01 01 CD 10_1101-2021_01_08_425952 171 21 " " '' 10_1101-2021_01_08_425952 171 22 ) ) -RRB- 10_1101-2021_01_08_425952 171 23 ) ) -RRB- 10_1101-2021_01_08_425952 171 24 , , , 10_1101-2021_01_08_425952 171 25 + + CC 10_1101-2021_01_08_425952 171 26 stop stop VB 10_1101-2021_01_08_425952 171 27 = = NNS 10_1101-2021_01_08_425952 171 28 as as IN 10_1101-2021_01_08_425952 171 29 . . . 10_1101-2021_01_08_425952 171 30 Date(as.character("2000 Date(as.character("2000 NNP 10_1101-2021_01_08_425952 171 31 - - HYPH 10_1101-2021_01_08_425952 171 32 12 12 CD 10_1101-2021_01_08_425952 171 33 - - SYM 10_1101-2021_01_08_425952 171 34 31 31 CD 10_1101-2021_01_08_425952 171 35 " " '' 10_1101-2021_01_08_425952 171 36 ) ) -RRB- 10_1101-2021_01_08_425952 171 37 ) ) -RRB- 10_1101-2021_01_08_425952 171 38 ) ) -RRB- 10_1101-2021_01_08_425952 171 39 .CC .CC NFP 10_1101-2021_01_08_425952 171 40 - - : 10_1101-2021_01_08_425952 171 41 BY by IN 10_1101-2021_01_08_425952 171 42 - - HYPH 10_1101-2021_01_08_425952 171 43 ND ND NNP 10_1101-2021_01_08_425952 171 44 4.0 4.0 CD 10_1101-2021_01_08_425952 171 45 International international JJ 10_1101-2021_01_08_425952 171 46 licensemade licensemade NN 10_1101-2021_01_08_425952 171 47 available available JJ 10_1101-2021_01_08_425952 171 48 under under IN 10_1101-2021_01_08_425952 171 49 a a DT 10_1101-2021_01_08_425952 171 50 ( ( -LRB- 10_1101-2021_01_08_425952 171 51 which which WDT 10_1101-2021_01_08_425952 171 52 was be VBD 10_1101-2021_01_08_425952 171 53 not not RB 10_1101-2021_01_08_425952 171 54 certified certify VBN 10_1101-2021_01_08_425952 171 55 by by IN 10_1101-2021_01_08_425952 171 56 peer peer NN 10_1101-2021_01_08_425952 171 57 review review NN 10_1101-2021_01_08_425952 171 58 ) ) -RRB- 10_1101-2021_01_08_425952 171 59 is be VBZ 10_1101-2021_01_08_425952 171 60 the the DT 10_1101-2021_01_08_425952 171 61 author author NN 10_1101-2021_01_08_425952 171 62 / / SYM 10_1101-2021_01_08_425952 171 63 funder funder NN 10_1101-2021_01_08_425952 171 64 , , , 10_1101-2021_01_08_425952 171 65 who who WP 10_1101-2021_01_08_425952 171 66 has have VBZ 10_1101-2021_01_08_425952 171 67 granted grant VBN 10_1101-2021_01_08_425952 171 68 bioRxiv biorxiv IN 10_1101-2021_01_08_425952 171 69 a a DT 10_1101-2021_01_08_425952 171 70 license license NN 10_1101-2021_01_08_425952 171 71 to to TO 10_1101-2021_01_08_425952 171 72 display display VB 10_1101-2021_01_08_425952 171 73 the the DT 10_1101-2021_01_08_425952 171 74 preprint preprint NN 10_1101-2021_01_08_425952 171 75 in in IN 10_1101-2021_01_08_425952 171 76 perpetuity perpetuity NN 10_1101-2021_01_08_425952 171 77 . . . 10_1101-2021_01_08_425952 172 1 It -PRON- PRP 10_1101-2021_01_08_425952 172 2 is be VBZ 10_1101-2021_01_08_425952 172 3 The the DT 10_1101-2021_01_08_425952 172 4 copyright copyright NN 10_1101-2021_01_08_425952 172 5 holder holder NN 10_1101-2021_01_08_425952 172 6 for for IN 10_1101-2021_01_08_425952 172 7 this this DT 10_1101-2021_01_08_425952 172 8 preprintthis preprintthis NN 10_1101-2021_01_08_425952 172 9 version version NN 10_1101-2021_01_08_425952 172 10 posted post VBD 10_1101-2021_01_08_425952 172 11 January January NNP 10_1101-2021_01_08_425952 172 12 9 9 CD 10_1101-2021_01_08_425952 172 13 , , , 10_1101-2021_01_08_425952 172 14 2021 2021 CD 10_1101-2021_01_08_425952 172 15 . . . 10_1101-2021_01_08_425952 172 16 ; ; : 10_1101-2021_01_08_425952 172 17 https://doi.org/10.1101/2021.01.08.425952doi https://doi.org/10.1101/2021.01.08.425952doi ADD 10_1101-2021_01_08_425952 172 18 : : : 10_1101-2021_01_08_425952 172 19 bioRxiv biorxiv IN 10_1101-2021_01_08_425952 172 20 preprint preprint NN 10_1101-2021_01_08_425952 172 21 https://doi.org/10.1101/2021.01.08.425952 https://doi.org/10.1101/2021.01.08.425952 NN 10_1101-2021_01_08_425952 172 22 http://creativecommons.org/licenses/by-nd/4.0/ http://creativecommons.org/licenses/by-nd/4.0/ NN 10_1101-2021_01_08_425952 172 23 14 14 CD 10_1101-2021_01_08_425952 172 24 rdrugtrajectory rdrugtrajectory NN 10_1101-2021_01_08_425952 172 25 : : : 10_1101-2021_01_08_425952 172 26 Analysing Analysing NNP 10_1101-2021_01_08_425952 172 27 Drug Drug NNP 10_1101-2021_01_08_425952 172 28 Prescriptions Prescriptions NNPS 10_1101-2021_01_08_425952 172 29 in in IN 10_1101-2021_01_08_425952 172 30 Electronic Electronic NNP 10_1101-2021_01_08_425952 172 31 Health Health NNP 10_1101-2021_01_08_425952 172 32 Care Care NNP 10_1101-2021_01_08_425952 172 33 Records Records NNPS 10_1101-2021_01_08_425952 172 34 0 0 NFP 10_1101-2021_01_08_425952 172 35 500 500 CD 10_1101-2021_01_08_425952 172 36 1000 1000 CD 10_1101-2021_01_08_425952 172 37 1500 1500 CD 10_1101-2021_01_08_425952 172 38 2000 2000 CD 10_1101-2021_01_08_425952 172 39 No no DT 10_1101-2021_01_08_425952 172 40 c c NN 10_1101-2021_01_08_425952 172 41 om om NN 10_1101-2021_01_08_425952 172 42 or or CC 10_1101-2021_01_08_425952 172 43 bi bi NNP 10_1101-2021_01_08_425952 172 44 di di NNP 10_1101-2021_01_08_425952 172 45 tie tie VB 10_1101-2021_01_08_425952 172 46 s s NNP 10_1101-2021_01_08_425952 172 47 Pr pr NN 10_1101-2021_01_08_425952 172 48 es es FW 10_1101-2021_01_08_425952 172 49 cr cr FW 10_1101-2021_01_08_425952 172 50 ib ib IN 10_1101-2021_01_08_425952 172 51 ed ed NNP 10_1101-2021_01_08_425952 172 52 W W NNP 10_1101-2021_01_08_425952 172 53 ith ith NNP 10_1101-2021_01_08_425952 172 54 h h NNP 10_1101-2021_01_08_425952 172 55 ea ea NNP 10_1101-2021_01_08_425952 172 56 da da NNP 10_1101-2021_01_08_425952 172 57 ch ch NN 10_1101-2021_01_08_425952 172 58 e e NNP 10_1101-2021_01_08_425952 172 59 Search Search NNP 10_1101-2021_01_08_425952 172 60 critera critera NN 10_1101-2021_01_08_425952 172 61 ( ( -LRB- 10_1101-2021_01_08_425952 172 62 severity severity NN 10_1101-2021_01_08_425952 172 63 ) ) -RRB- 10_1101-2021_01_08_425952 172 64 P p NN 10_1101-2021_01_08_425952 172 65 a a DT 10_1101-2021_01_08_425952 172 66 tie tie NN 10_1101-2021_01_08_425952 172 67 n n IN 10_1101-2021_01_08_425952 172 68 t t NN 10_1101-2021_01_08_425952 172 69 co co NN 10_1101-2021_01_08_425952 172 70 u u NNP 10_1101-2021_01_08_425952 172 71 n n CC 10_1101-2021_01_08_425952 172 72 t t NN 10_1101-2021_01_08_425952 172 73 Gender Gender NNP 10_1101-2021_01_08_425952 172 74 Female Female NNP 10_1101-2021_01_08_425952 172 75 Male male NN 10_1101-2021_01_08_425952 172 76 AmitriptylineA amitriptylinea NN 10_1101-2021_01_08_425952 172 77 0 0 CD 10_1101-2021_01_08_425952 172 78 250 250 CD 10_1101-2021_01_08_425952 172 79 500 500 CD 10_1101-2021_01_08_425952 172 80 750 750 CD 10_1101-2021_01_08_425952 172 81 1000 1000 CD 10_1101-2021_01_08_425952 172 82 At at IN 10_1101-2021_01_08_425952 172 83 a a DT 10_1101-2021_01_08_425952 172 84 ny ny NN 10_1101-2021_01_08_425952 172 85 ti ti NN 10_1101-2021_01_08_425952 172 86 m m NN 10_1101-2021_01_08_425952 172 87 e e NNP 10_1101-2021_01_08_425952 172 88 Cl Cl NNP 10_1101-2021_01_08_425952 172 89 in in IN 10_1101-2021_01_08_425952 172 90 ica ica NNP 10_1101-2021_01_08_425952 172 91 l l NNP 10_1101-2021_01_08_425952 172 92 & & CC 10_1101-2021_01_08_425952 172 93 N N NNP 10_1101-2021_01_08_425952 172 94 o o NNP 10_1101-2021_01_08_425952 172 95 co co NN 10_1101-2021_01_08_425952 172 96 m m NNP 10_1101-2021_01_08_425952 172 97 or or CC 10_1101-2021_01_08_425952 172 98 bi bi NNP 10_1101-2021_01_08_425952 172 99 di di NNP 10_1101-2021_01_08_425952 172 100 tie tie VB 10_1101-2021_01_08_425952 172 101 s s NNP 10_1101-2021_01_08_425952 172 102 W W NNP 10_1101-2021_01_08_425952 172 103 ith ith NNP 10_1101-2021_01_08_425952 172 104 c c NNP 10_1101-2021_01_08_425952 172 105 lin lin NNP 10_1101-2021_01_08_425952 172 106 ica ica NNP 10_1101-2021_01_08_425952 172 107 l l NNP 10_1101-2021_01_08_425952 172 108 Search Search NNP 10_1101-2021_01_08_425952 172 109 critera critera NN 10_1101-2021_01_08_425952 172 110 ( ( -LRB- 10_1101-2021_01_08_425952 172 111 severity severity NN 10_1101-2021_01_08_425952 172 112 ) ) -RRB- 10_1101-2021_01_08_425952 172 113 P p NN 10_1101-2021_01_08_425952 172 114 a a DT 10_1101-2021_01_08_425952 172 115 tie tie NN 10_1101-2021_01_08_425952 172 116 n n IN 10_1101-2021_01_08_425952 172 117 t t NN 10_1101-2021_01_08_425952 172 118 co co NN 10_1101-2021_01_08_425952 172 119 u u NNP 10_1101-2021_01_08_425952 172 120 n n CC 10_1101-2021_01_08_425952 172 121 t t NN 10_1101-2021_01_08_425952 172 122 Gender Gender NNP 10_1101-2021_01_08_425952 172 123 Female Female NNP 10_1101-2021_01_08_425952 172 124 Male Male NNP 10_1101-2021_01_08_425952 172 125 PropranololB PropranololB NNP 10_1101-2021_01_08_425952 172 126 Figure figure NN 10_1101-2021_01_08_425952 172 127 1 1 CD 10_1101-2021_01_08_425952 172 128 : : : 10_1101-2021_01_08_425952 172 129 The the DT 10_1101-2021_01_08_425952 172 130 number number NN 10_1101-2021_01_08_425952 172 131 of of IN 10_1101-2021_01_08_425952 172 132 patients patient NNS 10_1101-2021_01_08_425952 172 133 prescribed prescribe VBN 10_1101-2021_01_08_425952 172 134 ( ( -LRB- 10_1101-2021_01_08_425952 172 135 A a NN 10_1101-2021_01_08_425952 172 136 ) ) -RRB- 10_1101-2021_01_08_425952 172 137 amitriptyline amitriptyline NN 10_1101-2021_01_08_425952 172 138 or or CC 10_1101-2021_01_08_425952 172 139 ( ( -LRB- 10_1101-2021_01_08_425952 172 140 B b NN 10_1101-2021_01_08_425952 172 141 ) ) -RRB- 10_1101-2021_01_08_425952 172 142 propranolol propranolol NN 10_1101-2021_01_08_425952 172 143 . . . 10_1101-2021_01_08_425952 173 1 The the DT 10_1101-2021_01_08_425952 173 2 criteria criterion NNS 10_1101-2021_01_08_425952 173 3 to to TO 10_1101-2021_01_08_425952 173 4 match match VB 10_1101-2021_01_08_425952 173 5 against against IN 10_1101-2021_01_08_425952 173 6 clinical clinical JJ 10_1101-2021_01_08_425952 173 7 data datum NNS 10_1101-2021_01_08_425952 173 8 is be VBZ 10_1101-2021_01_08_425952 173 9 indicated indicate VBN 10_1101-2021_01_08_425952 173 10 : : : 10_1101-2021_01_08_425952 173 11 at at IN 10_1101-2021_01_08_425952 173 12 any any DT 10_1101-2021_01_08_425952 173 13 time time NN 10_1101-2021_01_08_425952 173 14 , , , 10_1101-2021_01_08_425952 173 15 with with IN 10_1101-2021_01_08_425952 173 16 a a DT 10_1101-2021_01_08_425952 173 17 clinical clinical JJ 10_1101-2021_01_08_425952 173 18 record record NN 10_1101-2021_01_08_425952 173 19 , , , 10_1101-2021_01_08_425952 173 20 and and CC 10_1101-2021_01_08_425952 173 21 with with IN 10_1101-2021_01_08_425952 173 22 a a DT 10_1101-2021_01_08_425952 173 23 clinical clinical JJ 10_1101-2021_01_08_425952 173 24 record record NN 10_1101-2021_01_08_425952 173 25 clear clear JJ 10_1101-2021_01_08_425952 173 26 off off IN 10_1101-2021_01_08_425952 173 27 topic topic JJ 10_1101-2021_01_08_425952 173 28 clinical clinical JJ 10_1101-2021_01_08_425952 173 29 events event NNS 10_1101-2021_01_08_425952 173 30 . . . 10_1101-2021_01_08_425952 174 1 > > XX 10_1101-2021_01_08_425952 174 2 date2001DF date2001df FW 10_1101-2021_01_08_425952 174 3 < < XX 10_1101-2021_01_08_425952 174 4 - - HYPH 10_1101-2021_01_08_425952 174 5 data.frame(patid data.frame(patid NNP 10_1101-2021_01_08_425952 174 6 = = SYM 10_1101-2021_01_08_425952 174 7 unlist(getUniquePatidList(testTherapyDF unlist(getUniquePatidList(testTherapyDF NNS 10_1101-2021_01_08_425952 174 8 ) ) -RRB- 10_1101-2021_01_08_425952 174 9 ) ) -RRB- 10_1101-2021_01_08_425952 174 10 , , , 10_1101-2021_01_08_425952 174 11 + + CC 10_1101-2021_01_08_425952 174 12 start start VB 10_1101-2021_01_08_425952 174 13 = = NNS 10_1101-2021_01_08_425952 174 14 as as IN 10_1101-2021_01_08_425952 174 15 . . . 10_1101-2021_01_08_425952 174 16 Date(as.character("2001 Date(as.character("2001 NNP 10_1101-2021_01_08_425952 174 17 - - HYPH 10_1101-2021_01_08_425952 174 18 01 01 CD 10_1101-2021_01_08_425952 174 19 - - HYPH 10_1101-2021_01_08_425952 174 20 01 01 CD 10_1101-2021_01_08_425952 174 21 " " '' 10_1101-2021_01_08_425952 174 22 ) ) -RRB- 10_1101-2021_01_08_425952 174 23 ) ) -RRB- 10_1101-2021_01_08_425952 174 24 , , , 10_1101-2021_01_08_425952 174 25 + + CC 10_1101-2021_01_08_425952 174 26 stop stop VB 10_1101-2021_01_08_425952 174 27 = = SYM 10_1101-2021_01_08_425952 174 28 as as IN 10_1101-2021_01_08_425952 174 29 . . . 10_1101-2021_01_08_425952 174 30 Date(as.character("2001 Date(as.character("2001 NNP 10_1101-2021_01_08_425952 174 31 - - HYPH 10_1101-2021_01_08_425952 174 32 12 12 CD 10_1101-2021_01_08_425952 174 33 - - SYM 10_1101-2021_01_08_425952 174 34 31 31 CD 10_1101-2021_01_08_425952 174 35 " " '' 10_1101-2021_01_08_425952 174 36 ) ) -RRB- 10_1101-2021_01_08_425952 174 37 ) ) -RRB- 10_1101-2021_01_08_425952 174 38 ) ) -RRB- 10_1101-2021_01_08_425952 174 39 > > XX 10_1101-2021_01_08_425952 174 40 date2002DF date2002df VBP 10_1101-2021_01_08_425952 174 41 < < XX 10_1101-2021_01_08_425952 174 42 - - HYPH 10_1101-2021_01_08_425952 174 43 data.frame(patid data.frame(patid NNP 10_1101-2021_01_08_425952 174 44 = = SYM 10_1101-2021_01_08_425952 174 45 unlist(getUniquePatidList(testTherapyDF unlist(getUniquePatidList(testTherapyDF NNS 10_1101-2021_01_08_425952 174 46 ) ) -RRB- 10_1101-2021_01_08_425952 174 47 ) ) -RRB- 10_1101-2021_01_08_425952 174 48 , , , 10_1101-2021_01_08_425952 174 49 + + CC 10_1101-2021_01_08_425952 174 50 start start VB 10_1101-2021_01_08_425952 174 51 = = NNS 10_1101-2021_01_08_425952 174 52 as as IN 10_1101-2021_01_08_425952 174 53 . . . 10_1101-2021_01_08_425952 174 54 Date(as.character("2002 Date(as.character("2002 NNP 10_1101-2021_01_08_425952 174 55 - - HYPH 10_1101-2021_01_08_425952 174 56 01 01 CD 10_1101-2021_01_08_425952 174 57 - - HYPH 10_1101-2021_01_08_425952 174 58 01 01 CD 10_1101-2021_01_08_425952 174 59 " " '' 10_1101-2021_01_08_425952 174 60 ) ) -RRB- 10_1101-2021_01_08_425952 174 61 ) ) -RRB- 10_1101-2021_01_08_425952 174 62 , , , 10_1101-2021_01_08_425952 174 63 + + CC 10_1101-2021_01_08_425952 174 64 stop stop VB 10_1101-2021_01_08_425952 174 65 = = NNS 10_1101-2021_01_08_425952 174 66 as as IN 10_1101-2021_01_08_425952 174 67 . . . 10_1101-2021_01_08_425952 174 68 Date(as.character("2002 Date(as.character("2002 NNP 10_1101-2021_01_08_425952 174 69 - - HYPH 10_1101-2021_01_08_425952 174 70 12 12 CD 10_1101-2021_01_08_425952 174 71 - - SYM 10_1101-2021_01_08_425952 174 72 31 31 CD 10_1101-2021_01_08_425952 174 73 " " '' 10_1101-2021_01_08_425952 174 74 ) ) -RRB- 10_1101-2021_01_08_425952 174 75 ) ) -RRB- 10_1101-2021_01_08_425952 174 76 ) ) -RRB- 10_1101-2021_01_08_425952 174 77 > > XX 10_1101-2021_01_08_425952 174 78 date2003DF date2003DF NNP 10_1101-2021_01_08_425952 174 79 < < XX 10_1101-2021_01_08_425952 174 80 - - HYPH 10_1101-2021_01_08_425952 174 81 data.frame(patid data.frame(patid NNP 10_1101-2021_01_08_425952 174 82 = = SYM 10_1101-2021_01_08_425952 174 83 unlist(getUniquePatidList(testTherapyDF unlist(getUniquePatidList(testTherapyDF NNS 10_1101-2021_01_08_425952 174 84 ) ) -RRB- 10_1101-2021_01_08_425952 174 85 ) ) -RRB- 10_1101-2021_01_08_425952 174 86 , , , 10_1101-2021_01_08_425952 174 87 + + CC 10_1101-2021_01_08_425952 174 88 start start VB 10_1101-2021_01_08_425952 174 89 = = NNS 10_1101-2021_01_08_425952 174 90 as as IN 10_1101-2021_01_08_425952 174 91 . . . 10_1101-2021_01_08_425952 174 92 Date(as.character("2003 Date(as.character("2003 NNP 10_1101-2021_01_08_425952 174 93 - - HYPH 10_1101-2021_01_08_425952 174 94 01 01 CD 10_1101-2021_01_08_425952 174 95 - - HYPH 10_1101-2021_01_08_425952 174 96 01 01 CD 10_1101-2021_01_08_425952 174 97 " " '' 10_1101-2021_01_08_425952 174 98 ) ) -RRB- 10_1101-2021_01_08_425952 174 99 ) ) -RRB- 10_1101-2021_01_08_425952 174 100 , , , 10_1101-2021_01_08_425952 174 101 + + CC 10_1101-2021_01_08_425952 174 102 stop stop VB 10_1101-2021_01_08_425952 174 103 = = NNS 10_1101-2021_01_08_425952 174 104 as as IN 10_1101-2021_01_08_425952 174 105 . . . 10_1101-2021_01_08_425952 174 106 Date(as.character("2003 Date(as.character("2003 NNP 10_1101-2021_01_08_425952 174 107 - - HYPH 10_1101-2021_01_08_425952 174 108 12 12 CD 10_1101-2021_01_08_425952 174 109 - - SYM 10_1101-2021_01_08_425952 174 110 31 31 CD 10_1101-2021_01_08_425952 174 111 " " '' 10_1101-2021_01_08_425952 174 112 ) ) -RRB- 10_1101-2021_01_08_425952 174 113 ) ) -RRB- 10_1101-2021_01_08_425952 174 114 ) ) -RRB- 10_1101-2021_01_08_425952 174 115 > > XX 10_1101-2021_01_08_425952 174 116 date2004DF date2004DF NNP 10_1101-2021_01_08_425952 174 117 < < XX 10_1101-2021_01_08_425952 174 118 - - HYPH 10_1101-2021_01_08_425952 174 119 data.frame(patid data.frame(patid NNP 10_1101-2021_01_08_425952 174 120 = = SYM 10_1101-2021_01_08_425952 174 121 unlist(getUniquePatidList(testTherapyDF unlist(getUniquePatidList(testTherapyDF NNS 10_1101-2021_01_08_425952 174 122 ) ) -RRB- 10_1101-2021_01_08_425952 174 123 ) ) -RRB- 10_1101-2021_01_08_425952 174 124 , , , 10_1101-2021_01_08_425952 174 125 + + CC 10_1101-2021_01_08_425952 174 126 start start VB 10_1101-2021_01_08_425952 174 127 = = NNS 10_1101-2021_01_08_425952 174 128 as as IN 10_1101-2021_01_08_425952 174 129 . . . 10_1101-2021_01_08_425952 174 130 Date(as.character("2004 Date(as.character("2004 NNP 10_1101-2021_01_08_425952 174 131 - - HYPH 10_1101-2021_01_08_425952 174 132 01 01 CD 10_1101-2021_01_08_425952 174 133 - - HYPH 10_1101-2021_01_08_425952 174 134 01 01 CD 10_1101-2021_01_08_425952 174 135 " " '' 10_1101-2021_01_08_425952 174 136 ) ) -RRB- 10_1101-2021_01_08_425952 174 137 ) ) -RRB- 10_1101-2021_01_08_425952 174 138 , , , 10_1101-2021_01_08_425952 174 139 + + CC 10_1101-2021_01_08_425952 174 140 stop stop VB 10_1101-2021_01_08_425952 174 141 = = NNS 10_1101-2021_01_08_425952 174 142 as as IN 10_1101-2021_01_08_425952 174 143 . . . 10_1101-2021_01_08_425952 174 144 Date(as.character("2004 Date(as.character("2004 NNP 10_1101-2021_01_08_425952 174 145 - - HYPH 10_1101-2021_01_08_425952 174 146 12 12 CD 10_1101-2021_01_08_425952 174 147 - - SYM 10_1101-2021_01_08_425952 174 148 31 31 CD 10_1101-2021_01_08_425952 174 149 " " '' 10_1101-2021_01_08_425952 174 150 ) ) -RRB- 10_1101-2021_01_08_425952 174 151 ) ) -RRB- 10_1101-2021_01_08_425952 174 152 ) ) -RRB- 10_1101-2021_01_08_425952 174 153 > > XX 10_1101-2021_01_08_425952 174 154 # # $ 10_1101-2021_01_08_425952 174 155 Retrieve retrieve NN 10_1101-2021_01_08_425952 174 156 prescription prescription NN 10_1101-2021_01_08_425952 174 157 frequencies frequency NNS 10_1101-2021_01_08_425952 174 158 per per IN 10_1101-2021_01_08_425952 174 159 binned bin VBN 10_1101-2021_01_08_425952 174 160 range range NN 10_1101-2021_01_08_425952 174 161 > > XX 10_1101-2021_01_08_425952 174 162 amitResult2000 amitResult2000 NNP 10_1101-2021_01_08_425952 174 163 < < XX 10_1101-2021_01_08_425952 174 164 - - HYPH 10_1101-2021_01_08_425952 174 165 matchDrugWithDisease(clinicalDF matchDrugWithDisease(clinicalDF NNP 10_1101-2021_01_08_425952 174 166 = = -RRB- 10_1101-2021_01_08_425952 174 167 testClinicalDF testClinicalDF NNP 10_1101-2021_01_08_425952 174 168 , , , 10_1101-2021_01_08_425952 174 169 + + CC 10_1101-2021_01_08_425952 174 170 therapyDF therapyDF NNP 10_1101-2021_01_08_425952 174 171 = = SYM 10_1101-2021_01_08_425952 174 172 testTherapyDF testTherapyDF NNS 10_1101-2021_01_08_425952 174 173 , , , 10_1101-2021_01_08_425952 174 174 .CC .CC : 10_1101-2021_01_08_425952 174 175 - - : 10_1101-2021_01_08_425952 174 176 BY by IN 10_1101-2021_01_08_425952 174 177 - - HYPH 10_1101-2021_01_08_425952 174 178 ND ND NNP 10_1101-2021_01_08_425952 174 179 4.0 4.0 CD 10_1101-2021_01_08_425952 174 180 International international JJ 10_1101-2021_01_08_425952 174 181 licensemade licensemade NN 10_1101-2021_01_08_425952 174 182 available available JJ 10_1101-2021_01_08_425952 174 183 under under IN 10_1101-2021_01_08_425952 174 184 a a DT 10_1101-2021_01_08_425952 174 185 ( ( -LRB- 10_1101-2021_01_08_425952 174 186 which which WDT 10_1101-2021_01_08_425952 174 187 was be VBD 10_1101-2021_01_08_425952 174 188 not not RB 10_1101-2021_01_08_425952 174 189 certified certify VBN 10_1101-2021_01_08_425952 174 190 by by IN 10_1101-2021_01_08_425952 174 191 peer peer NN 10_1101-2021_01_08_425952 174 192 review review NN 10_1101-2021_01_08_425952 174 193 ) ) -RRB- 10_1101-2021_01_08_425952 174 194 is be VBZ 10_1101-2021_01_08_425952 174 195 the the DT 10_1101-2021_01_08_425952 174 196 author author NN 10_1101-2021_01_08_425952 174 197 / / SYM 10_1101-2021_01_08_425952 174 198 funder funder NN 10_1101-2021_01_08_425952 174 199 , , , 10_1101-2021_01_08_425952 174 200 who who WP 10_1101-2021_01_08_425952 174 201 has have VBZ 10_1101-2021_01_08_425952 174 202 granted grant VBN 10_1101-2021_01_08_425952 174 203 bioRxiv biorxiv IN 10_1101-2021_01_08_425952 174 204 a a DT 10_1101-2021_01_08_425952 174 205 license license NN 10_1101-2021_01_08_425952 174 206 to to TO 10_1101-2021_01_08_425952 174 207 display display VB 10_1101-2021_01_08_425952 174 208 the the DT 10_1101-2021_01_08_425952 174 209 preprint preprint NN 10_1101-2021_01_08_425952 174 210 in in IN 10_1101-2021_01_08_425952 174 211 perpetuity perpetuity NN 10_1101-2021_01_08_425952 174 212 . . . 10_1101-2021_01_08_425952 175 1 It -PRON- PRP 10_1101-2021_01_08_425952 175 2 is be VBZ 10_1101-2021_01_08_425952 175 3 The the DT 10_1101-2021_01_08_425952 175 4 copyright copyright NN 10_1101-2021_01_08_425952 175 5 holder holder NN 10_1101-2021_01_08_425952 175 6 for for IN 10_1101-2021_01_08_425952 175 7 this this DT 10_1101-2021_01_08_425952 175 8 preprintthis preprintthis NN 10_1101-2021_01_08_425952 175 9 version version NN 10_1101-2021_01_08_425952 175 10 posted post VBD 10_1101-2021_01_08_425952 175 11 January January NNP 10_1101-2021_01_08_425952 175 12 9 9 CD 10_1101-2021_01_08_425952 175 13 , , , 10_1101-2021_01_08_425952 175 14 2021 2021 CD 10_1101-2021_01_08_425952 175 15 . . . 10_1101-2021_01_08_425952 175 16 ; ; : 10_1101-2021_01_08_425952 175 17 https://doi.org/10.1101/2021.01.08.425952doi https://doi.org/10.1101/2021.01.08.425952doi ADD 10_1101-2021_01_08_425952 175 18 : : : 10_1101-2021_01_08_425952 175 19 bioRxiv biorxiv IN 10_1101-2021_01_08_425952 175 20 preprint preprint NN 10_1101-2021_01_08_425952 175 21 https://doi.org/10.1101/2021.01.08.425952 https://doi.org/10.1101/2021.01.08.425952 XX 10_1101-2021_01_08_425952 175 22 http://creativecommons.org/licenses/by-nd/4.0/ http://creativecommons.org/licenses/by-nd/4.0/ NNP 10_1101-2021_01_08_425952 175 23 Journal Journal NNP 10_1101-2021_01_08_425952 175 24 of of IN 10_1101-2021_01_08_425952 175 25 Statistical Statistical NNP 10_1101-2021_01_08_425952 175 26 Software Software NNP 10_1101-2021_01_08_425952 175 27 15 15 CD 10_1101-2021_01_08_425952 175 28 + + SYM 10_1101-2021_01_08_425952 175 29 medcodeList medcodeList NNS 10_1101-2021_01_08_425952 175 30 = = SYM 10_1101-2021_01_08_425952 175 31 headacheCodes headachecode NNS 10_1101-2021_01_08_425952 175 32 , , , 10_1101-2021_01_08_425952 175 33 + + CC 10_1101-2021_01_08_425952 175 34 drugcodeList drugcodelist NN 10_1101-2021_01_08_425952 175 35 = = NFP 10_1101-2021_01_08_425952 175 36 amitriptylineCodes amitriptylinecode NNS 10_1101-2021_01_08_425952 175 37 , , , 10_1101-2021_01_08_425952 175 38 + + CC 10_1101-2021_01_08_425952 175 39 severity severity NN 10_1101-2021_01_08_425952 175 40 = = SYM 10_1101-2021_01_08_425952 175 41 1 1 CD 10_1101-2021_01_08_425952 175 42 , , , 10_1101-2021_01_08_425952 175 43 + + CC 10_1101-2021_01_08_425952 175 44 dateDF datedf NN 10_1101-2021_01_08_425952 175 45 = = SYM 10_1101-2021_01_08_425952 175 46 date2000DF date2000DF NNS 10_1101-2021_01_08_425952 175 47 ) ) -RRB- 10_1101-2021_01_08_425952 175 48 > > XX 10_1101-2021_01_08_425952 175 49 amitResult2001 amitResult2001 NNP 10_1101-2021_01_08_425952 175 50 < < XX 10_1101-2021_01_08_425952 175 51 - - HYPH 10_1101-2021_01_08_425952 175 52 matchDrugWithDisease(clinicalDF matchDrugWithDisease(clinicalDF NNP 10_1101-2021_01_08_425952 175 53 = = -RRB- 10_1101-2021_01_08_425952 175 54 testClinicalDF testClinicalDF NNP 10_1101-2021_01_08_425952 175 55 , , , 10_1101-2021_01_08_425952 175 56 + + CC 10_1101-2021_01_08_425952 175 57 therapyDF therapyDF NNP 10_1101-2021_01_08_425952 175 58 = = SYM 10_1101-2021_01_08_425952 175 59 testTherapyDF testTherapyDF NNS 10_1101-2021_01_08_425952 175 60 , , , 10_1101-2021_01_08_425952 175 61 + + CC 10_1101-2021_01_08_425952 175 62 medcodeList medcodeList NNS 10_1101-2021_01_08_425952 175 63 = = SYM 10_1101-2021_01_08_425952 175 64 headacheCodes headachecode NNS 10_1101-2021_01_08_425952 175 65 , , , 10_1101-2021_01_08_425952 175 66 + + CC 10_1101-2021_01_08_425952 175 67 drugcodeList drugcodelist NN 10_1101-2021_01_08_425952 175 68 = = NFP 10_1101-2021_01_08_425952 175 69 amitriptylineCodes amitriptylinecode NNS 10_1101-2021_01_08_425952 175 70 , , , 10_1101-2021_01_08_425952 175 71 + + CC 10_1101-2021_01_08_425952 175 72 severity severity NN 10_1101-2021_01_08_425952 175 73 = = SYM 10_1101-2021_01_08_425952 175 74 1 1 CD 10_1101-2021_01_08_425952 175 75 , , , 10_1101-2021_01_08_425952 175 76 + + CC 10_1101-2021_01_08_425952 175 77 dateDF dateDF NNP 10_1101-2021_01_08_425952 175 78 = = SYM 10_1101-2021_01_08_425952 175 79 date2001DF date2001df FW 10_1101-2021_01_08_425952 175 80 ) ) -RRB- 10_1101-2021_01_08_425952 175 81 > > XX 10_1101-2021_01_08_425952 175 82 amitResult2002 amitResult2002 NNP 10_1101-2021_01_08_425952 175 83 < < XX 10_1101-2021_01_08_425952 175 84 - - HYPH 10_1101-2021_01_08_425952 175 85 matchDrugWithDisease(clinicalDF matchDrugWithDisease(clinicalDF NNP 10_1101-2021_01_08_425952 175 86 = = -RRB- 10_1101-2021_01_08_425952 175 87 testClinicalDF testClinicalDF NNP 10_1101-2021_01_08_425952 175 88 , , , 10_1101-2021_01_08_425952 175 89 + + CC 10_1101-2021_01_08_425952 175 90 therapyDF therapyDF NNP 10_1101-2021_01_08_425952 175 91 = = SYM 10_1101-2021_01_08_425952 175 92 testTherapyDF testTherapyDF NNS 10_1101-2021_01_08_425952 175 93 , , , 10_1101-2021_01_08_425952 175 94 + + CC 10_1101-2021_01_08_425952 175 95 medcodeList medcodeList NNS 10_1101-2021_01_08_425952 175 96 = = SYM 10_1101-2021_01_08_425952 175 97 headacheCodes headachecode NNS 10_1101-2021_01_08_425952 175 98 , , , 10_1101-2021_01_08_425952 175 99 + + CC 10_1101-2021_01_08_425952 175 100 drugcodeList drugcodelist NN 10_1101-2021_01_08_425952 175 101 = = NFP 10_1101-2021_01_08_425952 175 102 amitriptylineCodes amitriptylinecode NNS 10_1101-2021_01_08_425952 175 103 , , , 10_1101-2021_01_08_425952 175 104 + + CC 10_1101-2021_01_08_425952 175 105 severity severity NN 10_1101-2021_01_08_425952 175 106 = = SYM 10_1101-2021_01_08_425952 175 107 1 1 CD 10_1101-2021_01_08_425952 175 108 , , , 10_1101-2021_01_08_425952 175 109 + + CC 10_1101-2021_01_08_425952 175 110 dateDF dateDF NNP 10_1101-2021_01_08_425952 175 111 = = SYM 10_1101-2021_01_08_425952 175 112 date2002DF date2002df VBP 10_1101-2021_01_08_425952 175 113 ) ) -RRB- 10_1101-2021_01_08_425952 175 114 > > XX 10_1101-2021_01_08_425952 175 115 amitResult2003 amitresult2003 XX 10_1101-2021_01_08_425952 175 116 < < XX 10_1101-2021_01_08_425952 175 117 - - HYPH 10_1101-2021_01_08_425952 175 118 matchDrugWithDisease(clinicalDF matchDrugWithDisease(clinicalDF NNP 10_1101-2021_01_08_425952 175 119 = = -RRB- 10_1101-2021_01_08_425952 175 120 testClinicalDF testClinicalDF NNP 10_1101-2021_01_08_425952 175 121 , , , 10_1101-2021_01_08_425952 175 122 + + CC 10_1101-2021_01_08_425952 175 123 therapyDF therapyDF NNP 10_1101-2021_01_08_425952 175 124 = = SYM 10_1101-2021_01_08_425952 175 125 testTherapyDF testTherapyDF NNS 10_1101-2021_01_08_425952 175 126 , , , 10_1101-2021_01_08_425952 175 127 + + CC 10_1101-2021_01_08_425952 175 128 medcodeList medcodeList NNS 10_1101-2021_01_08_425952 175 129 = = SYM 10_1101-2021_01_08_425952 175 130 headacheCodes headachecode NNS 10_1101-2021_01_08_425952 175 131 , , , 10_1101-2021_01_08_425952 175 132 + + CC 10_1101-2021_01_08_425952 175 133 drugcodeList drugcodelist NN 10_1101-2021_01_08_425952 175 134 = = NFP 10_1101-2021_01_08_425952 175 135 amitriptylineCodes amitriptylinecode NNS 10_1101-2021_01_08_425952 175 136 , , , 10_1101-2021_01_08_425952 175 137 + + CC 10_1101-2021_01_08_425952 175 138 severity severity NN 10_1101-2021_01_08_425952 175 139 = = SYM 10_1101-2021_01_08_425952 175 140 1 1 CD 10_1101-2021_01_08_425952 175 141 , , , 10_1101-2021_01_08_425952 175 142 + + CC 10_1101-2021_01_08_425952 175 143 dateDF dateDF NNP 10_1101-2021_01_08_425952 175 144 = = SYM 10_1101-2021_01_08_425952 175 145 date2003DF date2003df NN 10_1101-2021_01_08_425952 175 146 ) ) -RRB- 10_1101-2021_01_08_425952 175 147 > > XX 10_1101-2021_01_08_425952 175 148 amitResult2004 amitResult2004 NNP 10_1101-2021_01_08_425952 175 149 < < XX 10_1101-2021_01_08_425952 175 150 - - HYPH 10_1101-2021_01_08_425952 175 151 matchDrugWithDisease(clinicalDF matchDrugWithDisease(clinicalDF NNP 10_1101-2021_01_08_425952 175 152 = = -RRB- 10_1101-2021_01_08_425952 175 153 testClinicalDF testClinicalDF NNP 10_1101-2021_01_08_425952 175 154 , , , 10_1101-2021_01_08_425952 175 155 + + CC 10_1101-2021_01_08_425952 175 156 therapyDF therapyDF NNP 10_1101-2021_01_08_425952 175 157 = = SYM 10_1101-2021_01_08_425952 175 158 testTherapyDF testTherapyDF NNS 10_1101-2021_01_08_425952 175 159 , , , 10_1101-2021_01_08_425952 175 160 + + CC 10_1101-2021_01_08_425952 175 161 medcodeList medcodeList NNS 10_1101-2021_01_08_425952 175 162 = = SYM 10_1101-2021_01_08_425952 175 163 headacheCodes headachecode NNS 10_1101-2021_01_08_425952 175 164 , , , 10_1101-2021_01_08_425952 175 165 + + CC 10_1101-2021_01_08_425952 175 166 drugcodeList drugcodelist NN 10_1101-2021_01_08_425952 175 167 = = NFP 10_1101-2021_01_08_425952 175 168 amitriptylineCodes amitriptylinecode NNS 10_1101-2021_01_08_425952 175 169 , , , 10_1101-2021_01_08_425952 175 170 + + CC 10_1101-2021_01_08_425952 175 171 severity severity NN 10_1101-2021_01_08_425952 175 172 = = SYM 10_1101-2021_01_08_425952 175 173 1 1 CD 10_1101-2021_01_08_425952 175 174 , , , 10_1101-2021_01_08_425952 175 175 + + CC 10_1101-2021_01_08_425952 175 176 dateDF dateDF NNP 10_1101-2021_01_08_425952 175 177 = = SYM 10_1101-2021_01_08_425952 175 178 date2004DF date2004df NN 10_1101-2021_01_08_425952 175 179 ) ) -RRB- 10_1101-2021_01_08_425952 175 180 > > XX 10_1101-2021_01_08_425952 175 181 # # $ 10_1101-2021_01_08_425952 175 182 The the DT 10_1101-2021_01_08_425952 175 183 number number NN 10_1101-2021_01_08_425952 175 184 of of IN 10_1101-2021_01_08_425952 175 185 patids patid NNS 10_1101-2021_01_08_425952 175 186 returned return VBN 10_1101-2021_01_08_425952 175 187 by by IN 10_1101-2021_01_08_425952 175 188 matchDrugWithDisease matchdrugwithdisease PRP 10_1101-2021_01_08_425952 175 189 is be VBZ 10_1101-2021_01_08_425952 175 190 equal equal JJ 10_1101-2021_01_08_425952 175 191 to to IN 10_1101-2021_01_08_425952 175 192 the the DT 10_1101-2021_01_08_425952 175 193 number number NN 10_1101-2021_01_08_425952 175 194 > > XX 10_1101-2021_01_08_425952 175 195 # # NN 10_1101-2021_01_08_425952 175 196 of of IN 10_1101-2021_01_08_425952 175 197 patients patient NNS 10_1101-2021_01_08_425952 175 198 with with IN 10_1101-2021_01_08_425952 175 199 a a DT 10_1101-2021_01_08_425952 175 200 drug drug NN 10_1101-2021_01_08_425952 175 201 - - HYPH 10_1101-2021_01_08_425952 175 202 disease disease NN 10_1101-2021_01_08_425952 175 203 match match NN 10_1101-2021_01_08_425952 175 204 per per IN 10_1101-2021_01_08_425952 175 205 year year NN 10_1101-2021_01_08_425952 175 206 > > XX 10_1101-2021_01_08_425952 175 207 dataDF dataDF NNP 10_1101-2021_01_08_425952 175 208 < < XX 10_1101-2021_01_08_425952 175 209 - - HYPH 10_1101-2021_01_08_425952 175 210 data.frame(Year data.frame(year ADD 10_1101-2021_01_08_425952 175 211 = = NFP 10_1101-2021_01_08_425952 175 212 c("2000","2001","2002","2003","2004 c("2000","2001","2002","2003","2004 NN 10_1101-2021_01_08_425952 175 213 " " '' 10_1101-2021_01_08_425952 175 214 ) ) -RRB- 10_1101-2021_01_08_425952 175 215 , , , 10_1101-2021_01_08_425952 175 216 + + CC 10_1101-2021_01_08_425952 175 217 Count Count NNP 10_1101-2021_01_08_425952 175 218 = = SYM 10_1101-2021_01_08_425952 175 219 c(length(amitResult2000),length(amitResult2001 c(length(amitResult2000),length(amitResult2001 NNP 10_1101-2021_01_08_425952 175 220 ) ) -RRB- 10_1101-2021_01_08_425952 175 221 , , , 10_1101-2021_01_08_425952 175 222 + + CC 10_1101-2021_01_08_425952 175 223 length(amitResult2002),length(amitResult2003 length(amitresult2002),length(amitresult2003 NN 10_1101-2021_01_08_425952 175 224 ) ) -RRB- 10_1101-2021_01_08_425952 175 225 , , , 10_1101-2021_01_08_425952 175 226 + + CC 10_1101-2021_01_08_425952 175 227 length(amitResult2004 length(amitresult2004 NN 10_1101-2021_01_08_425952 175 228 ) ) -RRB- 10_1101-2021_01_08_425952 175 229 ) ) -RRB- 10_1101-2021_01_08_425952 175 230 ) ) -RRB- 10_1101-2021_01_08_425952 175 231 > > XX 10_1101-2021_01_08_425952 175 232 ggPrescriptionYear ggPrescriptionYear NNP 10_1101-2021_01_08_425952 175 233 < < XX 10_1101-2021_01_08_425952 175 234 - - HYPH 10_1101-2021_01_08_425952 175 235 ggplot(dataDF ggplot(dataDF NNP 10_1101-2021_01_08_425952 175 236 , , , 10_1101-2021_01_08_425952 175 237 aes(x aes(x NNP 10_1101-2021_01_08_425952 175 238 = = -RRB- 10_1101-2021_01_08_425952 175 239 Year year NN 10_1101-2021_01_08_425952 175 240 , , , 10_1101-2021_01_08_425952 175 241 y y NNP 10_1101-2021_01_08_425952 175 242 = = SYM 10_1101-2021_01_08_425952 175 243 Count Count NNP 10_1101-2021_01_08_425952 175 244 ) ) -RRB- 10_1101-2021_01_08_425952 175 245 ) ) -RRB- 10_1101-2021_01_08_425952 175 246 + + NFP 10_1101-2021_01_08_425952 175 247 + + SYM 10_1101-2021_01_08_425952 175 248 geom_bar(stat geom_bar(stat NN 10_1101-2021_01_08_425952 175 249 = = SYM 10_1101-2021_01_08_425952 175 250 " " `` 10_1101-2021_01_08_425952 175 251 identity identity NN 10_1101-2021_01_08_425952 175 252 " " '' 10_1101-2021_01_08_425952 175 253 ) ) -RRB- 10_1101-2021_01_08_425952 175 254 + + NFP 10_1101-2021_01_08_425952 175 255 theme_bw theme_bw NNP 10_1101-2021_01_08_425952 175 256 ( ( -LRB- 10_1101-2021_01_08_425952 175 257 ) ) -RRB- 10_1101-2021_01_08_425952 175 258 getPatientsWithFirstDrugWithDisease getPatientsWithFirstDrugWithDisease VBN 10_1101-2021_01_08_425952 175 259 Unlike unlike IN 10_1101-2021_01_08_425952 175 260 matchDrugWithDisease matchdrugwithdisease PRP 10_1101-2021_01_08_425952 175 261 which which WDT 10_1101-2021_01_08_425952 175 262 retrieves retrieve VBZ 10_1101-2021_01_08_425952 175 263 patients patient NNS 10_1101-2021_01_08_425952 175 264 with with IN 10_1101-2021_01_08_425952 175 265 a a DT 10_1101-2021_01_08_425952 175 266 prescription prescription NN 10_1101-2021_01_08_425952 175 267 event event NN 10_1101-2021_01_08_425952 175 268 matching match VBG 10_1101-2021_01_08_425952 175 269 clinical clinical JJ 10_1101-2021_01_08_425952 175 270 criteria criterion NNS 10_1101-2021_01_08_425952 175 271 at at IN 10_1101-2021_01_08_425952 175 272 any any DT 10_1101-2021_01_08_425952 175 273 time time NN 10_1101-2021_01_08_425952 175 274 within within IN 10_1101-2021_01_08_425952 175 275 a a DT 10_1101-2021_01_08_425952 175 276 CPRD CPRD NNP 10_1101-2021_01_08_425952 175 277 EHR ehr NN 10_1101-2021_01_08_425952 175 278 record record NN 10_1101-2021_01_08_425952 175 279 , , , 10_1101-2021_01_08_425952 175 280 getPatientsWithFirstDrugWithDisease getPatientsWithFirstDrugWithDisease NNP 10_1101-2021_01_08_425952 175 281 identifies identify VBZ 10_1101-2021_01_08_425952 175 282 patients patient NNS 10_1101-2021_01_08_425952 175 283 with with IN 10_1101-2021_01_08_425952 175 284 a a DT 10_1101-2021_01_08_425952 175 285 first first JJ 10_1101-2021_01_08_425952 175 286 prescription prescription NN 10_1101-2021_01_08_425952 175 287 event event NN 10_1101-2021_01_08_425952 175 288 that that WDT 10_1101-2021_01_08_425952 175 289 matches match VBZ 10_1101-2021_01_08_425952 175 290 a a DT 10_1101-2021_01_08_425952 175 291 desired desire VBN 10_1101-2021_01_08_425952 175 292 clinical clinical JJ 10_1101-2021_01_08_425952 175 293 event event NN 10_1101-2021_01_08_425952 175 294 . . . 10_1101-2021_01_08_425952 176 1 Please please UH 10_1101-2021_01_08_425952 176 2 note note VB 10_1101-2021_01_08_425952 176 3 , , , 10_1101-2021_01_08_425952 176 4 care care NN 10_1101-2021_01_08_425952 176 5 must must MD 10_1101-2021_01_08_425952 176 6 be be VB 10_1101-2021_01_08_425952 176 7 taken take VBN 10_1101-2021_01_08_425952 176 8 when when WRB 10_1101-2021_01_08_425952 176 9 searching search VBG 10_1101-2021_01_08_425952 176 10 for for IN 10_1101-2021_01_08_425952 176 11 medication medication NN 10_1101-2021_01_08_425952 176 12 with with IN 10_1101-2021_01_08_425952 176 13 off off IN 10_1101-2021_01_08_425952 176 14 - - HYPH 10_1101-2021_01_08_425952 176 15 label label NN 10_1101-2021_01_08_425952 176 16 uses use NNS 10_1101-2021_01_08_425952 176 17 . . . 10_1101-2021_01_08_425952 177 1 For for IN 10_1101-2021_01_08_425952 177 2 example example NN 10_1101-2021_01_08_425952 177 3 , , , 10_1101-2021_01_08_425952 177 4 beta beta NN 10_1101-2021_01_08_425952 177 5 - - HYPH 10_1101-2021_01_08_425952 177 6 blockers blocker NNS 10_1101-2021_01_08_425952 177 7 are be VBP 10_1101-2021_01_08_425952 177 8 frequently frequently RB 10_1101-2021_01_08_425952 177 9 prescribed prescribe VBN 10_1101-2021_01_08_425952 177 10 to to TO 10_1101-2021_01_08_425952 177 11 treat treat VB 10_1101-2021_01_08_425952 177 12 hypertension hypertension NN 10_1101-2021_01_08_425952 177 13 and and CC 10_1101-2021_01_08_425952 177 14 arrhythmia arrhythmia NN 10_1101-2021_01_08_425952 177 15 , , , 10_1101-2021_01_08_425952 177 16 however however RB 10_1101-2021_01_08_425952 177 17 , , , 10_1101-2021_01_08_425952 177 18 the the DT 10_1101-2021_01_08_425952 177 19 beta beta NN 10_1101-2021_01_08_425952 177 20 - - HYPH 10_1101-2021_01_08_425952 177 21 blocker blocker NN 10_1101-2021_01_08_425952 177 22 propranolol propranolol NN 10_1101-2021_01_08_425952 177 23 is be VBZ 10_1101-2021_01_08_425952 177 24 also also RB 10_1101-2021_01_08_425952 177 25 prescribed prescribe VBN 10_1101-2021_01_08_425952 177 26 to to TO 10_1101-2021_01_08_425952 177 27 treat treat VB 10_1101-2021_01_08_425952 177 28 migraine migraine NN 10_1101-2021_01_08_425952 177 29 . . . 10_1101-2021_01_08_425952 178 1 Without without IN 10_1101-2021_01_08_425952 178 2 in in IN 10_1101-2021_01_08_425952 178 3 depth depth NN 10_1101-2021_01_08_425952 178 4 analysis analysis NN 10_1101-2021_01_08_425952 178 5 into into IN 10_1101-2021_01_08_425952 178 6 the the DT 10_1101-2021_01_08_425952 178 7 patient patient NN 10_1101-2021_01_08_425952 178 8 history history NN 10_1101-2021_01_08_425952 178 9 , , , 10_1101-2021_01_08_425952 178 10 patients patient NNS 10_1101-2021_01_08_425952 178 11 propranolol propranolol VBP 10_1101-2021_01_08_425952 178 12 with with IN 10_1101-2021_01_08_425952 178 13 records record NNS 10_1101-2021_01_08_425952 178 14 for for IN 10_1101-2021_01_08_425952 178 15 hypertension hypertension NN 10_1101-2021_01_08_425952 178 16 or or CC 10_1101-2021_01_08_425952 178 17 arrhythmia arrhythmia NN 10_1101-2021_01_08_425952 178 18 in in IN 10_1101-2021_01_08_425952 178 19 addi- addi- NNP 10_1101-2021_01_08_425952 178 20 tion tion NN 10_1101-2021_01_08_425952 178 21 to to IN 10_1101-2021_01_08_425952 178 22 migraine migraine VB 10_1101-2021_01_08_425952 178 23 on on IN 10_1101-2021_01_08_425952 178 24 a a DT 10_1101-2021_01_08_425952 178 25 matching matching NN 10_1101-2021_01_08_425952 178 26 eventdate eventdate NN 10_1101-2021_01_08_425952 178 27 with with IN 10_1101-2021_01_08_425952 178 28 the the DT 10_1101-2021_01_08_425952 178 29 first first JJ 10_1101-2021_01_08_425952 178 30 propranolol propranolol JJ 10_1101-2021_01_08_425952 178 31 prescription prescription NN 10_1101-2021_01_08_425952 178 32 , , , 10_1101-2021_01_08_425952 178 33 could could MD 10_1101-2021_01_08_425952 178 34 result result VB 10_1101-2021_01_08_425952 178 35 .CC .CC : 10_1101-2021_01_08_425952 178 36 - - : 10_1101-2021_01_08_425952 178 37 BY by IN 10_1101-2021_01_08_425952 178 38 - - HYPH 10_1101-2021_01_08_425952 178 39 ND ND NNP 10_1101-2021_01_08_425952 178 40 4.0 4.0 CD 10_1101-2021_01_08_425952 178 41 International international JJ 10_1101-2021_01_08_425952 178 42 licensemade licensemade NN 10_1101-2021_01_08_425952 178 43 available available JJ 10_1101-2021_01_08_425952 178 44 under under IN 10_1101-2021_01_08_425952 178 45 a a DT 10_1101-2021_01_08_425952 178 46 ( ( -LRB- 10_1101-2021_01_08_425952 178 47 which which WDT 10_1101-2021_01_08_425952 178 48 was be VBD 10_1101-2021_01_08_425952 178 49 not not RB 10_1101-2021_01_08_425952 178 50 certified certify VBN 10_1101-2021_01_08_425952 178 51 by by IN 10_1101-2021_01_08_425952 178 52 peer peer NN 10_1101-2021_01_08_425952 178 53 review review NN 10_1101-2021_01_08_425952 178 54 ) ) -RRB- 10_1101-2021_01_08_425952 178 55 is be VBZ 10_1101-2021_01_08_425952 178 56 the the DT 10_1101-2021_01_08_425952 178 57 author author NN 10_1101-2021_01_08_425952 178 58 / / SYM 10_1101-2021_01_08_425952 178 59 funder funder NN 10_1101-2021_01_08_425952 178 60 , , , 10_1101-2021_01_08_425952 178 61 who who WP 10_1101-2021_01_08_425952 178 62 has have VBZ 10_1101-2021_01_08_425952 178 63 granted grant VBN 10_1101-2021_01_08_425952 178 64 bioRxiv biorxiv IN 10_1101-2021_01_08_425952 178 65 a a DT 10_1101-2021_01_08_425952 178 66 license license NN 10_1101-2021_01_08_425952 178 67 to to TO 10_1101-2021_01_08_425952 178 68 display display VB 10_1101-2021_01_08_425952 178 69 the the DT 10_1101-2021_01_08_425952 178 70 preprint preprint NN 10_1101-2021_01_08_425952 178 71 in in IN 10_1101-2021_01_08_425952 178 72 perpetuity perpetuity NN 10_1101-2021_01_08_425952 178 73 . . . 10_1101-2021_01_08_425952 179 1 It -PRON- PRP 10_1101-2021_01_08_425952 179 2 is be VBZ 10_1101-2021_01_08_425952 179 3 The the DT 10_1101-2021_01_08_425952 179 4 copyright copyright NN 10_1101-2021_01_08_425952 179 5 holder holder NN 10_1101-2021_01_08_425952 179 6 for for IN 10_1101-2021_01_08_425952 179 7 this this DT 10_1101-2021_01_08_425952 179 8 preprintthis preprintthis NN 10_1101-2021_01_08_425952 179 9 version version NN 10_1101-2021_01_08_425952 179 10 posted post VBD 10_1101-2021_01_08_425952 179 11 January January NNP 10_1101-2021_01_08_425952 179 12 9 9 CD 10_1101-2021_01_08_425952 179 13 , , , 10_1101-2021_01_08_425952 179 14 2021 2021 CD 10_1101-2021_01_08_425952 179 15 . . . 10_1101-2021_01_08_425952 179 16 ; ; : 10_1101-2021_01_08_425952 179 17 https://doi.org/10.1101/2021.01.08.425952doi https://doi.org/10.1101/2021.01.08.425952doi ADD 10_1101-2021_01_08_425952 179 18 : : : 10_1101-2021_01_08_425952 179 19 bioRxiv biorxiv IN 10_1101-2021_01_08_425952 179 20 preprint preprint NN 10_1101-2021_01_08_425952 179 21 https://doi.org/10.1101/2021.01.08.425952 https://doi.org/10.1101/2021.01.08.425952 NN 10_1101-2021_01_08_425952 179 22 http://creativecommons.org/licenses/by-nd/4.0/ http://creativecommons.org/licenses/by-nd/4.0/ NN 10_1101-2021_01_08_425952 179 23 16 16 CD 10_1101-2021_01_08_425952 179 24 rdrugtrajectory rdrugtrajectory NN 10_1101-2021_01_08_425952 179 25 : : : 10_1101-2021_01_08_425952 179 26 Analysing Analysing NNP 10_1101-2021_01_08_425952 179 27 Drug Drug NNP 10_1101-2021_01_08_425952 179 28 Prescriptions Prescriptions NNPS 10_1101-2021_01_08_425952 179 29 in in IN 10_1101-2021_01_08_425952 179 30 Electronic Electronic NNP 10_1101-2021_01_08_425952 179 31 Health Health NNP 10_1101-2021_01_08_425952 179 32 Care Care NNP 10_1101-2021_01_08_425952 179 33 Records Records NNPS 10_1101-2021_01_08_425952 179 34 0 0 NFP 10_1101-2021_01_08_425952 179 35 100 100 CD 10_1101-2021_01_08_425952 179 36 200 200 CD 10_1101-2021_01_08_425952 179 37 300 300 CD 10_1101-2021_01_08_425952 179 38 2000 2000 CD 10_1101-2021_01_08_425952 179 39 2001 2001 CD 10_1101-2021_01_08_425952 179 40 2002 2002 CD 10_1101-2021_01_08_425952 179 41 2003 2003 CD 10_1101-2021_01_08_425952 179 42 2004 2004 CD 10_1101-2021_01_08_425952 179 43 Year year NN 10_1101-2021_01_08_425952 179 44 C C NNP 10_1101-2021_01_08_425952 179 45 o o NN 10_1101-2021_01_08_425952 179 46 u u NN 10_1101-2021_01_08_425952 179 47 n n NNP 10_1101-2021_01_08_425952 179 48 t t NNP 10_1101-2021_01_08_425952 179 49 Figure Figure NNP 10_1101-2021_01_08_425952 179 50 2 2 CD 10_1101-2021_01_08_425952 179 51 : : : 10_1101-2021_01_08_425952 179 52 The the DT 10_1101-2021_01_08_425952 179 53 number number NN 10_1101-2021_01_08_425952 179 54 of of IN 10_1101-2021_01_08_425952 179 55 patients patient NNS 10_1101-2021_01_08_425952 179 56 prescribed prescribe VBD 10_1101-2021_01_08_425952 179 57 amitriptyline amitriptyline NN 10_1101-2021_01_08_425952 179 58 from from IN 10_1101-2021_01_08_425952 179 59 the the DT 10_1101-2021_01_08_425952 179 60 start start NN 10_1101-2021_01_08_425952 179 61 of of IN 10_1101-2021_01_08_425952 179 62 the the DT 10_1101-2021_01_08_425952 179 63 year year NN 10_1101-2021_01_08_425952 179 64 2000 2000 CD 10_1101-2021_01_08_425952 179 65 to to IN 10_1101-2021_01_08_425952 179 66 the the DT 10_1101-2021_01_08_425952 179 67 end end NN 10_1101-2021_01_08_425952 179 68 of of IN 10_1101-2021_01_08_425952 179 69 2004 2004 CD 10_1101-2021_01_08_425952 179 70 , , , 10_1101-2021_01_08_425952 179 71 stratified stratify VBN 10_1101-2021_01_08_425952 179 72 in in IN 10_1101-2021_01_08_425952 179 73 year year NN 10_1101-2021_01_08_425952 179 74 intervals interval NNS 10_1101-2021_01_08_425952 179 75 . . . 10_1101-2021_01_08_425952 180 1 in in IN 10_1101-2021_01_08_425952 180 2 a a DT 10_1101-2021_01_08_425952 180 3 misleading misleading JJ 10_1101-2021_01_08_425952 180 4 disease disease NN 10_1101-2021_01_08_425952 180 5 - - HYPH 10_1101-2021_01_08_425952 180 6 drug drug NN 10_1101-2021_01_08_425952 180 7 association association NN 10_1101-2021_01_08_425952 180 8 . . . 10_1101-2021_01_08_425952 181 1 In in IN 10_1101-2021_01_08_425952 181 2 cases case NNS 10_1101-2021_01_08_425952 181 3 where where WRB 10_1101-2021_01_08_425952 181 4 a a DT 10_1101-2021_01_08_425952 181 5 health health NN 10_1101-2021_01_08_425952 181 6 care care NN 10_1101-2021_01_08_425952 181 7 professional professional NN 10_1101-2021_01_08_425952 181 8 suggests suggest VBZ 10_1101-2021_01_08_425952 181 9 a a DT 10_1101-2021_01_08_425952 181 10 change change NN 10_1101-2021_01_08_425952 181 11 in in IN 10_1101-2021_01_08_425952 181 12 the the DT 10_1101-2021_01_08_425952 181 13 patient patient NN 10_1101-2021_01_08_425952 181 14 ’s ’s POS 10_1101-2021_01_08_425952 181 15 lifestyle lifestyle NN 10_1101-2021_01_08_425952 181 16 choices choice NNS 10_1101-2021_01_08_425952 181 17 , , , 10_1101-2021_01_08_425952 181 18 that that DT 10_1101-2021_01_08_425952 181 19 patient patient NN 10_1101-2021_01_08_425952 181 20 may may MD 10_1101-2021_01_08_425952 181 21 have have VB 10_1101-2021_01_08_425952 181 22 several several JJ 10_1101-2021_01_08_425952 181 23 clinical clinical JJ 10_1101-2021_01_08_425952 181 24 events event NNS 10_1101-2021_01_08_425952 181 25 free free JJ 10_1101-2021_01_08_425952 181 26 from from IN 10_1101-2021_01_08_425952 181 27 prescriptions prescription NNS 10_1101-2021_01_08_425952 181 28 before before IN 10_1101-2021_01_08_425952 181 29 the the DT 10_1101-2021_01_08_425952 181 30 first first JJ 10_1101-2021_01_08_425952 181 31 prescription prescription NN 10_1101-2021_01_08_425952 181 32 of of IN 10_1101-2021_01_08_425952 181 33 interest interest NN 10_1101-2021_01_08_425952 181 34 is be VBZ 10_1101-2021_01_08_425952 181 35 prescribed prescribe VBN 10_1101-2021_01_08_425952 181 36 . . . 10_1101-2021_01_08_425952 182 1 Using use VBG 10_1101-2021_01_08_425952 182 2 basic basic JJ 10_1101-2021_01_08_425952 182 3 subsetting subsette VBG 10_1101-2021_01_08_425952 182 4 one one PRP 10_1101-2021_01_08_425952 182 5 can can MD 10_1101-2021_01_08_425952 182 6 calculate calculate VB 10_1101-2021_01_08_425952 182 7 the the DT 10_1101-2021_01_08_425952 182 8 number number NN 10_1101-2021_01_08_425952 182 9 of of IN 10_1101-2021_01_08_425952 182 10 clinical clinical JJ 10_1101-2021_01_08_425952 182 11 events event NNS 10_1101-2021_01_08_425952 182 12 before before IN 10_1101-2021_01_08_425952 182 13 the the DT 10_1101-2021_01_08_425952 182 14 patient patient NN 10_1101-2021_01_08_425952 182 15 ’s ’s POS 10_1101-2021_01_08_425952 182 16 first first JJ 10_1101-2021_01_08_425952 182 17 prescription prescription NN 10_1101-2021_01_08_425952 182 18 intervention intervention NN 10_1101-2021_01_08_425952 182 19 ( ( -LRB- 10_1101-2021_01_08_425952 182 20 Figure figure NN 10_1101-2021_01_08_425952 182 21 3 3 CD 10_1101-2021_01_08_425952 182 22 A a NN 10_1101-2021_01_08_425952 182 23 ) ) -RRB- 10_1101-2021_01_08_425952 182 24 . . . 10_1101-2021_01_08_425952 183 1 Further further RB 10_1101-2021_01_08_425952 183 2 more more JJR 10_1101-2021_01_08_425952 183 3 , , , 10_1101-2021_01_08_425952 183 4 we -PRON- PRP 10_1101-2021_01_08_425952 183 5 can can MD 10_1101-2021_01_08_425952 183 6 stratify stratify VB 10_1101-2021_01_08_425952 183 7 patients patient NNS 10_1101-2021_01_08_425952 183 8 into into IN 10_1101-2021_01_08_425952 183 9 subgroups subgroup NNS 10_1101-2021_01_08_425952 183 10 ( ( -LRB- 10_1101-2021_01_08_425952 183 11 Figure figure NN 10_1101-2021_01_08_425952 183 12 3 3 CD 10_1101-2021_01_08_425952 183 13 B B NNP 10_1101-2021_01_08_425952 183 14 ) ) -RRB- 10_1101-2021_01_08_425952 183 15 : : : 10_1101-2021_01_08_425952 183 16 > > XX 10_1101-2021_01_08_425952 183 17 library(rdrugtrajectory library(rdrugtrajectory NN 10_1101-2021_01_08_425952 183 18 ) ) -RRB- 10_1101-2021_01_08_425952 183 19 > > XX 10_1101-2021_01_08_425952 183 20 library(ggplot2 library(ggplot2 NN 10_1101-2021_01_08_425952 183 21 ) ) -RRB- 10_1101-2021_01_08_425952 183 22 > > XX 10_1101-2021_01_08_425952 183 23 # # $ 10_1101-2021_01_08_425952 183 24 A a DT 10_1101-2021_01_08_425952 183 25 vector vector NN 10_1101-2021_01_08_425952 183 26 of of IN 10_1101-2021_01_08_425952 183 27 prescriptions prescription NNS 10_1101-2021_01_08_425952 183 28 of of IN 10_1101-2021_01_08_425952 183 29 interest interest NN 10_1101-2021_01_08_425952 183 30 . . . 10_1101-2021_01_08_425952 184 1 > > XX 10_1101-2021_01_08_425952 184 2 drugList druglist XX 10_1101-2021_01_08_425952 184 3 < < XX 10_1101-2021_01_08_425952 184 4 - - HYPH 10_1101-2021_01_08_425952 184 5 unique(testTherapyDF$prodcode unique(testTherapyDF$prodcode NNP 10_1101-2021_01_08_425952 184 6 ) ) -RRB- 10_1101-2021_01_08_425952 184 7 > > XX 10_1101-2021_01_08_425952 184 8 sampleDrugs sampledrug NNS 10_1101-2021_01_08_425952 184 9 < < XX 10_1101-2021_01_08_425952 184 10 - - HYPH 10_1101-2021_01_08_425952 184 11 drugList[1:8 druglist[1:8 NN 10_1101-2021_01_08_425952 184 12 ] ] -RRB- 10_1101-2021_01_08_425952 184 13 > > NFP 10_1101-2021_01_08_425952 184 14 # # $ 10_1101-2021_01_08_425952 184 15 A a DT 10_1101-2021_01_08_425952 184 16 vector vector NN 10_1101-2021_01_08_425952 184 17 of of IN 10_1101-2021_01_08_425952 184 18 clinical clinical JJ 10_1101-2021_01_08_425952 184 19 events event NNS 10_1101-2021_01_08_425952 184 20 to to TO 10_1101-2021_01_08_425952 184 21 match match VB 10_1101-2021_01_08_425952 184 22 prescriptions prescription NNS 10_1101-2021_01_08_425952 184 23 against against IN 10_1101-2021_01_08_425952 184 24 . . . 10_1101-2021_01_08_425952 185 1 > > XX 10_1101-2021_01_08_425952 185 2 medCodes medcodes FW 10_1101-2021_01_08_425952 185 3 < < XX 10_1101-2021_01_08_425952 185 4 - - HYPH 10_1101-2021_01_08_425952 185 5 unique(testClinicalDF$medcode unique(testclinicaldf$medcode NN 10_1101-2021_01_08_425952 185 6 ) ) -RRB- 10_1101-2021_01_08_425952 185 7 > > XX 10_1101-2021_01_08_425952 185 8 sampleMedCodes samplemedcodes FW 10_1101-2021_01_08_425952 185 9 < < XX 10_1101-2021_01_08_425952 185 10 - - HYPH 10_1101-2021_01_08_425952 185 11 medCodes[1:30 medCodes[1:30 NNP 10_1101-2021_01_08_425952 185 12 ] ] -RRB- 10_1101-2021_01_08_425952 185 13 > > XX 10_1101-2021_01_08_425952 185 14 # # NN 10_1101-2021_01_08_425952 185 15 Returns return NNS 10_1101-2021_01_08_425952 185 16 the the DT 10_1101-2021_01_08_425952 185 17 subset subset NN 10_1101-2021_01_08_425952 185 18 of of IN 10_1101-2021_01_08_425952 185 19 the the DT 10_1101-2021_01_08_425952 185 20 first first JJ 10_1101-2021_01_08_425952 185 21 prescription prescription NN 10_1101-2021_01_08_425952 185 22 event event NN 10_1101-2021_01_08_425952 185 23 prescribed prescribe VBN 10_1101-2021_01_08_425952 185 24 on on IN 10_1101-2021_01_08_425952 185 25 the the DT 10_1101-2021_01_08_425952 185 26 same same JJ 10_1101-2021_01_08_425952 185 27 > > XX 10_1101-2021_01_08_425952 185 28 # # $ 10_1101-2021_01_08_425952 185 29 eventdate eventdate VBP 10_1101-2021_01_08_425952 185 30 as as IN 10_1101-2021_01_08_425952 185 31 those those DT 10_1101-2021_01_08_425952 185 32 clinical clinical JJ 10_1101-2021_01_08_425952 185 33 events event NNS 10_1101-2021_01_08_425952 185 34 of of IN 10_1101-2021_01_08_425952 185 35 interest interest NN 10_1101-2021_01_08_425952 185 36 .CC .CC NFP 10_1101-2021_01_08_425952 185 37 - - : 10_1101-2021_01_08_425952 185 38 BY by IN 10_1101-2021_01_08_425952 185 39 - - HYPH 10_1101-2021_01_08_425952 185 40 ND ND NNP 10_1101-2021_01_08_425952 185 41 4.0 4.0 CD 10_1101-2021_01_08_425952 185 42 International international JJ 10_1101-2021_01_08_425952 185 43 licensemade licensemade NN 10_1101-2021_01_08_425952 185 44 available available JJ 10_1101-2021_01_08_425952 185 45 under under IN 10_1101-2021_01_08_425952 185 46 a a DT 10_1101-2021_01_08_425952 185 47 ( ( -LRB- 10_1101-2021_01_08_425952 185 48 which which WDT 10_1101-2021_01_08_425952 185 49 was be VBD 10_1101-2021_01_08_425952 185 50 not not RB 10_1101-2021_01_08_425952 185 51 certified certify VBN 10_1101-2021_01_08_425952 185 52 by by IN 10_1101-2021_01_08_425952 185 53 peer peer NN 10_1101-2021_01_08_425952 185 54 review review NN 10_1101-2021_01_08_425952 185 55 ) ) -RRB- 10_1101-2021_01_08_425952 185 56 is be VBZ 10_1101-2021_01_08_425952 185 57 the the DT 10_1101-2021_01_08_425952 185 58 author author NN 10_1101-2021_01_08_425952 185 59 / / SYM 10_1101-2021_01_08_425952 185 60 funder funder NN 10_1101-2021_01_08_425952 185 61 , , , 10_1101-2021_01_08_425952 185 62 who who WP 10_1101-2021_01_08_425952 185 63 has have VBZ 10_1101-2021_01_08_425952 185 64 granted grant VBN 10_1101-2021_01_08_425952 185 65 bioRxiv biorxiv IN 10_1101-2021_01_08_425952 185 66 a a DT 10_1101-2021_01_08_425952 185 67 license license NN 10_1101-2021_01_08_425952 185 68 to to TO 10_1101-2021_01_08_425952 185 69 display display VB 10_1101-2021_01_08_425952 185 70 the the DT 10_1101-2021_01_08_425952 185 71 preprint preprint NN 10_1101-2021_01_08_425952 185 72 in in IN 10_1101-2021_01_08_425952 185 73 perpetuity perpetuity NN 10_1101-2021_01_08_425952 185 74 . . . 10_1101-2021_01_08_425952 186 1 It -PRON- PRP 10_1101-2021_01_08_425952 186 2 is be VBZ 10_1101-2021_01_08_425952 186 3 The the DT 10_1101-2021_01_08_425952 186 4 copyright copyright NN 10_1101-2021_01_08_425952 186 5 holder holder NN 10_1101-2021_01_08_425952 186 6 for for IN 10_1101-2021_01_08_425952 186 7 this this DT 10_1101-2021_01_08_425952 186 8 preprintthis preprintthis NN 10_1101-2021_01_08_425952 186 9 version version NN 10_1101-2021_01_08_425952 186 10 posted post VBD 10_1101-2021_01_08_425952 186 11 January January NNP 10_1101-2021_01_08_425952 186 12 9 9 CD 10_1101-2021_01_08_425952 186 13 , , , 10_1101-2021_01_08_425952 186 14 2021 2021 CD 10_1101-2021_01_08_425952 186 15 . . . 10_1101-2021_01_08_425952 186 16 ; ; : 10_1101-2021_01_08_425952 186 17 https://doi.org/10.1101/2021.01.08.425952doi https://doi.org/10.1101/2021.01.08.425952doi ADD 10_1101-2021_01_08_425952 186 18 : : : 10_1101-2021_01_08_425952 186 19 bioRxiv biorxiv IN 10_1101-2021_01_08_425952 186 20 preprint preprint NN 10_1101-2021_01_08_425952 186 21 https://doi.org/10.1101/2021.01.08.425952 https://doi.org/10.1101/2021.01.08.425952 XX 10_1101-2021_01_08_425952 186 22 http://creativecommons.org/licenses/by-nd/4.0/ http://creativecommons.org/licenses/by-nd/4.0/ NNP 10_1101-2021_01_08_425952 186 23 Journal Journal NNP 10_1101-2021_01_08_425952 186 24 of of IN 10_1101-2021_01_08_425952 186 25 Statistical Statistical NNP 10_1101-2021_01_08_425952 186 26 Software Software NNP 10_1101-2021_01_08_425952 186 27 17 17 CD 10_1101-2021_01_08_425952 186 28 > > XX 10_1101-2021_01_08_425952 186 29 firstDF firstDF NNP 10_1101-2021_01_08_425952 186 30 < < XX 10_1101-2021_01_08_425952 186 31 - - HYPH 10_1101-2021_01_08_425952 186 32 getPatientsWithFirstDrugWithDisease(clinicalDF getPatientsWithFirstDrugWithDisease(clinicalDF NNP 10_1101-2021_01_08_425952 186 33 = = -RRB- 10_1101-2021_01_08_425952 186 34 testClinicalDF testClinicalDF NNP 10_1101-2021_01_08_425952 186 35 , , , 10_1101-2021_01_08_425952 186 36 + + CC 10_1101-2021_01_08_425952 186 37 therapyDF therapyDF NNP 10_1101-2021_01_08_425952 186 38 = = SYM 10_1101-2021_01_08_425952 186 39 testTherapyDF testTherapyDF NNS 10_1101-2021_01_08_425952 186 40 , , , 10_1101-2021_01_08_425952 186 41 + + CC 10_1101-2021_01_08_425952 186 42 medCodesVector medcodesvector UH 10_1101-2021_01_08_425952 186 43 = = SYM 10_1101-2021_01_08_425952 186 44 sampleMedCodes samplemedcodes FW 10_1101-2021_01_08_425952 186 45 , , , 10_1101-2021_01_08_425952 186 46 + + CC 10_1101-2021_01_08_425952 186 47 drugCodesVector drugcodesvector NN 10_1101-2021_01_08_425952 186 48 = = SYM 10_1101-2021_01_08_425952 186 49 sampleDrugs sampledrug NNS 10_1101-2021_01_08_425952 186 50 ) ) -RRB- 10_1101-2021_01_08_425952 186 51 > > XX 10_1101-2021_01_08_425952 186 52 # # $ 10_1101-2021_01_08_425952 186 53 Ensure ensure VB 10_1101-2021_01_08_425952 186 54 the the DT 10_1101-2021_01_08_425952 186 55 only only JJ 10_1101-2021_01_08_425952 186 56 clinical clinical JJ 10_1101-2021_01_08_425952 186 57 data datum NNS 10_1101-2021_01_08_425952 186 58 are be VBP 10_1101-2021_01_08_425952 186 59 for for IN 10_1101-2021_01_08_425952 186 60 those those DT 10_1101-2021_01_08_425952 186 61 with with IN 10_1101-2021_01_08_425952 186 62 an an DT 10_1101-2021_01_08_425952 186 63 assume assume JJ 10_1101-2021_01_08_425952 186 64 first first JJ 10_1101-2021_01_08_425952 186 65 - - HYPH 10_1101-2021_01_08_425952 186 66 drug drug NN 10_1101-2021_01_08_425952 186 67 - - HYPH 10_1101-2021_01_08_425952 186 68 disease disease NN 10_1101-2021_01_08_425952 186 69 > > XX 10_1101-2021_01_08_425952 186 70 firstClinicalDF firstClinicalDF NNP 10_1101-2021_01_08_425952 186 71 < < XX 10_1101-2021_01_08_425952 186 72 - - HYPH 10_1101-2021_01_08_425952 186 73 subset(testClinicalDF subset(testClinicalDF NNP 10_1101-2021_01_08_425952 186 74 , , , 10_1101-2021_01_08_425952 186 75 + + CC 10_1101-2021_01_08_425952 186 76 testClinicalDF$patid testclinicaldf$patid VB 10_1101-2021_01_08_425952 186 77 % % NN 10_1101-2021_01_08_425952 186 78 in% in% VBP 10_1101-2021_01_08_425952 186 79 getUniquePatidList(firstDF getuniquepatidlist(firstdf CD 10_1101-2021_01_08_425952 186 80 ) ) -RRB- 10_1101-2021_01_08_425952 186 81 ) ) -RRB- 10_1101-2021_01_08_425952 186 82 > > XX 10_1101-2021_01_08_425952 186 83 # # $ 10_1101-2021_01_08_425952 186 84 Only only RB 10_1101-2021_01_08_425952 186 85 keep keep VB 10_1101-2021_01_08_425952 186 86 the the DT 10_1101-2021_01_08_425952 186 87 diseases disease NNS 10_1101-2021_01_08_425952 186 88 of of IN 10_1101-2021_01_08_425952 186 89 interest interest NN 10_1101-2021_01_08_425952 186 90 > > XX 10_1101-2021_01_08_425952 186 91 firstClinicalDF firstClinicalDF NNP 10_1101-2021_01_08_425952 186 92 < < XX 10_1101-2021_01_08_425952 186 93 - - HYPH 10_1101-2021_01_08_425952 186 94 subset(firstClinicalDF subset(firstClinicalDF NNP 10_1101-2021_01_08_425952 186 95 , , , 10_1101-2021_01_08_425952 186 96 + + CC 10_1101-2021_01_08_425952 186 97 firstClinicalDF$medcode firstClinicalDF$medcode NNP 10_1101-2021_01_08_425952 186 98 % % NN 10_1101-2021_01_08_425952 186 99 in% in% CD 10_1101-2021_01_08_425952 186 100 sampleMedCodes samplemedcodes XX 10_1101-2021_01_08_425952 186 101 ) ) -RRB- 10_1101-2021_01_08_425952 186 102 > > XX 10_1101-2021_01_08_425952 186 103 # # $ 10_1101-2021_01_08_425952 186 104 Only only RB 10_1101-2021_01_08_425952 186 105 keep keep VB 10_1101-2021_01_08_425952 186 106 the the DT 10_1101-2021_01_08_425952 186 107 prescriptions prescription NNS 10_1101-2021_01_08_425952 186 108 of of IN 10_1101-2021_01_08_425952 186 109 interest interest NN 10_1101-2021_01_08_425952 186 110 > > XX 10_1101-2021_01_08_425952 186 111 firstDF firstDF NNP 10_1101-2021_01_08_425952 186 112 < < XX 10_1101-2021_01_08_425952 186 113 - - HYPH 10_1101-2021_01_08_425952 186 114 subset(firstDF subset(firstDF NNP 10_1101-2021_01_08_425952 186 115 , , , 10_1101-2021_01_08_425952 186 116 firstDF$prodcode firstDF$prodcode `` 10_1101-2021_01_08_425952 186 117 % % NN 10_1101-2021_01_08_425952 186 118 in% in% NN 10_1101-2021_01_08_425952 186 119 sampleDrugs sampledrug NNS 10_1101-2021_01_08_425952 186 120 ) ) -RRB- 10_1101-2021_01_08_425952 186 121 > > XX 10_1101-2021_01_08_425952 186 122 idList idList NNP 10_1101-2021_01_08_425952 186 123 < < NNP 10_1101-2021_01_08_425952 186 124 - - HYPH 10_1101-2021_01_08_425952 186 125 getUniquePatidList(firstClinicalDF getUniquePatidList(firstClinicalDF NNP 10_1101-2021_01_08_425952 186 126 ) ) -RRB- 10_1101-2021_01_08_425952 186 127 > > XX 10_1101-2021_01_08_425952 186 128 beforeResultDF beforeResultDF NNP 10_1101-2021_01_08_425952 186 129 < < XX 10_1101-2021_01_08_425952 186 130 - - HYPH 10_1101-2021_01_08_425952 186 131 data.frame(patid data.frame(patid NNP 10_1101-2021_01_08_425952 186 132 = = SYM 10_1101-2021_01_08_425952 186 133 unlist(idList unlist(idList NNP 10_1101-2021_01_08_425952 186 134 ) ) -RRB- 10_1101-2021_01_08_425952 186 135 , , , 10_1101-2021_01_08_425952 186 136 Freq=0 Freq=0 NNP 10_1101-2021_01_08_425952 186 137 ) ) -RRB- 10_1101-2021_01_08_425952 186 138 > > XX 10_1101-2021_01_08_425952 186 139 for(id for(id NN 10_1101-2021_01_08_425952 186 140 in in IN 10_1101-2021_01_08_425952 186 141 idList idList NNP 10_1101-2021_01_08_425952 186 142 ) ) -RRB- 10_1101-2021_01_08_425952 186 143 { { -LRB- 10_1101-2021_01_08_425952 186 144 + + CC 10_1101-2021_01_08_425952 186 145 # # $ 10_1101-2021_01_08_425952 186 146 Retrieve retrieve VB 10_1101-2021_01_08_425952 186 147 the the DT 10_1101-2021_01_08_425952 186 148 clinical clinical JJ 10_1101-2021_01_08_425952 186 149 / / SYM 10_1101-2021_01_08_425952 186 150 therapy therapy NN 10_1101-2021_01_08_425952 186 151 data datum NNS 10_1101-2021_01_08_425952 186 152 for for IN 10_1101-2021_01_08_425952 186 153 each each DT 10_1101-2021_01_08_425952 186 154 patients patient NNS 10_1101-2021_01_08_425952 186 155 , , , 10_1101-2021_01_08_425952 186 156 one one CD 10_1101-2021_01_08_425952 186 157 by by IN 10_1101-2021_01_08_425952 186 158 one one CD 10_1101-2021_01_08_425952 186 159 . . . 10_1101-2021_01_08_425952 187 1 + + CC 10_1101-2021_01_08_425952 187 2 indClinicalDF indclinicaldf JJ 10_1101-2021_01_08_425952 187 3 < < XX 10_1101-2021_01_08_425952 187 4 - - HYPH 10_1101-2021_01_08_425952 187 5 subset(firstClinicalDF subset(firstclinicaldf JJ 10_1101-2021_01_08_425952 187 6 , , , 10_1101-2021_01_08_425952 187 7 firstClinicalDF$patid firstClinicalDF$patid NNP 10_1101-2021_01_08_425952 187 8 = = SYM 10_1101-2021_01_08_425952 187 9 = = NFP 10_1101-2021_01_08_425952 187 10 i -PRON- PRP 10_1101-2021_01_08_425952 187 11 d d VBN 10_1101-2021_01_08_425952 187 12 ) ) -RRB- 10_1101-2021_01_08_425952 187 13 + + SYM 10_1101-2021_01_08_425952 187 14 indTherapyDF indTherapyDF NNS 10_1101-2021_01_08_425952 187 15 < < XX 10_1101-2021_01_08_425952 187 16 - - HYPH 10_1101-2021_01_08_425952 187 17 subset(firstDF subset(firstdf CD 10_1101-2021_01_08_425952 187 18 , , , 10_1101-2021_01_08_425952 187 19 firstDF$patid firstdf$patid XX 10_1101-2021_01_08_425952 187 20 = = NFP 10_1101-2021_01_08_425952 187 21 = = NFP 10_1101-2021_01_08_425952 187 22 i -PRON- PRP 10_1101-2021_01_08_425952 187 23 d d VBN 10_1101-2021_01_08_425952 187 24 ) ) -RRB- 10_1101-2021_01_08_425952 187 25 + + CC 10_1101-2021_01_08_425952 187 26 # # $ 10_1101-2021_01_08_425952 187 27 Get get VB 10_1101-2021_01_08_425952 187 28 the the DT 10_1101-2021_01_08_425952 187 29 first first JJ 10_1101-2021_01_08_425952 187 30 event event NN 10_1101-2021_01_08_425952 187 31 date date NN 10_1101-2021_01_08_425952 187 32 on on IN 10_1101-2021_01_08_425952 187 33 record record NN 10_1101-2021_01_08_425952 187 34 ; ; : 10_1101-2021_01_08_425952 187 35 this this DT 10_1101-2021_01_08_425952 187 36 will will MD 10_1101-2021_01_08_425952 187 37 match match VB 10_1101-2021_01_08_425952 187 38 a a DT 10_1101-2021_01_08_425952 187 39 clinical clinical JJ 10_1101-2021_01_08_425952 187 40 date date NN 10_1101-2021_01_08_425952 187 41 . . . 10_1101-2021_01_08_425952 188 1 + + SYM 10_1101-2021_01_08_425952 188 2 firstEventDate firstEventDate NNP 10_1101-2021_01_08_425952 188 3 < < XX 10_1101-2021_01_08_425952 188 4 - - HYPH 10_1101-2021_01_08_425952 188 5 indTherapyDF$eventdate[1 indTherapyDF$eventdate[1 NNP 10_1101-2021_01_08_425952 188 6 ] ] -RRB- 10_1101-2021_01_08_425952 188 7 + + CC 10_1101-2021_01_08_425952 188 8 clinicalBeforeTherapyDF clinicalBeforeTherapyDF NNP 10_1101-2021_01_08_425952 188 9 < < XX 10_1101-2021_01_08_425952 188 10 - - HYPH 10_1101-2021_01_08_425952 188 11 subset(indClinicalDF subset(indClinicalDF NNP 10_1101-2021_01_08_425952 188 12 , , , 10_1101-2021_01_08_425952 188 13 + + CC 10_1101-2021_01_08_425952 188 14 indClinicalDF$eventdate indclinicaldf$eventdate NN 10_1101-2021_01_08_425952 188 15 < < XX 10_1101-2021_01_08_425952 188 16 firstEventDate firstEventDate NNP 10_1101-2021_01_08_425952 188 17 ) ) -RRB- 10_1101-2021_01_08_425952 188 18 + + CC 10_1101-2021_01_08_425952 188 19 # # NN 10_1101-2021_01_08_425952 188 20 Number number NN 10_1101-2021_01_08_425952 188 21 of of IN 10_1101-2021_01_08_425952 188 22 clinical clinical JJ 10_1101-2021_01_08_425952 188 23 complaints complaint NNS 10_1101-2021_01_08_425952 188 24 before before IN 10_1101-2021_01_08_425952 188 25 first first JJ 10_1101-2021_01_08_425952 188 26 prescription prescription NN 10_1101-2021_01_08_425952 188 27 . . . 10_1101-2021_01_08_425952 189 1 + + NFP 10_1101-2021_01_08_425952 189 2 nComplaints nComplaints NNP 10_1101-2021_01_08_425952 189 3 < < XX 10_1101-2021_01_08_425952 189 4 - - HYPH 10_1101-2021_01_08_425952 189 5 nrow(clinicalBeforeTherapyDF nrow(clinicalBeforeTherapyDF NNP 10_1101-2021_01_08_425952 189 6 ) ) -RRB- 10_1101-2021_01_08_425952 189 7 + + CC 10_1101-2021_01_08_425952 189 8 beforeResultDF[beforeResultDF$patid==id,]$Freq beforeResultDF[beforeResultDF$patid==id,]$Freq NNP 10_1101-2021_01_08_425952 189 9 < < XX 10_1101-2021_01_08_425952 189 10 - - : 10_1101-2021_01_08_425952 189 11 nComplaints nComplaints NNP 10_1101-2021_01_08_425952 189 12 + + CC 10_1101-2021_01_08_425952 189 13 } } -RRB- 10_1101-2021_01_08_425952 189 14 > > NN 10_1101-2021_01_08_425952 189 15 ggBefore ggbefore XX 10_1101-2021_01_08_425952 189 16 < < XX 10_1101-2021_01_08_425952 189 17 - - HYPH 10_1101-2021_01_08_425952 189 18 ggplot(beforeResultDF ggplot(beforeResultDF NNP 10_1101-2021_01_08_425952 189 19 , , , 10_1101-2021_01_08_425952 189 20 aes(x aes(x NNP 10_1101-2021_01_08_425952 189 21 = = NFP 10_1101-2021_01_08_425952 189 22 Freq freq NN 10_1101-2021_01_08_425952 189 23 ) ) -RRB- 10_1101-2021_01_08_425952 189 24 ) ) -RRB- 10_1101-2021_01_08_425952 189 25 + + NFP 10_1101-2021_01_08_425952 189 26 + + SYM 10_1101-2021_01_08_425952 189 27 geom_histogram(binwidth=1 geom_histogram(binwidth=1 NNS 10_1101-2021_01_08_425952 189 28 , , , 10_1101-2021_01_08_425952 189 29 color="black color="black NN 10_1101-2021_01_08_425952 189 30 " " '' 10_1101-2021_01_08_425952 189 31 , , , 10_1101-2021_01_08_425952 189 32 fill="white fill="white NNP 10_1101-2021_01_08_425952 189 33 " " '' 10_1101-2021_01_08_425952 189 34 ) ) -RRB- 10_1101-2021_01_08_425952 189 35 + + CC 10_1101-2021_01_08_425952 189 36 + + CC 10_1101-2021_01_08_425952 189 37 ylab("Patients ylab("patient NNS 10_1101-2021_01_08_425952 189 38 " " '' 10_1101-2021_01_08_425952 189 39 ) ) -RRB- 10_1101-2021_01_08_425952 189 40 + + NFP 10_1101-2021_01_08_425952 189 41 xlab("Clinical xlab("clinical JJ 10_1101-2021_01_08_425952 189 42 events event NNS 10_1101-2021_01_08_425952 189 43 before before IN 10_1101-2021_01_08_425952 189 44 prescription prescription NN 10_1101-2021_01_08_425952 189 45 " " '' 10_1101-2021_01_08_425952 189 46 ) ) -RRB- 10_1101-2021_01_08_425952 189 47 + + NFP 10_1101-2021_01_08_425952 189 48 + + NFP 10_1101-2021_01_08_425952 189 49 theme_bw theme_bw NNP 10_1101-2021_01_08_425952 189 50 ( ( -LRB- 10_1101-2021_01_08_425952 189 51 ) ) -RRB- 10_1101-2021_01_08_425952 189 52 > > XX 10_1101-2021_01_08_425952 189 53 # # NN 10_1101-2021_01_08_425952 189 54 Note note NN 10_1101-2021_01_08_425952 189 55 : : : 10_1101-2021_01_08_425952 189 56 not not RB 10_1101-2021_01_08_425952 189 57 every every DT 10_1101-2021_01_08_425952 189 58 patient patient NN 10_1101-2021_01_08_425952 189 59 will will MD 10_1101-2021_01_08_425952 189 60 have have VB 10_1101-2021_01_08_425952 189 61 a a DT 10_1101-2021_01_08_425952 189 62 clinical clinical JJ 10_1101-2021_01_08_425952 189 63 IMD IMD NNP 10_1101-2021_01_08_425952 189 64 score score NN 10_1101-2021_01_08_425952 189 65 . . . 10_1101-2021_01_08_425952 190 1 > > XX 10_1101-2021_01_08_425952 190 2 imdIDsDF imdIDsDF NNP 10_1101-2021_01_08_425952 190 3 < < XX 10_1101-2021_01_08_425952 190 4 - - HYPH 10_1101-2021_01_08_425952 190 5 getIMDOfPatients(idList getimdofpatients(idlist JJ 10_1101-2021_01_08_425952 190 6 = = -RRB- 10_1101-2021_01_08_425952 190 7 idList idList NNP 10_1101-2021_01_08_425952 190 8 , , , 10_1101-2021_01_08_425952 190 9 + + NFP 10_1101-2021_01_08_425952 190 10 imdDF imddf ADD 10_1101-2021_01_08_425952 190 11 = = SYM 10_1101-2021_01_08_425952 190 12 imdDF imdDF -RRB- 10_1101-2021_01_08_425952 190 13 ) ) -RRB- 10_1101-2021_01_08_425952 190 14 > > XX 10_1101-2021_01_08_425952 190 15 # # $ 10_1101-2021_01_08_425952 190 16 Only only RB 10_1101-2021_01_08_425952 190 17 work work VBP 10_1101-2021_01_08_425952 190 18 with with IN 10_1101-2021_01_08_425952 190 19 those those DT 10_1101-2021_01_08_425952 190 20 with with IN 10_1101-2021_01_08_425952 190 21 an an DT 10_1101-2021_01_08_425952 190 22 IMD IMD NNP 10_1101-2021_01_08_425952 190 23 score score NN 10_1101-2021_01_08_425952 190 24 . . . 10_1101-2021_01_08_425952 191 1 > > XX 10_1101-2021_01_08_425952 191 2 imdResultsDF imdresultsdf FW 10_1101-2021_01_08_425952 191 3 < < XX 10_1101-2021_01_08_425952 191 4 - - HYPH 10_1101-2021_01_08_425952 191 5 subset(beforeResultDF subset(beforeResultDF NNP 10_1101-2021_01_08_425952 191 6 , , , 10_1101-2021_01_08_425952 191 7 + + CC 10_1101-2021_01_08_425952 191 8 beforeResultDF$patid beforeresultdf$patid NN 10_1101-2021_01_08_425952 191 9 % % NN 10_1101-2021_01_08_425952 191 10 in% in% VBP 10_1101-2021_01_08_425952 191 11 getUniquePatidList(imdIDsDF getuniquepatidlist(imdidsdf CD 10_1101-2021_01_08_425952 191 12 ) ) -RRB- 10_1101-2021_01_08_425952 191 13 ) ) -RRB- 10_1101-2021_01_08_425952 191 14 > > XX 10_1101-2021_01_08_425952 191 15 imdResultsDF imdresultsdf FW 10_1101-2021_01_08_425952 191 16 < < XX 10_1101-2021_01_08_425952 191 17 - - HYPH 10_1101-2021_01_08_425952 191 18 imdResultsDF[order(imdResultsDF$patid imdresultsdf[order(imdresultsdf$patid FW 10_1101-2021_01_08_425952 191 19 ) ) -RRB- 10_1101-2021_01_08_425952 191 20 , , , 10_1101-2021_01_08_425952 191 21 ] ] -RRB- 10_1101-2021_01_08_425952 191 22 > > XX 10_1101-2021_01_08_425952 191 23 imdIDsDF imdidsdf ADD 10_1101-2021_01_08_425952 191 24 < < XX 10_1101-2021_01_08_425952 191 25 - - : 10_1101-2021_01_08_425952 191 26 imdIDsDF[order(imdIDsDF$patid imdIDsDF[order(imdIDsDF$patid NNP 10_1101-2021_01_08_425952 191 27 ) ) -RRB- 10_1101-2021_01_08_425952 191 28 , , , 10_1101-2021_01_08_425952 191 29 ] ] -RRB- 10_1101-2021_01_08_425952 191 30 > > XX 10_1101-2021_01_08_425952 191 31 imdResultsDF imdresultsdf FW 10_1101-2021_01_08_425952 191 32 < < XX 10_1101-2021_01_08_425952 191 33 - - HYPH 10_1101-2021_01_08_425952 191 34 cbind(imdResultsDF cbind(imdresultsdf JJ 10_1101-2021_01_08_425952 191 35 , , , 10_1101-2021_01_08_425952 191 36 IMD_score imd_score NN 10_1101-2021_01_08_425952 191 37 = = SYM 10_1101-2021_01_08_425952 191 38 as.factor(imdIDsDF$score as.factor(imdidsdf$score NN 10_1101-2021_01_08_425952 191 39 ) ) -RRB- 10_1101-2021_01_08_425952 191 40 ) ) -RRB- 10_1101-2021_01_08_425952 191 41 > > XX 10_1101-2021_01_08_425952 191 42 ggBeforeIMD ggbeforeimd FW 10_1101-2021_01_08_425952 191 43 < < XX 10_1101-2021_01_08_425952 191 44 - - HYPH 10_1101-2021_01_08_425952 191 45 ggplot(imdResultsDF ggplot(imdResultsDF NNP 10_1101-2021_01_08_425952 191 46 , , , 10_1101-2021_01_08_425952 191 47 + + CC 10_1101-2021_01_08_425952 191 48 aes(x aes(x NN 10_1101-2021_01_08_425952 191 49 = = SYM 10_1101-2021_01_08_425952 191 50 Freq Freq NNP 10_1101-2021_01_08_425952 191 51 , , , 10_1101-2021_01_08_425952 191 52 fill fill VB 10_1101-2021_01_08_425952 191 53 = = SYM 10_1101-2021_01_08_425952 191 54 IMD_score imd_score NN 10_1101-2021_01_08_425952 191 55 ) ) -RRB- 10_1101-2021_01_08_425952 191 56 ) ) -RRB- 10_1101-2021_01_08_425952 191 57 + + NFP 10_1101-2021_01_08_425952 191 58 + + SYM 10_1101-2021_01_08_425952 191 59 geom_histogram(binwidth=1 geom_histogram(binwidth=1 NN 10_1101-2021_01_08_425952 191 60 ) ) -RRB- 10_1101-2021_01_08_425952 191 61 + + NFP 10_1101-2021_01_08_425952 191 62 theme_bw theme_bw NNP 10_1101-2021_01_08_425952 191 63 ( ( -LRB- 10_1101-2021_01_08_425952 191 64 ) ) -RRB- 10_1101-2021_01_08_425952 191 65 + + CC 10_1101-2021_01_08_425952 191 66 + + CC 10_1101-2021_01_08_425952 191 67 ylab("Patients ylab("patient NNS 10_1101-2021_01_08_425952 191 68 " " '' 10_1101-2021_01_08_425952 191 69 ) ) -RRB- 10_1101-2021_01_08_425952 191 70 + + NFP 10_1101-2021_01_08_425952 191 71 xlab("Clinical xlab("clinical JJ 10_1101-2021_01_08_425952 191 72 events event NNS 10_1101-2021_01_08_425952 191 73 before before IN 10_1101-2021_01_08_425952 191 74 prescription prescription NN 10_1101-2021_01_08_425952 191 75 " " '' 10_1101-2021_01_08_425952 191 76 ) ) -RRB- 10_1101-2021_01_08_425952 191 77 getMultiPrescriptionSameDayPatients getMultiPrescriptionSameDayPatients NNP 10_1101-2021_01_08_425952 191 78 The the DT 10_1101-2021_01_08_425952 191 79 function function NN 10_1101-2021_01_08_425952 191 80 getMultiPrescriptionSameDayPatients getmultiprescriptionsamedaypatients NN 10_1101-2021_01_08_425952 191 81 returns return VBZ 10_1101-2021_01_08_425952 191 82 all all DT 10_1101-2021_01_08_425952 191 83 prescription prescription NN 10_1101-2021_01_08_425952 191 84 events event NNS 10_1101-2021_01_08_425952 191 85 for for IN 10_1101-2021_01_08_425952 191 86 .CC .CC NFP 10_1101-2021_01_08_425952 191 87 - - HYPH 10_1101-2021_01_08_425952 191 88 BY by IN 10_1101-2021_01_08_425952 191 89 - - HYPH 10_1101-2021_01_08_425952 191 90 ND ND NNP 10_1101-2021_01_08_425952 191 91 4.0 4.0 CD 10_1101-2021_01_08_425952 191 92 International international JJ 10_1101-2021_01_08_425952 191 93 licensemade licensemade NN 10_1101-2021_01_08_425952 191 94 available available JJ 10_1101-2021_01_08_425952 191 95 under under IN 10_1101-2021_01_08_425952 191 96 a a DT 10_1101-2021_01_08_425952 191 97 ( ( -LRB- 10_1101-2021_01_08_425952 191 98 which which WDT 10_1101-2021_01_08_425952 191 99 was be VBD 10_1101-2021_01_08_425952 191 100 not not RB 10_1101-2021_01_08_425952 191 101 certified certify VBN 10_1101-2021_01_08_425952 191 102 by by IN 10_1101-2021_01_08_425952 191 103 peer peer NN 10_1101-2021_01_08_425952 191 104 review review NN 10_1101-2021_01_08_425952 191 105 ) ) -RRB- 10_1101-2021_01_08_425952 191 106 is be VBZ 10_1101-2021_01_08_425952 191 107 the the DT 10_1101-2021_01_08_425952 191 108 author author NN 10_1101-2021_01_08_425952 191 109 / / SYM 10_1101-2021_01_08_425952 191 110 funder funder NN 10_1101-2021_01_08_425952 191 111 , , , 10_1101-2021_01_08_425952 191 112 who who WP 10_1101-2021_01_08_425952 191 113 has have VBZ 10_1101-2021_01_08_425952 191 114 granted grant VBN 10_1101-2021_01_08_425952 191 115 bioRxiv biorxiv IN 10_1101-2021_01_08_425952 191 116 a a DT 10_1101-2021_01_08_425952 191 117 license license NN 10_1101-2021_01_08_425952 191 118 to to TO 10_1101-2021_01_08_425952 191 119 display display VB 10_1101-2021_01_08_425952 191 120 the the DT 10_1101-2021_01_08_425952 191 121 preprint preprint NN 10_1101-2021_01_08_425952 191 122 in in IN 10_1101-2021_01_08_425952 191 123 perpetuity perpetuity NN 10_1101-2021_01_08_425952 191 124 . . . 10_1101-2021_01_08_425952 192 1 It -PRON- PRP 10_1101-2021_01_08_425952 192 2 is be VBZ 10_1101-2021_01_08_425952 192 3 The the DT 10_1101-2021_01_08_425952 192 4 copyright copyright NN 10_1101-2021_01_08_425952 192 5 holder holder NN 10_1101-2021_01_08_425952 192 6 for for IN 10_1101-2021_01_08_425952 192 7 this this DT 10_1101-2021_01_08_425952 192 8 preprintthis preprintthis NN 10_1101-2021_01_08_425952 192 9 version version NN 10_1101-2021_01_08_425952 192 10 posted post VBD 10_1101-2021_01_08_425952 192 11 January January NNP 10_1101-2021_01_08_425952 192 12 9 9 CD 10_1101-2021_01_08_425952 192 13 , , , 10_1101-2021_01_08_425952 192 14 2021 2021 CD 10_1101-2021_01_08_425952 192 15 . . . 10_1101-2021_01_08_425952 192 16 ; ; : 10_1101-2021_01_08_425952 192 17 https://doi.org/10.1101/2021.01.08.425952doi https://doi.org/10.1101/2021.01.08.425952doi ADD 10_1101-2021_01_08_425952 192 18 : : : 10_1101-2021_01_08_425952 192 19 bioRxiv biorxiv IN 10_1101-2021_01_08_425952 192 20 preprint preprint NN 10_1101-2021_01_08_425952 192 21 https://doi.org/10.1101/2021.01.08.425952 https://doi.org/10.1101/2021.01.08.425952 NN 10_1101-2021_01_08_425952 192 22 http://creativecommons.org/licenses/by-nd/4.0/ http://creativecommons.org/licenses/by-nd/4.0/ NN 10_1101-2021_01_08_425952 192 23 18 18 CD 10_1101-2021_01_08_425952 192 24 rdrugtrajectory rdrugtrajectory NN 10_1101-2021_01_08_425952 192 25 : : : 10_1101-2021_01_08_425952 192 26 Analysing Analysing NNP 10_1101-2021_01_08_425952 192 27 Drug Drug NNP 10_1101-2021_01_08_425952 192 28 Prescriptions Prescriptions NNPS 10_1101-2021_01_08_425952 192 29 in in IN 10_1101-2021_01_08_425952 192 30 Electronic Electronic NNP 10_1101-2021_01_08_425952 192 31 Health Health NNP 10_1101-2021_01_08_425952 192 32 Care Care NNP 10_1101-2021_01_08_425952 192 33 Records Records NNPS 10_1101-2021_01_08_425952 192 34 0 0 NFP 10_1101-2021_01_08_425952 192 35 100 100 CD 10_1101-2021_01_08_425952 192 36 200 200 CD 10_1101-2021_01_08_425952 192 37 0 0 CD 10_1101-2021_01_08_425952 192 38 10 10 CD 10_1101-2021_01_08_425952 192 39 20 20 CD 10_1101-2021_01_08_425952 192 40 Clinical clinical JJ 10_1101-2021_01_08_425952 192 41 events event NNS 10_1101-2021_01_08_425952 192 42 before before IN 10_1101-2021_01_08_425952 192 43 prescription prescription NN 10_1101-2021_01_08_425952 192 44 P p NN 10_1101-2021_01_08_425952 192 45 a a DT 10_1101-2021_01_08_425952 192 46 tie tie NN 10_1101-2021_01_08_425952 192 47 n n NNP 10_1101-2021_01_08_425952 192 48 ts ts NN 10_1101-2021_01_08_425952 192 49 A a NN 10_1101-2021_01_08_425952 192 50 0 0 CD 10_1101-2021_01_08_425952 192 51 50 50 CD 10_1101-2021_01_08_425952 192 52 100 100 CD 10_1101-2021_01_08_425952 192 53 150 150 CD 10_1101-2021_01_08_425952 192 54 0 0 CD 10_1101-2021_01_08_425952 192 55 10 10 CD 10_1101-2021_01_08_425952 192 56 20 20 CD 10_1101-2021_01_08_425952 192 57 Clinical clinical JJ 10_1101-2021_01_08_425952 192 58 events event NNS 10_1101-2021_01_08_425952 192 59 before before IN 10_1101-2021_01_08_425952 192 60 prescription prescription NN 10_1101-2021_01_08_425952 192 61 P p NN 10_1101-2021_01_08_425952 192 62 a a DT 10_1101-2021_01_08_425952 192 63 tie tie NN 10_1101-2021_01_08_425952 192 64 n n CC 10_1101-2021_01_08_425952 192 65 ts ts NN 10_1101-2021_01_08_425952 192 66 IMD_score imd_score NN 10_1101-2021_01_08_425952 192 67 1 1 CD 10_1101-2021_01_08_425952 192 68 2 2 CD 10_1101-2021_01_08_425952 192 69 3 3 CD 10_1101-2021_01_08_425952 192 70 4 4 CD 10_1101-2021_01_08_425952 192 71 5 5 CD 10_1101-2021_01_08_425952 192 72 B b NN 10_1101-2021_01_08_425952 192 73 Figure figure NN 10_1101-2021_01_08_425952 192 74 3 3 CD 10_1101-2021_01_08_425952 192 75 : : : 10_1101-2021_01_08_425952 192 76 The the DT 10_1101-2021_01_08_425952 192 77 number number NN 10_1101-2021_01_08_425952 192 78 of of IN 10_1101-2021_01_08_425952 192 79 clinical clinical JJ 10_1101-2021_01_08_425952 192 80 events event NNS 10_1101-2021_01_08_425952 192 81 before before IN 10_1101-2021_01_08_425952 192 82 the the DT 10_1101-2021_01_08_425952 192 83 first first JJ 10_1101-2021_01_08_425952 192 84 treatment treatment NN 10_1101-2021_01_08_425952 192 85 across across IN 10_1101-2021_01_08_425952 192 86 the the DT 10_1101-2021_01_08_425952 192 87 whole whole JJ 10_1101-2021_01_08_425952 192 88 cohort cohort NN 10_1101-2021_01_08_425952 192 89 ( ( -LRB- 10_1101-2021_01_08_425952 192 90 A a NN 10_1101-2021_01_08_425952 192 91 ) ) -RRB- 10_1101-2021_01_08_425952 192 92 , , , 10_1101-2021_01_08_425952 192 93 and and CC 10_1101-2021_01_08_425952 192 94 by by IN 10_1101-2021_01_08_425952 192 95 IMD IMD NNP 10_1101-2021_01_08_425952 192 96 score score NN 10_1101-2021_01_08_425952 192 97 ( ( -LRB- 10_1101-2021_01_08_425952 192 98 B b NN 10_1101-2021_01_08_425952 192 99 ) ) -RRB- 10_1101-2021_01_08_425952 192 100 . . . 10_1101-2021_01_08_425952 193 1 those those DT 10_1101-2021_01_08_425952 193 2 patients patient NNS 10_1101-2021_01_08_425952 193 3 prescribed prescribe VBD 10_1101-2021_01_08_425952 193 4 more more RBR 10_1101-2021_01_08_425952 193 5 than than IN 10_1101-2021_01_08_425952 193 6 two two CD 10_1101-2021_01_08_425952 193 7 prescriptions prescription NNS 10_1101-2021_01_08_425952 193 8 on on IN 10_1101-2021_01_08_425952 193 9 the the DT 10_1101-2021_01_08_425952 193 10 same same JJ 10_1101-2021_01_08_425952 193 11 date date NN 10_1101-2021_01_08_425952 193 12 . . . 10_1101-2021_01_08_425952 194 1 All all DT 10_1101-2021_01_08_425952 194 2 events event NNS 10_1101-2021_01_08_425952 194 3 of of IN 10_1101-2021_01_08_425952 194 4 those those DT 10_1101-2021_01_08_425952 194 5 pa- pa- XX 10_1101-2021_01_08_425952 194 6 tients tient NNS 10_1101-2021_01_08_425952 194 7 without without IN 10_1101-2021_01_08_425952 194 8 a a DT 10_1101-2021_01_08_425952 194 9 prescription prescription NN 10_1101-2021_01_08_425952 194 10 prodcode prodcode NN 10_1101-2021_01_08_425952 194 11 event event NN 10_1101-2021_01_08_425952 194 12 can can MD 10_1101-2021_01_08_425952 194 13 be be VB 10_1101-2021_01_08_425952 194 14 removed remove VBN 10_1101-2021_01_08_425952 194 15 . . . 10_1101-2021_01_08_425952 195 1 Combining combine VBG 10_1101-2021_01_08_425952 195 2 getMultiplePrescriptionSameDayPatients getMultiplePrescriptionSameDayPatients NNP 10_1101-2021_01_08_425952 195 3 with with IN 10_1101-2021_01_08_425952 195 4 getPatientsWithFirstDrugWithDisease getPatientsWithFirstDrugWithDisease NNP 10_1101-2021_01_08_425952 195 5 or or CC 10_1101-2021_01_08_425952 195 6 matchDrugWithDisease matchdrugwithdisease NN 10_1101-2021_01_08_425952 195 7 is be VBZ 10_1101-2021_01_08_425952 195 8 useful useful JJ 10_1101-2021_01_08_425952 195 9 for for IN 10_1101-2021_01_08_425952 195 10 filter- filter- NNP 10_1101-2021_01_08_425952 195 11 ing e VBG 10_1101-2021_01_08_425952 195 12 patients patient NNS 10_1101-2021_01_08_425952 195 13 for for IN 10_1101-2021_01_08_425952 195 14 specific specific JJ 10_1101-2021_01_08_425952 195 15 prescription prescription NN 10_1101-2021_01_08_425952 195 16 patterns pattern NNS 10_1101-2021_01_08_425952 195 17 . . . 10_1101-2021_01_08_425952 196 1 For for IN 10_1101-2021_01_08_425952 196 2 example example NN 10_1101-2021_01_08_425952 196 3 , , , 10_1101-2021_01_08_425952 196 4 to to TO 10_1101-2021_01_08_425952 196 5 retrieve retrieve VB 10_1101-2021_01_08_425952 196 6 all all DT 10_1101-2021_01_08_425952 196 7 patient patient JJ 10_1101-2021_01_08_425952 196 8 prescription prescription NN 10_1101-2021_01_08_425952 196 9 records record NNS 10_1101-2021_01_08_425952 196 10 if if IN 10_1101-2021_01_08_425952 196 11 specific specific JJ 10_1101-2021_01_08_425952 196 12 prescriptions prescription NNS 10_1101-2021_01_08_425952 196 13 are be VBP 10_1101-2021_01_08_425952 196 14 ( ( -LRB- 10_1101-2021_01_08_425952 196 15 a a DT 10_1101-2021_01_08_425952 196 16 ) ) -RRB- 10_1101-2021_01_08_425952 196 17 never never RB 10_1101-2021_01_08_425952 196 18 recorded record VBN 10_1101-2021_01_08_425952 196 19 together together RB 10_1101-2021_01_08_425952 196 20 on on IN 10_1101-2021_01_08_425952 196 21 the the DT 10_1101-2021_01_08_425952 196 22 same same JJ 10_1101-2021_01_08_425952 196 23 date date NN 10_1101-2021_01_08_425952 196 24 and and CC 10_1101-2021_01_08_425952 196 25 ( ( -LRB- 10_1101-2021_01_08_425952 196 26 b b NN 10_1101-2021_01_08_425952 196 27 ) ) -RRB- 10_1101-2021_01_08_425952 196 28 are be VBP 10_1101-2021_01_08_425952 196 29 used use VBN 10_1101-2021_01_08_425952 196 30 as as IN 10_1101-2021_01_08_425952 196 31 a a DT 10_1101-2021_01_08_425952 196 32 first first JJ 10_1101-2021_01_08_425952 196 33 line line NN 10_1101-2021_01_08_425952 196 34 treatment treatment NN 10_1101-2021_01_08_425952 196 35 for for IN 10_1101-2021_01_08_425952 196 36 a a DT 10_1101-2021_01_08_425952 196 37 given give VBN 10_1101-2021_01_08_425952 196 38 complaint complaint NN 10_1101-2021_01_08_425952 196 39 : : : 10_1101-2021_01_08_425952 196 40 > > XX 10_1101-2021_01_08_425952 196 41 library(rdrugtrajectory library(rdrugtrajectory NN 10_1101-2021_01_08_425952 196 42 ) ) -RRB- 10_1101-2021_01_08_425952 196 43 > > XX 10_1101-2021_01_08_425952 196 44 prodcodesVector prodcodesvector NN 10_1101-2021_01_08_425952 196 45 = = SYM 10_1101-2021_01_08_425952 196 46 unique(testTherapyDF$prodcode)[1:8 unique(testtherapydf$prodcode)[1:8 NN 10_1101-2021_01_08_425952 196 47 ] ] -RRB- 10_1101-2021_01_08_425952 196 48 > > NFP 10_1101-2021_01_08_425952 196 49 # # NN 10_1101-2021_01_08_425952 196 50 ensure ensure VBP 10_1101-2021_01_08_425952 196 51 only only RB 10_1101-2021_01_08_425952 196 52 patients patient NNS 10_1101-2021_01_08_425952 196 53 with with IN 10_1101-2021_01_08_425952 196 54 specific specific JJ 10_1101-2021_01_08_425952 196 55 prescriptions prescription NNS 10_1101-2021_01_08_425952 196 56 are be VBP 10_1101-2021_01_08_425952 196 57 returned return VBN 10_1101-2021_01_08_425952 196 58 providing provide VBG 10_1101-2021_01_08_425952 196 59 a a DT 10_1101-2021_01_08_425952 196 60 > > NN 10_1101-2021_01_08_425952 196 61 # # $ 10_1101-2021_01_08_425952 196 62 patient patient NN 10_1101-2021_01_08_425952 196 63 is be VBZ 10_1101-2021_01_08_425952 196 64 prescribed prescribe VBN 10_1101-2021_01_08_425952 196 65 those those DT 10_1101-2021_01_08_425952 196 66 drugs drug NNS 10_1101-2021_01_08_425952 196 67 on on IN 10_1101-2021_01_08_425952 196 68 different different JJ 10_1101-2021_01_08_425952 196 69 dates date NNS 10_1101-2021_01_08_425952 196 70 , , , 10_1101-2021_01_08_425952 196 71 never never RB 10_1101-2021_01_08_425952 196 72 on on IN 10_1101-2021_01_08_425952 196 73 the the DT 10_1101-2021_01_08_425952 196 74 same same JJ 10_1101-2021_01_08_425952 196 75 date date NN 10_1101-2021_01_08_425952 196 76 . . . 10_1101-2021_01_08_425952 197 1 > > XX 10_1101-2021_01_08_425952 197 2 uniqueTherapyDF uniqueTherapyDF NNP 10_1101-2021_01_08_425952 197 3 < < XX 10_1101-2021_01_08_425952 197 4 - - HYPH 10_1101-2021_01_08_425952 197 5 getMultiPrescriptionSameDayPatients(df getMultiPrescriptionSameDayPatients(df NNP 10_1101-2021_01_08_425952 197 6 = = SYM 10_1101-2021_01_08_425952 197 7 testTherapyDF testTherapyDF NNS 10_1101-2021_01_08_425952 197 8 , , , 10_1101-2021_01_08_425952 197 9 + + CC 10_1101-2021_01_08_425952 197 10 prodCodesVector prodcodesvector NN 10_1101-2021_01_08_425952 197 11 = = SYM 10_1101-2021_01_08_425952 197 12 prodcodesVector prodcodesvector NN 10_1101-2021_01_08_425952 197 13 , , , 10_1101-2021_01_08_425952 197 14 + + SYM 10_1101-2021_01_08_425952 197 15 removePatientsWithoutDrugs removePatientsWithoutDrugs NNP 10_1101-2021_01_08_425952 197 16 = = SYM 10_1101-2021_01_08_425952 197 17 TRUE TRUE NNP 10_1101-2021_01_08_425952 197 18 ) ) -RRB- 10_1101-2021_01_08_425952 197 19 > > XX 10_1101-2021_01_08_425952 197 20 # # NN 10_1101-2021_01_08_425952 197 21 Ensure ensure VB 10_1101-2021_01_08_425952 197 22 that that IN 10_1101-2021_01_08_425952 197 23 the the DT 10_1101-2021_01_08_425952 197 24 patients patient NNS 10_1101-2021_01_08_425952 197 25 ( ( -LRB- 10_1101-2021_01_08_425952 197 26 patid patid NNS 10_1101-2021_01_08_425952 197 27 ) ) -RRB- 10_1101-2021_01_08_425952 197 28 in in IN 10_1101-2021_01_08_425952 197 29 the the DT 10_1101-2021_01_08_425952 197 30 therapy therapy NN 10_1101-2021_01_08_425952 197 31 and and CC 10_1101-2021_01_08_425952 197 32 clinical clinical JJ 10_1101-2021_01_08_425952 197 33 dataframes dataframe VBZ 10_1101-2021_01_08_425952 197 34 > > XX 10_1101-2021_01_08_425952 197 35 # # $ 10_1101-2021_01_08_425952 197 36 are be VBP 10_1101-2021_01_08_425952 197 37 the the DT 10_1101-2021_01_08_425952 197 38 same same JJ 10_1101-2021_01_08_425952 197 39 . . . 10_1101-2021_01_08_425952 198 1 Subsetting subsetting NN 10_1101-2021_01_08_425952 198 2 might may MD 10_1101-2021_01_08_425952 198 3 not not RB 10_1101-2021_01_08_425952 198 4 be be VB 10_1101-2021_01_08_425952 198 5 enough enough RB 10_1101-2021_01_08_425952 198 6 . . . 10_1101-2021_01_08_425952 199 1 > > XX 10_1101-2021_01_08_425952 199 2 reducedClinicalDF reducedClinicalDF NNP 10_1101-2021_01_08_425952 199 3 < < XX 10_1101-2021_01_08_425952 199 4 - - HYPH 10_1101-2021_01_08_425952 199 5 subset(testClinicalDF subset(testClinicalDF NNP 10_1101-2021_01_08_425952 199 6 , , , 10_1101-2021_01_08_425952 199 7 .CC .CC : 10_1101-2021_01_08_425952 199 8 - - : 10_1101-2021_01_08_425952 199 9 BY by IN 10_1101-2021_01_08_425952 199 10 - - HYPH 10_1101-2021_01_08_425952 199 11 ND ND NNP 10_1101-2021_01_08_425952 199 12 4.0 4.0 CD 10_1101-2021_01_08_425952 199 13 International international JJ 10_1101-2021_01_08_425952 199 14 licensemade licensemade NN 10_1101-2021_01_08_425952 199 15 available available JJ 10_1101-2021_01_08_425952 199 16 under under IN 10_1101-2021_01_08_425952 199 17 a a DT 10_1101-2021_01_08_425952 199 18 ( ( -LRB- 10_1101-2021_01_08_425952 199 19 which which WDT 10_1101-2021_01_08_425952 199 20 was be VBD 10_1101-2021_01_08_425952 199 21 not not RB 10_1101-2021_01_08_425952 199 22 certified certify VBN 10_1101-2021_01_08_425952 199 23 by by IN 10_1101-2021_01_08_425952 199 24 peer peer NN 10_1101-2021_01_08_425952 199 25 review review NN 10_1101-2021_01_08_425952 199 26 ) ) -RRB- 10_1101-2021_01_08_425952 199 27 is be VBZ 10_1101-2021_01_08_425952 199 28 the the DT 10_1101-2021_01_08_425952 199 29 author author NN 10_1101-2021_01_08_425952 199 30 / / SYM 10_1101-2021_01_08_425952 199 31 funder funder NN 10_1101-2021_01_08_425952 199 32 , , , 10_1101-2021_01_08_425952 199 33 who who WP 10_1101-2021_01_08_425952 199 34 has have VBZ 10_1101-2021_01_08_425952 199 35 granted grant VBN 10_1101-2021_01_08_425952 199 36 bioRxiv biorxiv IN 10_1101-2021_01_08_425952 199 37 a a DT 10_1101-2021_01_08_425952 199 38 license license NN 10_1101-2021_01_08_425952 199 39 to to TO 10_1101-2021_01_08_425952 199 40 display display VB 10_1101-2021_01_08_425952 199 41 the the DT 10_1101-2021_01_08_425952 199 42 preprint preprint NN 10_1101-2021_01_08_425952 199 43 in in IN 10_1101-2021_01_08_425952 199 44 perpetuity perpetuity NN 10_1101-2021_01_08_425952 199 45 . . . 10_1101-2021_01_08_425952 200 1 It -PRON- PRP 10_1101-2021_01_08_425952 200 2 is be VBZ 10_1101-2021_01_08_425952 200 3 The the DT 10_1101-2021_01_08_425952 200 4 copyright copyright NN 10_1101-2021_01_08_425952 200 5 holder holder NN 10_1101-2021_01_08_425952 200 6 for for IN 10_1101-2021_01_08_425952 200 7 this this DT 10_1101-2021_01_08_425952 200 8 preprintthis preprintthis NN 10_1101-2021_01_08_425952 200 9 version version NN 10_1101-2021_01_08_425952 200 10 posted post VBD 10_1101-2021_01_08_425952 200 11 January January NNP 10_1101-2021_01_08_425952 200 12 9 9 CD 10_1101-2021_01_08_425952 200 13 , , , 10_1101-2021_01_08_425952 200 14 2021 2021 CD 10_1101-2021_01_08_425952 200 15 . . . 10_1101-2021_01_08_425952 200 16 ; ; : 10_1101-2021_01_08_425952 200 17 https://doi.org/10.1101/2021.01.08.425952doi https://doi.org/10.1101/2021.01.08.425952doi ADD 10_1101-2021_01_08_425952 200 18 : : : 10_1101-2021_01_08_425952 200 19 bioRxiv biorxiv IN 10_1101-2021_01_08_425952 200 20 preprint preprint NN 10_1101-2021_01_08_425952 200 21 https://doi.org/10.1101/2021.01.08.425952 https://doi.org/10.1101/2021.01.08.425952 XX 10_1101-2021_01_08_425952 200 22 http://creativecommons.org/licenses/by-nd/4.0/ http://creativecommons.org/licenses/by-nd/4.0/ NNP 10_1101-2021_01_08_425952 200 23 Journal Journal NNP 10_1101-2021_01_08_425952 200 24 of of IN 10_1101-2021_01_08_425952 200 25 Statistical Statistical NNP 10_1101-2021_01_08_425952 200 26 Software Software NNP 10_1101-2021_01_08_425952 200 27 19 19 CD 10_1101-2021_01_08_425952 200 28 + + SYM 10_1101-2021_01_08_425952 200 29 testClinicalDF$patid testclinicaldf$patid VB 10_1101-2021_01_08_425952 200 30 % % NN 10_1101-2021_01_08_425952 200 31 in% in% NN 10_1101-2021_01_08_425952 200 32 getUniquePatidList(uniqueTherapyDF getuniquepatidlist(uniquetherapydf XX 10_1101-2021_01_08_425952 200 33 ) ) -RRB- 10_1101-2021_01_08_425952 200 34 ) ) -RRB- 10_1101-2021_01_08_425952 200 35 > > XX 10_1101-2021_01_08_425952 200 36 # # $ 10_1101-2021_01_08_425952 200 37 Specific specific JJ 10_1101-2021_01_08_425952 200 38 medcodes medcode NNS 10_1101-2021_01_08_425952 200 39 have have VBP 10_1101-2021_01_08_425952 200 40 not not RB 10_1101-2021_01_08_425952 200 41 been be VBN 10_1101-2021_01_08_425952 200 42 provided provide VBN 10_1101-2021_01_08_425952 200 43 . . . 10_1101-2021_01_08_425952 201 1 All all DT 10_1101-2021_01_08_425952 201 2 medcodes medcode NNS 10_1101-2021_01_08_425952 201 3 in in IN 10_1101-2021_01_08_425952 201 4 the the DT 10_1101-2021_01_08_425952 201 5 clinical clinical JJ 10_1101-2021_01_08_425952 201 6 > > XX 10_1101-2021_01_08_425952 201 7 # # $ 10_1101-2021_01_08_425952 201 8 dataframe dataframe NN 10_1101-2021_01_08_425952 201 9 are be VBP 10_1101-2021_01_08_425952 201 10 considered consider VBN 10_1101-2021_01_08_425952 201 11 . . . 10_1101-2021_01_08_425952 202 1 This this DT 10_1101-2021_01_08_425952 202 2 is be VBZ 10_1101-2021_01_08_425952 202 3 possible possible JJ 10_1101-2021_01_08_425952 202 4 if if IN 10_1101-2021_01_08_425952 202 5 one one CD 10_1101-2021_01_08_425952 202 6 either either CC 10_1101-2021_01_08_425952 202 7 one one NN 10_1101-2021_01_08_425952 202 8 is be VBZ 10_1101-2021_01_08_425952 202 9 not not RB 10_1101-2021_01_08_425952 202 10 interested interested JJ 10_1101-2021_01_08_425952 202 11 > > XX 10_1101-2021_01_08_425952 202 12 # # $ 10_1101-2021_01_08_425952 202 13 in in IN 10_1101-2021_01_08_425952 202 14 the the DT 10_1101-2021_01_08_425952 202 15 nature nature NN 10_1101-2021_01_08_425952 202 16 of of IN 10_1101-2021_01_08_425952 202 17 the the DT 10_1101-2021_01_08_425952 202 18 clinical clinical JJ 10_1101-2021_01_08_425952 202 19 complaint complaint NN 10_1101-2021_01_08_425952 202 20 or or CC 10_1101-2021_01_08_425952 202 21 the the DT 10_1101-2021_01_08_425952 202 22 clinical clinical JJ 10_1101-2021_01_08_425952 202 23 dataframe dataframe NN 10_1101-2021_01_08_425952 202 24 has have VBZ 10_1101-2021_01_08_425952 202 25 been be VBN 10_1101-2021_01_08_425952 202 26 > > XX 10_1101-2021_01_08_425952 202 27 # # NN 10_1101-2021_01_08_425952 202 28 adjusted adjust VBN 10_1101-2021_01_08_425952 202 29 to to IN 10_1101-2021_01_08_425952 202 30 only only RB 10_1101-2021_01_08_425952 202 31 include include VB 10_1101-2021_01_08_425952 202 32 clinical clinical JJ 10_1101-2021_01_08_425952 202 33 complaints complaint NNS 10_1101-2021_01_08_425952 202 34 of of IN 10_1101-2021_01_08_425952 202 35 interest interest NN 10_1101-2021_01_08_425952 202 36 . . . 10_1101-2021_01_08_425952 203 1 > > XX 10_1101-2021_01_08_425952 203 2 firstDF firstDF NNP 10_1101-2021_01_08_425952 203 3 < < XX 10_1101-2021_01_08_425952 203 4 - - HYPH 10_1101-2021_01_08_425952 203 5 getPatientsWithFirstDrugWithDisease(clinicalDF getPatientsWithFirstDrugWithDisease(clinicalDF NNP 10_1101-2021_01_08_425952 203 6 = = SYM 10_1101-2021_01_08_425952 203 7 reducedClinicalDF reducedClinicalDF NNP 10_1101-2021_01_08_425952 203 8 , , , 10_1101-2021_01_08_425952 203 9 + + CC 10_1101-2021_01_08_425952 203 10 therapyDF therapyDF NNP 10_1101-2021_01_08_425952 203 11 = = SYM 10_1101-2021_01_08_425952 203 12 uniqueTherapyDF uniqueTherapyDF NNP 10_1101-2021_01_08_425952 203 13 , , , 10_1101-2021_01_08_425952 203 14 + + CC 10_1101-2021_01_08_425952 203 15 drugCodesVector drugcodesvector NN 10_1101-2021_01_08_425952 203 16 = = SYM 10_1101-2021_01_08_425952 203 17 sampleDrugs sampledrug NNS 10_1101-2021_01_08_425952 203 18 ) ) -RRB- 10_1101-2021_01_08_425952 203 19 In in IN 10_1101-2021_01_08_425952 203 20 the the DT 10_1101-2021_01_08_425952 203 21 above above JJ 10_1101-2021_01_08_425952 203 22 example example NN 10_1101-2021_01_08_425952 203 23 , , , 10_1101-2021_01_08_425952 203 24 patients patient NNS 10_1101-2021_01_08_425952 203 25 with with IN 10_1101-2021_01_08_425952 203 26 more more JJR 10_1101-2021_01_08_425952 203 27 than than IN 10_1101-2021_01_08_425952 203 28 one one CD 10_1101-2021_01_08_425952 203 29 prescription prescription NN 10_1101-2021_01_08_425952 203 30 on on IN 10_1101-2021_01_08_425952 203 31 the the DT 10_1101-2021_01_08_425952 203 32 same same JJ 10_1101-2021_01_08_425952 203 33 date date NN 10_1101-2021_01_08_425952 203 34 or or CC 10_1101-2021_01_08_425952 203 35 without without IN 10_1101-2021_01_08_425952 203 36 a a DT 10_1101-2021_01_08_425952 203 37 prescription prescription NN 10_1101-2021_01_08_425952 203 38 at at RB 10_1101-2021_01_08_425952 203 39 all all RB 10_1101-2021_01_08_425952 203 40 ( ( -LRB- 10_1101-2021_01_08_425952 203 41 from from IN 10_1101-2021_01_08_425952 203 42 the the DT 10_1101-2021_01_08_425952 203 43 set set NN 10_1101-2021_01_08_425952 203 44 of of IN 10_1101-2021_01_08_425952 203 45 desired desire VBN 10_1101-2021_01_08_425952 203 46 prescription prescription NN 10_1101-2021_01_08_425952 203 47 prodcodes prodcode NNS 10_1101-2021_01_08_425952 203 48 ) ) -RRB- 10_1101-2021_01_08_425952 203 49 were be VBD 10_1101-2021_01_08_425952 203 50 removed remove VBN 10_1101-2021_01_08_425952 203 51 from from IN 10_1101-2021_01_08_425952 203 52 the the DT 10_1101-2021_01_08_425952 203 53 cohort cohort NN 10_1101-2021_01_08_425952 203 54 . . . 10_1101-2021_01_08_425952 204 1 This this DT 10_1101-2021_01_08_425952 204 2 reduced reduce VBD 10_1101-2021_01_08_425952 204 3 the the DT 10_1101-2021_01_08_425952 204 4 number number NN 10_1101-2021_01_08_425952 204 5 of of IN 10_1101-2021_01_08_425952 204 6 patients patient NNS 10_1101-2021_01_08_425952 204 7 from from IN 10_1101-2021_01_08_425952 204 8 3838 3838 CD 10_1101-2021_01_08_425952 204 9 patients patient NNS 10_1101-2021_01_08_425952 204 10 to to IN 10_1101-2021_01_08_425952 204 11 2930 2930 CD 10_1101-2021_01_08_425952 204 12 . . . 10_1101-2021_01_08_425952 205 1 Next next RB 10_1101-2021_01_08_425952 205 2 , , , 10_1101-2021_01_08_425952 205 3 only only RB 10_1101-2021_01_08_425952 205 4 those those DT 10_1101-2021_01_08_425952 205 5 patients patient NNS 10_1101-2021_01_08_425952 205 6 with with IN 10_1101-2021_01_08_425952 205 7 a a DT 10_1101-2021_01_08_425952 205 8 first first JJ 10_1101-2021_01_08_425952 205 9 line line NN 10_1101-2021_01_08_425952 205 10 treatment treatment NN 10_1101-2021_01_08_425952 205 11 ( ( -LRB- 10_1101-2021_01_08_425952 205 12 first first JJ 10_1101-2021_01_08_425952 205 13 prescription prescription NN 10_1101-2021_01_08_425952 205 14 event event NN 10_1101-2021_01_08_425952 205 15 on on IN 10_1101-2021_01_08_425952 205 16 the the DT 10_1101-2021_01_08_425952 205 17 same same JJ 10_1101-2021_01_08_425952 205 18 date date NN 10_1101-2021_01_08_425952 205 19 as as IN 10_1101-2021_01_08_425952 205 20 a a DT 10_1101-2021_01_08_425952 205 21 clinical clinical JJ 10_1101-2021_01_08_425952 205 22 event event NN 10_1101-2021_01_08_425952 205 23 ) ) -RRB- 10_1101-2021_01_08_425952 205 24 were be VBD 10_1101-2021_01_08_425952 205 25 kept keep VBN 10_1101-2021_01_08_425952 205 26 , , , 10_1101-2021_01_08_425952 205 27 reducing reduce VBG 10_1101-2021_01_08_425952 205 28 the the DT 10_1101-2021_01_08_425952 205 29 sample sample NN 10_1101-2021_01_08_425952 205 30 size size NN 10_1101-2021_01_08_425952 205 31 to to IN 10_1101-2021_01_08_425952 205 32 587 587 CD 10_1101-2021_01_08_425952 205 33 patients patient NNS 10_1101-2021_01_08_425952 205 34 . . . 10_1101-2021_01_08_425952 206 1 removePatientsByDuration removePatientsByDuration VBZ 10_1101-2021_01_08_425952 206 2 Longitudinal Longitudinal NNP 10_1101-2021_01_08_425952 206 3 EHR EHR NNP 10_1101-2021_01_08_425952 206 4 cohort cohort NN 10_1101-2021_01_08_425952 206 5 studies study NNS 10_1101-2021_01_08_425952 206 6 often often RB 10_1101-2021_01_08_425952 206 7 requires require VBZ 10_1101-2021_01_08_425952 206 8 careful careful JJ 10_1101-2021_01_08_425952 206 9 time time NN 10_1101-2021_01_08_425952 206 10 - - HYPH 10_1101-2021_01_08_425952 206 11 related relate VBN 10_1101-2021_01_08_425952 206 12 consideration consideration NN 10_1101-2021_01_08_425952 206 13 . . . 10_1101-2021_01_08_425952 207 1 Currently currently RB 10_1101-2021_01_08_425952 207 2 , , , 10_1101-2021_01_08_425952 207 3 rdrugtrajectory rdrugtrajectory NN 10_1101-2021_01_08_425952 207 4 presents present VBZ 10_1101-2021_01_08_425952 207 5 two two CD 10_1101-2021_01_08_425952 207 6 functions function NNS 10_1101-2021_01_08_425952 207 7 that that WDT 10_1101-2021_01_08_425952 207 8 identify identify VBP 10_1101-2021_01_08_425952 207 9 prescription prescription NN 10_1101-2021_01_08_425952 207 10 records record NNS 10_1101-2021_01_08_425952 207 11 of of IN 10_1101-2021_01_08_425952 207 12 patients patient NNS 10_1101-2021_01_08_425952 207 13 that that WDT 10_1101-2021_01_08_425952 207 14 match match VBP 10_1101-2021_01_08_425952 207 15 two two CD 10_1101-2021_01_08_425952 207 16 time time NN 10_1101-2021_01_08_425952 207 17 constraints constraint NNS 10_1101-2021_01_08_425952 207 18 . . . 10_1101-2021_01_08_425952 208 1 The the DT 10_1101-2021_01_08_425952 208 2 first first JJ 10_1101-2021_01_08_425952 208 3 , , , 10_1101-2021_01_08_425952 208 4 removePatientsByDuration removePatientsByDuration NNS 10_1101-2021_01_08_425952 208 5 , , , 10_1101-2021_01_08_425952 208 6 removes remove VBZ 10_1101-2021_01_08_425952 208 7 all all DT 10_1101-2021_01_08_425952 208 8 patients patient NNS 10_1101-2021_01_08_425952 208 9 with with IN 10_1101-2021_01_08_425952 208 10 prescription prescription NN 10_1101-2021_01_08_425952 208 11 events event NNS 10_1101-2021_01_08_425952 208 12 that that WDT 10_1101-2021_01_08_425952 208 13 are be VBP 10_1101-2021_01_08_425952 208 14 no no RB 10_1101-2021_01_08_425952 208 15 more more JJR 10_1101-2021_01_08_425952 208 16 than than IN 10_1101-2021_01_08_425952 208 17 n n DT 10_1101-2021_01_08_425952 208 18 years year NNS 10_1101-2021_01_08_425952 208 19 between between IN 10_1101-2021_01_08_425952 208 20 consecutive consecutive JJ 10_1101-2021_01_08_425952 208 21 events event NNS 10_1101-2021_01_08_425952 208 22 or or CC 10_1101-2021_01_08_425952 208 23 removes remove VBZ 10_1101-2021_01_08_425952 208 24 patients patient NNS 10_1101-2021_01_08_425952 208 25 if if IN 10_1101-2021_01_08_425952 208 26 the the DT 10_1101-2021_01_08_425952 208 27 duration duration NN 10_1101-2021_01_08_425952 208 28 between between IN 10_1101-2021_01_08_425952 208 29 the the DT 10_1101-2021_01_08_425952 208 30 first first JJ 10_1101-2021_01_08_425952 208 31 and and CC 10_1101-2021_01_08_425952 208 32 last last JJ 10_1101-2021_01_08_425952 208 33 prescription prescription NN 10_1101-2021_01_08_425952 208 34 event event NN 10_1101-2021_01_08_425952 208 35 on on IN 10_1101-2021_01_08_425952 208 36 record record NN 10_1101-2021_01_08_425952 208 37 is be VBZ 10_1101-2021_01_08_425952 208 38 less less JJR 10_1101-2021_01_08_425952 208 39 than than IN 10_1101-2021_01_08_425952 208 40 n n CD 10_1101-2021_01_08_425952 208 41 years year NNS 10_1101-2021_01_08_425952 208 42 . . . 10_1101-2021_01_08_425952 209 1 > > XX 10_1101-2021_01_08_425952 209 2 library(rdrugtrajectory library(rdrugtrajectory NNP 10_1101-2021_01_08_425952 209 3 ) ) -RRB- 10_1101-2021_01_08_425952 209 4 > > XX 10_1101-2021_01_08_425952 209 5 df df FW 10_1101-2021_01_08_425952 209 6 < < XX 10_1101-2021_01_08_425952 209 7 - - HYPH 10_1101-2021_01_08_425952 209 8 removePatientsByDuration(minObsYr removePatientsByDuration(minObsYr NNPS 10_1101-2021_01_08_425952 209 9 = = NN 10_1101-2021_01_08_425952 209 10 5 5 CD 10_1101-2021_01_08_425952 209 11 , , , 10_1101-2021_01_08_425952 209 12 + + CC 10_1101-2021_01_08_425952 209 13 minBreakYr minBreakYr NNPS 10_1101-2021_01_08_425952 209 14 = = SYM 10_1101-2021_01_08_425952 209 15 2 2 CD 10_1101-2021_01_08_425952 209 16 , , , 10_1101-2021_01_08_425952 209 17 + + CC 10_1101-2021_01_08_425952 209 18 therapyDF therapyDF NNS 10_1101-2021_01_08_425952 209 19 = = SYM 10_1101-2021_01_08_425952 209 20 testTherapyDF testTherapyDF NNS 10_1101-2021_01_08_425952 209 21 ) ) -RRB- 10_1101-2021_01_08_425952 209 22 getBurnInPatients getburninpatient NNS 10_1101-2021_01_08_425952 209 23 The the DT 10_1101-2021_01_08_425952 209 24 second second JJ 10_1101-2021_01_08_425952 209 25 time time NN 10_1101-2021_01_08_425952 209 26 - - HYPH 10_1101-2021_01_08_425952 209 27 related relate VBN 10_1101-2021_01_08_425952 209 28 function function NN 10_1101-2021_01_08_425952 209 29 , , , 10_1101-2021_01_08_425952 209 30 getBurnInPatients getburninpatient NNS 10_1101-2021_01_08_425952 209 31 identifies identify VBZ 10_1101-2021_01_08_425952 209 32 all all DT 10_1101-2021_01_08_425952 209 33 patient patient JJ 10_1101-2021_01_08_425952 209 34 prescription prescription NN 10_1101-2021_01_08_425952 209 35 records record NNS 10_1101-2021_01_08_425952 209 36 with with IN 10_1101-2021_01_08_425952 209 37 at at IN 10_1101-2021_01_08_425952 209 38 least least JJS 10_1101-2021_01_08_425952 209 39 n n JJ 10_1101-2021_01_08_425952 209 40 days day NNS 10_1101-2021_01_08_425952 209 41 free free JJ 10_1101-2021_01_08_425952 209 42 from from IN 10_1101-2021_01_08_425952 209 43 prescription prescription NN 10_1101-2021_01_08_425952 209 44 events event NNS 10_1101-2021_01_08_425952 209 45 before before IN 10_1101-2021_01_08_425952 209 46 a a DT 10_1101-2021_01_08_425952 209 47 specific specific JJ 10_1101-2021_01_08_425952 209 48 prescription prescription NN 10_1101-2021_01_08_425952 209 49 event event NN 10_1101-2021_01_08_425952 209 50 . . . 10_1101-2021_01_08_425952 210 1 This this DT 10_1101-2021_01_08_425952 210 2 is be VBZ 10_1101-2021_01_08_425952 210 3 useful useful JJ 10_1101-2021_01_08_425952 210 4 if if IN 10_1101-2021_01_08_425952 210 5 one one PRP 10_1101-2021_01_08_425952 210 6 requires require VBZ 10_1101-2021_01_08_425952 210 7 a a DT 10_1101-2021_01_08_425952 210 8 period period NN 10_1101-2021_01_08_425952 210 9 of of IN 10_1101-2021_01_08_425952 210 10 time time NN 10_1101-2021_01_08_425952 210 11 free free JJ 10_1101-2021_01_08_425952 210 12 from from IN 10_1101-2021_01_08_425952 210 13 prescription prescription NN 10_1101-2021_01_08_425952 210 14 intervention intervention NN 10_1101-2021_01_08_425952 210 15 before before IN 10_1101-2021_01_08_425952 210 16 a a DT 10_1101-2021_01_08_425952 210 17 given give VBN 10_1101-2021_01_08_425952 210 18 prescription prescription NN 10_1101-2021_01_08_425952 210 19 event event NN 10_1101-2021_01_08_425952 210 20 : : : 10_1101-2021_01_08_425952 210 21 > > XX 10_1101-2021_01_08_425952 210 22 library(rdrugtrajectory library(rdrugtrajectory NN 10_1101-2021_01_08_425952 210 23 ) ) -RRB- 10_1101-2021_01_08_425952 210 24 > > XX 10_1101-2021_01_08_425952 210 25 drugOfInterestVector drugOfInterestVector NNP 10_1101-2021_01_08_425952 210 26 < < NNP 10_1101-2021_01_08_425952 210 27 - - HYPH 10_1101-2021_01_08_425952 210 28 c(83,49,297,1888,940,5 c(83,49,297,1888,940,5 NNP 10_1101-2021_01_08_425952 210 29 ) ) -RRB- 10_1101-2021_01_08_425952 210 30 > > XX 10_1101-2021_01_08_425952 210 31 patientList patientList NNP 10_1101-2021_01_08_425952 210 32 < < XX 10_1101-2021_01_08_425952 210 33 - - HYPH 10_1101-2021_01_08_425952 210 34 getBurnInPatients(df getBurnInPatients(df NNP 10_1101-2021_01_08_425952 210 35 = = SYM 10_1101-2021_01_08_425952 210 36 testTherapyDF testTherapyDF NNS 10_1101-2021_01_08_425952 210 37 , , , 10_1101-2021_01_08_425952 210 38 + + CC 10_1101-2021_01_08_425952 210 39 startCodesVector startcodesvector NN 10_1101-2021_01_08_425952 210 40 = = SYM 10_1101-2021_01_08_425952 210 41 drugOfInterestVector drugofinterestvector NN 10_1101-2021_01_08_425952 210 42 , , , 10_1101-2021_01_08_425952 210 43 + + CC 10_1101-2021_01_08_425952 210 44 periodDaysBefore perioddaysbefore NN 10_1101-2021_01_08_425952 210 45 = = SYM 10_1101-2021_01_08_425952 210 46 172 172 CD 10_1101-2021_01_08_425952 210 47 ) ) -RRB- 10_1101-2021_01_08_425952 210 48 > > NFP 10_1101-2021_01_08_425952 210 49 burnInTherapyDF burnInTherapyDF NNP 10_1101-2021_01_08_425952 210 50 < < XX 10_1101-2021_01_08_425952 210 51 - - HYPH 10_1101-2021_01_08_425952 210 52 subset(testTherapyDF subset(testTherapyDF NNP 10_1101-2021_01_08_425952 210 53 , , , 10_1101-2021_01_08_425952 210 54 + + CC 10_1101-2021_01_08_425952 210 55 testTherapyDF$patid testtherapydf$patid NN 10_1101-2021_01_08_425952 210 56 % % NN 10_1101-2021_01_08_425952 210 57 in% in% VBP 10_1101-2021_01_08_425952 210 58 patientList patientlist NN 10_1101-2021_01_08_425952 210 59 ) ) -RRB- 10_1101-2021_01_08_425952 210 60 In in IN 10_1101-2021_01_08_425952 210 61 the the DT 10_1101-2021_01_08_425952 210 62 above above JJ 10_1101-2021_01_08_425952 210 63 example example NN 10_1101-2021_01_08_425952 210 64 , , , 10_1101-2021_01_08_425952 210 65 from from IN 10_1101-2021_01_08_425952 210 66 a a DT 10_1101-2021_01_08_425952 210 67 cohort cohort NN 10_1101-2021_01_08_425952 210 68 of of IN 10_1101-2021_01_08_425952 210 69 3838 3838 CD 10_1101-2021_01_08_425952 210 70 patients patient NNS 10_1101-2021_01_08_425952 210 71 , , , 10_1101-2021_01_08_425952 210 72 426 426 CD 10_1101-2021_01_08_425952 210 73 patients patient NNS 10_1101-2021_01_08_425952 210 74 had have VBD 10_1101-2021_01_08_425952 210 75 a a DT 10_1101-2021_01_08_425952 210 76 period period NN 10_1101-2021_01_08_425952 210 77 of of IN 10_1101-2021_01_08_425952 210 78 up up IN 10_1101-2021_01_08_425952 210 79 to to TO 10_1101-2021_01_08_425952 210 80 172 172 CD 10_1101-2021_01_08_425952 210 81 days day NNS 10_1101-2021_01_08_425952 210 82 free free JJ 10_1101-2021_01_08_425952 210 83 from from IN 10_1101-2021_01_08_425952 210 84 of of IN 10_1101-2021_01_08_425952 210 85 prescription prescription NN 10_1101-2021_01_08_425952 210 86 events event NNS 10_1101-2021_01_08_425952 210 87 before before IN 10_1101-2021_01_08_425952 210 88 the the DT 10_1101-2021_01_08_425952 210 89 first first JJ 10_1101-2021_01_08_425952 210 90 prescription prescription NN 10_1101-2021_01_08_425952 210 91 prodcode prodcode NN 10_1101-2021_01_08_425952 210 92 specified specify VBN 10_1101-2021_01_08_425952 210 93 via via IN 10_1101-2021_01_08_425952 210 94 the the DT 10_1101-2021_01_08_425952 210 95 startCodesVector startCodesVector NNP 10_1101-2021_01_08_425952 210 96 argument argument NN 10_1101-2021_01_08_425952 210 97 . . . 10_1101-2021_01_08_425952 211 1 The the DT 10_1101-2021_01_08_425952 211 2 functionality functionality NN 10_1101-2021_01_08_425952 211 3 relies rely VBZ 10_1101-2021_01_08_425952 211 4 on on IN 10_1101-2021_01_08_425952 211 5 the the DT 10_1101-2021_01_08_425952 211 6 patient patient NN 10_1101-2021_01_08_425952 211 7 having have VBG 10_1101-2021_01_08_425952 211 8 prescription prescription NN 10_1101-2021_01_08_425952 211 9 events event NNS 10_1101-2021_01_08_425952 211 10 before before IN 10_1101-2021_01_08_425952 211 11 the the DT 10_1101-2021_01_08_425952 211 12 burn burn NN 10_1101-2021_01_08_425952 211 13 - - HYPH 10_1101-2021_01_08_425952 211 14 in in RP 10_1101-2021_01_08_425952 211 15 period period NN 10_1101-2021_01_08_425952 211 16 ( ( -LRB- 10_1101-2021_01_08_425952 211 17 required require VBN 10_1101-2021_01_08_425952 211 18 to to TO 10_1101-2021_01_08_425952 211 19 define define VB 10_1101-2021_01_08_425952 211 20 whether whether IN 10_1101-2021_01_08_425952 211 21 the the DT 10_1101-2021_01_08_425952 211 22 patient patient NN 10_1101-2021_01_08_425952 211 23 had have VBD 10_1101-2021_01_08_425952 211 24 a a DT 10_1101-2021_01_08_425952 211 25 CPRD cprd NN 10_1101-2021_01_08_425952 211 26 record record NN 10_1101-2021_01_08_425952 211 27 early early RB 10_1101-2021_01_08_425952 211 28 .CC .CC , 10_1101-2021_01_08_425952 211 29 - - HYPH 10_1101-2021_01_08_425952 211 30 BY by IN 10_1101-2021_01_08_425952 211 31 - - HYPH 10_1101-2021_01_08_425952 211 32 ND ND NNP 10_1101-2021_01_08_425952 211 33 4.0 4.0 CD 10_1101-2021_01_08_425952 211 34 International international JJ 10_1101-2021_01_08_425952 211 35 licensemade licensemade NN 10_1101-2021_01_08_425952 211 36 available available JJ 10_1101-2021_01_08_425952 211 37 under under IN 10_1101-2021_01_08_425952 211 38 a a DT 10_1101-2021_01_08_425952 211 39 ( ( -LRB- 10_1101-2021_01_08_425952 211 40 which which WDT 10_1101-2021_01_08_425952 211 41 was be VBD 10_1101-2021_01_08_425952 211 42 not not RB 10_1101-2021_01_08_425952 211 43 certified certify VBN 10_1101-2021_01_08_425952 211 44 by by IN 10_1101-2021_01_08_425952 211 45 peer peer NN 10_1101-2021_01_08_425952 211 46 review review NN 10_1101-2021_01_08_425952 211 47 ) ) -RRB- 10_1101-2021_01_08_425952 211 48 is be VBZ 10_1101-2021_01_08_425952 211 49 the the DT 10_1101-2021_01_08_425952 211 50 author author NN 10_1101-2021_01_08_425952 211 51 / / SYM 10_1101-2021_01_08_425952 211 52 funder funder NN 10_1101-2021_01_08_425952 211 53 , , , 10_1101-2021_01_08_425952 211 54 who who WP 10_1101-2021_01_08_425952 211 55 has have VBZ 10_1101-2021_01_08_425952 211 56 granted grant VBN 10_1101-2021_01_08_425952 211 57 bioRxiv biorxiv IN 10_1101-2021_01_08_425952 211 58 a a DT 10_1101-2021_01_08_425952 211 59 license license NN 10_1101-2021_01_08_425952 211 60 to to TO 10_1101-2021_01_08_425952 211 61 display display VB 10_1101-2021_01_08_425952 211 62 the the DT 10_1101-2021_01_08_425952 211 63 preprint preprint NN 10_1101-2021_01_08_425952 211 64 in in IN 10_1101-2021_01_08_425952 211 65 perpetuity perpetuity NN 10_1101-2021_01_08_425952 211 66 . . . 10_1101-2021_01_08_425952 212 1 It -PRON- PRP 10_1101-2021_01_08_425952 212 2 is be VBZ 10_1101-2021_01_08_425952 212 3 The the DT 10_1101-2021_01_08_425952 212 4 copyright copyright NN 10_1101-2021_01_08_425952 212 5 holder holder NN 10_1101-2021_01_08_425952 212 6 for for IN 10_1101-2021_01_08_425952 212 7 this this DT 10_1101-2021_01_08_425952 212 8 preprintthis preprintthis NN 10_1101-2021_01_08_425952 212 9 version version NN 10_1101-2021_01_08_425952 212 10 posted post VBD 10_1101-2021_01_08_425952 212 11 January January NNP 10_1101-2021_01_08_425952 212 12 9 9 CD 10_1101-2021_01_08_425952 212 13 , , , 10_1101-2021_01_08_425952 212 14 2021 2021 CD 10_1101-2021_01_08_425952 212 15 . . . 10_1101-2021_01_08_425952 212 16 ; ; : 10_1101-2021_01_08_425952 212 17 https://doi.org/10.1101/2021.01.08.425952doi https://doi.org/10.1101/2021.01.08.425952doi ADD 10_1101-2021_01_08_425952 212 18 : : : 10_1101-2021_01_08_425952 212 19 bioRxiv biorxiv IN 10_1101-2021_01_08_425952 212 20 preprint preprint NN 10_1101-2021_01_08_425952 212 21 https://doi.org/10.1101/2021.01.08.425952 https://doi.org/10.1101/2021.01.08.425952 NN 10_1101-2021_01_08_425952 212 22 http://creativecommons.org/licenses/by-nd/4.0/ http://creativecommons.org/licenses/by-nd/4.0/ NN 10_1101-2021_01_08_425952 212 23 20 20 CD 10_1101-2021_01_08_425952 212 24 rdrugtrajectory rdrugtrajectory NN 10_1101-2021_01_08_425952 212 25 : : : 10_1101-2021_01_08_425952 212 26 Analysing Analysing NNP 10_1101-2021_01_08_425952 212 27 Drug Drug NNP 10_1101-2021_01_08_425952 212 28 Prescriptions Prescriptions NNPS 10_1101-2021_01_08_425952 212 29 in in IN 10_1101-2021_01_08_425952 212 30 Electronic Electronic NNP 10_1101-2021_01_08_425952 212 31 Health Health NNP 10_1101-2021_01_08_425952 212 32 Care Care NNP 10_1101-2021_01_08_425952 212 33 Records Records NNPS 10_1101-2021_01_08_425952 212 34 enough enough RB 10_1101-2021_01_08_425952 212 35 before before IN 10_1101-2021_01_08_425952 212 36 the the DT 10_1101-2021_01_08_425952 212 37 burn burn NN 10_1101-2021_01_08_425952 212 38 - - HYPH 10_1101-2021_01_08_425952 212 39 in in RP 10_1101-2021_01_08_425952 212 40 period period NN 10_1101-2021_01_08_425952 212 41 began begin VBD 10_1101-2021_01_08_425952 212 42 ) ) -RRB- 10_1101-2021_01_08_425952 212 43 . . . 10_1101-2021_01_08_425952 213 1 For for IN 10_1101-2021_01_08_425952 213 2 example example NN 10_1101-2021_01_08_425952 213 3 , , , 10_1101-2021_01_08_425952 213 4 this this DT 10_1101-2021_01_08_425952 213 5 patient patient NN 10_1101-2021_01_08_425952 213 6 had have VBD 10_1101-2021_01_08_425952 213 7 over over IN 10_1101-2021_01_08_425952 213 8 three three CD 10_1101-2021_01_08_425952 213 9 years year NNS 10_1101-2021_01_08_425952 213 10 of of IN 10_1101-2021_01_08_425952 213 11 prescription prescription NN 10_1101-2021_01_08_425952 213 12 events event NNS 10_1101-2021_01_08_425952 213 13 before before IN 10_1101-2021_01_08_425952 213 14 the the DT 10_1101-2021_01_08_425952 213 15 prescription prescription NN 10_1101-2021_01_08_425952 213 16 of of IN 10_1101-2021_01_08_425952 213 17 interest interest NN 10_1101-2021_01_08_425952 213 18 ( ( -LRB- 10_1101-2021_01_08_425952 213 19 from from IN 10_1101-2021_01_08_425952 213 20 2003 2003 CD 10_1101-2021_01_08_425952 213 21 - - SYM 10_1101-2021_01_08_425952 213 22 05 05 CD 10_1101-2021_01_08_425952 213 23 - - SYM 10_1101-2021_01_08_425952 213 24 29 29 CD 10_1101-2021_01_08_425952 213 25 to to TO 10_1101-2021_01_08_425952 213 26 2007 2007 CD 10_1101-2021_01_08_425952 213 27 - - SYM 10_1101-2021_01_08_425952 213 28 10 10 CD 10_1101-2021_01_08_425952 213 29 - - SYM 10_1101-2021_01_08_425952 213 30 17 17 CD 10_1101-2021_01_08_425952 213 31 with with IN 10_1101-2021_01_08_425952 213 32 over over IN 10_1101-2021_01_08_425952 213 33 172 172 CD 10_1101-2021_01_08_425952 213 34 days day NNS 10_1101-2021_01_08_425952 213 35 free free JJ 10_1101-2021_01_08_425952 213 36 from from IN 10_1101-2021_01_08_425952 213 37 exposure exposure NN 10_1101-2021_01_08_425952 213 38 before before IN 10_1101-2021_01_08_425952 213 39 the the DT 10_1101-2021_01_08_425952 213 40 prescription prescription NN 10_1101-2021_01_08_425952 213 41 event event NN 10_1101-2021_01_08_425952 213 42 of of IN 10_1101-2021_01_08_425952 213 43 interest interest NN 10_1101-2021_01_08_425952 213 44 prodcode prodcode NN 10_1101-2021_01_08_425952 213 45 297 297 CD 10_1101-2021_01_08_425952 213 46 : : : 10_1101-2021_01_08_425952 213 47 > > XX 10_1101-2021_01_08_425952 213 48 head(burnInTherapyDF[burnInTherapyDF$patid head(burnInTherapyDF[burnInTherapyDF$patid NNP 10_1101-2021_01_08_425952 213 49 = = SYM 10_1101-2021_01_08_425952 213 50 = = SYM 10_1101-2021_01_08_425952 213 51 332412 332412 CD 10_1101-2021_01_08_425952 213 52 , , , 10_1101-2021_01_08_425952 213 53 ] ] -RRB- 10_1101-2021_01_08_425952 213 54 , , , 10_1101-2021_01_08_425952 213 55 n=9 n=9 NN 10_1101-2021_01_08_425952 213 56 ) ) -RRB- 10_1101-2021_01_08_425952 213 57 [ [ -LRB- 10_1101-2021_01_08_425952 213 58 1 1 CD 10_1101-2021_01_08_425952 213 59 ] ] -RRB- 10_1101-2021_01_08_425952 213 60 patid patid NNP 10_1101-2021_01_08_425952 213 61 eventdate eventdate NNP 10_1101-2021_01_08_425952 213 62 prodcode prodcode NN 10_1101-2021_01_08_425952 213 63 consid consid NN 10_1101-2021_01_08_425952 213 64 issueseq issueseq NN 10_1101-2021_01_08_425952 213 65 < < XX 10_1101-2021_01_08_425952 213 66 0 0 NFP 10_1101-2021_01_08_425952 213 67 rows row NNS 10_1101-2021_01_08_425952 213 68 > > XX 10_1101-2021_01_08_425952 213 69 ( ( -LRB- 10_1101-2021_01_08_425952 213 70 or or CC 10_1101-2021_01_08_425952 213 71 0-length 0-length CD 10_1101-2021_01_08_425952 213 72 row.names row.names NNP 10_1101-2021_01_08_425952 213 73 ) ) -RRB- 10_1101-2021_01_08_425952 213 74 3.3 3.3 CD 10_1101-2021_01_08_425952 213 75 . . . 10_1101-2021_01_08_425952 214 1 First first JJ 10_1101-2021_01_08_425952 214 2 drug drug NN 10_1101-2021_01_08_425952 214 3 prescriptions prescription NNS 10_1101-2021_01_08_425952 214 4 getFirstDrugPrescription getfirstdrugprescription PRP 10_1101-2021_01_08_425952 214 5 A a DT 10_1101-2021_01_08_425952 214 6 patient patient NN 10_1101-2021_01_08_425952 214 7 ’s ’s POS 10_1101-2021_01_08_425952 214 8 first first JJ 10_1101-2021_01_08_425952 214 9 prescription prescription NN 10_1101-2021_01_08_425952 214 10 event event NN 10_1101-2021_01_08_425952 214 11 on on IN 10_1101-2021_01_08_425952 214 12 CPRD cprd NN 10_1101-2021_01_08_425952 214 13 record record NN 10_1101-2021_01_08_425952 214 14 can can MD 10_1101-2021_01_08_425952 214 15 be be VB 10_1101-2021_01_08_425952 214 16 identified identify VBN 10_1101-2021_01_08_425952 214 17 by by IN 10_1101-2021_01_08_425952 214 18 supplying supply VBG 10_1101-2021_01_08_425952 214 19 getFirstDrugPrescription getfirstdrugprescription CD 10_1101-2021_01_08_425952 214 20 with with IN 10_1101-2021_01_08_425952 214 21 a a DT 10_1101-2021_01_08_425952 214 22 list list NN 10_1101-2021_01_08_425952 214 23 of of IN 10_1101-2021_01_08_425952 214 24 prescription prescription NN 10_1101-2021_01_08_425952 214 25 prodcodes prodcode NNS 10_1101-2021_01_08_425952 214 26 . . . 10_1101-2021_01_08_425952 215 1 The the DT 10_1101-2021_01_08_425952 215 2 functions function NNS 10_1101-2021_01_08_425952 215 3 returns return VBZ 10_1101-2021_01_08_425952 215 4 FirstDrugObject firstdrugobject NN 10_1101-2021_01_08_425952 215 5 , , , 10_1101-2021_01_08_425952 215 6 an an DT 10_1101-2021_01_08_425952 215 7 R R NNP 10_1101-2021_01_08_425952 215 8 S3 S3 NNP 10_1101-2021_01_08_425952 215 9 ob- ob- NN 10_1101-2021_01_08_425952 215 10 ject ject NN 10_1101-2021_01_08_425952 215 11 of of IN 10_1101-2021_01_08_425952 215 12 type type NN 10_1101-2021_01_08_425952 215 13 List List NNP 10_1101-2021_01_08_425952 215 14 . . . 10_1101-2021_01_08_425952 216 1 Only only RB 10_1101-2021_01_08_425952 216 2 the the DT 10_1101-2021_01_08_425952 216 3 first first JJ 10_1101-2021_01_08_425952 216 4 prescription prescription NN 10_1101-2021_01_08_425952 216 5 event event NN 10_1101-2021_01_08_425952 216 6 to to TO 10_1101-2021_01_08_425952 216 7 match match VB 10_1101-2021_01_08_425952 216 8 anyone anyone NN 10_1101-2021_01_08_425952 216 9 one one CD 10_1101-2021_01_08_425952 216 10 of of IN 10_1101-2021_01_08_425952 216 11 the the DT 10_1101-2021_01_08_425952 216 12 prescription prescription NN 10_1101-2021_01_08_425952 216 13 prodcodes prodcode NNS 10_1101-2021_01_08_425952 216 14 provided provide VBN 10_1101-2021_01_08_425952 216 15 is be VBZ 10_1101-2021_01_08_425952 216 16 identified identify VBN 10_1101-2021_01_08_425952 216 17 . . . 10_1101-2021_01_08_425952 217 1 The the DT 10_1101-2021_01_08_425952 217 2 first first JJ 10_1101-2021_01_08_425952 217 3 element element NN 10_1101-2021_01_08_425952 217 4 of of IN 10_1101-2021_01_08_425952 217 5 FirstDrugObject firstdrugobject NN 10_1101-2021_01_08_425952 217 6 contains contain VBZ 10_1101-2021_01_08_425952 217 7 a a DT 10_1101-2021_01_08_425952 217 8 named name VBN 10_1101-2021_01_08_425952 217 9 list list NN 10_1101-2021_01_08_425952 217 10 of of IN 10_1101-2021_01_08_425952 217 11 patid patid JJ 10_1101-2021_01_08_425952 217 12 vectors vector NNS 10_1101-2021_01_08_425952 217 13 . . . 10_1101-2021_01_08_425952 218 1 Each each DT 10_1101-2021_01_08_425952 218 2 vector vector NN 10_1101-2021_01_08_425952 218 3 contains contain VBZ 10_1101-2021_01_08_425952 218 4 the the DT 10_1101-2021_01_08_425952 218 5 patids patid NNS 10_1101-2021_01_08_425952 218 6 of of IN 10_1101-2021_01_08_425952 218 7 all all PDT 10_1101-2021_01_08_425952 218 8 those those DT 10_1101-2021_01_08_425952 218 9 patients patient NNS 10_1101-2021_01_08_425952 218 10 that that WDT 10_1101-2021_01_08_425952 218 11 share share VBP 10_1101-2021_01_08_425952 218 12 the the DT 10_1101-2021_01_08_425952 218 13 same same JJ 10_1101-2021_01_08_425952 218 14 first first JJ 10_1101-2021_01_08_425952 218 15 prescription prescription NN 10_1101-2021_01_08_425952 218 16 prodcode prodcode NN 10_1101-2021_01_08_425952 218 17 . . . 10_1101-2021_01_08_425952 219 1 The the DT 10_1101-2021_01_08_425952 219 2 list list NN 10_1101-2021_01_08_425952 219 3 element element NN 10_1101-2021_01_08_425952 219 4 is be VBZ 10_1101-2021_01_08_425952 219 5 named name VBN 10_1101-2021_01_08_425952 219 6 after after IN 10_1101-2021_01_08_425952 219 7 the the DT 10_1101-2021_01_08_425952 219 8 corresponding corresponding JJ 10_1101-2021_01_08_425952 219 9 prescription prescription NN 10_1101-2021_01_08_425952 219 10 prodcode prodcode NN 10_1101-2021_01_08_425952 219 11 . . . 10_1101-2021_01_08_425952 220 1 The the DT 10_1101-2021_01_08_425952 220 2 second second JJ 10_1101-2021_01_08_425952 220 3 element element NN 10_1101-2021_01_08_425952 220 4 in in IN 10_1101-2021_01_08_425952 220 5 FirstDrugOject firstdrugoject NN 10_1101-2021_01_08_425952 220 6 , , , 10_1101-2021_01_08_425952 220 7 like like IN 10_1101-2021_01_08_425952 220 8 the the DT 10_1101-2021_01_08_425952 220 9 first first JJ 10_1101-2021_01_08_425952 220 10 , , , 10_1101-2021_01_08_425952 220 11 is be VBZ 10_1101-2021_01_08_425952 220 12 a a DT 10_1101-2021_01_08_425952 220 13 list list NN 10_1101-2021_01_08_425952 220 14 of of IN 10_1101-2021_01_08_425952 220 15 Date Date NNP 10_1101-2021_01_08_425952 220 16 vectors vector NNS 10_1101-2021_01_08_425952 220 17 , , , 10_1101-2021_01_08_425952 220 18 each each DT 10_1101-2021_01_08_425952 220 19 named name VBN 10_1101-2021_01_08_425952 220 20 after after IN 10_1101-2021_01_08_425952 220 21 the the DT 10_1101-2021_01_08_425952 220 22 corresponding corresponding JJ 10_1101-2021_01_08_425952 220 23 prescription prescription NN 10_1101-2021_01_08_425952 220 24 prodcode prodcode NN 10_1101-2021_01_08_425952 220 25 . . . 10_1101-2021_01_08_425952 221 1 Each each DT 10_1101-2021_01_08_425952 221 2 Date date NN 10_1101-2021_01_08_425952 221 3 vector vector NN 10_1101-2021_01_08_425952 221 4 contains contain VBZ 10_1101-2021_01_08_425952 221 5 the the DT 10_1101-2021_01_08_425952 221 6 eventdate eventdate NN 10_1101-2021_01_08_425952 221 7 of of IN 10_1101-2021_01_08_425952 221 8 the the DT 10_1101-2021_01_08_425952 221 9 prescription prescription NN 10_1101-2021_01_08_425952 221 10 event event NN 10_1101-2021_01_08_425952 221 11 for for IN 10_1101-2021_01_08_425952 221 12 the the DT 10_1101-2021_01_08_425952 221 13 patient patient NN 10_1101-2021_01_08_425952 221 14 identified identify VBN 10_1101-2021_01_08_425952 221 15 by by IN 10_1101-2021_01_08_425952 221 16 the the DT 10_1101-2021_01_08_425952 221 17 patid patid NN 10_1101-2021_01_08_425952 221 18 in in IN 10_1101-2021_01_08_425952 221 19 the the DT 10_1101-2021_01_08_425952 221 20 identical identical JJ 10_1101-2021_01_08_425952 221 21 position position NN 10_1101-2021_01_08_425952 221 22 of of IN 10_1101-2021_01_08_425952 221 23 the the DT 10_1101-2021_01_08_425952 221 24 preceding precede VBG 10_1101-2021_01_08_425952 221 25 List list NN 10_1101-2021_01_08_425952 221 26 . . . 10_1101-2021_01_08_425952 222 1 The the DT 10_1101-2021_01_08_425952 222 2 third third JJ 10_1101-2021_01_08_425952 222 3 list list NN 10_1101-2021_01_08_425952 222 4 element element NN 10_1101-2021_01_08_425952 222 5 contains contain VBZ 10_1101-2021_01_08_425952 222 6 a a DT 10_1101-2021_01_08_425952 222 7 table table NN 10_1101-2021_01_08_425952 222 8 of of IN 10_1101-2021_01_08_425952 222 9 prescription prescription NN 10_1101-2021_01_08_425952 222 10 frequencies frequency NNS 10_1101-2021_01_08_425952 222 11 for for IN 10_1101-2021_01_08_425952 222 12 each each DT 10_1101-2021_01_08_425952 222 13 first first JJ 10_1101-2021_01_08_425952 222 14 prescription prescription NN 10_1101-2021_01_08_425952 222 15 prodcode prodcode NN 10_1101-2021_01_08_425952 222 16 on on IN 10_1101-2021_01_08_425952 222 17 record record NN 10_1101-2021_01_08_425952 222 18 . . . 10_1101-2021_01_08_425952 223 1 The the DT 10_1101-2021_01_08_425952 223 2 prodcode prodcode NN 10_1101-2021_01_08_425952 223 3 is be VBZ 10_1101-2021_01_08_425952 223 4 accompanied accompany VBN 10_1101-2021_01_08_425952 223 5 by by IN 10_1101-2021_01_08_425952 223 6 a a DT 10_1101-2021_01_08_425952 223 7 product product NN 10_1101-2021_01_08_425952 223 8 description description NN 10_1101-2021_01_08_425952 223 9 providing provide VBG 10_1101-2021_01_08_425952 223 10 a a DT 10_1101-2021_01_08_425952 223 11 file file NN 10_1101-2021_01_08_425952 223 12 of of IN 10_1101-2021_01_08_425952 223 13 CPRD cprd NN 10_1101-2021_01_08_425952 223 14 prescription prescription NN 10_1101-2021_01_08_425952 223 15 products product NNS 10_1101-2021_01_08_425952 223 16 has have VBZ 10_1101-2021_01_08_425952 223 17 been be VBN 10_1101-2021_01_08_425952 223 18 provided provide VBN 10_1101-2021_01_08_425952 223 19 . . . 10_1101-2021_01_08_425952 224 1 Below below RB 10_1101-2021_01_08_425952 224 2 we -PRON- PRP 10_1101-2021_01_08_425952 224 3 demonstrate demonstrate VBP 10_1101-2021_01_08_425952 224 4 how how WRB 10_1101-2021_01_08_425952 224 5 to to TO 10_1101-2021_01_08_425952 224 6 retrieve retrieve VB 10_1101-2021_01_08_425952 224 7 information information NN 10_1101-2021_01_08_425952 224 8 on on IN 10_1101-2021_01_08_425952 224 9 first first JJ 10_1101-2021_01_08_425952 224 10 - - HYPH 10_1101-2021_01_08_425952 224 11 line line NN 10_1101-2021_01_08_425952 224 12 treatment treatment NN 10_1101-2021_01_08_425952 224 13 : : : 10_1101-2021_01_08_425952 224 14 > > XX 10_1101-2021_01_08_425952 224 15 library(rdrugtrajectory library(rdrugtrajectory NN 10_1101-2021_01_08_425952 224 16 ) ) -RRB- 10_1101-2021_01_08_425952 224 17 > > XX 10_1101-2021_01_08_425952 224 18 library(ggplot2 library(ggplot2 NN 10_1101-2021_01_08_425952 224 19 ) ) -RRB- 10_1101-2021_01_08_425952 224 20 > > XX 10_1101-2021_01_08_425952 224 21 # # $ 10_1101-2021_01_08_425952 224 22 An an DT 10_1101-2021_01_08_425952 224 23 adjusted adjust VBN 10_1101-2021_01_08_425952 224 24 data datum NNS 10_1101-2021_01_08_425952 224 25 dictionary dictionary JJ 10_1101-2021_01_08_425952 224 26 file file NN 10_1101-2021_01_08_425952 224 27 . . . 10_1101-2021_01_08_425952 225 1 > > XX 10_1101-2021_01_08_425952 225 2 fileLocation fileLocation NNP 10_1101-2021_01_08_425952 225 3 < < XX 10_1101-2021_01_08_425952 225 4 - - : 10_1101-2021_01_08_425952 225 5 " " `` 10_1101-2021_01_08_425952 225 6 product.txt product.txt NN 10_1101-2021_01_08_425952 225 7 " " '' 10_1101-2021_01_08_425952 225 8 > > XX 10_1101-2021_01_08_425952 225 9 # # NNP 10_1101-2021_01_08_425952 225 10 Without without IN 10_1101-2021_01_08_425952 225 11 supplying supply VBG 10_1101-2021_01_08_425952 225 12 a a DT 10_1101-2021_01_08_425952 225 13 vector vector NN 10_1101-2021_01_08_425952 225 14 of of IN 10_1101-2021_01_08_425952 225 15 product product NN 10_1101-2021_01_08_425952 225 16 files file NNS 10_1101-2021_01_08_425952 225 17 all all DT 10_1101-2021_01_08_425952 225 18 prodcodes prodcode NNS 10_1101-2021_01_08_425952 225 19 in in IN 10_1101-2021_01_08_425952 225 20 the the DT 10_1101-2021_01_08_425952 225 21 therapy therapy NN 10_1101-2021_01_08_425952 225 22 > > XX 10_1101-2021_01_08_425952 225 23 # # $ 10_1101-2021_01_08_425952 225 24 dataset dataset NN 10_1101-2021_01_08_425952 225 25 are be VBP 10_1101-2021_01_08_425952 225 26 considered consider VBN 10_1101-2021_01_08_425952 225 27 . . . 10_1101-2021_01_08_425952 226 1 > > XX 10_1101-2021_01_08_425952 226 2 resultFDO resultfdo FW 10_1101-2021_01_08_425952 226 3 < < XX 10_1101-2021_01_08_425952 226 4 - - HYPH 10_1101-2021_01_08_425952 226 5 getFirstDrugPrescription(df getFirstDrugPrescription(df NNP 10_1101-2021_01_08_425952 226 6 = = SYM 10_1101-2021_01_08_425952 226 7 testTherapyDF testTherapyDF NNS 10_1101-2021_01_08_425952 226 8 , , , 10_1101-2021_01_08_425952 226 9 + + CC 10_1101-2021_01_08_425952 226 10 idList idList NNP 10_1101-2021_01_08_425952 226 11 = = SYM 10_1101-2021_01_08_425952 226 12 NULL NULL NNP 10_1101-2021_01_08_425952 226 13 , , , 10_1101-2021_01_08_425952 226 14 + + CC 10_1101-2021_01_08_425952 226 15 prodCodesVector prodcodesvector NN 10_1101-2021_01_08_425952 226 16 = = SYM 10_1101-2021_01_08_425952 226 17 NULL NULL NNP 10_1101-2021_01_08_425952 226 18 , , , 10_1101-2021_01_08_425952 226 19 + + CC 10_1101-2021_01_08_425952 226 20 descriptionFile descriptionfile NN 10_1101-2021_01_08_425952 226 21 = = SYM 10_1101-2021_01_08_425952 226 22 fileLocation filelocation NN 10_1101-2021_01_08_425952 226 23 ) ) -RRB- 10_1101-2021_01_08_425952 226 24 > > XX 10_1101-2021_01_08_425952 226 25 patidList patidlist NN 10_1101-2021_01_08_425952 226 26 < < XX 10_1101-2021_01_08_425952 226 27 - - HYPH 10_1101-2021_01_08_425952 226 28 resultFDO[[1 resultFDO[[1 NNP 10_1101-2021_01_08_425952 226 29 ] ] -RRB- 10_1101-2021_01_08_425952 226 30 ] ] -RRB- 10_1101-2021_01_08_425952 226 31 > > XX 10_1101-2021_01_08_425952 226 32 eventdateList eventdatelist XX 10_1101-2021_01_08_425952 226 33 < < XX 10_1101-2021_01_08_425952 226 34 - - HYPH 10_1101-2021_01_08_425952 226 35 resultFDO[[2 resultFDO[[2 NNP 10_1101-2021_01_08_425952 226 36 ] ] -RRB- 10_1101-2021_01_08_425952 226 37 ] ] -RRB- 10_1101-2021_01_08_425952 226 38 > > NN 10_1101-2021_01_08_425952 226 39 drugFrequencyDF drugFrequencyDF NNS 10_1101-2021_01_08_425952 226 40 < < XX 10_1101-2021_01_08_425952 226 41 - - HYPH 10_1101-2021_01_08_425952 226 42 resultFDO[[3 resultFDO[[3 NNP 10_1101-2021_01_08_425952 226 43 ] ] -RRB- 10_1101-2021_01_08_425952 226 44 ] ] -RRB- 10_1101-2021_01_08_425952 226 45 > > NN 10_1101-2021_01_08_425952 226 46 drugFrequencyDF drugFrequencyDF NNS 10_1101-2021_01_08_425952 226 47 < < XX 10_1101-2021_01_08_425952 226 48 - - HYPH 10_1101-2021_01_08_425952 226 49 drugFrequencyDF[order(drugFrequencyDF$Frequency drugFrequencyDF[order(drugFrequencyDF$Frequency NNP 10_1101-2021_01_08_425952 226 50 , , , 10_1101-2021_01_08_425952 226 51 + + CC 10_1101-2021_01_08_425952 226 52 decreasing decrease VBG 10_1101-2021_01_08_425952 226 53 = = -RRB- 10_1101-2021_01_08_425952 226 54 TRUE TRUE NNP 10_1101-2021_01_08_425952 226 55 ) ) -RRB- 10_1101-2021_01_08_425952 226 56 , , , 10_1101-2021_01_08_425952 226 57 ] ] -RRB- 10_1101-2021_01_08_425952 226 58 > > XX 10_1101-2021_01_08_425952 226 59 ggFreq ggfreq CD 10_1101-2021_01_08_425952 226 60 < < XX 10_1101-2021_01_08_425952 226 61 - - HYPH 10_1101-2021_01_08_425952 226 62 ggplot(data ggplot(data NNP 10_1101-2021_01_08_425952 226 63 = = SYM 10_1101-2021_01_08_425952 226 64 drugFrequencyDF drugFrequencyDF NNP 10_1101-2021_01_08_425952 226 65 , , , 10_1101-2021_01_08_425952 226 66 aes(x aes(x NN 10_1101-2021_01_08_425952 226 67 = = SYM 10_1101-2021_01_08_425952 226 68 description description NN 10_1101-2021_01_08_425952 226 69 , , , 10_1101-2021_01_08_425952 226 70 y y NNP 10_1101-2021_01_08_425952 226 71 = = : 10_1101-2021_01_08_425952 226 72 Frequency Frequency NNP 10_1101-2021_01_08_425952 226 73 ) ) -RRB- 10_1101-2021_01_08_425952 226 74 ) ) -RRB- 10_1101-2021_01_08_425952 226 75 + + CC 10_1101-2021_01_08_425952 226 76 + + SYM 10_1101-2021_01_08_425952 226 77 geom_bar(stat="identity geom_bar(stat="identity NN 10_1101-2021_01_08_425952 226 78 " " '' 10_1101-2021_01_08_425952 226 79 ) ) -RRB- 10_1101-2021_01_08_425952 226 80 + + NFP 10_1101-2021_01_08_425952 226 81 theme_bw theme_bw NNP 10_1101-2021_01_08_425952 226 82 ( ( -LRB- 10_1101-2021_01_08_425952 226 83 ) ) -RRB- 10_1101-2021_01_08_425952 226 84 + + CD 10_1101-2021_01_08_425952 226 85 + + SYM 10_1101-2021_01_08_425952 226 86 theme(axis.text.x theme(axis.text.x XX 10_1101-2021_01_08_425952 226 87 = = SYM 10_1101-2021_01_08_425952 226 88 element_text(angle=45 element_text(angle=45 FW 10_1101-2021_01_08_425952 226 89 , , , 10_1101-2021_01_08_425952 226 90 hjust=1 hjust=1 ADD 10_1101-2021_01_08_425952 226 91 ) ) -RRB- 10_1101-2021_01_08_425952 226 92 ) ) -RRB- 10_1101-2021_01_08_425952 226 93 + + NFP 10_1101-2021_01_08_425952 226 94 + + SYM 10_1101-2021_01_08_425952 226 95 xlab("Drug xlab("Drug NNP 10_1101-2021_01_08_425952 226 96 product product NN 10_1101-2021_01_08_425952 226 97 description description NN 10_1101-2021_01_08_425952 226 98 " " '' 10_1101-2021_01_08_425952 226 99 ) ) -RRB- 10_1101-2021_01_08_425952 226 100 .CC .CC NFP 10_1101-2021_01_08_425952 226 101 - - : 10_1101-2021_01_08_425952 226 102 BY by IN 10_1101-2021_01_08_425952 226 103 - - HYPH 10_1101-2021_01_08_425952 226 104 ND ND NNP 10_1101-2021_01_08_425952 226 105 4.0 4.0 CD 10_1101-2021_01_08_425952 226 106 International international JJ 10_1101-2021_01_08_425952 226 107 licensemade licensemade NN 10_1101-2021_01_08_425952 226 108 available available JJ 10_1101-2021_01_08_425952 226 109 under under IN 10_1101-2021_01_08_425952 226 110 a a DT 10_1101-2021_01_08_425952 226 111 ( ( -LRB- 10_1101-2021_01_08_425952 226 112 which which WDT 10_1101-2021_01_08_425952 226 113 was be VBD 10_1101-2021_01_08_425952 226 114 not not RB 10_1101-2021_01_08_425952 226 115 certified certify VBN 10_1101-2021_01_08_425952 226 116 by by IN 10_1101-2021_01_08_425952 226 117 peer peer NN 10_1101-2021_01_08_425952 226 118 review review NN 10_1101-2021_01_08_425952 226 119 ) ) -RRB- 10_1101-2021_01_08_425952 226 120 is be VBZ 10_1101-2021_01_08_425952 226 121 the the DT 10_1101-2021_01_08_425952 226 122 author author NN 10_1101-2021_01_08_425952 226 123 / / SYM 10_1101-2021_01_08_425952 226 124 funder funder NN 10_1101-2021_01_08_425952 226 125 , , , 10_1101-2021_01_08_425952 226 126 who who WP 10_1101-2021_01_08_425952 226 127 has have VBZ 10_1101-2021_01_08_425952 226 128 granted grant VBN 10_1101-2021_01_08_425952 226 129 bioRxiv biorxiv IN 10_1101-2021_01_08_425952 226 130 a a DT 10_1101-2021_01_08_425952 226 131 license license NN 10_1101-2021_01_08_425952 226 132 to to TO 10_1101-2021_01_08_425952 226 133 display display VB 10_1101-2021_01_08_425952 226 134 the the DT 10_1101-2021_01_08_425952 226 135 preprint preprint NN 10_1101-2021_01_08_425952 226 136 in in IN 10_1101-2021_01_08_425952 226 137 perpetuity perpetuity NN 10_1101-2021_01_08_425952 226 138 . . . 10_1101-2021_01_08_425952 227 1 It -PRON- PRP 10_1101-2021_01_08_425952 227 2 is be VBZ 10_1101-2021_01_08_425952 227 3 The the DT 10_1101-2021_01_08_425952 227 4 copyright copyright NN 10_1101-2021_01_08_425952 227 5 holder holder NN 10_1101-2021_01_08_425952 227 6 for for IN 10_1101-2021_01_08_425952 227 7 this this DT 10_1101-2021_01_08_425952 227 8 preprintthis preprintthis NN 10_1101-2021_01_08_425952 227 9 version version NN 10_1101-2021_01_08_425952 227 10 posted post VBD 10_1101-2021_01_08_425952 227 11 January January NNP 10_1101-2021_01_08_425952 227 12 9 9 CD 10_1101-2021_01_08_425952 227 13 , , , 10_1101-2021_01_08_425952 227 14 2021 2021 CD 10_1101-2021_01_08_425952 227 15 . . . 10_1101-2021_01_08_425952 227 16 ; ; : 10_1101-2021_01_08_425952 227 17 https://doi.org/10.1101/2021.01.08.425952doi https://doi.org/10.1101/2021.01.08.425952doi ADD 10_1101-2021_01_08_425952 227 18 : : : 10_1101-2021_01_08_425952 227 19 bioRxiv biorxiv IN 10_1101-2021_01_08_425952 227 20 preprint preprint NN 10_1101-2021_01_08_425952 227 21 https://doi.org/10.1101/2021.01.08.425952 https://doi.org/10.1101/2021.01.08.425952 XX 10_1101-2021_01_08_425952 227 22 http://creativecommons.org/licenses/by-nd/4.0/ http://creativecommons.org/licenses/by-nd/4.0/ NNP 10_1101-2021_01_08_425952 227 23 Journal Journal NNP 10_1101-2021_01_08_425952 227 24 of of IN 10_1101-2021_01_08_425952 227 25 Statistical Statistical NNP 10_1101-2021_01_08_425952 227 26 Software Software NNP 10_1101-2021_01_08_425952 227 27 21 21 CD 10_1101-2021_01_08_425952 227 28 > > NFP 10_1101-2021_01_08_425952 227 29 # # $ 10_1101-2021_01_08_425952 227 30 The the DT 10_1101-2021_01_08_425952 227 31 structure structure NN 10_1101-2021_01_08_425952 227 32 of of IN 10_1101-2021_01_08_425952 227 33 the the DT 10_1101-2021_01_08_425952 227 34 FirstDrugObject firstdrugobject NN 10_1101-2021_01_08_425952 227 35 . . . 10_1101-2021_01_08_425952 228 1 > > XX 10_1101-2021_01_08_425952 228 2 str(resultFDO str(resultFDO NNS 10_1101-2021_01_08_425952 228 3 , , , 10_1101-2021_01_08_425952 228 4 strict.width="wrap strict.width="wrap NN 10_1101-2021_01_08_425952 228 5 " " '' 10_1101-2021_01_08_425952 228 6 , , , 10_1101-2021_01_08_425952 228 7 list.len list.len ADD 10_1101-2021_01_08_425952 228 8 = = SYM 10_1101-2021_01_08_425952 228 9 5 5 CD 10_1101-2021_01_08_425952 228 10 ) ) -RRB- 10_1101-2021_01_08_425952 228 11 0 0 CD 10_1101-2021_01_08_425952 228 12 500 500 CD 10_1101-2021_01_08_425952 228 13 1000 1000 CD 10_1101-2021_01_08_425952 228 14 Am be VBP 10_1101-2021_01_08_425952 228 15 itr itr JJ 10_1101-2021_01_08_425952 228 16 ip ip NNP 10_1101-2021_01_08_425952 228 17 ty ty NNP 10_1101-2021_01_08_425952 228 18 lin lin NNP 10_1101-2021_01_08_425952 228 19 e e NNP 10_1101-2021_01_08_425952 228 20 10 10 CD 10_1101-2021_01_08_425952 228 21 m m NNP 10_1101-2021_01_08_425952 228 22 g g NNP 10_1101-2021_01_08_425952 228 23 ta ta NNP 10_1101-2021_01_08_425952 228 24 bl bl NNP 10_1101-2021_01_08_425952 228 25 et et NNP 10_1101-2021_01_08_425952 228 26 s s NNP 10_1101-2021_01_08_425952 228 27 Am be VBP 10_1101-2021_01_08_425952 228 28 itr itr JJ 10_1101-2021_01_08_425952 228 29 ip ip NNP 10_1101-2021_01_08_425952 228 30 ty ty NNP 10_1101-2021_01_08_425952 228 31 lin lin NNP 10_1101-2021_01_08_425952 228 32 e e NNP 10_1101-2021_01_08_425952 228 33 25 25 CD 10_1101-2021_01_08_425952 228 34 m m NN 10_1101-2021_01_08_425952 228 35 g g NNP 10_1101-2021_01_08_425952 228 36 ta ta NNP 10_1101-2021_01_08_425952 228 37 bl bl NNP 10_1101-2021_01_08_425952 228 38 et et NNP 10_1101-2021_01_08_425952 228 39 s s NNP 10_1101-2021_01_08_425952 228 40 Am be VBP 10_1101-2021_01_08_425952 228 41 itr itr JJ 10_1101-2021_01_08_425952 228 42 ip ip NNP 10_1101-2021_01_08_425952 228 43 ty ty NNP 10_1101-2021_01_08_425952 228 44 lin lin NNP 10_1101-2021_01_08_425952 228 45 e e NNP 10_1101-2021_01_08_425952 228 46 50 50 CD 10_1101-2021_01_08_425952 228 47 m m NNP 10_1101-2021_01_08_425952 228 48 g g NNP 10_1101-2021_01_08_425952 228 49 ta ta NNP 10_1101-2021_01_08_425952 228 50 bl bl NNP 10_1101-2021_01_08_425952 228 51 et et NNP 10_1101-2021_01_08_425952 228 52 s s NNP 10_1101-2021_01_08_425952 228 53 At at IN 10_1101-2021_01_08_425952 228 54 en en FW 10_1101-2021_01_08_425952 228 55 ol old NNP 10_1101-2021_01_08_425952 228 56 ol old NNP 10_1101-2021_01_08_425952 228 57 1 1 CD 10_1101-2021_01_08_425952 228 58 00 00 CD 10_1101-2021_01_08_425952 228 59 m m NNP 10_1101-2021_01_08_425952 228 60 g g NNP 10_1101-2021_01_08_425952 228 61 ta ta NNP 10_1101-2021_01_08_425952 228 62 bl bl NNP 10_1101-2021_01_08_425952 228 63 et et NNP 10_1101-2021_01_08_425952 228 64 s s NNP 10_1101-2021_01_08_425952 228 65 At at IN 10_1101-2021_01_08_425952 228 66 en en NNP 10_1101-2021_01_08_425952 228 67 ol old NNP 10_1101-2021_01_08_425952 228 68 ol old NNP 10_1101-2021_01_08_425952 228 69 2 2 CD 10_1101-2021_01_08_425952 228 70 5 5 CD 10_1101-2021_01_08_425952 228 71 m m NN 10_1101-2021_01_08_425952 228 72 g g NN 10_1101-2021_01_08_425952 228 73 ta ta NNP 10_1101-2021_01_08_425952 228 74 bl bl NNP 10_1101-2021_01_08_425952 228 75 et et NNP 10_1101-2021_01_08_425952 228 76 s s NNP 10_1101-2021_01_08_425952 228 77 At at IN 10_1101-2021_01_08_425952 228 78 en en NNP 10_1101-2021_01_08_425952 228 79 ol old NNP 10_1101-2021_01_08_425952 228 80 ol old NNP 10_1101-2021_01_08_425952 228 81 5 5 CD 10_1101-2021_01_08_425952 228 82 0 0 CD 10_1101-2021_01_08_425952 228 83 m m NN 10_1101-2021_01_08_425952 228 84 g g NNP 10_1101-2021_01_08_425952 228 85 ta ta NNP 10_1101-2021_01_08_425952 228 86 bl bl NNP 10_1101-2021_01_08_425952 228 87 et et NNP 10_1101-2021_01_08_425952 228 88 s s NNP 10_1101-2021_01_08_425952 228 89 Ca Ca NNP 10_1101-2021_01_08_425952 228 90 nd nd NNP 10_1101-2021_01_08_425952 228 91 es es NNP 10_1101-2021_01_08_425952 228 92 ar ar NNP 10_1101-2021_01_08_425952 228 93 ta ta NNP 10_1101-2021_01_08_425952 228 94 n n NNP 10_1101-2021_01_08_425952 228 95 2 2 CD 10_1101-2021_01_08_425952 228 96 m m NNP 10_1101-2021_01_08_425952 228 97 g g NNP 10_1101-2021_01_08_425952 228 98 ta ta NNP 10_1101-2021_01_08_425952 228 99 bl bl NNP 10_1101-2021_01_08_425952 228 100 et et NNP 10_1101-2021_01_08_425952 228 101 s s NNP 10_1101-2021_01_08_425952 228 102 Ca Ca NNP 10_1101-2021_01_08_425952 228 103 nd nd NNP 10_1101-2021_01_08_425952 228 104 es es NNP 10_1101-2021_01_08_425952 228 105 ar ar NNP 10_1101-2021_01_08_425952 228 106 ta ta NNP 10_1101-2021_01_08_425952 228 107 n n NNP 10_1101-2021_01_08_425952 228 108 4 4 CD 10_1101-2021_01_08_425952 228 109 m m NNP 10_1101-2021_01_08_425952 228 110 g g NNP 10_1101-2021_01_08_425952 228 111 ta ta NNP 10_1101-2021_01_08_425952 228 112 bl bl NNP 10_1101-2021_01_08_425952 228 113 et et NNP 10_1101-2021_01_08_425952 228 114 s s NNP 10_1101-2021_01_08_425952 228 115 Li Li NNP 10_1101-2021_01_08_425952 228 116 sin sin NN 10_1101-2021_01_08_425952 228 117 op op NN 10_1101-2021_01_08_425952 228 118 ril ril NN 10_1101-2021_01_08_425952 228 119 1 1 CD 10_1101-2021_01_08_425952 228 120 0 0 CD 10_1101-2021_01_08_425952 228 121 m m NN 10_1101-2021_01_08_425952 228 122 g g NNP 10_1101-2021_01_08_425952 228 123 ta ta NNP 10_1101-2021_01_08_425952 228 124 bl bl NNP 10_1101-2021_01_08_425952 228 125 et et NNP 10_1101-2021_01_08_425952 228 126 s s NNP 10_1101-2021_01_08_425952 228 127 Li Li NNP 10_1101-2021_01_08_425952 228 128 sin sin NN 10_1101-2021_01_08_425952 228 129 op op NN 10_1101-2021_01_08_425952 228 130 ril ril NN 10_1101-2021_01_08_425952 228 131 2 2 CD 10_1101-2021_01_08_425952 228 132 .5 .5 NN 10_1101-2021_01_08_425952 228 133 m m NNP 10_1101-2021_01_08_425952 228 134 g g NNP 10_1101-2021_01_08_425952 228 135 ta ta NNP 10_1101-2021_01_08_425952 228 136 bl bl NNP 10_1101-2021_01_08_425952 228 137 et et NNP 10_1101-2021_01_08_425952 228 138 s s NNP 10_1101-2021_01_08_425952 228 139 Li Li NNP 10_1101-2021_01_08_425952 228 140 sin sin NN 10_1101-2021_01_08_425952 228 141 op op NN 10_1101-2021_01_08_425952 228 142 ril ril NN 10_1101-2021_01_08_425952 228 143 5 5 CD 10_1101-2021_01_08_425952 228 144 m m NN 10_1101-2021_01_08_425952 228 145 g g NNP 10_1101-2021_01_08_425952 228 146 ta ta NNP 10_1101-2021_01_08_425952 228 147 bl bl NNP 10_1101-2021_01_08_425952 228 148 et et NNP 10_1101-2021_01_08_425952 228 149 s s NNP 10_1101-2021_01_08_425952 228 150 Pr Pr NNP 10_1101-2021_01_08_425952 228 151 op op NN 10_1101-2021_01_08_425952 228 152 ra ra UH 10_1101-2021_01_08_425952 228 153 no no UH 10_1101-2021_01_08_425952 228 154 lo lo NNP 10_1101-2021_01_08_425952 228 155 l l NN 10_1101-2021_01_08_425952 228 156 1 1 CD 10_1101-2021_01_08_425952 228 157 0 0 CD 10_1101-2021_01_08_425952 228 158 m m NN 10_1101-2021_01_08_425952 228 159 g g NNP 10_1101-2021_01_08_425952 228 160 ta ta NNP 10_1101-2021_01_08_425952 228 161 bl bl NNP 10_1101-2021_01_08_425952 228 162 et et NNP 10_1101-2021_01_08_425952 228 163 s s NNP 10_1101-2021_01_08_425952 228 164 Pr Pr NNP 10_1101-2021_01_08_425952 228 165 op op NN 10_1101-2021_01_08_425952 228 166 ra ra UH 10_1101-2021_01_08_425952 228 167 no no UH 10_1101-2021_01_08_425952 228 168 lo lo NNP 10_1101-2021_01_08_425952 228 169 l l NN 10_1101-2021_01_08_425952 228 170 4 4 CD 10_1101-2021_01_08_425952 228 171 0 0 CD 10_1101-2021_01_08_425952 228 172 m m NN 10_1101-2021_01_08_425952 228 173 g g NNP 10_1101-2021_01_08_425952 228 174 ta ta NNP 10_1101-2021_01_08_425952 228 175 bl bl NNP 10_1101-2021_01_08_425952 228 176 et et NNP 10_1101-2021_01_08_425952 228 177 s s NNP 10_1101-2021_01_08_425952 228 178 Pr Pr NNP 10_1101-2021_01_08_425952 228 179 op op NN 10_1101-2021_01_08_425952 228 180 ra ra UH 10_1101-2021_01_08_425952 228 181 no no UH 10_1101-2021_01_08_425952 228 182 lo lo NNP 10_1101-2021_01_08_425952 228 183 l l NN 10_1101-2021_01_08_425952 228 184 8 8 CD 10_1101-2021_01_08_425952 228 185 0 0 CD 10_1101-2021_01_08_425952 228 186 m m NN 10_1101-2021_01_08_425952 228 187 g g NNP 10_1101-2021_01_08_425952 228 188 m m NNP 10_1101-2021_01_08_425952 228 189 od od NNP 10_1101-2021_01_08_425952 228 190 ifie ifie NN 10_1101-2021_01_08_425952 228 191 d− d− NNP 10_1101-2021_01_08_425952 228 192 re re NN 10_1101-2021_01_08_425952 228 193 le le NNP 10_1101-2021_01_08_425952 228 194 as as IN 10_1101-2021_01_08_425952 228 195 e e NNP 10_1101-2021_01_08_425952 228 196 ca ca MD 10_1101-2021_01_08_425952 228 197 ps ps VB 10_1101-2021_01_08_425952 228 198 ul ul NNP 10_1101-2021_01_08_425952 228 199 es es XX 10_1101-2021_01_08_425952 228 200 Pr Pr NNP 10_1101-2021_01_08_425952 228 201 op op NN 10_1101-2021_01_08_425952 228 202 ra ra UH 10_1101-2021_01_08_425952 228 203 no no UH 10_1101-2021_01_08_425952 228 204 lo lo NNP 10_1101-2021_01_08_425952 228 205 l l NN 10_1101-2021_01_08_425952 228 206 8 8 CD 10_1101-2021_01_08_425952 228 207 0 0 CD 10_1101-2021_01_08_425952 228 208 m m NN 10_1101-2021_01_08_425952 228 209 g g NN 10_1101-2021_01_08_425952 228 210 ta ta NNP 10_1101-2021_01_08_425952 228 211 bl bl NNP 10_1101-2021_01_08_425952 228 212 et et NNP 10_1101-2021_01_08_425952 228 213 s s VBZ 10_1101-2021_01_08_425952 228 214 To to IN 10_1101-2021_01_08_425952 228 215 pi pi NNP 10_1101-2021_01_08_425952 228 216 ra ra NNP 10_1101-2021_01_08_425952 228 217 m m NNP 10_1101-2021_01_08_425952 228 218 at at IN 10_1101-2021_01_08_425952 228 219 e e NNP 10_1101-2021_01_08_425952 228 220 25 25 CD 10_1101-2021_01_08_425952 228 221 m m NN 10_1101-2021_01_08_425952 228 222 g g NNP 10_1101-2021_01_08_425952 228 223 ta ta NNP 10_1101-2021_01_08_425952 228 224 bl bl NNP 10_1101-2021_01_08_425952 228 225 et et NNP 10_1101-2021_01_08_425952 228 226 s s NNP 10_1101-2021_01_08_425952 228 227 Ve Ve NNP 10_1101-2021_01_08_425952 228 228 nl nl UH 10_1101-2021_01_08_425952 228 229 af af NN 10_1101-2021_01_08_425952 228 230 ax ax NN 10_1101-2021_01_08_425952 228 231 in in IN 10_1101-2021_01_08_425952 228 232 e e NNP 10_1101-2021_01_08_425952 228 233 37 37 CD 10_1101-2021_01_08_425952 228 234 .5 .5 NN 10_1101-2021_01_08_425952 228 235 m m NNP 10_1101-2021_01_08_425952 228 236 g g NNP 10_1101-2021_01_08_425952 228 237 ta ta NNP 10_1101-2021_01_08_425952 228 238 bl bl NNP 10_1101-2021_01_08_425952 228 239 et et NNP 10_1101-2021_01_08_425952 228 240 s s NNP 10_1101-2021_01_08_425952 228 241 Ve Ve NNP 10_1101-2021_01_08_425952 228 242 nl nl UH 10_1101-2021_01_08_425952 228 243 af af NN 10_1101-2021_01_08_425952 228 244 ax ax NN 10_1101-2021_01_08_425952 228 245 in in IN 10_1101-2021_01_08_425952 228 246 e e NNP 10_1101-2021_01_08_425952 228 247 75 75 CD 10_1101-2021_01_08_425952 228 248 m m NNP 10_1101-2021_01_08_425952 228 249 g g NNP 10_1101-2021_01_08_425952 228 250 m m NNP 10_1101-2021_01_08_425952 228 251 od od NNP 10_1101-2021_01_08_425952 228 252 ifie ifie NN 10_1101-2021_01_08_425952 228 253 d− d− NNP 10_1101-2021_01_08_425952 228 254 re re NN 10_1101-2021_01_08_425952 228 255 le le NNP 10_1101-2021_01_08_425952 228 256 as as IN 10_1101-2021_01_08_425952 228 257 e e NNP 10_1101-2021_01_08_425952 228 258 ca ca MD 10_1101-2021_01_08_425952 228 259 ps ps VB 10_1101-2021_01_08_425952 228 260 ul ul NNP 10_1101-2021_01_08_425952 228 261 es es NNP 10_1101-2021_01_08_425952 228 262 Ve Ve NNP 10_1101-2021_01_08_425952 228 263 nl nl NNP 10_1101-2021_01_08_425952 228 264 af af IN 10_1101-2021_01_08_425952 228 265 ax ax NN 10_1101-2021_01_08_425952 228 266 in in IN 10_1101-2021_01_08_425952 228 267 e e NNP 10_1101-2021_01_08_425952 228 268 75 75 CD 10_1101-2021_01_08_425952 228 269 m m NNP 10_1101-2021_01_08_425952 228 270 g g NNP 10_1101-2021_01_08_425952 228 271 m m NNP 10_1101-2021_01_08_425952 228 272 od od NNP 10_1101-2021_01_08_425952 228 273 ifie ifie NN 10_1101-2021_01_08_425952 228 274 d− d− NNP 10_1101-2021_01_08_425952 228 275 re re NN 10_1101-2021_01_08_425952 228 276 le le NNP 10_1101-2021_01_08_425952 228 277 as as IN 10_1101-2021_01_08_425952 228 278 e e NNP 10_1101-2021_01_08_425952 228 279 ta ta NNP 10_1101-2021_01_08_425952 228 280 bl bl NNP 10_1101-2021_01_08_425952 228 281 et et NNP 10_1101-2021_01_08_425952 228 282 s s NNP 10_1101-2021_01_08_425952 228 283 Drug Drug NNP 10_1101-2021_01_08_425952 228 284 product product NN 10_1101-2021_01_08_425952 228 285 description description NN 10_1101-2021_01_08_425952 228 286 F F NNP 10_1101-2021_01_08_425952 228 287 re re IN 10_1101-2021_01_08_425952 228 288 q q NNP 10_1101-2021_01_08_425952 228 289 u u NNP 10_1101-2021_01_08_425952 228 290 e e NNP 10_1101-2021_01_08_425952 228 291 n n NNP 10_1101-2021_01_08_425952 228 292 cy cy NNP 10_1101-2021_01_08_425952 228 293 Figure Figure NNP 10_1101-2021_01_08_425952 228 294 4 4 CD 10_1101-2021_01_08_425952 228 295 : : : 10_1101-2021_01_08_425952 228 296 The the DT 10_1101-2021_01_08_425952 228 297 frequency frequency NN 10_1101-2021_01_08_425952 228 298 of of IN 10_1101-2021_01_08_425952 228 299 first first JJ 10_1101-2021_01_08_425952 228 300 line line NN 10_1101-2021_01_08_425952 228 301 treatment treatment NN 10_1101-2021_01_08_425952 228 302 prescription prescription NN 10_1101-2021_01_08_425952 228 303 . . . 10_1101-2021_01_08_425952 229 1 getAgeGroupByEvents getagegroupbyevent NNS 10_1101-2021_01_08_425952 229 2 In in IN 10_1101-2021_01_08_425952 229 3 the the DT 10_1101-2021_01_08_425952 229 4 next next JJ 10_1101-2021_01_08_425952 229 5 example example NN 10_1101-2021_01_08_425952 229 6 we -PRON- PRP 10_1101-2021_01_08_425952 229 7 explore explore VBP 10_1101-2021_01_08_425952 229 8 stratifying stratify VBG 10_1101-2021_01_08_425952 229 9 first first JJ 10_1101-2021_01_08_425952 229 10 - - HYPH 10_1101-2021_01_08_425952 229 11 line line NN 10_1101-2021_01_08_425952 229 12 prescription prescription NN 10_1101-2021_01_08_425952 229 13 events event NNS 10_1101-2021_01_08_425952 229 14 by by IN 10_1101-2021_01_08_425952 229 15 patient patient JJ 10_1101-2021_01_08_425952 229 16 character- character- XX 10_1101-2021_01_08_425952 229 17 istics istic NNS 10_1101-2021_01_08_425952 229 18 , , , 10_1101-2021_01_08_425952 229 19 such such JJ 10_1101-2021_01_08_425952 229 20 as as IN 10_1101-2021_01_08_425952 229 21 , , , 10_1101-2021_01_08_425952 229 22 age age NN 10_1101-2021_01_08_425952 229 23 , , , 10_1101-2021_01_08_425952 229 24 gender gender NN 10_1101-2021_01_08_425952 229 25 , , , 10_1101-2021_01_08_425952 229 26 IMD IMD NNP 10_1101-2021_01_08_425952 229 27 , , , 10_1101-2021_01_08_425952 229 28 and and CC 10_1101-2021_01_08_425952 229 29 number number NN 10_1101-2021_01_08_425952 229 30 of of IN 10_1101-2021_01_08_425952 229 31 medcodes medcode NNS 10_1101-2021_01_08_425952 229 32 ( ( -LRB- 10_1101-2021_01_08_425952 229 33 for for IN 10_1101-2021_01_08_425952 229 34 instance instance NN 10_1101-2021_01_08_425952 229 35 , , , 10_1101-2021_01_08_425952 229 36 by by IN 10_1101-2021_01_08_425952 229 37 comorbidities comorbiditie NNS 10_1101-2021_01_08_425952 229 38 ) ) -RRB- 10_1101-2021_01_08_425952 229 39 or or CC 10_1101-2021_01_08_425952 229 40 prodcodes prodcode NNS 10_1101-2021_01_08_425952 229 41 ( ( -LRB- 10_1101-2021_01_08_425952 229 42 for for IN 10_1101-2021_01_08_425952 229 43 instance instance NN 10_1101-2021_01_08_425952 229 44 , , , 10_1101-2021_01_08_425952 229 45 to to TO 10_1101-2021_01_08_425952 229 46 separate separate VB 10_1101-2021_01_08_425952 229 47 those those DT 10_1101-2021_01_08_425952 229 48 patients patient NNS 10_1101-2021_01_08_425952 229 49 by by IN 10_1101-2021_01_08_425952 229 50 additional additional JJ 10_1101-2021_01_08_425952 229 51 prescriptions prescription NNS 10_1101-2021_01_08_425952 229 52 ) ) -RRB- 10_1101-2021_01_08_425952 229 53 , , , 10_1101-2021_01_08_425952 229 54 or or CC 10_1101-2021_01_08_425952 229 55 by by IN 10_1101-2021_01_08_425952 229 56 any any DT 10_1101-2021_01_08_425952 229 57 additional additional JJ 10_1101-2021_01_08_425952 229 58 clinical clinical JJ 10_1101-2021_01_08_425952 229 59 event event NN 10_1101-2021_01_08_425952 229 60 retrieved retrieve VBN 10_1101-2021_01_08_425952 229 61 using use VBG 10_1101-2021_01_08_425952 229 62 CPRDLookups cprdlookup NNS 10_1101-2021_01_08_425952 229 63 . . . 10_1101-2021_01_08_425952 229 64 R r NN 10_1101-2021_01_08_425952 229 65 ? ? . 10_1101-2021_01_08_425952 229 66 . . . 10_1101-2021_01_08_425952 230 1 rdrugtrajectory rdrugtrajectory NNP 10_1101-2021_01_08_425952 230 2 provides provide VBZ 10_1101-2021_01_08_425952 230 3 several several JJ 10_1101-2021_01_08_425952 230 4 utility utility NN 10_1101-2021_01_08_425952 230 5 functions function NNS 10_1101-2021_01_08_425952 230 6 to to TO 10_1101-2021_01_08_425952 230 7 stratify stratify VB 10_1101-2021_01_08_425952 230 8 patients patient NNS 10_1101-2021_01_08_425952 230 9 ( ( -LRB- 10_1101-2021_01_08_425952 230 10 see see VB 10_1101-2021_01_08_425952 230 11 reference reference NN 10_1101-2021_01_08_425952 230 12 manual manual NN 10_1101-2021_01_08_425952 230 13 for for IN 10_1101-2021_01_08_425952 230 14 further further JJ 10_1101-2021_01_08_425952 230 15 information information NN 10_1101-2021_01_08_425952 230 16 ) ) -RRB- 10_1101-2021_01_08_425952 230 17 . . . 10_1101-2021_01_08_425952 231 1 The the DT 10_1101-2021_01_08_425952 231 2 func- func- JJ 10_1101-2021_01_08_425952 231 3 tion tion NN 10_1101-2021_01_08_425952 231 4 getAgeGroupByEvents getagegroupbyevent NNS 10_1101-2021_01_08_425952 231 5 calculates calculate VBZ 10_1101-2021_01_08_425952 231 6 the the DT 10_1101-2021_01_08_425952 231 7 number number NN 10_1101-2021_01_08_425952 231 8 of of IN 10_1101-2021_01_08_425952 231 9 first first JJ 10_1101-2021_01_08_425952 231 10 - - HYPH 10_1101-2021_01_08_425952 231 11 line line NN 10_1101-2021_01_08_425952 231 12 prescription prescription NN 10_1101-2021_01_08_425952 231 13 events event NNS 10_1101-2021_01_08_425952 231 14 by by IN 10_1101-2021_01_08_425952 231 15 patient patient JJ 10_1101-2021_01_08_425952 231 16 age age NN 10_1101-2021_01_08_425952 231 17 . . . 10_1101-2021_01_08_425952 232 1 By by IN 10_1101-2021_01_08_425952 232 2 specifying specify VBG 10_1101-2021_01_08_425952 232 3 a a DT 10_1101-2021_01_08_425952 232 4 set set NN 10_1101-2021_01_08_425952 232 5 of of IN 10_1101-2021_01_08_425952 232 6 patids patid NNS 10_1101-2021_01_08_425952 232 7 and and CC 10_1101-2021_01_08_425952 232 8 eventdates eventdate NNS 10_1101-2021_01_08_425952 232 9 from from IN 10_1101-2021_01_08_425952 232 10 the the DT 10_1101-2021_01_08_425952 232 11 FirstDrugObject firstdrugobject NN 10_1101-2021_01_08_425952 232 12 , , , 10_1101-2021_01_08_425952 232 13 we -PRON- PRP 10_1101-2021_01_08_425952 232 14 can can MD 10_1101-2021_01_08_425952 232 15 calculate calculate VB 10_1101-2021_01_08_425952 232 16 the the DT 10_1101-2021_01_08_425952 232 17 number number NN 10_1101-2021_01_08_425952 232 18 of of IN 10_1101-2021_01_08_425952 232 19 first first JJ 10_1101-2021_01_08_425952 232 20 - - HYPH 10_1101-2021_01_08_425952 232 21 line line NN 10_1101-2021_01_08_425952 232 22 prescriptions prescription NNS 10_1101-2021_01_08_425952 232 23 by by IN 10_1101-2021_01_08_425952 232 24 age age NN 10_1101-2021_01_08_425952 232 25 - - HYPH 10_1101-2021_01_08_425952 232 26 group group NN 10_1101-2021_01_08_425952 232 27 for for IN 10_1101-2021_01_08_425952 232 28 patients patient NNS 10_1101-2021_01_08_425952 232 29 linked link VBN 10_1101-2021_01_08_425952 232 30 with with IN 10_1101-2021_01_08_425952 232 31 a a DT 10_1101-2021_01_08_425952 232 32 specified specify VBN 10_1101-2021_01_08_425952 232 33 medical medical JJ 10_1101-2021_01_08_425952 232 34 condition condition NN 10_1101-2021_01_08_425952 232 35 : : : 10_1101-2021_01_08_425952 232 36 > > XX 10_1101-2021_01_08_425952 232 37 library(rdrugtrajectory library(rdrugtrajectory NN 10_1101-2021_01_08_425952 232 38 ) ) -RRB- 10_1101-2021_01_08_425952 232 39 > > XX 10_1101-2021_01_08_425952 232 40 fileLocation filelocation NN 10_1101-2021_01_08_425952 232 41 < < XX 10_1101-2021_01_08_425952 232 42 - - : 10_1101-2021_01_08_425952 232 43 " " `` 10_1101-2021_01_08_425952 232 44 product.txt product.txt NNP 10_1101-2021_01_08_425952 232 45 " " '' 10_1101-2021_01_08_425952 232 46 .CC .CC : 10_1101-2021_01_08_425952 232 47 - - : 10_1101-2021_01_08_425952 232 48 BY by IN 10_1101-2021_01_08_425952 232 49 - - HYPH 10_1101-2021_01_08_425952 232 50 ND ND NNP 10_1101-2021_01_08_425952 232 51 4.0 4.0 CD 10_1101-2021_01_08_425952 232 52 International international JJ 10_1101-2021_01_08_425952 232 53 licensemade licensemade NN 10_1101-2021_01_08_425952 232 54 available available JJ 10_1101-2021_01_08_425952 232 55 under under IN 10_1101-2021_01_08_425952 232 56 a a DT 10_1101-2021_01_08_425952 232 57 ( ( -LRB- 10_1101-2021_01_08_425952 232 58 which which WDT 10_1101-2021_01_08_425952 232 59 was be VBD 10_1101-2021_01_08_425952 232 60 not not RB 10_1101-2021_01_08_425952 232 61 certified certify VBN 10_1101-2021_01_08_425952 232 62 by by IN 10_1101-2021_01_08_425952 232 63 peer peer NN 10_1101-2021_01_08_425952 232 64 review review NN 10_1101-2021_01_08_425952 232 65 ) ) -RRB- 10_1101-2021_01_08_425952 232 66 is be VBZ 10_1101-2021_01_08_425952 232 67 the the DT 10_1101-2021_01_08_425952 232 68 author author NN 10_1101-2021_01_08_425952 232 69 / / SYM 10_1101-2021_01_08_425952 232 70 funder funder NN 10_1101-2021_01_08_425952 232 71 , , , 10_1101-2021_01_08_425952 232 72 who who WP 10_1101-2021_01_08_425952 232 73 has have VBZ 10_1101-2021_01_08_425952 232 74 granted grant VBN 10_1101-2021_01_08_425952 232 75 bioRxiv biorxiv IN 10_1101-2021_01_08_425952 232 76 a a DT 10_1101-2021_01_08_425952 232 77 license license NN 10_1101-2021_01_08_425952 232 78 to to TO 10_1101-2021_01_08_425952 232 79 display display VB 10_1101-2021_01_08_425952 232 80 the the DT 10_1101-2021_01_08_425952 232 81 preprint preprint NN 10_1101-2021_01_08_425952 232 82 in in IN 10_1101-2021_01_08_425952 232 83 perpetuity perpetuity NN 10_1101-2021_01_08_425952 232 84 . . . 10_1101-2021_01_08_425952 233 1 It -PRON- PRP 10_1101-2021_01_08_425952 233 2 is be VBZ 10_1101-2021_01_08_425952 233 3 The the DT 10_1101-2021_01_08_425952 233 4 copyright copyright NN 10_1101-2021_01_08_425952 233 5 holder holder NN 10_1101-2021_01_08_425952 233 6 for for IN 10_1101-2021_01_08_425952 233 7 this this DT 10_1101-2021_01_08_425952 233 8 preprintthis preprintthis NN 10_1101-2021_01_08_425952 233 9 version version NN 10_1101-2021_01_08_425952 233 10 posted post VBD 10_1101-2021_01_08_425952 233 11 January January NNP 10_1101-2021_01_08_425952 233 12 9 9 CD 10_1101-2021_01_08_425952 233 13 , , , 10_1101-2021_01_08_425952 233 14 2021 2021 CD 10_1101-2021_01_08_425952 233 15 . . . 10_1101-2021_01_08_425952 233 16 ; ; : 10_1101-2021_01_08_425952 233 17 https://doi.org/10.1101/2021.01.08.425952doi https://doi.org/10.1101/2021.01.08.425952doi ADD 10_1101-2021_01_08_425952 233 18 : : : 10_1101-2021_01_08_425952 233 19 bioRxiv biorxiv IN 10_1101-2021_01_08_425952 233 20 preprint preprint NN 10_1101-2021_01_08_425952 233 21 https://doi.org/10.1101/2021.01.08.425952 https://doi.org/10.1101/2021.01.08.425952 NN 10_1101-2021_01_08_425952 233 22 http://creativecommons.org/licenses/by-nd/4.0/ http://creativecommons.org/licenses/by-nd/4.0/ NN 10_1101-2021_01_08_425952 233 23 22 22 CD 10_1101-2021_01_08_425952 233 24 rdrugtrajectory rdrugtrajectory NN 10_1101-2021_01_08_425952 233 25 : : : 10_1101-2021_01_08_425952 233 26 Analysing Analysing NNP 10_1101-2021_01_08_425952 233 27 Drug Drug NNP 10_1101-2021_01_08_425952 233 28 Prescriptions Prescriptions NNPS 10_1101-2021_01_08_425952 233 29 in in IN 10_1101-2021_01_08_425952 233 30 Electronic Electronic NNP 10_1101-2021_01_08_425952 233 31 Health Health NNP 10_1101-2021_01_08_425952 233 32 Care Care NNP 10_1101-2021_01_08_425952 233 33 Records Records NNPS 10_1101-2021_01_08_425952 233 34 > > FW 10_1101-2021_01_08_425952 233 35 resultFDO resultfdo FW 10_1101-2021_01_08_425952 233 36 < < XX 10_1101-2021_01_08_425952 233 37 - - HYPH 10_1101-2021_01_08_425952 233 38 getFirstDrugPrescription(df getFirstDrugPrescription(df NNP 10_1101-2021_01_08_425952 233 39 = = SYM 10_1101-2021_01_08_425952 233 40 testTherapyDF testTherapyDF NNS 10_1101-2021_01_08_425952 233 41 , , , 10_1101-2021_01_08_425952 233 42 + + CC 10_1101-2021_01_08_425952 233 43 idList idList NNP 10_1101-2021_01_08_425952 233 44 = = SYM 10_1101-2021_01_08_425952 233 45 NULL NULL NNP 10_1101-2021_01_08_425952 233 46 , , , 10_1101-2021_01_08_425952 233 47 + + CC 10_1101-2021_01_08_425952 233 48 prodCodesVector prodcodesvector NN 10_1101-2021_01_08_425952 233 49 = = SYM 10_1101-2021_01_08_425952 233 50 NULL NULL NNP 10_1101-2021_01_08_425952 233 51 , , , 10_1101-2021_01_08_425952 233 52 + + CC 10_1101-2021_01_08_425952 233 53 descriptionFile descriptionfile NN 10_1101-2021_01_08_425952 233 54 = = SYM 10_1101-2021_01_08_425952 233 55 fileLocation filelocation NN 10_1101-2021_01_08_425952 233 56 ) ) -RRB- 10_1101-2021_01_08_425952 233 57 > > XX 10_1101-2021_01_08_425952 233 58 patidList patidlist NN 10_1101-2021_01_08_425952 233 59 < < XX 10_1101-2021_01_08_425952 233 60 - - HYPH 10_1101-2021_01_08_425952 233 61 resultFDO[[1 resultFDO[[1 NNP 10_1101-2021_01_08_425952 233 62 ] ] -RRB- 10_1101-2021_01_08_425952 233 63 ] ] -RRB- 10_1101-2021_01_08_425952 233 64 > > XX 10_1101-2021_01_08_425952 233 65 eventdateList eventdatelist XX 10_1101-2021_01_08_425952 233 66 < < XX 10_1101-2021_01_08_425952 233 67 - - HYPH 10_1101-2021_01_08_425952 233 68 resultFDO[[2 resultFDO[[2 NNP 10_1101-2021_01_08_425952 233 69 ] ] -RRB- 10_1101-2021_01_08_425952 233 70 ] ] -RRB- 10_1101-2021_01_08_425952 233 71 > > FW 10_1101-2021_01_08_425952 233 72 names(ageGenderDF names(agegenderdf NN 10_1101-2021_01_08_425952 233 73 ) ) -RRB- 10_1101-2021_01_08_425952 233 74 < < XX 10_1101-2021_01_08_425952 233 75 - - HYPH 10_1101-2021_01_08_425952 233 76 c("patid","age","gender c("patid","age","gender NN 10_1101-2021_01_08_425952 233 77 " " '' 10_1101-2021_01_08_425952 233 78 ) ) -RRB- 10_1101-2021_01_08_425952 233 79 > > XX 10_1101-2021_01_08_425952 233 80 # # $ 10_1101-2021_01_08_425952 233 81 The the DT 10_1101-2021_01_08_425952 233 82 age age NN 10_1101-2021_01_08_425952 233 83 - - HYPH 10_1101-2021_01_08_425952 233 84 groups group NNS 10_1101-2021_01_08_425952 233 85 : : : 10_1101-2021_01_08_425952 233 86 [ [ -LRB- 10_1101-2021_01_08_425952 233 87 18,25 18,25 CD 10_1101-2021_01_08_425952 233 88 ) ) -RRB- 10_1101-2021_01_08_425952 233 89 , , , 10_1101-2021_01_08_425952 233 90 [ [ -LRB- 10_1101-2021_01_08_425952 233 91 25,30 25,30 CD 10_1101-2021_01_08_425952 233 92 ) ) -RRB- 10_1101-2021_01_08_425952 233 93 , , , 10_1101-2021_01_08_425952 233 94 [ [ -LRB- 10_1101-2021_01_08_425952 233 95 30,35 30,35 CD 10_1101-2021_01_08_425952 233 96 ) ) -RRB- 10_1101-2021_01_08_425952 233 97 , , , 10_1101-2021_01_08_425952 233 98 ... ... : 10_1101-2021_01_08_425952 233 99 , , , 10_1101-2021_01_08_425952 233 100 [ [ -LRB- 10_1101-2021_01_08_425952 233 101 60,60 60,60 CD 10_1101-2021_01_08_425952 233 102 + + SYM 10_1101-2021_01_08_425952 233 103 ) ) -RRB- 10_1101-2021_01_08_425952 233 104 . . . 10_1101-2021_01_08_425952 234 1 > > XX 10_1101-2021_01_08_425952 234 2 ageGroupVector ageGroupVector NNP 10_1101-2021_01_08_425952 234 3 < < XX 10_1101-2021_01_08_425952 234 4 - - HYPH 10_1101-2021_01_08_425952 234 5 c(18,25,30,35,40,45,50,55,60 c(18,25,30,35,40,45,50,55,60 NNP 10_1101-2021_01_08_425952 234 6 ) ) -RRB- 10_1101-2021_01_08_425952 234 7 > > XX 10_1101-2021_01_08_425952 234 8 # # JJR 10_1101-2021_01_08_425952 234 9 CPRD cprd VBP 10_1101-2021_01_08_425952 234 10 database database NN 10_1101-2021_01_08_425952 234 11 release release NN 10_1101-2021_01_08_425952 234 12 year year NN 10_1101-2021_01_08_425952 234 13 . . . 10_1101-2021_01_08_425952 235 1 > > XX 10_1101-2021_01_08_425952 235 2 ageAtYear ageAtYear NNP 10_1101-2021_01_08_425952 235 3 < < XX 10_1101-2021_01_08_425952 235 4 - - HYPH 10_1101-2021_01_08_425952 235 5 " " `` 10_1101-2021_01_08_425952 235 6 2017 2017 CD 10_1101-2021_01_08_425952 235 7 " " '' 10_1101-2021_01_08_425952 235 8 > > XX 10_1101-2021_01_08_425952 235 9 ageGroupList ageGroupList NNP 10_1101-2021_01_08_425952 235 10 < < XX 10_1101-2021_01_08_425952 235 11 - - HYPH 10_1101-2021_01_08_425952 235 12 getAgeGroupByEvents(idList getAgeGroupByEvents(idList NNP 10_1101-2021_01_08_425952 235 13 = = NFP 10_1101-2021_01_08_425952 235 14 as.list(patidList[1:2 as.list(patidList[1:2 : 10_1101-2021_01_08_425952 235 15 ] ] -RRB- 10_1101-2021_01_08_425952 235 16 ) ) -RRB- 10_1101-2021_01_08_425952 235 17 , , , 10_1101-2021_01_08_425952 235 18 + + SYM 10_1101-2021_01_08_425952 235 19 eventdateList eventdateList NNS 10_1101-2021_01_08_425952 235 20 = = SYM 10_1101-2021_01_08_425952 235 21 eventdateList[1:2 eventdatelist[1:2 JJ 10_1101-2021_01_08_425952 235 22 ] ] -RRB- 10_1101-2021_01_08_425952 235 23 , , , 10_1101-2021_01_08_425952 235 24 + + CC 10_1101-2021_01_08_425952 235 25 ageDF agedf ADD 10_1101-2021_01_08_425952 235 26 = = NFP 10_1101-2021_01_08_425952 235 27 ageGenderDF agegenderdf XX 10_1101-2021_01_08_425952 235 28 , , , 10_1101-2021_01_08_425952 235 29 + + CC 10_1101-2021_01_08_425952 235 30 ageGroupVector agegroupvector NN 10_1101-2021_01_08_425952 235 31 = = SYM 10_1101-2021_01_08_425952 235 32 ageGroupVector ageGroupVector NNP 10_1101-2021_01_08_425952 235 33 , , , 10_1101-2021_01_08_425952 235 34 + + SYM 10_1101-2021_01_08_425952 235 35 ageAtYear ageatyear UH 10_1101-2021_01_08_425952 235 36 = = SYM 10_1101-2021_01_08_425952 235 37 ageAtYear ageatyear SYM 10_1101-2021_01_08_425952 235 38 ) ) -RRB- 10_1101-2021_01_08_425952 235 39 > > NFP 10_1101-2021_01_08_425952 235 40 ageGroupList agegrouplist NN 10_1101-2021_01_08_425952 235 41 [ [ -LRB- 10_1101-2021_01_08_425952 235 42 [ [ -LRB- 10_1101-2021_01_08_425952 235 43 1 1 CD 10_1101-2021_01_08_425952 235 44 ] ] -RRB- 10_1101-2021_01_08_425952 235 45 ] ] -RRB- 10_1101-2021_01_08_425952 235 46 18 18 CD 10_1101-2021_01_08_425952 235 47 - - SYM 10_1101-2021_01_08_425952 235 48 24 24 CD 10_1101-2021_01_08_425952 235 49 25 25 CD 10_1101-2021_01_08_425952 235 50 - - SYM 10_1101-2021_01_08_425952 235 51 29 29 CD 10_1101-2021_01_08_425952 235 52 30 30 CD 10_1101-2021_01_08_425952 235 53 - - SYM 10_1101-2021_01_08_425952 235 54 34 34 CD 10_1101-2021_01_08_425952 235 55 35 35 CD 10_1101-2021_01_08_425952 235 56 - - SYM 10_1101-2021_01_08_425952 235 57 39 39 CD 10_1101-2021_01_08_425952 235 58 40 40 CD 10_1101-2021_01_08_425952 235 59 - - SYM 10_1101-2021_01_08_425952 235 60 44 44 CD 10_1101-2021_01_08_425952 235 61 45 45 CD 10_1101-2021_01_08_425952 235 62 - - SYM 10_1101-2021_01_08_425952 235 63 49 49 CD 10_1101-2021_01_08_425952 235 64 50 50 CD 10_1101-2021_01_08_425952 235 65 - - HYPH 10_1101-2021_01_08_425952 235 66 54 54 CD 10_1101-2021_01_08_425952 235 67 55 55 CD 10_1101-2021_01_08_425952 235 68 - - SYM 10_1101-2021_01_08_425952 235 69 59 59 CD 10_1101-2021_01_08_425952 235 70 60 60 CD 10_1101-2021_01_08_425952 235 71 + + SYM 10_1101-2021_01_08_425952 235 72 1 1 CD 10_1101-2021_01_08_425952 235 73 103 103 CD 10_1101-2021_01_08_425952 235 74 94 94 CD 10_1101-2021_01_08_425952 235 75 106 106 CD 10_1101-2021_01_08_425952 235 76 131 131 CD 10_1101-2021_01_08_425952 235 77 165 165 CD 10_1101-2021_01_08_425952 235 78 182 182 CD 10_1101-2021_01_08_425952 235 79 153 153 CD 10_1101-2021_01_08_425952 235 80 185 185 CD 10_1101-2021_01_08_425952 235 81 240 240 CD 10_1101-2021_01_08_425952 235 82 [ [ -LRB- 10_1101-2021_01_08_425952 235 83 [ [ -LRB- 10_1101-2021_01_08_425952 235 84 2 2 CD 10_1101-2021_01_08_425952 235 85 ] ] -RRB- 10_1101-2021_01_08_425952 235 86 ] ] -RRB- 10_1101-2021_01_08_425952 235 87 18 18 CD 10_1101-2021_01_08_425952 235 88 - - SYM 10_1101-2021_01_08_425952 235 89 24 24 CD 10_1101-2021_01_08_425952 235 90 25 25 CD 10_1101-2021_01_08_425952 235 91 - - SYM 10_1101-2021_01_08_425952 235 92 29 29 CD 10_1101-2021_01_08_425952 235 93 30 30 CD 10_1101-2021_01_08_425952 235 94 - - SYM 10_1101-2021_01_08_425952 235 95 34 34 CD 10_1101-2021_01_08_425952 235 96 35 35 CD 10_1101-2021_01_08_425952 235 97 - - SYM 10_1101-2021_01_08_425952 235 98 39 39 CD 10_1101-2021_01_08_425952 235 99 40 40 CD 10_1101-2021_01_08_425952 235 100 - - SYM 10_1101-2021_01_08_425952 235 101 44 44 CD 10_1101-2021_01_08_425952 235 102 45 45 CD 10_1101-2021_01_08_425952 235 103 - - SYM 10_1101-2021_01_08_425952 235 104 49 49 CD 10_1101-2021_01_08_425952 235 105 50 50 CD 10_1101-2021_01_08_425952 235 106 - - HYPH 10_1101-2021_01_08_425952 235 107 54 54 CD 10_1101-2021_01_08_425952 235 108 55 55 CD 10_1101-2021_01_08_425952 235 109 - - SYM 10_1101-2021_01_08_425952 235 110 59 59 CD 10_1101-2021_01_08_425952 235 111 60 60 CD 10_1101-2021_01_08_425952 235 112 + + SYM 10_1101-2021_01_08_425952 235 113 1 1 CD 10_1101-2021_01_08_425952 235 114 45 45 CD 10_1101-2021_01_08_425952 235 115 39 39 CD 10_1101-2021_01_08_425952 235 116 35 35 CD 10_1101-2021_01_08_425952 235 117 23 23 CD 10_1101-2021_01_08_425952 235 118 43 43 CD 10_1101-2021_01_08_425952 235 119 34 34 CD 10_1101-2021_01_08_425952 235 120 32 32 CD 10_1101-2021_01_08_425952 235 121 18 18 CD 10_1101-2021_01_08_425952 235 122 25 25 CD 10_1101-2021_01_08_425952 235 123 In in IN 10_1101-2021_01_08_425952 235 124 the the DT 10_1101-2021_01_08_425952 235 125 above above JJ 10_1101-2021_01_08_425952 235 126 example example NN 10_1101-2021_01_08_425952 235 127 , , , 10_1101-2021_01_08_425952 235 128 the the DT 10_1101-2021_01_08_425952 235 129 age age NN 10_1101-2021_01_08_425952 235 130 of of IN 10_1101-2021_01_08_425952 235 131 each each DT 10_1101-2021_01_08_425952 235 132 patient patient NN 10_1101-2021_01_08_425952 235 133 ( ( -LRB- 10_1101-2021_01_08_425952 235 134 ageDF agedf ADD 10_1101-2021_01_08_425952 235 135 ) ) -RRB- 10_1101-2021_01_08_425952 235 136 was be VBD 10_1101-2021_01_08_425952 235 137 provided provide VBN 10_1101-2021_01_08_425952 235 138 using use VBG 10_1101-2021_01_08_425952 235 139 year year NN 10_1101-2021_01_08_425952 235 140 - - HYPH 10_1101-2021_01_08_425952 235 141 of of IN 10_1101-2021_01_08_425952 235 142 - - HYPH 10_1101-2021_01_08_425952 235 143 birth birth NN 10_1101-2021_01_08_425952 235 144 calcu- calcu- NN 10_1101-2021_01_08_425952 235 145 lated late VBN 10_1101-2021_01_08_425952 235 146 against against IN 10_1101-2021_01_08_425952 235 147 the the DT 10_1101-2021_01_08_425952 235 148 release release NN 10_1101-2021_01_08_425952 235 149 year year NN 10_1101-2021_01_08_425952 235 150 of of IN 10_1101-2021_01_08_425952 235 151 the the DT 10_1101-2021_01_08_425952 235 152 CPRD CPRD NNP 10_1101-2021_01_08_425952 235 153 Gold Gold NNP 10_1101-2021_01_08_425952 235 154 database database NN 10_1101-2021_01_08_425952 235 155 ( ( -LRB- 10_1101-2021_01_08_425952 235 156 explained explain VBN 10_1101-2021_01_08_425952 235 157 above above RB 10_1101-2021_01_08_425952 235 158 ) ) -RRB- 10_1101-2021_01_08_425952 235 159 . . . 10_1101-2021_01_08_425952 236 1 By by IN 10_1101-2021_01_08_425952 236 2 providing provide VBG 10_1101-2021_01_08_425952 236 3 the the DT 10_1101-2021_01_08_425952 236 4 database database NN 10_1101-2021_01_08_425952 236 5 release release NN 10_1101-2021_01_08_425952 236 6 year year NN 10_1101-2021_01_08_425952 236 7 ( ( -LRB- 10_1101-2021_01_08_425952 236 8 in in IN 10_1101-2021_01_08_425952 236 9 ageAtYear ageAtYear NNP 10_1101-2021_01_08_425952 236 10 ) ) -RRB- 10_1101-2021_01_08_425952 236 11 and and CC 10_1101-2021_01_08_425952 236 12 the the DT 10_1101-2021_01_08_425952 236 13 first first JJ 10_1101-2021_01_08_425952 236 14 prescription prescription NN 10_1101-2021_01_08_425952 236 15 eventdate eventdate NN 10_1101-2021_01_08_425952 236 16 ( ( -LRB- 10_1101-2021_01_08_425952 236 17 in in IN 10_1101-2021_01_08_425952 236 18 eventdateList eventdateList NNP 10_1101-2021_01_08_425952 236 19 ) ) -RRB- 10_1101-2021_01_08_425952 236 20 , , , 10_1101-2021_01_08_425952 236 21 the the DT 10_1101-2021_01_08_425952 236 22 age age NN 10_1101-2021_01_08_425952 236 23 of of IN 10_1101-2021_01_08_425952 236 24 each each DT 10_1101-2021_01_08_425952 236 25 patient patient NN 10_1101-2021_01_08_425952 236 26 is be VBZ 10_1101-2021_01_08_425952 236 27 adjusted adjust VBN 10_1101-2021_01_08_425952 236 28 against against IN 10_1101-2021_01_08_425952 236 29 the the DT 10_1101-2021_01_08_425952 236 30 prescription prescription NN 10_1101-2021_01_08_425952 236 31 eventdate eventdate NN 10_1101-2021_01_08_425952 236 32 year year NN 10_1101-2021_01_08_425952 236 33 . . . 10_1101-2021_01_08_425952 237 1 Finally finally RB 10_1101-2021_01_08_425952 237 2 , , , 10_1101-2021_01_08_425952 237 3 by by IN 10_1101-2021_01_08_425952 237 4 using use VBG 10_1101-2021_01_08_425952 237 5 a a DT 10_1101-2021_01_08_425952 237 6 list list NN 10_1101-2021_01_08_425952 237 7 slice slice NN 10_1101-2021_01_08_425952 237 8 on on IN 10_1101-2021_01_08_425952 237 9 idList idList NNP 10_1101-2021_01_08_425952 237 10 and and CC 10_1101-2021_01_08_425952 237 11 eventdateList eventdatelist CD 10_1101-2021_01_08_425952 237 12 , , , 10_1101-2021_01_08_425952 237 13 ( ( -LRB- 10_1101-2021_01_08_425952 237 14 individual individual JJ 10_1101-2021_01_08_425952 237 15 prescriptions prescription NNS 10_1101-2021_01_08_425952 237 16 can can MD 10_1101-2021_01_08_425952 237 17 be be VB 10_1101-2021_01_08_425952 237 18 specified specify VBN 10_1101-2021_01_08_425952 237 19 using use VBG 10_1101-2021_01_08_425952 237 20 their -PRON- PRP$ 10_1101-2021_01_08_425952 237 21 prodcode prodcode NN 10_1101-2021_01_08_425952 237 22 , , , 10_1101-2021_01_08_425952 237 23 for for IN 10_1101-2021_01_08_425952 237 24 example example NN 10_1101-2021_01_08_425952 237 25 , , , 10_1101-2021_01_08_425952 237 26 eventdateList$‘105 eventdateList$‘105 NNP 10_1101-2021_01_08_425952 237 27 ‘ ' `` 10_1101-2021_01_08_425952 237 28 ) ) -RRB- 10_1101-2021_01_08_425952 237 29 , , , 10_1101-2021_01_08_425952 237 30 first first JJ 10_1101-2021_01_08_425952 237 31 prescription prescription NN 10_1101-2021_01_08_425952 237 32 prescriptions prescription NNS 10_1101-2021_01_08_425952 237 33 frequencies frequency NNS 10_1101-2021_01_08_425952 237 34 by by IN 10_1101-2021_01_08_425952 237 35 age age NN 10_1101-2021_01_08_425952 237 36 - - HYPH 10_1101-2021_01_08_425952 237 37 group group NN 10_1101-2021_01_08_425952 237 38 are be VBP 10_1101-2021_01_08_425952 237 39 retrievable retrievable NN 10_1101-2021_01_08_425952 237 40 ( ( -LRB- 10_1101-2021_01_08_425952 237 41 Figure Figure NNP 10_1101-2021_01_08_425952 237 42 5 5 CD 10_1101-2021_01_08_425952 237 43 ) ) -RRB- 10_1101-2021_01_08_425952 237 44 . . . 10_1101-2021_01_08_425952 238 1 > > XX 10_1101-2021_01_08_425952 238 2 library(ggplot2 library(ggplot2 NN 10_1101-2021_01_08_425952 238 3 ) ) -RRB- 10_1101-2021_01_08_425952 238 4 > > XX 10_1101-2021_01_08_425952 238 5 ageGroupDrugDF ageGroupDrugDF NNP 10_1101-2021_01_08_425952 238 6 < < XX 10_1101-2021_01_08_425952 238 7 - - HYPH 10_1101-2021_01_08_425952 238 8 data.frame(Age data.frame(Age NNP 10_1101-2021_01_08_425952 238 9 = = SYM 10_1101-2021_01_08_425952 238 10 names(ageGroupList[[1 names(ageGroupList[[1 NNP 10_1101-2021_01_08_425952 238 11 ] ] -RRB- 10_1101-2021_01_08_425952 238 12 ] ] -RRB- 10_1101-2021_01_08_425952 238 13 ) ) -RRB- 10_1101-2021_01_08_425952 238 14 , , , 10_1101-2021_01_08_425952 238 15 + + CC 10_1101-2021_01_08_425952 238 16 Count Count NNP 10_1101-2021_01_08_425952 238 17 = = SYM 10_1101-2021_01_08_425952 238 18 unlist(ageGroupList[[1 unlist(ageGroupList[[1 NNP 10_1101-2021_01_08_425952 238 19 ] ] -RRB- 10_1101-2021_01_08_425952 238 20 ] ] -RRB- 10_1101-2021_01_08_425952 238 21 ) ) -RRB- 10_1101-2021_01_08_425952 238 22 , , , 10_1101-2021_01_08_425952 238 23 + + CC 10_1101-2021_01_08_425952 238 24 Drug="Amitriptyline Drug="Amitriptyline NNP 10_1101-2021_01_08_425952 238 25 10 10 CD 10_1101-2021_01_08_425952 238 26 mg mg NNP 10_1101-2021_01_08_425952 238 27 " " '' 10_1101-2021_01_08_425952 238 28 ) ) -RRB- 10_1101-2021_01_08_425952 238 29 > > XX 10_1101-2021_01_08_425952 238 30 ggAmitriptyline ggAmitriptyline NNP 10_1101-2021_01_08_425952 238 31 < < XX 10_1101-2021_01_08_425952 238 32 - - HYPH 10_1101-2021_01_08_425952 238 33 ggplot(ageGroupDrugDF ggplot(ageGroupDrugDF NNP 10_1101-2021_01_08_425952 238 34 , , , 10_1101-2021_01_08_425952 238 35 aes(x aes(x NNP 10_1101-2021_01_08_425952 238 36 = = NFP 10_1101-2021_01_08_425952 238 37 Age Age NNP 10_1101-2021_01_08_425952 238 38 , , , 10_1101-2021_01_08_425952 238 39 y y NNP 10_1101-2021_01_08_425952 238 40 = = SYM 10_1101-2021_01_08_425952 238 41 Count Count NNP 10_1101-2021_01_08_425952 238 42 ) ) -RRB- 10_1101-2021_01_08_425952 238 43 ) ) -RRB- 10_1101-2021_01_08_425952 238 44 + + CC 10_1101-2021_01_08_425952 238 45 + + SYM 10_1101-2021_01_08_425952 238 46 geom_bar(stat="identity geom_bar(stat="identity NN 10_1101-2021_01_08_425952 238 47 " " '' 10_1101-2021_01_08_425952 238 48 ) ) -RRB- 10_1101-2021_01_08_425952 238 49 + + NFP 10_1101-2021_01_08_425952 238 50 + + NFP 10_1101-2021_01_08_425952 238 51 theme_bw theme_bw NNP 10_1101-2021_01_08_425952 238 52 ( ( -LRB- 10_1101-2021_01_08_425952 238 53 ) ) -RRB- 10_1101-2021_01_08_425952 238 54 + + SYM 10_1101-2021_01_08_425952 238 55 ggtitle("Amitriptyline ggtitle("Amitriptyline NNP 10_1101-2021_01_08_425952 238 56 10 10 CD 10_1101-2021_01_08_425952 238 57 mg mg NNP 10_1101-2021_01_08_425952 238 58 " " '' 10_1101-2021_01_08_425952 238 59 ) ) -RRB- 10_1101-2021_01_08_425952 238 60 + + CD 10_1101-2021_01_08_425952 238 61 + + SYM 10_1101-2021_01_08_425952 238 62 theme(axis.text.x theme(axis.text.x XX 10_1101-2021_01_08_425952 238 63 = = SYM 10_1101-2021_01_08_425952 238 64 element_text(angle=45 element_text(angle=45 FW 10_1101-2021_01_08_425952 238 65 , , , 10_1101-2021_01_08_425952 238 66 hjust=1 hjust=1 ADD 10_1101-2021_01_08_425952 238 67 ) ) -RRB- 10_1101-2021_01_08_425952 238 68 ) ) -RRB- 10_1101-2021_01_08_425952 238 69 + + CC 10_1101-2021_01_08_425952 238 70 + + NFP 10_1101-2021_01_08_425952 238 71 xlab("Age xlab("Age NNP 10_1101-2021_01_08_425952 238 72 - - HYPH 10_1101-2021_01_08_425952 238 73 group group NNP 10_1101-2021_01_08_425952 238 74 " " '' 10_1101-2021_01_08_425952 238 75 ) ) -RRB- 10_1101-2021_01_08_425952 238 76 + + NFP 10_1101-2021_01_08_425952 238 77 ylab("Frequency ylab("frequency NN 10_1101-2021_01_08_425952 238 78 " " '' 10_1101-2021_01_08_425952 238 79 ) ) -RRB- 10_1101-2021_01_08_425952 238 80 .CC .CC NFP 10_1101-2021_01_08_425952 238 81 - - : 10_1101-2021_01_08_425952 238 82 BY by IN 10_1101-2021_01_08_425952 238 83 - - HYPH 10_1101-2021_01_08_425952 238 84 ND ND NNP 10_1101-2021_01_08_425952 238 85 4.0 4.0 CD 10_1101-2021_01_08_425952 238 86 International international JJ 10_1101-2021_01_08_425952 238 87 licensemade licensemade NN 10_1101-2021_01_08_425952 238 88 available available JJ 10_1101-2021_01_08_425952 238 89 under under IN 10_1101-2021_01_08_425952 238 90 a a DT 10_1101-2021_01_08_425952 238 91 ( ( -LRB- 10_1101-2021_01_08_425952 238 92 which which WDT 10_1101-2021_01_08_425952 238 93 was be VBD 10_1101-2021_01_08_425952 238 94 not not RB 10_1101-2021_01_08_425952 238 95 certified certify VBN 10_1101-2021_01_08_425952 238 96 by by IN 10_1101-2021_01_08_425952 238 97 peer peer NN 10_1101-2021_01_08_425952 238 98 review review NN 10_1101-2021_01_08_425952 238 99 ) ) -RRB- 10_1101-2021_01_08_425952 238 100 is be VBZ 10_1101-2021_01_08_425952 238 101 the the DT 10_1101-2021_01_08_425952 238 102 author author NN 10_1101-2021_01_08_425952 238 103 / / SYM 10_1101-2021_01_08_425952 238 104 funder funder NN 10_1101-2021_01_08_425952 238 105 , , , 10_1101-2021_01_08_425952 238 106 who who WP 10_1101-2021_01_08_425952 238 107 has have VBZ 10_1101-2021_01_08_425952 238 108 granted grant VBN 10_1101-2021_01_08_425952 238 109 bioRxiv biorxiv IN 10_1101-2021_01_08_425952 238 110 a a DT 10_1101-2021_01_08_425952 238 111 license license NN 10_1101-2021_01_08_425952 238 112 to to TO 10_1101-2021_01_08_425952 238 113 display display VB 10_1101-2021_01_08_425952 238 114 the the DT 10_1101-2021_01_08_425952 238 115 preprint preprint NN 10_1101-2021_01_08_425952 238 116 in in IN 10_1101-2021_01_08_425952 238 117 perpetuity perpetuity NN 10_1101-2021_01_08_425952 238 118 . . . 10_1101-2021_01_08_425952 239 1 It -PRON- PRP 10_1101-2021_01_08_425952 239 2 is be VBZ 10_1101-2021_01_08_425952 239 3 The the DT 10_1101-2021_01_08_425952 239 4 copyright copyright NN 10_1101-2021_01_08_425952 239 5 holder holder NN 10_1101-2021_01_08_425952 239 6 for for IN 10_1101-2021_01_08_425952 239 7 this this DT 10_1101-2021_01_08_425952 239 8 preprintthis preprintthis NN 10_1101-2021_01_08_425952 239 9 version version NN 10_1101-2021_01_08_425952 239 10 posted post VBD 10_1101-2021_01_08_425952 239 11 January January NNP 10_1101-2021_01_08_425952 239 12 9 9 CD 10_1101-2021_01_08_425952 239 13 , , , 10_1101-2021_01_08_425952 239 14 2021 2021 CD 10_1101-2021_01_08_425952 239 15 . . . 10_1101-2021_01_08_425952 239 16 ; ; : 10_1101-2021_01_08_425952 239 17 https://doi.org/10.1101/2021.01.08.425952doi https://doi.org/10.1101/2021.01.08.425952doi ADD 10_1101-2021_01_08_425952 239 18 : : : 10_1101-2021_01_08_425952 239 19 bioRxiv biorxiv IN 10_1101-2021_01_08_425952 239 20 preprint preprint NN 10_1101-2021_01_08_425952 239 21 https://doi.org/10.1101/2021.01.08.425952 https://doi.org/10.1101/2021.01.08.425952 XX 10_1101-2021_01_08_425952 239 22 http://creativecommons.org/licenses/by-nd/4.0/ http://creativecommons.org/licenses/by-nd/4.0/ NNP 10_1101-2021_01_08_425952 239 23 Journal Journal NNP 10_1101-2021_01_08_425952 239 24 of of IN 10_1101-2021_01_08_425952 239 25 Statistical Statistical NNP 10_1101-2021_01_08_425952 239 26 Software Software NNP 10_1101-2021_01_08_425952 239 27 23 23 CD 10_1101-2021_01_08_425952 239 28 0 0 CD 10_1101-2021_01_08_425952 239 29 50 50 CD 10_1101-2021_01_08_425952 239 30 100 100 CD 10_1101-2021_01_08_425952 239 31 150 150 CD 10_1101-2021_01_08_425952 239 32 200 200 CD 10_1101-2021_01_08_425952 239 33 250 250 CD 10_1101-2021_01_08_425952 239 34 18 18 CD 10_1101-2021_01_08_425952 239 35 −2 −2 NNP 10_1101-2021_01_08_425952 239 36 4 4 CD 10_1101-2021_01_08_425952 239 37 25 25 CD 10_1101-2021_01_08_425952 239 38 −2 −2 CD 10_1101-2021_01_08_425952 239 39 9 9 CD 10_1101-2021_01_08_425952 239 40 30 30 CD 10_1101-2021_01_08_425952 239 41 −3 −3 CD 10_1101-2021_01_08_425952 239 42 4 4 CD 10_1101-2021_01_08_425952 239 43 35 35 CD 10_1101-2021_01_08_425952 239 44 −3 −3 CD 10_1101-2021_01_08_425952 239 45 9 9 CD 10_1101-2021_01_08_425952 239 46 40 40 CD 10_1101-2021_01_08_425952 239 47 −4 −4 CD 10_1101-2021_01_08_425952 239 48 4 4 CD 10_1101-2021_01_08_425952 239 49 45 45 CD 10_1101-2021_01_08_425952 239 50 −4 −4 CD 10_1101-2021_01_08_425952 239 51 9 9 CD 10_1101-2021_01_08_425952 239 52 50 50 CD 10_1101-2021_01_08_425952 239 53 −5 −5 CD 10_1101-2021_01_08_425952 239 54 4 4 CD 10_1101-2021_01_08_425952 239 55 55 55 CD 10_1101-2021_01_08_425952 239 56 −5 −5 CD 10_1101-2021_01_08_425952 239 57 9 9 CD 10_1101-2021_01_08_425952 239 58 60 60 CD 10_1101-2021_01_08_425952 239 59 + + SYM 10_1101-2021_01_08_425952 239 60 Age−group Age−group NNP 10_1101-2021_01_08_425952 239 61 F F NNP 10_1101-2021_01_08_425952 239 62 re re IN 10_1101-2021_01_08_425952 239 63 q q NNP 10_1101-2021_01_08_425952 239 64 u u NNP 10_1101-2021_01_08_425952 239 65 e e NNP 10_1101-2021_01_08_425952 239 66 n n NNP 10_1101-2021_01_08_425952 239 67 cy cy NNP 10_1101-2021_01_08_425952 239 68 Amitriptyline Amitriptyline NNP 10_1101-2021_01_08_425952 239 69 10 10 CD 10_1101-2021_01_08_425952 239 70 mg mg NNP 10_1101-2021_01_08_425952 239 71 Figure figure NN 10_1101-2021_01_08_425952 239 72 5 5 CD 10_1101-2021_01_08_425952 239 73 : : : 10_1101-2021_01_08_425952 239 74 The the DT 10_1101-2021_01_08_425952 239 75 distribution distribution NN 10_1101-2021_01_08_425952 239 76 of of IN 10_1101-2021_01_08_425952 239 77 Amitriptyline Amitriptyline NNP 10_1101-2021_01_08_425952 239 78 10 10 CD 10_1101-2021_01_08_425952 239 79 mg mg NNP 10_1101-2021_01_08_425952 239 80 as as IN 10_1101-2021_01_08_425952 239 81 a a DT 10_1101-2021_01_08_425952 239 82 first first JJ 10_1101-2021_01_08_425952 239 83 - - HYPH 10_1101-2021_01_08_425952 239 84 line line NN 10_1101-2021_01_08_425952 239 85 treatment treatment NN 10_1101-2021_01_08_425952 239 86 by by IN 10_1101-2021_01_08_425952 239 87 age age NN 10_1101-2021_01_08_425952 239 88 - - HYPH 10_1101-2021_01_08_425952 239 89 group group NN 10_1101-2021_01_08_425952 239 90 . . . 10_1101-2021_01_08_425952 240 1 3.4 3.4 CD 10_1101-2021_01_08_425952 240 2 . . . 10_1101-2021_01_08_425952 241 1 Prescription prescription NN 10_1101-2021_01_08_425952 241 2 sequences sequence VBZ 10_1101-2021_01_08_425952 241 3 mapDrugTrajectory mapDrugTrajectory , 10_1101-2021_01_08_425952 241 4 Identifying identify VBG 10_1101-2021_01_08_425952 241 5 patient patient JJ 10_1101-2021_01_08_425952 241 6 prescription prescription NN 10_1101-2021_01_08_425952 241 7 trajectories trajectory NNS 10_1101-2021_01_08_425952 241 8 in in IN 10_1101-2021_01_08_425952 241 9 longitudinal longitudinal JJ 10_1101-2021_01_08_425952 241 10 EHRs ehr NNS 10_1101-2021_01_08_425952 241 11 remains remain VBZ 10_1101-2021_01_08_425952 241 12 our -PRON- PRP$ 10_1101-2021_01_08_425952 241 13 biggest big JJS 10_1101-2021_01_08_425952 241 14 motiva- motiva- JJ 10_1101-2021_01_08_425952 241 15 tor tor NN 10_1101-2021_01_08_425952 241 16 behind behind IN 10_1101-2021_01_08_425952 241 17 the the DT 10_1101-2021_01_08_425952 241 18 development development NN 10_1101-2021_01_08_425952 241 19 of of IN 10_1101-2021_01_08_425952 241 20 rdrugtrajectory rdrugtrajectory NN 10_1101-2021_01_08_425952 241 21 . . . 10_1101-2021_01_08_425952 242 1 Therefore therefore RB 10_1101-2021_01_08_425952 242 2 , , , 10_1101-2021_01_08_425952 242 3 we -PRON- PRP 10_1101-2021_01_08_425952 242 4 developed develop VBD 10_1101-2021_01_08_425952 242 5 mapDrugTrajectory mapdrugtrajectory ADD 10_1101-2021_01_08_425952 242 6 to to TO 10_1101-2021_01_08_425952 242 7 identify identify VB 10_1101-2021_01_08_425952 242 8 the the DT 10_1101-2021_01_08_425952 242 9 chronological chronological JJ 10_1101-2021_01_08_425952 242 10 of of IN 10_1101-2021_01_08_425952 242 11 patient patient JJ 10_1101-2021_01_08_425952 242 12 prescription prescription NN 10_1101-2021_01_08_425952 242 13 events event NNS 10_1101-2021_01_08_425952 242 14 . . . 10_1101-2021_01_08_425952 243 1 We -PRON- PRP 10_1101-2021_01_08_425952 243 2 restrict restrict VBP 10_1101-2021_01_08_425952 243 3 the the DT 10_1101-2021_01_08_425952 243 4 calculation calculation NN 10_1101-2021_01_08_425952 243 5 to to TO 10_1101-2021_01_08_425952 243 6 only only RB 10_1101-2021_01_08_425952 243 7 look look VB 10_1101-2021_01_08_425952 243 8 for for IN 10_1101-2021_01_08_425952 243 9 prescription prescription NN 10_1101-2021_01_08_425952 243 10 prodcodes prodcode NNS 10_1101-2021_01_08_425952 243 11 as as IN 10_1101-2021_01_08_425952 243 12 supplied supply VBN 10_1101-2021_01_08_425952 243 13 to to IN 10_1101-2021_01_08_425952 243 14 groupingList groupinglist NN 10_1101-2021_01_08_425952 243 15 as as IN 10_1101-2021_01_08_425952 243 16 a a DT 10_1101-2021_01_08_425952 243 17 named name VBN 10_1101-2021_01_08_425952 243 18 list list NN 10_1101-2021_01_08_425952 243 19 ( ( -LRB- 10_1101-2021_01_08_425952 243 20 named name VBN 10_1101-2021_01_08_425952 243 21 prodcode prodcode NNP 10_1101-2021_01_08_425952 243 22 vectors vector NNS 10_1101-2021_01_08_425952 243 23 ) ) -RRB- 10_1101-2021_01_08_425952 243 24 . . . 10_1101-2021_01_08_425952 244 1 The the DT 10_1101-2021_01_08_425952 244 2 required required JJ 10_1101-2021_01_08_425952 244 3 number number NN 10_1101-2021_01_08_425952 244 4 of of IN 10_1101-2021_01_08_425952 244 5 grouped group VBN 10_1101-2021_01_08_425952 244 6 - - HYPH 10_1101-2021_01_08_425952 244 7 prescription prescription NN 10_1101-2021_01_08_425952 244 8 events event NNS 10_1101-2021_01_08_425952 244 9 is be VBZ 10_1101-2021_01_08_425952 244 10 defined define VBN 10_1101-2021_01_08_425952 244 11 by by IN 10_1101-2021_01_08_425952 244 12 specifying specify VBG 10_1101-2021_01_08_425952 244 13 the the DT 10_1101-2021_01_08_425952 244 14 minDepth mindepth NN 10_1101-2021_01_08_425952 244 15 and and CC 10_1101-2021_01_08_425952 244 16 the the DT 10_1101-2021_01_08_425952 244 17 number number NN 10_1101-2021_01_08_425952 244 18 of of IN 10_1101-2021_01_08_425952 244 19 those those DT 10_1101-2021_01_08_425952 244 20 changes change NNS 10_1101-2021_01_08_425952 244 21 to to TO 10_1101-2021_01_08_425952 244 22 display display VB 10_1101-2021_01_08_425952 244 23 is be VBZ 10_1101-2021_01_08_425952 244 24 controlled control VBN 10_1101-2021_01_08_425952 244 25 by by IN 10_1101-2021_01_08_425952 244 26 maxDepth maxDepth NNP 10_1101-2021_01_08_425952 244 27 maximum maximum JJ 10_1101-2021_01_08_425952 244 28 number number NN 10_1101-2021_01_08_425952 244 29 . . . 10_1101-2021_01_08_425952 245 1 By by IN 10_1101-2021_01_08_425952 245 2 keeping keep VBG 10_1101-2021_01_08_425952 245 3 minDepth minDepth NNS 10_1101-2021_01_08_425952 245 4 and and CC 10_1101-2021_01_08_425952 245 5 maxDepth maxDepth VBG 10_1101-2021_01_08_425952 245 6 the the DT 10_1101-2021_01_08_425952 245 7 same same JJ 10_1101-2021_01_08_425952 245 8 , , , 10_1101-2021_01_08_425952 245 9 only only RB 10_1101-2021_01_08_425952 245 10 patients patient NNS 10_1101-2021_01_08_425952 245 11 with with IN 10_1101-2021_01_08_425952 245 12 a a DT 10_1101-2021_01_08_425952 245 13 valid valid JJ 10_1101-2021_01_08_425952 245 14 number number NN 10_1101-2021_01_08_425952 245 15 of of IN 10_1101-2021_01_08_425952 245 16 prescription prescription NN 10_1101-2021_01_08_425952 245 17 changes change NNS 10_1101-2021_01_08_425952 245 18 are be VBP 10_1101-2021_01_08_425952 245 19 displayed display VBN 10_1101-2021_01_08_425952 245 20 ( ( -LRB- 10_1101-2021_01_08_425952 245 21 Figure figure NN 10_1101-2021_01_08_425952 245 22 6 6 CD 10_1101-2021_01_08_425952 245 23 ( ( -LRB- 10_1101-2021_01_08_425952 245 24 A a NN 10_1101-2021_01_08_425952 245 25 ) ) -RRB- 10_1101-2021_01_08_425952 245 26 and and CC 10_1101-2021_01_08_425952 245 27 ( ( -LRB- 10_1101-2021_01_08_425952 245 28 C C NNP 10_1101-2021_01_08_425952 245 29 ) ) -RRB- 10_1101-2021_01_08_425952 245 30 ) ) -RRB- 10_1101-2021_01_08_425952 245 31 . . . 10_1101-2021_01_08_425952 246 1 Patient patient JJ 10_1101-2021_01_08_425952 246 2 records record NNS 10_1101-2021_01_08_425952 246 3 with with IN 10_1101-2021_01_08_425952 246 4 fewer few JJR 10_1101-2021_01_08_425952 246 5 than than IN 10_1101-2021_01_08_425952 246 6 minDepth mindepth NN 10_1101-2021_01_08_425952 246 7 number number NN 10_1101-2021_01_08_425952 246 8 of of IN 10_1101-2021_01_08_425952 246 9 changes change NNS 10_1101-2021_01_08_425952 246 10 to to IN 10_1101-2021_01_08_425952 246 11 prescription prescription NN 10_1101-2021_01_08_425952 246 12 sequences sequence NNS 10_1101-2021_01_08_425952 246 13 are be VBP 10_1101-2021_01_08_425952 246 14 ignored ignore VBN 10_1101-2021_01_08_425952 246 15 ( ( -LRB- 10_1101-2021_01_08_425952 246 16 Figure figure NN 10_1101-2021_01_08_425952 246 17 6 6 CD 10_1101-2021_01_08_425952 246 18 ( ( -LRB- 10_1101-2021_01_08_425952 246 19 B b NN 10_1101-2021_01_08_425952 246 20 ) ) -RRB- 10_1101-2021_01_08_425952 246 21 ) ) -RRB- 10_1101-2021_01_08_425952 246 22 . . . 10_1101-2021_01_08_425952 247 1 For for IN 10_1101-2021_01_08_425952 247 2 further further JJ 10_1101-2021_01_08_425952 247 3 information information NN 10_1101-2021_01_08_425952 247 4 please please UH 10_1101-2021_01_08_425952 247 5 refer refer VB 10_1101-2021_01_08_425952 247 6 to to IN 10_1101-2021_01_08_425952 247 7 the the DT 10_1101-2021_01_08_425952 247 8 reference reference NN 10_1101-2021_01_08_425952 247 9 manual manual NN 10_1101-2021_01_08_425952 247 10 . . . 10_1101-2021_01_08_425952 248 1 In in IN 10_1101-2021_01_08_425952 248 2 the the DT 10_1101-2021_01_08_425952 248 3 code code NN 10_1101-2021_01_08_425952 248 4 below below RB 10_1101-2021_01_08_425952 248 5 , , , 10_1101-2021_01_08_425952 248 6 mapDrugTrajectory mapdrugtrajectory CD 10_1101-2021_01_08_425952 248 7 returns return NNS 10_1101-2021_01_08_425952 248 8 patients patient NNS 10_1101-2021_01_08_425952 248 9 with with IN 10_1101-2021_01_08_425952 248 10 at at RB 10_1101-2021_01_08_425952 248 11 least least JJS 10_1101-2021_01_08_425952 248 12 first first RB 10_1101-2021_01_08_425952 248 13 five five CD 10_1101-2021_01_08_425952 248 14 grouped group VBN 10_1101-2021_01_08_425952 248 15 pre- pre- NN 10_1101-2021_01_08_425952 248 16 scriptions scription NNS 10_1101-2021_01_08_425952 248 17 . . . 10_1101-2021_01_08_425952 249 1 prodcodes prodcode NNS 10_1101-2021_01_08_425952 249 2 that that WDT 10_1101-2021_01_08_425952 249 3 have have VBP 10_1101-2021_01_08_425952 249 4 not not RB 10_1101-2021_01_08_425952 249 5 been be VBN 10_1101-2021_01_08_425952 249 6 grouped group VBN 10_1101-2021_01_08_425952 249 7 are be VBP 10_1101-2021_01_08_425952 249 8 ignored ignore VBN 10_1101-2021_01_08_425952 249 9 . . . 10_1101-2021_01_08_425952 250 1 Duplication duplication NN 10_1101-2021_01_08_425952 250 2 of of IN 10_1101-2021_01_08_425952 250 3 prodcodes prodcode NNS 10_1101-2021_01_08_425952 250 4 ( ( -LRB- 10_1101-2021_01_08_425952 250 5 those those DT 10_1101-2021_01_08_425952 250 6 from from IN 10_1101-2021_01_08_425952 250 7 the the DT 10_1101-2021_01_08_425952 250 8 same same JJ 10_1101-2021_01_08_425952 250 9 group group NN 10_1101-2021_01_08_425952 250 10 ) ) -RRB- 10_1101-2021_01_08_425952 250 11 do do VBP 10_1101-2021_01_08_425952 250 12 not not RB 10_1101-2021_01_08_425952 250 13 count count VB 10_1101-2021_01_08_425952 250 14 as as IN 10_1101-2021_01_08_425952 250 15 a a DT 10_1101-2021_01_08_425952 250 16 change change NN 10_1101-2021_01_08_425952 250 17 in in IN 10_1101-2021_01_08_425952 250 18 treatment treatment NN 10_1101-2021_01_08_425952 250 19 : : : 10_1101-2021_01_08_425952 250 20 .CC .CC : 10_1101-2021_01_08_425952 250 21 - - : 10_1101-2021_01_08_425952 250 22 BY by IN 10_1101-2021_01_08_425952 250 23 - - HYPH 10_1101-2021_01_08_425952 250 24 ND ND NNP 10_1101-2021_01_08_425952 250 25 4.0 4.0 CD 10_1101-2021_01_08_425952 250 26 International international JJ 10_1101-2021_01_08_425952 250 27 licensemade licensemade NN 10_1101-2021_01_08_425952 250 28 available available JJ 10_1101-2021_01_08_425952 250 29 under under IN 10_1101-2021_01_08_425952 250 30 a a DT 10_1101-2021_01_08_425952 250 31 ( ( -LRB- 10_1101-2021_01_08_425952 250 32 which which WDT 10_1101-2021_01_08_425952 250 33 was be VBD 10_1101-2021_01_08_425952 250 34 not not RB 10_1101-2021_01_08_425952 250 35 certified certify VBN 10_1101-2021_01_08_425952 250 36 by by IN 10_1101-2021_01_08_425952 250 37 peer peer NN 10_1101-2021_01_08_425952 250 38 review review NN 10_1101-2021_01_08_425952 250 39 ) ) -RRB- 10_1101-2021_01_08_425952 250 40 is be VBZ 10_1101-2021_01_08_425952 250 41 the the DT 10_1101-2021_01_08_425952 250 42 author author NN 10_1101-2021_01_08_425952 250 43 / / SYM 10_1101-2021_01_08_425952 250 44 funder funder NN 10_1101-2021_01_08_425952 250 45 , , , 10_1101-2021_01_08_425952 250 46 who who WP 10_1101-2021_01_08_425952 250 47 has have VBZ 10_1101-2021_01_08_425952 250 48 granted grant VBN 10_1101-2021_01_08_425952 250 49 bioRxiv biorxiv IN 10_1101-2021_01_08_425952 250 50 a a DT 10_1101-2021_01_08_425952 250 51 license license NN 10_1101-2021_01_08_425952 250 52 to to TO 10_1101-2021_01_08_425952 250 53 display display VB 10_1101-2021_01_08_425952 250 54 the the DT 10_1101-2021_01_08_425952 250 55 preprint preprint NN 10_1101-2021_01_08_425952 250 56 in in IN 10_1101-2021_01_08_425952 250 57 perpetuity perpetuity NN 10_1101-2021_01_08_425952 250 58 . . . 10_1101-2021_01_08_425952 251 1 It -PRON- PRP 10_1101-2021_01_08_425952 251 2 is be VBZ 10_1101-2021_01_08_425952 251 3 The the DT 10_1101-2021_01_08_425952 251 4 copyright copyright NN 10_1101-2021_01_08_425952 251 5 holder holder NN 10_1101-2021_01_08_425952 251 6 for for IN 10_1101-2021_01_08_425952 251 7 this this DT 10_1101-2021_01_08_425952 251 8 preprintthis preprintthis NN 10_1101-2021_01_08_425952 251 9 version version NN 10_1101-2021_01_08_425952 251 10 posted post VBD 10_1101-2021_01_08_425952 251 11 January January NNP 10_1101-2021_01_08_425952 251 12 9 9 CD 10_1101-2021_01_08_425952 251 13 , , , 10_1101-2021_01_08_425952 251 14 2021 2021 CD 10_1101-2021_01_08_425952 251 15 . . . 10_1101-2021_01_08_425952 251 16 ; ; : 10_1101-2021_01_08_425952 251 17 https://doi.org/10.1101/2021.01.08.425952doi https://doi.org/10.1101/2021.01.08.425952doi ADD 10_1101-2021_01_08_425952 251 18 : : : 10_1101-2021_01_08_425952 251 19 bioRxiv biorxiv IN 10_1101-2021_01_08_425952 251 20 preprint preprint NN 10_1101-2021_01_08_425952 251 21 https://doi.org/10.1101/2021.01.08.425952 https://doi.org/10.1101/2021.01.08.425952 NN 10_1101-2021_01_08_425952 251 22 http://creativecommons.org/licenses/by-nd/4.0/ http://creativecommons.org/licenses/by-nd/4.0/ NN 10_1101-2021_01_08_425952 251 23 24 24 CD 10_1101-2021_01_08_425952 251 24 rdrugtrajectory rdrugtrajectory NN 10_1101-2021_01_08_425952 251 25 : : : 10_1101-2021_01_08_425952 251 26 Analysing Analysing NNP 10_1101-2021_01_08_425952 251 27 Drug Drug NNP 10_1101-2021_01_08_425952 251 28 Prescriptions Prescriptions NNPS 10_1101-2021_01_08_425952 251 29 in in IN 10_1101-2021_01_08_425952 251 30 Electronic Electronic NNP 10_1101-2021_01_08_425952 251 31 Health Health NNP 10_1101-2021_01_08_425952 251 32 Care Care NNP 10_1101-2021_01_08_425952 251 33 Records Records NNP 10_1101-2021_01_08_425952 251 34 Figure Figure NNP 10_1101-2021_01_08_425952 251 35 6 6 CD 10_1101-2021_01_08_425952 251 36 : : : 10_1101-2021_01_08_425952 251 37 The the DT 10_1101-2021_01_08_425952 251 38 distribution distribution NN 10_1101-2021_01_08_425952 251 39 of of IN 10_1101-2021_01_08_425952 251 40 grouped group VBN 10_1101-2021_01_08_425952 251 41 prodcodes prodcode NNS 10_1101-2021_01_08_425952 251 42 across across IN 10_1101-2021_01_08_425952 251 43 three three CD 10_1101-2021_01_08_425952 251 44 patients patient NNS 10_1101-2021_01_08_425952 251 45 . . . 10_1101-2021_01_08_425952 252 1 ( ( -LRB- 10_1101-2021_01_08_425952 252 2 A a DT 10_1101-2021_01_08_425952 252 3 ) ) -RRB- 10_1101-2021_01_08_425952 252 4 Five five CD 10_1101-2021_01_08_425952 252 5 groups group NNS 10_1101-2021_01_08_425952 252 6 of of IN 10_1101-2021_01_08_425952 252 7 valid valid JJ 10_1101-2021_01_08_425952 252 8 prescription prescription NN 10_1101-2021_01_08_425952 252 9 prodcodes prodcode NNS 10_1101-2021_01_08_425952 252 10 , , , 10_1101-2021_01_08_425952 252 11 ( ( -LRB- 10_1101-2021_01_08_425952 252 12 B b NN 10_1101-2021_01_08_425952 252 13 ) ) -RRB- 10_1101-2021_01_08_425952 252 14 only only RB 10_1101-2021_01_08_425952 252 15 three three CD 10_1101-2021_01_08_425952 252 16 groups group NNS 10_1101-2021_01_08_425952 252 17 , , , 10_1101-2021_01_08_425952 252 18 ( ( -LRB- 10_1101-2021_01_08_425952 252 19 C c NN 10_1101-2021_01_08_425952 252 20 ) ) -RRB- 10_1101-2021_01_08_425952 252 21 five five CD 10_1101-2021_01_08_425952 252 22 valid valid JJ 10_1101-2021_01_08_425952 252 23 groups group NNS 10_1101-2021_01_08_425952 252 24 , , , 10_1101-2021_01_08_425952 252 25 in in IN 10_1101-2021_01_08_425952 252 26 addition addition NN 10_1101-2021_01_08_425952 252 27 to to IN 10_1101-2021_01_08_425952 252 28 prodcodes prodcode NNS 10_1101-2021_01_08_425952 252 29 101 101 CD 10_1101-2021_01_08_425952 252 30 and and CC 10_1101-2021_01_08_425952 252 31 1 1 CD 10_1101-2021_01_08_425952 252 32 which which WDT 10_1101-2021_01_08_425952 252 33 are be VBP 10_1101-2021_01_08_425952 252 34 ignored ignore VBN 10_1101-2021_01_08_425952 252 35 . . . 10_1101-2021_01_08_425952 253 1 > > XX 10_1101-2021_01_08_425952 253 2 library(ggplot2 library(ggplot2 NN 10_1101-2021_01_08_425952 253 3 ) ) -RRB- 10_1101-2021_01_08_425952 253 4 > > XX 10_1101-2021_01_08_425952 253 5 library(ggalluvial library(ggalluvial JJ 10_1101-2021_01_08_425952 253 6 ) ) -RRB- 10_1101-2021_01_08_425952 253 7 > > XX 10_1101-2021_01_08_425952 253 8 structureList structureList NNP 10_1101-2021_01_08_425952 253 9 < < XX 10_1101-2021_01_08_425952 253 10 - - HYPH 10_1101-2021_01_08_425952 253 11 list(Amitriptyline list(Amitriptyline NNP 10_1101-2021_01_08_425952 253 12 = = -RRB- 10_1101-2021_01_08_425952 253 13 c(83,49,1888 c(83,49,1888 NNP 10_1101-2021_01_08_425952 253 14 ) ) -RRB- 10_1101-2021_01_08_425952 253 15 , , , 10_1101-2021_01_08_425952 253 16 + + CC 10_1101-2021_01_08_425952 253 17 Propranolol propranolol NN 10_1101-2021_01_08_425952 253 18 = = SYM 10_1101-2021_01_08_425952 253 19 c(707,297,769 c(707,297,769 NNP 10_1101-2021_01_08_425952 253 20 ) ) -RRB- 10_1101-2021_01_08_425952 253 21 , , , 10_1101-2021_01_08_425952 253 22 + + CC 10_1101-2021_01_08_425952 253 23 Topiramate Topiramate NNP 10_1101-2021_01_08_425952 253 24 = = SYM 10_1101-2021_01_08_425952 253 25 c(11237 c(11237 UH 10_1101-2021_01_08_425952 253 26 ) ) -RRB- 10_1101-2021_01_08_425952 253 27 , , , 10_1101-2021_01_08_425952 253 28 + + NFP 10_1101-2021_01_08_425952 253 29 Venlafaxine Venlafaxine NNP 10_1101-2021_01_08_425952 253 30 = = SYM 10_1101-2021_01_08_425952 253 31 c(470,301,39359 c(470,301,39359 NNP 10_1101-2021_01_08_425952 253 32 ) ) -RRB- 10_1101-2021_01_08_425952 253 33 , , , 10_1101-2021_01_08_425952 253 34 + + CC 10_1101-2021_01_08_425952 253 35 Lisinopril Lisinopril NNP 10_1101-2021_01_08_425952 253 36 = = SYM 10_1101-2021_01_08_425952 253 37 c(78,65,277 c(78,65,277 NN 10_1101-2021_01_08_425952 253 38 ) ) -RRB- 10_1101-2021_01_08_425952 253 39 , , , 10_1101-2021_01_08_425952 253 40 + + CC 10_1101-2021_01_08_425952 253 41 Atenolol atenolol NN 10_1101-2021_01_08_425952 253 42 = = SYM 10_1101-2021_01_08_425952 253 43 c(5,24,26 c(5,24,26 NNP 10_1101-2021_01_08_425952 253 44 ) ) -RRB- 10_1101-2021_01_08_425952 253 45 , , , 10_1101-2021_01_08_425952 253 46 + + CC 10_1101-2021_01_08_425952 253 47 Candesartan Candesartan NNP 10_1101-2021_01_08_425952 253 48 = = SYM 10_1101-2021_01_08_425952 253 49 c(531 c(531 NNP 10_1101-2021_01_08_425952 253 50 ) ) -RRB- 10_1101-2021_01_08_425952 253 51 + + SYM 10_1101-2021_01_08_425952 253 52 ) ) -RRB- 10_1101-2021_01_08_425952 253 53 > > XX 10_1101-2021_01_08_425952 253 54 resultList resultlist NN 10_1101-2021_01_08_425952 253 55 < < XX 10_1101-2021_01_08_425952 253 56 - - HYPH 10_1101-2021_01_08_425952 253 57 mapDrugTrajectory(df mapDrugTrajectory(df NNP 10_1101-2021_01_08_425952 253 58 = = -RRB- 10_1101-2021_01_08_425952 253 59 testTherapyDF testTherapyDF NNS 10_1101-2021_01_08_425952 253 60 , , , 10_1101-2021_01_08_425952 253 61 + + CC 10_1101-2021_01_08_425952 253 62 minDepth minDepth NNS 10_1101-2021_01_08_425952 253 63 = = SYM 10_1101-2021_01_08_425952 253 64 5 5 CD 10_1101-2021_01_08_425952 253 65 , , , 10_1101-2021_01_08_425952 253 66 + + CC 10_1101-2021_01_08_425952 253 67 maxDepth maxdepth NN 10_1101-2021_01_08_425952 253 68 = = SYM 10_1101-2021_01_08_425952 253 69 5 5 CD 10_1101-2021_01_08_425952 253 70 , , , 10_1101-2021_01_08_425952 253 71 + + CC 10_1101-2021_01_08_425952 253 72 groupingList groupinglist NN 10_1101-2021_01_08_425952 253 73 = = SYM 10_1101-2021_01_08_425952 253 74 structureList structurelist NN 10_1101-2021_01_08_425952 253 75 , , , 10_1101-2021_01_08_425952 253 76 + + CC 10_1101-2021_01_08_425952 253 77 removeUndefinedCode removeundefinedcode LS 10_1101-2021_01_08_425952 253 78 = = SYM 10_1101-2021_01_08_425952 253 79 TRUE TRUE NNP 10_1101-2021_01_08_425952 253 80 ) ) -RRB- 10_1101-2021_01_08_425952 253 81 > > XX 10_1101-2021_01_08_425952 253 82 df df FW 10_1101-2021_01_08_425952 253 83 < < XX 10_1101-2021_01_08_425952 253 84 - - HYPH 10_1101-2021_01_08_425952 253 85 resultList[[3 resultList[[3 NNP 10_1101-2021_01_08_425952 253 86 ] ] -RRB- 10_1101-2021_01_08_425952 253 87 ] ] -RRB- 10_1101-2021_01_08_425952 253 88 > > XX 10_1101-2021_01_08_425952 253 89 ggSwitch ggSwitch NNP 10_1101-2021_01_08_425952 253 90 < < XX 10_1101-2021_01_08_425952 253 91 - - HYPH 10_1101-2021_01_08_425952 253 92 ggplot(df ggplot(df NNP 10_1101-2021_01_08_425952 253 93 , , , 10_1101-2021_01_08_425952 253 94 + + SYM 10_1101-2021_01_08_425952 253 95 aes(y aes(y NNP 10_1101-2021_01_08_425952 253 96 = = NFP 10_1101-2021_01_08_425952 253 97 Freq Freq NNP 10_1101-2021_01_08_425952 253 98 , , , 10_1101-2021_01_08_425952 253 99 axis1 axis1 NNP 10_1101-2021_01_08_425952 253 100 = = SYM 10_1101-2021_01_08_425952 253 101 FirstDrug FirstDrug NNP 10_1101-2021_01_08_425952 253 102 , , , 10_1101-2021_01_08_425952 253 103 axis2 axis2 NNP 10_1101-2021_01_08_425952 253 104 = = SYM 10_1101-2021_01_08_425952 253 105 Switch1 Switch1 NNP 10_1101-2021_01_08_425952 253 106 , , , 10_1101-2021_01_08_425952 253 107 + + CC 10_1101-2021_01_08_425952 253 108 axis3 axis3 NNP 10_1101-2021_01_08_425952 253 109 = = SYM 10_1101-2021_01_08_425952 253 110 Switch2 Switch2 NNP 10_1101-2021_01_08_425952 253 111 , , , 10_1101-2021_01_08_425952 253 112 axis4 axis4 NNP 10_1101-2021_01_08_425952 253 113 = = -RRB- 10_1101-2021_01_08_425952 253 114 Switch3 Switch3 NNP 10_1101-2021_01_08_425952 253 115 , , , 10_1101-2021_01_08_425952 253 116 axis5 axis5 NNP 10_1101-2021_01_08_425952 253 117 = = -RRB- 10_1101-2021_01_08_425952 253 118 Switch4 Switch4 NNP 10_1101-2021_01_08_425952 253 119 ) ) -RRB- 10_1101-2021_01_08_425952 253 120 ) ) -RRB- 10_1101-2021_01_08_425952 253 121 + + NFP 10_1101-2021_01_08_425952 253 122 + + SYM 10_1101-2021_01_08_425952 253 123 geom_alluvium(aes(fill geom_alluvium(aes(fill NN 10_1101-2021_01_08_425952 253 124 = = SYM 10_1101-2021_01_08_425952 253 125 FirstDrug FirstDrug NNP 10_1101-2021_01_08_425952 253 126 ) ) -RRB- 10_1101-2021_01_08_425952 253 127 , , , 10_1101-2021_01_08_425952 253 128 width width NN 10_1101-2021_01_08_425952 253 129 = = SYM 10_1101-2021_01_08_425952 253 130 1/12 1/12 CD 10_1101-2021_01_08_425952 253 131 ) ) -RRB- 10_1101-2021_01_08_425952 253 132 + + CC 10_1101-2021_01_08_425952 253 133 + + SYM 10_1101-2021_01_08_425952 253 134 geom_stratum(width geom_stratum(width NNP 10_1101-2021_01_08_425952 253 135 = = SYM 10_1101-2021_01_08_425952 253 136 1/12 1/12 CD 10_1101-2021_01_08_425952 253 137 , , , 10_1101-2021_01_08_425952 253 138 fill fill VB 10_1101-2021_01_08_425952 253 139 = = -RRB- 10_1101-2021_01_08_425952 253 140 " " `` 10_1101-2021_01_08_425952 253 141 black black JJ 10_1101-2021_01_08_425952 253 142 " " '' 10_1101-2021_01_08_425952 253 143 , , , 10_1101-2021_01_08_425952 253 144 color color NN 10_1101-2021_01_08_425952 253 145 = = SYM 10_1101-2021_01_08_425952 253 146 " " `` 10_1101-2021_01_08_425952 253 147 grey grey NN 10_1101-2021_01_08_425952 253 148 " " '' 10_1101-2021_01_08_425952 253 149 ) ) -RRB- 10_1101-2021_01_08_425952 253 150 + + NFP 10_1101-2021_01_08_425952 253 151 + + SYM 10_1101-2021_01_08_425952 253 152 geom_label(stat geom_label(stat NN 10_1101-2021_01_08_425952 253 153 = = NFP 10_1101-2021_01_08_425952 253 154 " " `` 10_1101-2021_01_08_425952 253 155 stratum stratum JJ 10_1101-2021_01_08_425952 253 156 " " '' 10_1101-2021_01_08_425952 253 157 , , , 10_1101-2021_01_08_425952 253 158 infer.label infer.label NN 10_1101-2021_01_08_425952 253 159 = = SYM 10_1101-2021_01_08_425952 253 160 TRUE TRUE NNP 10_1101-2021_01_08_425952 253 161 ) ) -RRB- 10_1101-2021_01_08_425952 253 162 + + CC 10_1101-2021_01_08_425952 253 163 + + SYM 10_1101-2021_01_08_425952 253 164 scale_fill_brewer(type scale_fill_brewer(type VB 10_1101-2021_01_08_425952 253 165 = = SYM 10_1101-2021_01_08_425952 253 166 " " `` 10_1101-2021_01_08_425952 253 167 qual qual JJ 10_1101-2021_01_08_425952 253 168 " " '' 10_1101-2021_01_08_425952 253 169 , , , 10_1101-2021_01_08_425952 253 170 palette palette NN 10_1101-2021_01_08_425952 253 171 = = NFP 10_1101-2021_01_08_425952 253 172 " " `` 10_1101-2021_01_08_425952 253 173 Set1 Set1 NNP 10_1101-2021_01_08_425952 253 174 " " '' 10_1101-2021_01_08_425952 253 175 ) ) -RRB- 10_1101-2021_01_08_425952 253 176 + + NFP 10_1101-2021_01_08_425952 253 177 + + NFP 10_1101-2021_01_08_425952 253 178 theme_bw theme_bw NNP 10_1101-2021_01_08_425952 253 179 ( ( -LRB- 10_1101-2021_01_08_425952 253 180 ) ) -RRB- 10_1101-2021_01_08_425952 253 181 + + SYM 10_1101-2021_01_08_425952 253 182 theme(legend.position theme(legend.position NN 10_1101-2021_01_08_425952 253 183 = = SYM 10_1101-2021_01_08_425952 253 184 " " `` 10_1101-2021_01_08_425952 253 185 none none NN 10_1101-2021_01_08_425952 253 186 " " '' 10_1101-2021_01_08_425952 253 187 ) ) -RRB- 10_1101-2021_01_08_425952 253 188 + + NFP 10_1101-2021_01_08_425952 253 189 + + SYM 10_1101-2021_01_08_425952 253 190 scale_x_discrete(limits scale_x_discrete(limits XX 10_1101-2021_01_08_425952 253 191 = = -RRB- 10_1101-2021_01_08_425952 253 192 c("First c("First NNP 10_1101-2021_01_08_425952 253 193 Drug Drug NNP 10_1101-2021_01_08_425952 253 194 " " '' 10_1101-2021_01_08_425952 253 195 , , , 10_1101-2021_01_08_425952 253 196 " " `` 10_1101-2021_01_08_425952 253 197 1st 1st NNP 10_1101-2021_01_08_425952 253 198 Switch Switch NNP 10_1101-2021_01_08_425952 253 199 " " '' 10_1101-2021_01_08_425952 253 200 , , , 10_1101-2021_01_08_425952 253 201 " " `` 10_1101-2021_01_08_425952 253 202 2nd 2nd NNP 10_1101-2021_01_08_425952 253 203 Switch Switch NNP 10_1101-2021_01_08_425952 253 204 " " '' 10_1101-2021_01_08_425952 253 205 , , , 10_1101-2021_01_08_425952 253 206 + + CC 10_1101-2021_01_08_425952 253 207 " " `` 10_1101-2021_01_08_425952 253 208 3rd 3rd JJ 10_1101-2021_01_08_425952 253 209 Switch","4th switch","4th JJ 10_1101-2021_01_08_425952 253 210 Switch Switch NNP 10_1101-2021_01_08_425952 253 211 " " '' 10_1101-2021_01_08_425952 253 212 ) ) -RRB- 10_1101-2021_01_08_425952 253 213 , , , 10_1101-2021_01_08_425952 253 214 + + CC 10_1101-2021_01_08_425952 253 215 expand expand VB 10_1101-2021_01_08_425952 253 216 = = NFP 10_1101-2021_01_08_425952 253 217 c(.05 c(.05 JJS 10_1101-2021_01_08_425952 253 218 , , , 10_1101-2021_01_08_425952 253 219 .05 .05 NFP 10_1101-2021_01_08_425952 253 220 ) ) -RRB- 10_1101-2021_01_08_425952 253 221 ) ) -RRB- 10_1101-2021_01_08_425952 253 222 + + CC 10_1101-2021_01_08_425952 253 223 + + CC 10_1101-2021_01_08_425952 253 224 ggtitle("Migraine ggtitle("migraine NN 10_1101-2021_01_08_425952 253 225 Preventative Preventative NNP 10_1101-2021_01_08_425952 253 226 Switching Switching NNP 10_1101-2021_01_08_425952 253 227 Among among IN 10_1101-2021_01_08_425952 253 228 Patients Patients NNPS 10_1101-2021_01_08_425952 253 229 " " '' 10_1101-2021_01_08_425952 253 230 ) ) -RRB- 10_1101-2021_01_08_425952 253 231 .CC .CC NFP 10_1101-2021_01_08_425952 253 232 - - : 10_1101-2021_01_08_425952 253 233 BY by IN 10_1101-2021_01_08_425952 253 234 - - HYPH 10_1101-2021_01_08_425952 253 235 ND ND NNP 10_1101-2021_01_08_425952 253 236 4.0 4.0 CD 10_1101-2021_01_08_425952 253 237 International international JJ 10_1101-2021_01_08_425952 253 238 licensemade licensemade NN 10_1101-2021_01_08_425952 253 239 available available JJ 10_1101-2021_01_08_425952 253 240 under under IN 10_1101-2021_01_08_425952 253 241 a a DT 10_1101-2021_01_08_425952 253 242 ( ( -LRB- 10_1101-2021_01_08_425952 253 243 which which WDT 10_1101-2021_01_08_425952 253 244 was be VBD 10_1101-2021_01_08_425952 253 245 not not RB 10_1101-2021_01_08_425952 253 246 certified certify VBN 10_1101-2021_01_08_425952 253 247 by by IN 10_1101-2021_01_08_425952 253 248 peer peer NN 10_1101-2021_01_08_425952 253 249 review review NN 10_1101-2021_01_08_425952 253 250 ) ) -RRB- 10_1101-2021_01_08_425952 253 251 is be VBZ 10_1101-2021_01_08_425952 253 252 the the DT 10_1101-2021_01_08_425952 253 253 author author NN 10_1101-2021_01_08_425952 253 254 / / SYM 10_1101-2021_01_08_425952 253 255 funder funder NN 10_1101-2021_01_08_425952 253 256 , , , 10_1101-2021_01_08_425952 253 257 who who WP 10_1101-2021_01_08_425952 253 258 has have VBZ 10_1101-2021_01_08_425952 253 259 granted grant VBN 10_1101-2021_01_08_425952 253 260 bioRxiv biorxiv IN 10_1101-2021_01_08_425952 253 261 a a DT 10_1101-2021_01_08_425952 253 262 license license NN 10_1101-2021_01_08_425952 253 263 to to TO 10_1101-2021_01_08_425952 253 264 display display VB 10_1101-2021_01_08_425952 253 265 the the DT 10_1101-2021_01_08_425952 253 266 preprint preprint NN 10_1101-2021_01_08_425952 253 267 in in IN 10_1101-2021_01_08_425952 253 268 perpetuity perpetuity NN 10_1101-2021_01_08_425952 253 269 . . . 10_1101-2021_01_08_425952 254 1 It -PRON- PRP 10_1101-2021_01_08_425952 254 2 is be VBZ 10_1101-2021_01_08_425952 254 3 The the DT 10_1101-2021_01_08_425952 254 4 copyright copyright NN 10_1101-2021_01_08_425952 254 5 holder holder NN 10_1101-2021_01_08_425952 254 6 for for IN 10_1101-2021_01_08_425952 254 7 this this DT 10_1101-2021_01_08_425952 254 8 preprintthis preprintthis NN 10_1101-2021_01_08_425952 254 9 version version NN 10_1101-2021_01_08_425952 254 10 posted post VBD 10_1101-2021_01_08_425952 254 11 January January NNP 10_1101-2021_01_08_425952 254 12 9 9 CD 10_1101-2021_01_08_425952 254 13 , , , 10_1101-2021_01_08_425952 254 14 2021 2021 CD 10_1101-2021_01_08_425952 254 15 . . . 10_1101-2021_01_08_425952 254 16 ; ; : 10_1101-2021_01_08_425952 254 17 https://doi.org/10.1101/2021.01.08.425952doi https://doi.org/10.1101/2021.01.08.425952doi ADD 10_1101-2021_01_08_425952 254 18 : : : 10_1101-2021_01_08_425952 254 19 bioRxiv biorxiv IN 10_1101-2021_01_08_425952 254 20 preprint preprint NN 10_1101-2021_01_08_425952 254 21 https://doi.org/10.1101/2021.01.08.425952 https://doi.org/10.1101/2021.01.08.425952 XX 10_1101-2021_01_08_425952 254 22 http://creativecommons.org/licenses/by-nd/4.0/ http://creativecommons.org/licenses/by-nd/4.0/ NNP 10_1101-2021_01_08_425952 254 23 Journal Journal NNP 10_1101-2021_01_08_425952 254 24 of of IN 10_1101-2021_01_08_425952 254 25 Statistical Statistical NNP 10_1101-2021_01_08_425952 254 26 Software Software NNP 10_1101-2021_01_08_425952 254 27 25 25 CD 10_1101-2021_01_08_425952 254 28 Venlafaxine Venlafaxine NNP 10_1101-2021_01_08_425952 254 29 Propranolol Propranolol NNP 10_1101-2021_01_08_425952 254 30 Lisinopril Lisinopril NNP 10_1101-2021_01_08_425952 254 31 Atenolol Atenolol NNP 10_1101-2021_01_08_425952 254 32 Amitriptyline Amitriptyline NNP 10_1101-2021_01_08_425952 254 33 Candesartan Candesartan NNP 10_1101-2021_01_08_425952 254 34 Venlafaxine Venlafaxine NNP 10_1101-2021_01_08_425952 254 35 Propranolol Propranolol NNP 10_1101-2021_01_08_425952 254 36 Lisinopril Lisinopril NNP 10_1101-2021_01_08_425952 254 37 Atenolol Atenolol NNP 10_1101-2021_01_08_425952 254 38 Amitriptyline Amitriptyline NNP 10_1101-2021_01_08_425952 254 39 TopiramateCandesartan TopiramateCandesartan NNP 10_1101-2021_01_08_425952 254 40 Venlafaxine Venlafaxine NNP 10_1101-2021_01_08_425952 254 41 Propranolol Propranolol NNP 10_1101-2021_01_08_425952 254 42 Lisinopril Lisinopril NNP 10_1101-2021_01_08_425952 254 43 Atenolol Atenolol NNP 10_1101-2021_01_08_425952 254 44 Amitriptyline Amitriptyline NNP 10_1101-2021_01_08_425952 254 45 Topiramate Topiramate NNP 10_1101-2021_01_08_425952 254 46 Candesartan Candesartan NNP 10_1101-2021_01_08_425952 254 47 Venlafaxine Venlafaxine NNP 10_1101-2021_01_08_425952 254 48 Propranolol Propranolol NNP 10_1101-2021_01_08_425952 254 49 Lisinopril Lisinopril NNP 10_1101-2021_01_08_425952 254 50 Atenolol Atenolol NNP 10_1101-2021_01_08_425952 254 51 Amitriptyline Amitriptyline NNP 10_1101-2021_01_08_425952 254 52 TopiramateCandesartan TopiramateCandesartan NNP 10_1101-2021_01_08_425952 254 53 Venlafaxine Venlafaxine NNP 10_1101-2021_01_08_425952 254 54 Propranolol Propranolol NNP 10_1101-2021_01_08_425952 254 55 Lisinopril Lisinopril NNP 10_1101-2021_01_08_425952 254 56 Atenolol Atenolol NNP 10_1101-2021_01_08_425952 254 57 Amitriptyline Amitriptyline NNP 10_1101-2021_01_08_425952 254 58 0 0 CD 10_1101-2021_01_08_425952 254 59 100 100 CD 10_1101-2021_01_08_425952 254 60 200 200 CD 10_1101-2021_01_08_425952 254 61 300 300 CD 10_1101-2021_01_08_425952 254 62 First First NNP 10_1101-2021_01_08_425952 254 63 Drug Drug NNP 10_1101-2021_01_08_425952 254 64 1st 1st NN 10_1101-2021_01_08_425952 254 65 Switch Switch NNP 10_1101-2021_01_08_425952 254 66 2nd 2nd NNP 10_1101-2021_01_08_425952 254 67 Switch Switch NNP 10_1101-2021_01_08_425952 254 68 3rd 3rd NNP 10_1101-2021_01_08_425952 254 69 Switch Switch NNP 10_1101-2021_01_08_425952 254 70 4th 4th NN 10_1101-2021_01_08_425952 254 71 Switch Switch NNP 10_1101-2021_01_08_425952 254 72 F F NNP 10_1101-2021_01_08_425952 254 73 re re NN 10_1101-2021_01_08_425952 254 74 q q NNP 10_1101-2021_01_08_425952 254 75 Migraine Migraine NNP 10_1101-2021_01_08_425952 254 76 Preventative Preventative NNP 10_1101-2021_01_08_425952 254 77 Switching Switching NNP 10_1101-2021_01_08_425952 254 78 Among among IN 10_1101-2021_01_08_425952 254 79 Patients Patients NNPS 10_1101-2021_01_08_425952 254 80 Figure Figure NNP 10_1101-2021_01_08_425952 254 81 7 7 CD 10_1101-2021_01_08_425952 254 82 : : : 10_1101-2021_01_08_425952 254 83 Prescription prescription NN 10_1101-2021_01_08_425952 254 84 pattern pattern NN 10_1101-2021_01_08_425952 254 85 switching switching NN 10_1101-2021_01_08_425952 254 86 of of IN 10_1101-2021_01_08_425952 254 87 seven seven CD 10_1101-2021_01_08_425952 254 88 different different JJ 10_1101-2021_01_08_425952 254 89 migraine migraine NNP 10_1101-2021_01_08_425952 254 90 preventatives preventative NNS 10_1101-2021_01_08_425952 254 91 . . . 10_1101-2021_01_08_425952 255 1 A a DT 10_1101-2021_01_08_425952 255 2 patient patient NN 10_1101-2021_01_08_425952 255 3 required require VBD 10_1101-2021_01_08_425952 255 4 a a DT 10_1101-2021_01_08_425952 255 5 a a DT 10_1101-2021_01_08_425952 255 6 minimum minimum NN 10_1101-2021_01_08_425952 255 7 of of IN 10_1101-2021_01_08_425952 255 8 five five CD 10_1101-2021_01_08_425952 255 9 changes change NNS 10_1101-2021_01_08_425952 255 10 in in IN 10_1101-2021_01_08_425952 255 11 prescriptions prescription NNS 10_1101-2021_01_08_425952 255 12 ( ( -LRB- 10_1101-2021_01_08_425952 255 13 including include VBG 10_1101-2021_01_08_425952 255 14 the the DT 10_1101-2021_01_08_425952 255 15 initial initial JJ 10_1101-2021_01_08_425952 255 16 prescription prescription NN 10_1101-2021_01_08_425952 255 17 ) ) -RRB- 10_1101-2021_01_08_425952 255 18 and and CC 10_1101-2021_01_08_425952 255 19 , , , 10_1101-2021_01_08_425952 255 20 equally equally RB 10_1101-2021_01_08_425952 255 21 , , , 10_1101-2021_01_08_425952 255 22 the the DT 10_1101-2021_01_08_425952 255 23 display display NN 10_1101-2021_01_08_425952 255 24 was be VBD 10_1101-2021_01_08_425952 255 25 set set VBN 10_1101-2021_01_08_425952 255 26 to to IN 10_1101-2021_01_08_425952 255 27 five five CD 10_1101-2021_01_08_425952 255 28 changes change NNS 10_1101-2021_01_08_425952 255 29 in in IN 10_1101-2021_01_08_425952 255 30 prescription prescription NN 10_1101-2021_01_08_425952 255 31 . . . 10_1101-2021_01_08_425952 256 1 3.5 3.5 CD 10_1101-2021_01_08_425952 256 2 . . . 10_1101-2021_01_08_425952 257 1 Prescription prescription NN 10_1101-2021_01_08_425952 257 2 timeline timeline NN 10_1101-2021_01_08_425952 257 3 construction construction NN 10_1101-2021_01_08_425952 257 4 rdrugtrajectory rdrugtrajectory NN 10_1101-2021_01_08_425952 257 5 contains contain VBZ 10_1101-2021_01_08_425952 257 6 several several JJ 10_1101-2021_01_08_425952 257 7 functions function NNS 10_1101-2021_01_08_425952 257 8 that that WDT 10_1101-2021_01_08_425952 257 9 transforms transform VBZ 10_1101-2021_01_08_425952 257 10 patient patient JJ 10_1101-2021_01_08_425952 257 11 data datum NNS 10_1101-2021_01_08_425952 257 12 into into IN 10_1101-2021_01_08_425952 257 13 a a DT 10_1101-2021_01_08_425952 257 14 format format NN 10_1101-2021_01_08_425952 257 15 com- com- NN 10_1101-2021_01_08_425952 257 16 patible patible NN 10_1101-2021_01_08_425952 257 17 with with IN 10_1101-2021_01_08_425952 257 18 mean mean NNP 10_1101-2021_01_08_425952 257 19 cumulative cumulative JJ 10_1101-2021_01_08_425952 257 20 function function NN 10_1101-2021_01_08_425952 257 21 ( ( -LRB- 10_1101-2021_01_08_425952 257 22 MCF MCF NNP 10_1101-2021_01_08_425952 257 23 ) ) -RRB- 10_1101-2021_01_08_425952 257 24 semi semi JJ 10_1101-2021_01_08_425952 257 25 - - JJ 10_1101-2021_01_08_425952 257 26 parametric parametric JJ 10_1101-2021_01_08_425952 257 27 estimates estimate NNS 10_1101-2021_01_08_425952 257 28 , , , 10_1101-2021_01_08_425952 257 29 prescription prescription NN 10_1101-2021_01_08_425952 257 30 per- per- NN 10_1101-2021_01_08_425952 257 31 sistence sistence NN 10_1101-2021_01_08_425952 257 32 , , , 10_1101-2021_01_08_425952 257 33 prescription prescription NN 10_1101-2021_01_08_425952 257 34 incidence incidence NN 10_1101-2021_01_08_425952 257 35 , , , 10_1101-2021_01_08_425952 257 36 and and CC 10_1101-2021_01_08_425952 257 37 survival survival NN 10_1101-2021_01_08_425952 257 38 analysis analysis NN 10_1101-2021_01_08_425952 257 39 . . . 10_1101-2021_01_08_425952 258 1 generateMCFOneGroup generateMCFOneGroup NNP 10_1101-2021_01_08_425952 258 2 Prescription Prescription NNP 10_1101-2021_01_08_425952 258 3 events event NNS 10_1101-2021_01_08_425952 258 4 are be VBP 10_1101-2021_01_08_425952 258 5 binned bin VBN 10_1101-2021_01_08_425952 258 6 into into IN 10_1101-2021_01_08_425952 258 7 weekly weekly JJ 10_1101-2021_01_08_425952 258 8 units unit NNS 10_1101-2021_01_08_425952 258 9 to to TO 10_1101-2021_01_08_425952 258 10 increase increase VB 10_1101-2021_01_08_425952 258 11 the the DT 10_1101-2021_01_08_425952 258 12 statistical statistical JJ 10_1101-2021_01_08_425952 258 13 power power NN 10_1101-2021_01_08_425952 258 14 at at IN 10_1101-2021_01_08_425952 258 15 each each DT 10_1101-2021_01_08_425952 258 16 time time NN 10_1101-2021_01_08_425952 258 17 point point NN 10_1101-2021_01_08_425952 258 18 . . . 10_1101-2021_01_08_425952 259 1 The the DT 10_1101-2021_01_08_425952 259 2 user user NN 10_1101-2021_01_08_425952 259 3 presents present VBZ 10_1101-2021_01_08_425952 259 4 a a DT 10_1101-2021_01_08_425952 259 5 group group NN 10_1101-2021_01_08_425952 259 6 at at IN 10_1101-2021_01_08_425952 259 7 a a DT 10_1101-2021_01_08_425952 259 8 time time NN 10_1101-2021_01_08_425952 259 9 , , , 10_1101-2021_01_08_425952 259 10 for for IN 10_1101-2021_01_08_425952 259 11 example example NN 10_1101-2021_01_08_425952 259 12 , , , 10_1101-2021_01_08_425952 259 13 all all DT 10_1101-2021_01_08_425952 259 14 clinical clinical JJ 10_1101-2021_01_08_425952 259 15 events event NNS 10_1101-2021_01_08_425952 259 16 of of IN 10_1101-2021_01_08_425952 259 17 male male JJ 10_1101-2021_01_08_425952 259 18 patients patient NNS 10_1101-2021_01_08_425952 259 19 with with IN 10_1101-2021_01_08_425952 259 20 a a DT 10_1101-2021_01_08_425952 259 21 first first JJ 10_1101-2021_01_08_425952 259 22 - - HYPH 10_1101-2021_01_08_425952 259 23 line line NN 10_1101-2021_01_08_425952 259 24 prescription prescription NN 10_1101-2021_01_08_425952 259 25 of of IN 10_1101-2021_01_08_425952 259 26 amitriptyline amitriptyline NN 10_1101-2021_01_08_425952 259 27 for for IN 10_1101-2021_01_08_425952 259 28 a a DT 10_1101-2021_01_08_425952 259 29 migraine migraine NN 10_1101-2021_01_08_425952 259 30 . . . 10_1101-2021_01_08_425952 260 1 The the DT 10_1101-2021_01_08_425952 260 2 clinical clinical JJ 10_1101-2021_01_08_425952 260 3 data datum NNS 10_1101-2021_01_08_425952 260 4 has have VBZ 10_1101-2021_01_08_425952 260 5 already already RB 10_1101-2021_01_08_425952 260 6 been be VBN 10_1101-2021_01_08_425952 260 7 refined refine VBN 10_1101-2021_01_08_425952 260 8 using use VBG 10_1101-2021_01_08_425952 260 9 the the DT 10_1101-2021_01_08_425952 260 10 steps step NNS 10_1101-2021_01_08_425952 260 11 for for IN 10_1101-2021_01_08_425952 260 12 first first JJ 10_1101-2021_01_08_425952 260 13 - - HYPH 10_1101-2021_01_08_425952 260 14 line line NN 10_1101-2021_01_08_425952 260 15 prescription prescription NN 10_1101-2021_01_08_425952 260 16 , , , 10_1101-2021_01_08_425952 260 17 as as IN 10_1101-2021_01_08_425952 260 18 described describe VBN 10_1101-2021_01_08_425952 260 19 above above RB 10_1101-2021_01_08_425952 260 20 . . . 10_1101-2021_01_08_425952 261 1 The the DT 10_1101-2021_01_08_425952 261 2 function function NN 10_1101-2021_01_08_425952 261 3 generateMCFOneGroup generatemcfonegroup NN 10_1101-2021_01_08_425952 261 4 accepts accept VBZ 10_1101-2021_01_08_425952 261 5 a a DT 10_1101-2021_01_08_425952 261 6 dataframe dataframe NN 10_1101-2021_01_08_425952 261 7 or or CC 10_1101-2021_01_08_425952 261 8 events event NNS 10_1101-2021_01_08_425952 261 9 , , , 10_1101-2021_01_08_425952 261 10 the the DT 10_1101-2021_01_08_425952 261 11 MCF MCF NNP 10_1101-2021_01_08_425952 261 12 start start VB 10_1101-2021_01_08_425952 261 13 date date NN 10_1101-2021_01_08_425952 261 14 ( ( -LRB- 10_1101-2021_01_08_425952 261 15 eventdates eventdate NNS 10_1101-2021_01_08_425952 261 16 are be VBP 10_1101-2021_01_08_425952 261 17 adjusted adjust VBN 10_1101-2021_01_08_425952 261 18 so so RB 10_1101-2021_01_08_425952 261 19 all all DT 10_1101-2021_01_08_425952 261 20 patient patient JJ 10_1101-2021_01_08_425952 261 21 records record NNS 10_1101-2021_01_08_425952 261 22 in in IN 10_1101-2021_01_08_425952 261 23 the the DT 10_1101-2021_01_08_425952 261 24 dataset dataset NN 10_1101-2021_01_08_425952 261 25 begin begin VBP 10_1101-2021_01_08_425952 261 26 at at IN 10_1101-2021_01_08_425952 261 27 the the DT 10_1101-2021_01_08_425952 261 28 same same JJ 10_1101-2021_01_08_425952 261 29 time time NN 10_1101-2021_01_08_425952 261 30 ) ) -RRB- 10_1101-2021_01_08_425952 261 31 , , , 10_1101-2021_01_08_425952 261 32 and and CC 10_1101-2021_01_08_425952 261 33 the the DT 10_1101-2021_01_08_425952 261 34 minimum minimum JJ 10_1101-2021_01_08_425952 261 35 number number NN 10_1101-2021_01_08_425952 261 36 of of IN 10_1101-2021_01_08_425952 261 37 events event NNS 10_1101-2021_01_08_425952 261 38 per per IN 10_1101-2021_01_08_425952 261 39 patients patient NNS 10_1101-2021_01_08_425952 261 40 ( ( -LRB- 10_1101-2021_01_08_425952 261 41 by by IN 10_1101-2021_01_08_425952 261 42 default default NN 10_1101-2021_01_08_425952 261 43 this this DT 10_1101-2021_01_08_425952 261 44 is be VBZ 10_1101-2021_01_08_425952 261 45 two two CD 10_1101-2021_01_08_425952 261 46 events event NNS 10_1101-2021_01_08_425952 261 47 ) ) -RRB- 10_1101-2021_01_08_425952 261 48 . . . 10_1101-2021_01_08_425952 262 1 The the DT 10_1101-2021_01_08_425952 262 2 following follow VBG 10_1101-2021_01_08_425952 262 3 example example NN 10_1101-2021_01_08_425952 262 4 presents present VBZ 10_1101-2021_01_08_425952 262 5 the the DT 10_1101-2021_01_08_425952 262 6 calculation calculation NN 10_1101-2021_01_08_425952 262 7 of of IN 10_1101-2021_01_08_425952 262 8 first first JJ 10_1101-2021_01_08_425952 262 9 prescription prescription NN 10_1101-2021_01_08_425952 262 10 events event NNS 10_1101-2021_01_08_425952 262 11 , , , 10_1101-2021_01_08_425952 262 12 the the DT 10_1101-2021_01_08_425952 262 13 assignment assignment NN 10_1101-2021_01_08_425952 262 14 of of IN 10_1101-2021_01_08_425952 262 15 gender gender NN 10_1101-2021_01_08_425952 262 16 and and CC 10_1101-2021_01_08_425952 262 17 the the DT 10_1101-2021_01_08_425952 262 18 calculation calculation NN 10_1101-2021_01_08_425952 262 19 of of IN 10_1101-2021_01_08_425952 262 20 .CC .CC , 10_1101-2021_01_08_425952 262 21 - - HYPH 10_1101-2021_01_08_425952 262 22 BY by IN 10_1101-2021_01_08_425952 262 23 - - HYPH 10_1101-2021_01_08_425952 262 24 ND ND NNP 10_1101-2021_01_08_425952 262 25 4.0 4.0 CD 10_1101-2021_01_08_425952 262 26 International international JJ 10_1101-2021_01_08_425952 262 27 licensemade licensemade NN 10_1101-2021_01_08_425952 262 28 available available JJ 10_1101-2021_01_08_425952 262 29 under under IN 10_1101-2021_01_08_425952 262 30 a a DT 10_1101-2021_01_08_425952 262 31 ( ( -LRB- 10_1101-2021_01_08_425952 262 32 which which WDT 10_1101-2021_01_08_425952 262 33 was be VBD 10_1101-2021_01_08_425952 262 34 not not RB 10_1101-2021_01_08_425952 262 35 certified certify VBN 10_1101-2021_01_08_425952 262 36 by by IN 10_1101-2021_01_08_425952 262 37 peer peer NN 10_1101-2021_01_08_425952 262 38 review review NN 10_1101-2021_01_08_425952 262 39 ) ) -RRB- 10_1101-2021_01_08_425952 262 40 is be VBZ 10_1101-2021_01_08_425952 262 41 the the DT 10_1101-2021_01_08_425952 262 42 author author NN 10_1101-2021_01_08_425952 262 43 / / SYM 10_1101-2021_01_08_425952 262 44 funder funder NN 10_1101-2021_01_08_425952 262 45 , , , 10_1101-2021_01_08_425952 262 46 who who WP 10_1101-2021_01_08_425952 262 47 has have VBZ 10_1101-2021_01_08_425952 262 48 granted grant VBN 10_1101-2021_01_08_425952 262 49 bioRxiv biorxiv IN 10_1101-2021_01_08_425952 262 50 a a DT 10_1101-2021_01_08_425952 262 51 license license NN 10_1101-2021_01_08_425952 262 52 to to TO 10_1101-2021_01_08_425952 262 53 display display VB 10_1101-2021_01_08_425952 262 54 the the DT 10_1101-2021_01_08_425952 262 55 preprint preprint NN 10_1101-2021_01_08_425952 262 56 in in IN 10_1101-2021_01_08_425952 262 57 perpetuity perpetuity NN 10_1101-2021_01_08_425952 262 58 . . . 10_1101-2021_01_08_425952 263 1 It -PRON- PRP 10_1101-2021_01_08_425952 263 2 is be VBZ 10_1101-2021_01_08_425952 263 3 The the DT 10_1101-2021_01_08_425952 263 4 copyright copyright NN 10_1101-2021_01_08_425952 263 5 holder holder NN 10_1101-2021_01_08_425952 263 6 for for IN 10_1101-2021_01_08_425952 263 7 this this DT 10_1101-2021_01_08_425952 263 8 preprintthis preprintthis NN 10_1101-2021_01_08_425952 263 9 version version NN 10_1101-2021_01_08_425952 263 10 posted post VBD 10_1101-2021_01_08_425952 263 11 January January NNP 10_1101-2021_01_08_425952 263 12 9 9 CD 10_1101-2021_01_08_425952 263 13 , , , 10_1101-2021_01_08_425952 263 14 2021 2021 CD 10_1101-2021_01_08_425952 263 15 . . . 10_1101-2021_01_08_425952 263 16 ; ; : 10_1101-2021_01_08_425952 263 17 https://doi.org/10.1101/2021.01.08.425952doi https://doi.org/10.1101/2021.01.08.425952doi ADD 10_1101-2021_01_08_425952 263 18 : : : 10_1101-2021_01_08_425952 263 19 bioRxiv biorxiv IN 10_1101-2021_01_08_425952 263 20 preprint preprint NN 10_1101-2021_01_08_425952 263 21 https://doi.org/10.1101/2021.01.08.425952 https://doi.org/10.1101/2021.01.08.425952 NN 10_1101-2021_01_08_425952 263 22 http://creativecommons.org/licenses/by-nd/4.0/ http://creativecommons.org/licenses/by-nd/4.0/ NN 10_1101-2021_01_08_425952 263 23 26 26 CD 10_1101-2021_01_08_425952 263 24 rdrugtrajectory rdrugtrajectory NN 10_1101-2021_01_08_425952 263 25 : : : 10_1101-2021_01_08_425952 263 26 Analysing Analysing NNP 10_1101-2021_01_08_425952 263 27 Drug Drug NNP 10_1101-2021_01_08_425952 263 28 Prescriptions Prescriptions NNPS 10_1101-2021_01_08_425952 263 29 in in IN 10_1101-2021_01_08_425952 263 30 Electronic Electronic NNP 10_1101-2021_01_08_425952 263 31 Health Health NNP 10_1101-2021_01_08_425952 263 32 Care Care NNP 10_1101-2021_01_08_425952 263 33 Records Records NNPS 10_1101-2021_01_08_425952 263 34 MCF MCF NNP 10_1101-2021_01_08_425952 263 35 of of IN 10_1101-2021_01_08_425952 263 36 prescription prescription NN 10_1101-2021_01_08_425952 263 37 ( ( -LRB- 10_1101-2021_01_08_425952 263 38 therapy therapy NNP 10_1101-2021_01_08_425952 263 39 dataframe dataframe NNP 10_1101-2021_01_08_425952 263 40 ) ) -RRB- 10_1101-2021_01_08_425952 263 41 burden burden NN 10_1101-2021_01_08_425952 263 42 of of IN 10_1101-2021_01_08_425952 263 43 amitriptyline amitriptyline NN 10_1101-2021_01_08_425952 263 44 and and CC 10_1101-2021_01_08_425952 263 45 propranolol propranolol NN 10_1101-2021_01_08_425952 263 46 : : : 10_1101-2021_01_08_425952 263 47 > > XX 10_1101-2021_01_08_425952 263 48 library(rdrugtrajectory library(rdrugtrajectory NN 10_1101-2021_01_08_425952 263 49 ) ) -RRB- 10_1101-2021_01_08_425952 263 50 > > XX 10_1101-2021_01_08_425952 263 51 fileLocation filelocation NN 10_1101-2021_01_08_425952 263 52 < < XX 10_1101-2021_01_08_425952 263 53 - - : 10_1101-2021_01_08_425952 263 54 " " `` 10_1101-2021_01_08_425952 263 55 product.txt product.txt NNP 10_1101-2021_01_08_425952 263 56 " " '' 10_1101-2021_01_08_425952 263 57 > > XX 10_1101-2021_01_08_425952 263 58 resultList resultList NNP 10_1101-2021_01_08_425952 263 59 < < NNP 10_1101-2021_01_08_425952 263 60 - - HYPH 10_1101-2021_01_08_425952 263 61 getFirstDrugPrescription(df getFirstDrugPrescription(df NNP 10_1101-2021_01_08_425952 263 62 = = SYM 10_1101-2021_01_08_425952 263 63 testTherapyDF testTherapyDF NNS 10_1101-2021_01_08_425952 263 64 , , , 10_1101-2021_01_08_425952 263 65 + + CC 10_1101-2021_01_08_425952 263 66 idList idList NNP 10_1101-2021_01_08_425952 263 67 = = SYM 10_1101-2021_01_08_425952 263 68 NULL NULL NNP 10_1101-2021_01_08_425952 263 69 , , , 10_1101-2021_01_08_425952 263 70 + + CC 10_1101-2021_01_08_425952 263 71 prodCodesVector prodcodesvector NN 10_1101-2021_01_08_425952 263 72 = = SYM 10_1101-2021_01_08_425952 263 73 NULL NULL NNP 10_1101-2021_01_08_425952 263 74 , , , 10_1101-2021_01_08_425952 263 75 + + CC 10_1101-2021_01_08_425952 263 76 descriptionFile descriptionfile NN 10_1101-2021_01_08_425952 263 77 = = SYM 10_1101-2021_01_08_425952 263 78 fileLocation filelocation NN 10_1101-2021_01_08_425952 263 79 ) ) -RRB- 10_1101-2021_01_08_425952 263 80 > > XX 10_1101-2021_01_08_425952 263 81 patidList patidlist NN 10_1101-2021_01_08_425952 263 82 < < XX 10_1101-2021_01_08_425952 263 83 - - HYPH 10_1101-2021_01_08_425952 263 84 resultList[[1 resultlist[[1 NN 10_1101-2021_01_08_425952 263 85 ] ] -RRB- 10_1101-2021_01_08_425952 263 86 ] ] -RRB- 10_1101-2021_01_08_425952 263 87 > > XX 10_1101-2021_01_08_425952 263 88 eventdateList eventdatelist XX 10_1101-2021_01_08_425952 263 89 < < XX 10_1101-2021_01_08_425952 263 90 - - HYPH 10_1101-2021_01_08_425952 263 91 resultList[[2 resultlist[[2 NN 10_1101-2021_01_08_425952 263 92 ] ] -RRB- 10_1101-2021_01_08_425952 263 93 ] ] -RRB- 10_1101-2021_01_08_425952 263 94 > > NN 10_1101-2021_01_08_425952 263 95 drugFrequencyDF drugFrequencyDF NNS 10_1101-2021_01_08_425952 263 96 < < XX 10_1101-2021_01_08_425952 263 97 - - HYPH 10_1101-2021_01_08_425952 263 98 resultList[[3 resultList[[3 NNP 10_1101-2021_01_08_425952 263 99 ] ] -RRB- 10_1101-2021_01_08_425952 263 100 ] ] -RRB- 10_1101-2021_01_08_425952 263 101 > > NN 10_1101-2021_01_08_425952 263 102 drugFrequencyDF drugFrequencyDF NNS 10_1101-2021_01_08_425952 263 103 < < XX 10_1101-2021_01_08_425952 263 104 - - HYPH 10_1101-2021_01_08_425952 263 105 drugFrequencyDF[order(drugFrequencyDF$Frequency drugFrequencyDF[order(drugFrequencyDF$Frequency NNP 10_1101-2021_01_08_425952 263 106 , , , 10_1101-2021_01_08_425952 263 107 + + CC 10_1101-2021_01_08_425952 263 108 decreasing decrease VBG 10_1101-2021_01_08_425952 263 109 = = -RRB- 10_1101-2021_01_08_425952 263 110 TRUE TRUE NNP 10_1101-2021_01_08_425952 263 111 ) ) -RRB- 10_1101-2021_01_08_425952 263 112 , , , 10_1101-2021_01_08_425952 263 113 ] ] -RRB- 10_1101-2021_01_08_425952 263 114 > > XX 10_1101-2021_01_08_425952 263 115 amitriptylinePatid amitriptylinePatid NNP 10_1101-2021_01_08_425952 263 116 < < XX 10_1101-2021_01_08_425952 263 117 - - HYPH 10_1101-2021_01_08_425952 263 118 patidList$`83 patidList$`83 NNP 10_1101-2021_01_08_425952 263 119 ` ` '' 10_1101-2021_01_08_425952 263 120 > > XX 10_1101-2021_01_08_425952 263 121 propranololPatid propranololPatid NNS 10_1101-2021_01_08_425952 263 122 < < XX 10_1101-2021_01_08_425952 263 123 - - HYPH 10_1101-2021_01_08_425952 263 124 patidList$`707 patidList$`707 NNP 10_1101-2021_01_08_425952 263 125 ` ` '' 10_1101-2021_01_08_425952 263 126 > > XX 10_1101-2021_01_08_425952 263 127 maleCode malecode FW 10_1101-2021_01_08_425952 263 128 < < XX 10_1101-2021_01_08_425952 263 129 - - HYPH 10_1101-2021_01_08_425952 263 130 1 1 CD 10_1101-2021_01_08_425952 263 131 > > XX 10_1101-2021_01_08_425952 263 132 malePatidsDF malePatidsDF NNP 10_1101-2021_01_08_425952 263 133 < < XX 10_1101-2021_01_08_425952 263 134 - - HYPH 10_1101-2021_01_08_425952 263 135 getGenderOfPatients(idList getGenderOfPatients(idList NNP 10_1101-2021_01_08_425952 263 136 = = SYM 10_1101-2021_01_08_425952 263 137 getUniquePatidList(testTherapyDF getuniquepatidlist(testtherapydf NN 10_1101-2021_01_08_425952 263 138 ) ) -RRB- 10_1101-2021_01_08_425952 263 139 , , , 10_1101-2021_01_08_425952 263 140 + + CC 10_1101-2021_01_08_425952 263 141 genderDF genderdf NN 10_1101-2021_01_08_425952 263 142 = = SYM 10_1101-2021_01_08_425952 263 143 ageGenderDF agegenderdf XX 10_1101-2021_01_08_425952 263 144 , , , 10_1101-2021_01_08_425952 263 145 + + CC 10_1101-2021_01_08_425952 263 146 genderCodeVector genderCodeVector NNP 10_1101-2021_01_08_425952 263 147 = = SYM 10_1101-2021_01_08_425952 263 148 maleCode malecode FW 10_1101-2021_01_08_425952 263 149 ) ) -RRB- 10_1101-2021_01_08_425952 263 150 > > NFP 10_1101-2021_01_08_425952 263 151 amitriptylineMalePatids amitriptylineMalePatids NNP 10_1101-2021_01_08_425952 263 152 < < XX 10_1101-2021_01_08_425952 263 153 - - HYPH 10_1101-2021_01_08_425952 263 154 subset(amitriptylinePatid subset(amitriptylinePatid NNP 10_1101-2021_01_08_425952 263 155 , , , 10_1101-2021_01_08_425952 263 156 + + CC 10_1101-2021_01_08_425952 263 157 amitriptylinePatid amitriptylinepatid JJ 10_1101-2021_01_08_425952 263 158 % % NN 10_1101-2021_01_08_425952 263 159 in% in% CD 10_1101-2021_01_08_425952 263 160 malePatidsDF$patid malepatidsdf$patid NN 10_1101-2021_01_08_425952 263 161 ) ) -RRB- 10_1101-2021_01_08_425952 263 162 > > XX 10_1101-2021_01_08_425952 263 163 propranololMalePatids propranololMalePatids NNP 10_1101-2021_01_08_425952 263 164 < < NNP 10_1101-2021_01_08_425952 263 165 - - HYPH 10_1101-2021_01_08_425952 263 166 subset(propranololPatid subset(propranololPatid NNP 10_1101-2021_01_08_425952 263 167 , , , 10_1101-2021_01_08_425952 263 168 + + CC 10_1101-2021_01_08_425952 263 169 propranololPatid propranololpatid JJ 10_1101-2021_01_08_425952 263 170 % % NN 10_1101-2021_01_08_425952 263 171 in% in% CD 10_1101-2021_01_08_425952 263 172 malePatidsDF$patid malepatidsdf$patid NN 10_1101-2021_01_08_425952 263 173 ) ) -RRB- 10_1101-2021_01_08_425952 263 174 > > XX 10_1101-2021_01_08_425952 263 175 amiMaleTherapyDF amimaletherapydf XX 10_1101-2021_01_08_425952 263 176 < < XX 10_1101-2021_01_08_425952 263 177 - - HYPH 10_1101-2021_01_08_425952 263 178 subset(testTherapyDF subset(testTherapyDF NNP 10_1101-2021_01_08_425952 263 179 , , , 10_1101-2021_01_08_425952 263 180 + + CC 10_1101-2021_01_08_425952 263 181 testTherapyDF$patid testtherapydf$patid NN 10_1101-2021_01_08_425952 263 182 % % NN 10_1101-2021_01_08_425952 263 183 in% in% VBP 10_1101-2021_01_08_425952 263 184 amitriptylineMalePatids amitriptylineMalePatids NNP 10_1101-2021_01_08_425952 263 185 ) ) -RRB- 10_1101-2021_01_08_425952 263 186 > > XX 10_1101-2021_01_08_425952 263 187 propMaleTherapyDF propmaletherapydf XX 10_1101-2021_01_08_425952 263 188 < < XX 10_1101-2021_01_08_425952 263 189 - - HYPH 10_1101-2021_01_08_425952 263 190 subset(testTherapyDF subset(testTherapyDF NNP 10_1101-2021_01_08_425952 263 191 , , , 10_1101-2021_01_08_425952 263 192 + + CC 10_1101-2021_01_08_425952 263 193 testTherapyDF$patid testtherapydf$patid NN 10_1101-2021_01_08_425952 263 194 % % NN 10_1101-2021_01_08_425952 263 195 in% in% VBP 10_1101-2021_01_08_425952 263 196 propranololMalePatids propranololMalePatids NNP 10_1101-2021_01_08_425952 263 197 ) ) -RRB- 10_1101-2021_01_08_425952 263 198 > > XX 10_1101-2021_01_08_425952 263 199 amiMaleMCFDF amiMaleMCFDF NNP 10_1101-2021_01_08_425952 263 200 < < XX 10_1101-2021_01_08_425952 263 201 - - HYPH 10_1101-2021_01_08_425952 263 202 generateMCFOneGroup(therapyDF generateMCFOneGroup(therapyDF NNP 10_1101-2021_01_08_425952 263 203 = = SYM 10_1101-2021_01_08_425952 263 204 amiMaleTherapyDF amimaletherapydf XX 10_1101-2021_01_08_425952 263 205 , , , 10_1101-2021_01_08_425952 263 206 + + CC 10_1101-2021_01_08_425952 263 207 startDateCharVector startdatecharvector NN 10_1101-2021_01_08_425952 263 208 = = SYM 10_1101-2021_01_08_425952 263 209 " " `` 10_1101-2021_01_08_425952 263 210 2000 2000 CD 10_1101-2021_01_08_425952 263 211 - - HYPH 10_1101-2021_01_08_425952 263 212 01 01 CD 10_1101-2021_01_08_425952 263 213 - - HYPH 10_1101-2021_01_08_425952 263 214 01 01 CD 10_1101-2021_01_08_425952 263 215 " " '' 10_1101-2021_01_08_425952 263 216 , , , 10_1101-2021_01_08_425952 263 217 + + SYM 10_1101-2021_01_08_425952 263 218 minRecords minrecord NNS 10_1101-2021_01_08_425952 263 219 = = SYM 10_1101-2021_01_08_425952 263 220 2 2 CD 10_1101-2021_01_08_425952 263 221 ) ) -RRB- 10_1101-2021_01_08_425952 263 222 > > NFP 10_1101-2021_01_08_425952 263 223 propMaleMCFDF propMaleMCFDF NNP 10_1101-2021_01_08_425952 263 224 < < XX 10_1101-2021_01_08_425952 263 225 - - HYPH 10_1101-2021_01_08_425952 263 226 generateMCFOneGroup(therapyDF generateMCFOneGroup(therapyDF NNS 10_1101-2021_01_08_425952 263 227 = = SYM 10_1101-2021_01_08_425952 263 228 propMaleTherapyDF propMaleTherapyDF NNS 10_1101-2021_01_08_425952 263 229 , , , 10_1101-2021_01_08_425952 263 230 + + CC 10_1101-2021_01_08_425952 263 231 startDateCharVector startdatecharvector NN 10_1101-2021_01_08_425952 263 232 = = SYM 10_1101-2021_01_08_425952 263 233 " " `` 10_1101-2021_01_08_425952 263 234 2000 2000 CD 10_1101-2021_01_08_425952 263 235 - - HYPH 10_1101-2021_01_08_425952 263 236 01 01 CD 10_1101-2021_01_08_425952 263 237 - - HYPH 10_1101-2021_01_08_425952 263 238 01 01 CD 10_1101-2021_01_08_425952 263 239 " " '' 10_1101-2021_01_08_425952 263 240 , , , 10_1101-2021_01_08_425952 263 241 + + SYM 10_1101-2021_01_08_425952 263 242 minRecords minrecord NNS 10_1101-2021_01_08_425952 263 243 = = SYM 10_1101-2021_01_08_425952 263 244 2 2 LS 10_1101-2021_01_08_425952 263 245 ) ) -RRB- 10_1101-2021_01_08_425952 263 246 > > XX 10_1101-2021_01_08_425952 263 247 amiMaleMCFDF amiMaleMCFDF NNP 10_1101-2021_01_08_425952 263 248 < < NNP 10_1101-2021_01_08_425952 263 249 - - HYPH 10_1101-2021_01_08_425952 263 250 cbind(amiMaleMCFDF cbind(amiMaleMCFDF NNP 10_1101-2021_01_08_425952 263 251 , , , 10_1101-2021_01_08_425952 263 252 Drug drug NN 10_1101-2021_01_08_425952 263 253 = = NFP 10_1101-2021_01_08_425952 263 254 " " `` 10_1101-2021_01_08_425952 263 255 Amitriptyline Amitriptyline NNP 10_1101-2021_01_08_425952 263 256 " " '' 10_1101-2021_01_08_425952 263 257 ) ) -RRB- 10_1101-2021_01_08_425952 263 258 > > XX 10_1101-2021_01_08_425952 263 259 propMaleMCFDF propMaleMCFDF NNP 10_1101-2021_01_08_425952 263 260 < < XX 10_1101-2021_01_08_425952 263 261 - - HYPH 10_1101-2021_01_08_425952 263 262 cbind(propMaleMCFDF cbind(propMaleMCFDF NNP 10_1101-2021_01_08_425952 263 263 , , , 10_1101-2021_01_08_425952 263 264 Drug drug NN 10_1101-2021_01_08_425952 263 265 = = NFP 10_1101-2021_01_08_425952 263 266 " " `` 10_1101-2021_01_08_425952 263 267 Propranolol Propranolol NNP 10_1101-2021_01_08_425952 263 268 " " '' 10_1101-2021_01_08_425952 263 269 ) ) -RRB- 10_1101-2021_01_08_425952 263 270 > > XX 10_1101-2021_01_08_425952 263 271 drugMCFDF drugMCFDF NNP 10_1101-2021_01_08_425952 263 272 < < XX 10_1101-2021_01_08_425952 263 273 - - HYPH 10_1101-2021_01_08_425952 263 274 rbind(amiMaleMCFDF rbind(amiMaleMCFDF NNP 10_1101-2021_01_08_425952 263 275 , , , 10_1101-2021_01_08_425952 263 276 propMaleMCFDF propMaleMCFDF NNP 10_1101-2021_01_08_425952 263 277 ) ) -RRB- 10_1101-2021_01_08_425952 263 278 > > NFP 10_1101-2021_01_08_425952 263 279 resultMCF resultMCF NNP 10_1101-2021_01_08_425952 263 280 < < XX 10_1101-2021_01_08_425952 263 281 - - HYPH 10_1101-2021_01_08_425952 263 282 reda::mcf(reda::Recur(week reda::mcf(reda::Recur(week NNP 10_1101-2021_01_08_425952 263 283 , , , 10_1101-2021_01_08_425952 263 284 i -PRON- PRP 10_1101-2021_01_08_425952 263 285 d d VBN 10_1101-2021_01_08_425952 263 286 , , , 10_1101-2021_01_08_425952 263 287 No no UH 10_1101-2021_01_08_425952 263 288 . . . 10_1101-2021_01_08_425952 263 289 ) ) -RRB- 10_1101-2021_01_08_425952 264 1 ~ ~ NFP 10_1101-2021_01_08_425952 264 2 Drug drug NN 10_1101-2021_01_08_425952 264 3 , , , 10_1101-2021_01_08_425952 264 4 data datum NNS 10_1101-2021_01_08_425952 264 5 = = SYM 10_1101-2021_01_08_425952 264 6 drugMCFDF drugMCFDF . 10_1101-2021_01_08_425952 264 7 ) ) -RRB- 10_1101-2021_01_08_425952 264 8 > > XX 10_1101-2021_01_08_425952 264 9 mcfPlot mcfPlot NNP 10_1101-2021_01_08_425952 264 10 < < XX 10_1101-2021_01_08_425952 264 11 - - HYPH 10_1101-2021_01_08_425952 264 12 reda::plot(resultMCF reda::plot(resultMCF NNP 10_1101-2021_01_08_425952 264 13 , , , 10_1101-2021_01_08_425952 264 14 conf.int conf.int NNP 10_1101-2021_01_08_425952 264 15 = = NFP 10_1101-2021_01_08_425952 264 16 TRUE TRUE NNP 10_1101-2021_01_08_425952 264 17 ) ) -RRB- 10_1101-2021_01_08_425952 264 18 + + CC 10_1101-2021_01_08_425952 264 19 + + SYM 10_1101-2021_01_08_425952 264 20 ggplot2::xlab("Weeks ggplot2::xlab("weeks NN 10_1101-2021_01_08_425952 264 21 " " '' 10_1101-2021_01_08_425952 264 22 ) ) -RRB- 10_1101-2021_01_08_425952 264 23 + + CC 10_1101-2021_01_08_425952 264 24 ggplot2::theme_bw ggplot2::theme_bw NNS 10_1101-2021_01_08_425952 264 25 ( ( -LRB- 10_1101-2021_01_08_425952 264 26 ) ) -RRB- 10_1101-2021_01_08_425952 264 27 + + NFP 10_1101-2021_01_08_425952 264 28 ggplot2::ggtitle ggplot2::ggtitle NNP 10_1101-2021_01_08_425952 264 29 ( ( -LRB- 10_1101-2021_01_08_425952 264 30 " " `` 10_1101-2021_01_08_425952 264 31 " " `` 10_1101-2021_01_08_425952 264 32 ) ) -RRB- 10_1101-2021_01_08_425952 264 33 getFirstDrugIncidenceRate getFirstDrugIncidenceRate NFP 10_1101-2021_01_08_425952 264 34 Prescription prescription NN 10_1101-2021_01_08_425952 264 35 incidence incidence NN 10_1101-2021_01_08_425952 264 36 be be VB 10_1101-2021_01_08_425952 264 37 calculated calculate VBN 10_1101-2021_01_08_425952 264 38 with with IN 10_1101-2021_01_08_425952 264 39 getFirstDrugIncidenceRate getfirstdrugincidencerate CD 10_1101-2021_01_08_425952 264 40 . . . 10_1101-2021_01_08_425952 265 1 The the DT 10_1101-2021_01_08_425952 265 2 following follow VBG 10_1101-2021_01_08_425952 265 3 code code NN 10_1101-2021_01_08_425952 265 4 demonstrates demonstrate VBZ 10_1101-2021_01_08_425952 265 5 how how WRB 10_1101-2021_01_08_425952 265 6 to to TO 10_1101-2021_01_08_425952 265 7 use use VB 10_1101-2021_01_08_425952 265 8 a a DT 10_1101-2021_01_08_425952 265 9 FirstDrugObject firstdrugobject NN 10_1101-2021_01_08_425952 265 10 to to TO 10_1101-2021_01_08_425952 265 11 calculate calculate VB 10_1101-2021_01_08_425952 265 12 incidence incidence NN 10_1101-2021_01_08_425952 265 13 rates rate NNS 10_1101-2021_01_08_425952 265 14 for for IN 10_1101-2021_01_08_425952 265 15 a a DT 10_1101-2021_01_08_425952 265 16 set set NN 10_1101-2021_01_08_425952 265 17 of of IN 10_1101-2021_01_08_425952 265 18 prodcodes prodcode NNS 10_1101-2021_01_08_425952 265 19 . . . 10_1101-2021_01_08_425952 266 1 The the DT 10_1101-2021_01_08_425952 266 2 study study NN 10_1101-2021_01_08_425952 266 3 observation observation NN 10_1101-2021_01_08_425952 266 4 starts start VBZ 10_1101-2021_01_08_425952 266 5 from from IN 10_1101-2021_01_08_425952 266 6 the the DT 10_1101-2021_01_08_425952 266 7 enrollmentDate enrollmentDate NNP 10_1101-2021_01_08_425952 266 8 and and CC 10_1101-2021_01_08_425952 266 9 ends end VBZ 10_1101-2021_01_08_425952 266 10 at at IN 10_1101-2021_01_08_425952 266 11 the the DT 10_1101-2021_01_08_425952 266 12 studyEndDate studyenddate XX 10_1101-2021_01_08_425952 266 13 : : : 10_1101-2021_01_08_425952 266 14 > > XX 10_1101-2021_01_08_425952 266 15 library(rdrugtrajectory library(rdrugtrajectory NNP 10_1101-2021_01_08_425952 266 16 ) ) -RRB- 10_1101-2021_01_08_425952 266 17 .CC .CC : 10_1101-2021_01_08_425952 266 18 - - : 10_1101-2021_01_08_425952 266 19 BY by IN 10_1101-2021_01_08_425952 266 20 - - HYPH 10_1101-2021_01_08_425952 266 21 ND ND NNP 10_1101-2021_01_08_425952 266 22 4.0 4.0 CD 10_1101-2021_01_08_425952 266 23 International international JJ 10_1101-2021_01_08_425952 266 24 licensemade licensemade NN 10_1101-2021_01_08_425952 266 25 available available JJ 10_1101-2021_01_08_425952 266 26 under under IN 10_1101-2021_01_08_425952 266 27 a a DT 10_1101-2021_01_08_425952 266 28 ( ( -LRB- 10_1101-2021_01_08_425952 266 29 which which WDT 10_1101-2021_01_08_425952 266 30 was be VBD 10_1101-2021_01_08_425952 266 31 not not RB 10_1101-2021_01_08_425952 266 32 certified certify VBN 10_1101-2021_01_08_425952 266 33 by by IN 10_1101-2021_01_08_425952 266 34 peer peer NN 10_1101-2021_01_08_425952 266 35 review review NN 10_1101-2021_01_08_425952 266 36 ) ) -RRB- 10_1101-2021_01_08_425952 266 37 is be VBZ 10_1101-2021_01_08_425952 266 38 the the DT 10_1101-2021_01_08_425952 266 39 author author NN 10_1101-2021_01_08_425952 266 40 / / SYM 10_1101-2021_01_08_425952 266 41 funder funder NN 10_1101-2021_01_08_425952 266 42 , , , 10_1101-2021_01_08_425952 266 43 who who WP 10_1101-2021_01_08_425952 266 44 has have VBZ 10_1101-2021_01_08_425952 266 45 granted grant VBN 10_1101-2021_01_08_425952 266 46 bioRxiv biorxiv IN 10_1101-2021_01_08_425952 266 47 a a DT 10_1101-2021_01_08_425952 266 48 license license NN 10_1101-2021_01_08_425952 266 49 to to TO 10_1101-2021_01_08_425952 266 50 display display VB 10_1101-2021_01_08_425952 266 51 the the DT 10_1101-2021_01_08_425952 266 52 preprint preprint NN 10_1101-2021_01_08_425952 266 53 in in IN 10_1101-2021_01_08_425952 266 54 perpetuity perpetuity NN 10_1101-2021_01_08_425952 266 55 . . . 10_1101-2021_01_08_425952 267 1 It -PRON- PRP 10_1101-2021_01_08_425952 267 2 is be VBZ 10_1101-2021_01_08_425952 267 3 The the DT 10_1101-2021_01_08_425952 267 4 copyright copyright NN 10_1101-2021_01_08_425952 267 5 holder holder NN 10_1101-2021_01_08_425952 267 6 for for IN 10_1101-2021_01_08_425952 267 7 this this DT 10_1101-2021_01_08_425952 267 8 preprintthis preprintthis NN 10_1101-2021_01_08_425952 267 9 version version NN 10_1101-2021_01_08_425952 267 10 posted post VBD 10_1101-2021_01_08_425952 267 11 January January NNP 10_1101-2021_01_08_425952 267 12 9 9 CD 10_1101-2021_01_08_425952 267 13 , , , 10_1101-2021_01_08_425952 267 14 2021 2021 CD 10_1101-2021_01_08_425952 267 15 . . . 10_1101-2021_01_08_425952 267 16 ; ; : 10_1101-2021_01_08_425952 267 17 https://doi.org/10.1101/2021.01.08.425952doi https://doi.org/10.1101/2021.01.08.425952doi ADD 10_1101-2021_01_08_425952 267 18 : : : 10_1101-2021_01_08_425952 267 19 bioRxiv biorxiv IN 10_1101-2021_01_08_425952 267 20 preprint preprint NN 10_1101-2021_01_08_425952 267 21 https://doi.org/10.1101/2021.01.08.425952 https://doi.org/10.1101/2021.01.08.425952 XX 10_1101-2021_01_08_425952 267 22 http://creativecommons.org/licenses/by-nd/4.0/ http://creativecommons.org/licenses/by-nd/4.0/ NNP 10_1101-2021_01_08_425952 267 23 Journal Journal NNP 10_1101-2021_01_08_425952 267 24 of of IN 10_1101-2021_01_08_425952 267 25 Statistical Statistical NNP 10_1101-2021_01_08_425952 267 26 Software Software NNP 10_1101-2021_01_08_425952 267 27 27 27 CD 10_1101-2021_01_08_425952 267 28 0 0 CD 10_1101-2021_01_08_425952 267 29 100 100 CD 10_1101-2021_01_08_425952 267 30 200 200 CD 10_1101-2021_01_08_425952 267 31 300 300 CD 10_1101-2021_01_08_425952 267 32 0 0 CD 10_1101-2021_01_08_425952 267 33 250 250 CD 10_1101-2021_01_08_425952 267 34 500 500 CD 10_1101-2021_01_08_425952 267 35 750 750 CD 10_1101-2021_01_08_425952 267 36 Weeks Weeks NNP 10_1101-2021_01_08_425952 267 37 M M NNP 10_1101-2021_01_08_425952 267 38 C C NNP 10_1101-2021_01_08_425952 267 39 F F NNP 10_1101-2021_01_08_425952 267 40 E E NNP 10_1101-2021_01_08_425952 267 41 st st NNP 10_1101-2021_01_08_425952 267 42 i -PRON- PRP 10_1101-2021_01_08_425952 267 43 m be VBP 10_1101-2021_01_08_425952 267 44 a a DT 10_1101-2021_01_08_425952 267 45 te te NNP 10_1101-2021_01_08_425952 267 46 s s NNP 10_1101-2021_01_08_425952 267 47 Drug Drug NNP 10_1101-2021_01_08_425952 267 48 Amitriptyline Amitriptyline NNP 10_1101-2021_01_08_425952 267 49 Propranolol Propranolol NNP 10_1101-2021_01_08_425952 267 50 Figure Figure NNP 10_1101-2021_01_08_425952 267 51 8 8 CD 10_1101-2021_01_08_425952 267 52 : : : 10_1101-2021_01_08_425952 267 53 MCF MCF NNP 10_1101-2021_01_08_425952 267 54 of of IN 10_1101-2021_01_08_425952 267 55 drug drug NN 10_1101-2021_01_08_425952 267 56 prescriptions prescription NNS 10_1101-2021_01_08_425952 267 57 of of IN 10_1101-2021_01_08_425952 267 58 patients patient NNS 10_1101-2021_01_08_425952 267 59 with with IN 10_1101-2021_01_08_425952 267 60 a a DT 10_1101-2021_01_08_425952 267 61 first first JJ 10_1101-2021_01_08_425952 267 62 drug drug NN 10_1101-2021_01_08_425952 267 63 prescription prescription NN 10_1101-2021_01_08_425952 267 64 for for IN 10_1101-2021_01_08_425952 267 65 either either DT 10_1101-2021_01_08_425952 267 66 amitriptyline amitriptyline NN 10_1101-2021_01_08_425952 267 67 or or CC 10_1101-2021_01_08_425952 267 68 propranolol propranolol NN 10_1101-2021_01_08_425952 267 69 , , , 10_1101-2021_01_08_425952 267 70 stratified stratify VBN 10_1101-2021_01_08_425952 267 71 by by IN 10_1101-2021_01_08_425952 267 72 gender gender NN 10_1101-2021_01_08_425952 267 73 . . . 10_1101-2021_01_08_425952 268 1 The the DT 10_1101-2021_01_08_425952 268 2 dotted dotted JJ 10_1101-2021_01_08_425952 268 3 lines line NNS 10_1101-2021_01_08_425952 268 4 indicate indicate VBP 10_1101-2021_01_08_425952 268 5 a a DT 10_1101-2021_01_08_425952 268 6 95 95 CD 10_1101-2021_01_08_425952 268 7 % % NN 10_1101-2021_01_08_425952 268 8 confidence confidence NN 10_1101-2021_01_08_425952 268 9 interval interval NN 10_1101-2021_01_08_425952 268 10 . . . 10_1101-2021_01_08_425952 269 1 > > XX 10_1101-2021_01_08_425952 269 2 fileLocation fileLocation NNP 10_1101-2021_01_08_425952 269 3 < < XX 10_1101-2021_01_08_425952 269 4 - - : 10_1101-2021_01_08_425952 269 5 " " `` 10_1101-2021_01_08_425952 269 6 product.txt product.txt NNP 10_1101-2021_01_08_425952 269 7 " " '' 10_1101-2021_01_08_425952 269 8 > > XX 10_1101-2021_01_08_425952 269 9 drugList druglist XX 10_1101-2021_01_08_425952 269 10 < < XX 10_1101-2021_01_08_425952 269 11 - - HYPH 10_1101-2021_01_08_425952 269 12 unique(testTherapyDF$prodcode unique(testTherapyDF$prodcode NNP 10_1101-2021_01_08_425952 269 13 ) ) -RRB- 10_1101-2021_01_08_425952 269 14 > > XX 10_1101-2021_01_08_425952 269 15 requiredProds requiredprod NNS 10_1101-2021_01_08_425952 269 16 < < XX 10_1101-2021_01_08_425952 269 17 - - HYPH 10_1101-2021_01_08_425952 269 18 drugList[1:10 drugList[1:10 NNP 10_1101-2021_01_08_425952 269 19 ] ] -RRB- 10_1101-2021_01_08_425952 269 20 > > NFP 10_1101-2021_01_08_425952 269 21 firstDrugObject firstDrugObject NNP 10_1101-2021_01_08_425952 269 22 < < XX 10_1101-2021_01_08_425952 269 23 - - HYPH 10_1101-2021_01_08_425952 269 24 getFirstDrugPrescription(df getFirstDrugPrescription(df NNP 10_1101-2021_01_08_425952 269 25 = = SYM 10_1101-2021_01_08_425952 269 26 testTherapyDF testTherapyDF NNS 10_1101-2021_01_08_425952 269 27 , , , 10_1101-2021_01_08_425952 269 28 + + CC 10_1101-2021_01_08_425952 269 29 idList idList NNP 10_1101-2021_01_08_425952 269 30 = = SYM 10_1101-2021_01_08_425952 269 31 NULL NULL NNP 10_1101-2021_01_08_425952 269 32 , , , 10_1101-2021_01_08_425952 269 33 + + CC 10_1101-2021_01_08_425952 269 34 prodCodesVector prodcodesvector NN 10_1101-2021_01_08_425952 269 35 = = SYM 10_1101-2021_01_08_425952 269 36 requiredProds requiredprod NNS 10_1101-2021_01_08_425952 269 37 , , , 10_1101-2021_01_08_425952 269 38 + + CC 10_1101-2021_01_08_425952 269 39 descriptionFile descriptionfile NN 10_1101-2021_01_08_425952 269 40 = = SYM 10_1101-2021_01_08_425952 269 41 fileLocation filelocation NN 10_1101-2021_01_08_425952 269 42 ) ) -RRB- 10_1101-2021_01_08_425952 269 43 > > NFP 10_1101-2021_01_08_425952 269 44 medhistoryDF medhistoryDF NNP 10_1101-2021_01_08_425952 269 45 < < XX 10_1101-2021_01_08_425952 269 46 - - HYPH 10_1101-2021_01_08_425952 269 47 constructMedicalHistory(testClinicalDF constructMedicalHistory(testClinicalDF NNP 10_1101-2021_01_08_425952 269 48 , , , 10_1101-2021_01_08_425952 269 49 NULL NULL NNP 10_1101-2021_01_08_425952 269 50 , , , 10_1101-2021_01_08_425952 269 51 testTherapyDF testTherapyDF NNP 10_1101-2021_01_08_425952 269 52 ) ) -RRB- 10_1101-2021_01_08_425952 269 53 > > XX 10_1101-2021_01_08_425952 269 54 patidList patidlist NN 10_1101-2021_01_08_425952 269 55 < < XX 10_1101-2021_01_08_425952 269 56 - - HYPH 10_1101-2021_01_08_425952 269 57 unlist(firstDrugObject$patidList unlist(firstdrugobject$patidlist NN 10_1101-2021_01_08_425952 269 58 ) ) -RRB- 10_1101-2021_01_08_425952 269 59 > > XX 10_1101-2021_01_08_425952 269 60 resultMatrix resultMatrix NNP 10_1101-2021_01_08_425952 269 61 < < XX 10_1101-2021_01_08_425952 269 62 - - HYPH 10_1101-2021_01_08_425952 269 63 getFirstDrugIncidenceRate(firstDrugObject getFirstDrugIncidenceRate(firstDrugObject NNP 10_1101-2021_01_08_425952 269 64 = = NFP 10_1101-2021_01_08_425952 269 65 firstDrugObject firstDrugObject NNP 10_1101-2021_01_08_425952 269 66 , , , 10_1101-2021_01_08_425952 269 67 + + SYM 10_1101-2021_01_08_425952 269 68 medHistoryDF medHistoryDF NNS 10_1101-2021_01_08_425952 269 69 = = SYM 10_1101-2021_01_08_425952 269 70 medhistoryDF medhistoryDF NNP 10_1101-2021_01_08_425952 269 71 , , , 10_1101-2021_01_08_425952 269 72 + + CC 10_1101-2021_01_08_425952 269 73 enrollmentDate enrollmentDate NNP 10_1101-2021_01_08_425952 269 74 = = SYM 10_1101-2021_01_08_425952 269 75 as as IN 10_1101-2021_01_08_425952 269 76 . . . 10_1101-2021_01_08_425952 269 77 Date("2000 Date("2000 NNP 10_1101-2021_01_08_425952 269 78 - - HYPH 10_1101-2021_01_08_425952 269 79 01 01 CD 10_1101-2021_01_08_425952 269 80 - - HYPH 10_1101-2021_01_08_425952 269 81 01 01 CD 10_1101-2021_01_08_425952 269 82 " " '' 10_1101-2021_01_08_425952 269 83 ) ) -RRB- 10_1101-2021_01_08_425952 269 84 , , , 10_1101-2021_01_08_425952 269 85 + + NFP 10_1101-2021_01_08_425952 269 86 studyEndDate studyenddate XX 10_1101-2021_01_08_425952 269 87 = = NFP 10_1101-2021_01_08_425952 269 88 as as IN 10_1101-2021_01_08_425952 269 89 . . . 10_1101-2021_01_08_425952 269 90 Date("2016 Date("2016 NNP 10_1101-2021_01_08_425952 269 91 - - HYPH 10_1101-2021_01_08_425952 269 92 12 12 CD 10_1101-2021_01_08_425952 269 93 - - SYM 10_1101-2021_01_08_425952 269 94 31 31 CD 10_1101-2021_01_08_425952 269 95 " " '' 10_1101-2021_01_08_425952 269 96 ) ) -RRB- 10_1101-2021_01_08_425952 269 97 ) ) -RRB- 10_1101-2021_01_08_425952 269 98 > > NFP 10_1101-2021_01_08_425952 269 99 incidenceDF incidenceDF NNP 10_1101-2021_01_08_425952 269 100 < < XX 10_1101-2021_01_08_425952 269 101 - - HYPH 10_1101-2021_01_08_425952 269 102 as.data.frame(t(resultMatrix as.data.frame(t(resultMatrix NNP 10_1101-2021_01_08_425952 269 103 ) ) -RRB- 10_1101-2021_01_08_425952 269 104 , , , 10_1101-2021_01_08_425952 269 105 stringsAsFactors stringsasfactor VBZ 10_1101-2021_01_08_425952 269 106 = = SYM 10_1101-2021_01_08_425952 269 107 TRUE TRUE NNP 10_1101-2021_01_08_425952 269 108 ) ) -RRB- 10_1101-2021_01_08_425952 269 109 The the DT 10_1101-2021_01_08_425952 269 110 above above JJ 10_1101-2021_01_08_425952 269 111 example example NN 10_1101-2021_01_08_425952 269 112 returns return VBZ 10_1101-2021_01_08_425952 269 113 an an DT 10_1101-2021_01_08_425952 269 114 incidence incidence NN 10_1101-2021_01_08_425952 269 115 rate rate NN 10_1101-2021_01_08_425952 269 116 of of IN 10_1101-2021_01_08_425952 269 117 0.11 0.11 CD 10_1101-2021_01_08_425952 269 118 per per IN 10_1101-2021_01_08_425952 269 119 17 17 CD 10_1101-2021_01_08_425952 269 120 person person NN 10_1101-2021_01_08_425952 269 121 years year NNS 10_1101-2021_01_08_425952 269 122 over over IN 10_1101-2021_01_08_425952 269 123 a a DT 10_1101-2021_01_08_425952 269 124 cohort cohort NN 10_1101-2021_01_08_425952 269 125 of of IN 10_1101-2021_01_08_425952 269 126 .CC .CC NFP 10_1101-2021_01_08_425952 269 127 - - HYPH 10_1101-2021_01_08_425952 269 128 BY by IN 10_1101-2021_01_08_425952 269 129 - - HYPH 10_1101-2021_01_08_425952 269 130 ND ND NNP 10_1101-2021_01_08_425952 269 131 4.0 4.0 CD 10_1101-2021_01_08_425952 269 132 International international JJ 10_1101-2021_01_08_425952 269 133 licensemade licensemade NN 10_1101-2021_01_08_425952 269 134 available available JJ 10_1101-2021_01_08_425952 269 135 under under IN 10_1101-2021_01_08_425952 269 136 a a DT 10_1101-2021_01_08_425952 269 137 ( ( -LRB- 10_1101-2021_01_08_425952 269 138 which which WDT 10_1101-2021_01_08_425952 269 139 was be VBD 10_1101-2021_01_08_425952 269 140 not not RB 10_1101-2021_01_08_425952 269 141 certified certify VBN 10_1101-2021_01_08_425952 269 142 by by IN 10_1101-2021_01_08_425952 269 143 peer peer NN 10_1101-2021_01_08_425952 269 144 review review NN 10_1101-2021_01_08_425952 269 145 ) ) -RRB- 10_1101-2021_01_08_425952 269 146 is be VBZ 10_1101-2021_01_08_425952 269 147 the the DT 10_1101-2021_01_08_425952 269 148 author author NN 10_1101-2021_01_08_425952 269 149 / / SYM 10_1101-2021_01_08_425952 269 150 funder funder NN 10_1101-2021_01_08_425952 269 151 , , , 10_1101-2021_01_08_425952 269 152 who who WP 10_1101-2021_01_08_425952 269 153 has have VBZ 10_1101-2021_01_08_425952 269 154 granted grant VBN 10_1101-2021_01_08_425952 269 155 bioRxiv biorxiv IN 10_1101-2021_01_08_425952 269 156 a a DT 10_1101-2021_01_08_425952 269 157 license license NN 10_1101-2021_01_08_425952 269 158 to to TO 10_1101-2021_01_08_425952 269 159 display display VB 10_1101-2021_01_08_425952 269 160 the the DT 10_1101-2021_01_08_425952 269 161 preprint preprint NN 10_1101-2021_01_08_425952 269 162 in in IN 10_1101-2021_01_08_425952 269 163 perpetuity perpetuity NN 10_1101-2021_01_08_425952 269 164 . . . 10_1101-2021_01_08_425952 270 1 It -PRON- PRP 10_1101-2021_01_08_425952 270 2 is be VBZ 10_1101-2021_01_08_425952 270 3 The the DT 10_1101-2021_01_08_425952 270 4 copyright copyright NN 10_1101-2021_01_08_425952 270 5 holder holder NN 10_1101-2021_01_08_425952 270 6 for for IN 10_1101-2021_01_08_425952 270 7 this this DT 10_1101-2021_01_08_425952 270 8 preprintthis preprintthis NN 10_1101-2021_01_08_425952 270 9 version version NN 10_1101-2021_01_08_425952 270 10 posted post VBD 10_1101-2021_01_08_425952 270 11 January January NNP 10_1101-2021_01_08_425952 270 12 9 9 CD 10_1101-2021_01_08_425952 270 13 , , , 10_1101-2021_01_08_425952 270 14 2021 2021 CD 10_1101-2021_01_08_425952 270 15 . . . 10_1101-2021_01_08_425952 270 16 ; ; : 10_1101-2021_01_08_425952 270 17 https://doi.org/10.1101/2021.01.08.425952doi https://doi.org/10.1101/2021.01.08.425952doi ADD 10_1101-2021_01_08_425952 270 18 : : : 10_1101-2021_01_08_425952 270 19 bioRxiv biorxiv IN 10_1101-2021_01_08_425952 270 20 preprint preprint NN 10_1101-2021_01_08_425952 270 21 https://doi.org/10.1101/2021.01.08.425952 https://doi.org/10.1101/2021.01.08.425952 NN 10_1101-2021_01_08_425952 270 22 http://creativecommons.org/licenses/by-nd/4.0/ http://creativecommons.org/licenses/by-nd/4.0/ NN 10_1101-2021_01_08_425952 270 23 28 28 CD 10_1101-2021_01_08_425952 270 24 rdrugtrajectory rdrugtrajectory NN 10_1101-2021_01_08_425952 270 25 : : : 10_1101-2021_01_08_425952 270 26 Analysing Analysing NNP 10_1101-2021_01_08_425952 270 27 Drug Drug NNP 10_1101-2021_01_08_425952 270 28 Prescriptions Prescriptions NNPS 10_1101-2021_01_08_425952 270 29 in in IN 10_1101-2021_01_08_425952 270 30 Electronic Electronic NNP 10_1101-2021_01_08_425952 270 31 Health Health NNP 10_1101-2021_01_08_425952 270 32 Care Care NNP 10_1101-2021_01_08_425952 270 33 Records Records NNP 10_1101-2021_01_08_425952 270 34 3838 3838 CD 10_1101-2021_01_08_425952 270 35 patients patient NNS 10_1101-2021_01_08_425952 270 36 . . . 10_1101-2021_01_08_425952 271 1 For for IN 10_1101-2021_01_08_425952 271 2 a a DT 10_1101-2021_01_08_425952 271 3 detailed detailed JJ 10_1101-2021_01_08_425952 271 4 description description NN 10_1101-2021_01_08_425952 271 5 please please UH 10_1101-2021_01_08_425952 271 6 see see VB 10_1101-2021_01_08_425952 271 7 Detail detail NN 10_1101-2021_01_08_425952 271 8 for for IN 10_1101-2021_01_08_425952 271 9 getFirstDrugIncidenceRate getFirstDrugIncidenceRate JJR 10_1101-2021_01_08_425952 271 10 in in IN 10_1101-2021_01_08_425952 271 11 the the DT 10_1101-2021_01_08_425952 271 12 reference reference NN 10_1101-2021_01_08_425952 271 13 manual manual NN 10_1101-2021_01_08_425952 271 14 . . . 10_1101-2021_01_08_425952 272 1 getDrugPersistence getdrugpersistence ADD 10_1101-2021_01_08_425952 272 2 Prescription prescription NN 10_1101-2021_01_08_425952 272 3 persistence persistence NN 10_1101-2021_01_08_425952 272 4 is be VBZ 10_1101-2021_01_08_425952 272 5 calculated calculate VBN 10_1101-2021_01_08_425952 272 6 as as IN 10_1101-2021_01_08_425952 272 7 the the DT 10_1101-2021_01_08_425952 272 8 fraction fraction NN 10_1101-2021_01_08_425952 272 9 of of IN 10_1101-2021_01_08_425952 272 10 patients patient NNS 10_1101-2021_01_08_425952 272 11 with with IN 10_1101-2021_01_08_425952 272 12 a a DT 10_1101-2021_01_08_425952 272 13 prescription prescription NN 10_1101-2021_01_08_425952 272 14 for for IN 10_1101-2021_01_08_425952 272 15 a a DT 10_1101-2021_01_08_425952 272 16 specific specific JJ 10_1101-2021_01_08_425952 272 17 treatment treatment NN 10_1101-2021_01_08_425952 272 18 N n NN 10_1101-2021_01_08_425952 272 19 - - HYPH 10_1101-2021_01_08_425952 272 20 days day NNS 10_1101-2021_01_08_425952 272 21 after after IN 10_1101-2021_01_08_425952 272 22 the the DT 10_1101-2021_01_08_425952 272 23 first first JJ 10_1101-2021_01_08_425952 272 24 prescription prescription NN 10_1101-2021_01_08_425952 272 25 event event NN 10_1101-2021_01_08_425952 272 26 . . . 10_1101-2021_01_08_425952 273 1 For for IN 10_1101-2021_01_08_425952 273 2 example example NN 10_1101-2021_01_08_425952 273 3 , , , 10_1101-2021_01_08_425952 273 4 if if IN 10_1101-2021_01_08_425952 273 5 we -PRON- PRP 10_1101-2021_01_08_425952 273 6 wanted want VBD 10_1101-2021_01_08_425952 273 7 to to TO 10_1101-2021_01_08_425952 273 8 calculate calculate VB 10_1101-2021_01_08_425952 273 9 the the DT 10_1101-2021_01_08_425952 273 10 fraction fraction NN 10_1101-2021_01_08_425952 273 11 of of IN 10_1101-2021_01_08_425952 273 12 patients patient NNS 10_1101-2021_01_08_425952 273 13 with with IN 10_1101-2021_01_08_425952 273 14 a a DT 10_1101-2021_01_08_425952 273 15 prescription prescription NN 10_1101-2021_01_08_425952 273 16 365-days 365-days CD 10_1101-2021_01_08_425952 273 17 after after IN 10_1101-2021_01_08_425952 273 18 their -PRON- PRP$ 10_1101-2021_01_08_425952 273 19 first first JJ 10_1101-2021_01_08_425952 273 20 prescription prescription NN 10_1101-2021_01_08_425952 273 21 , , , 10_1101-2021_01_08_425952 273 22 with with IN 10_1101-2021_01_08_425952 273 23 a a DT 10_1101-2021_01_08_425952 273 24 30-day 30-day CD 10_1101-2021_01_08_425952 273 25 buffer buffer NN 10_1101-2021_01_08_425952 273 26 either either DT 10_1101-2021_01_08_425952 273 27 side side NN 10_1101-2021_01_08_425952 273 28 , , , 10_1101-2021_01_08_425952 273 29 one one PRP 10_1101-2021_01_08_425952 273 30 specifies specify VBZ 10_1101-2021_01_08_425952 273 31 a a DT 10_1101-2021_01_08_425952 273 32 duration duration NN 10_1101-2021_01_08_425952 273 33 of of IN 10_1101-2021_01_08_425952 273 34 395-days 395-days CD 10_1101-2021_01_08_425952 273 35 and and CC 10_1101-2021_01_08_425952 273 36 a a DT 10_1101-2021_01_08_425952 273 37 preceding precede VBG 10_1101-2021_01_08_425952 273 38 buffer buffer NN 10_1101-2021_01_08_425952 273 39 of of IN 10_1101-2021_01_08_425952 273 40 60-days 60-days CD 10_1101-2021_01_08_425952 273 41 ( ( -LRB- 10_1101-2021_01_08_425952 273 42 therefore therefore RB 10_1101-2021_01_08_425952 273 43 , , , 10_1101-2021_01_08_425952 273 44 capturing capture VBG 10_1101-2021_01_08_425952 273 45 the the DT 10_1101-2021_01_08_425952 273 46 range range NN 10_1101-2021_01_08_425952 273 47 335 335 CD 10_1101-2021_01_08_425952 273 48 to to IN 10_1101-2021_01_08_425952 273 49 395 395 CD 10_1101-2021_01_08_425952 273 50 , , , 10_1101-2021_01_08_425952 273 51 30-days 30-days CD 10_1101-2021_01_08_425952 273 52 either either DT 10_1101-2021_01_08_425952 273 53 side side NN 10_1101-2021_01_08_425952 273 54 of of IN 10_1101-2021_01_08_425952 273 55 one one CD 10_1101-2021_01_08_425952 273 56 calender calender NN 10_1101-2021_01_08_425952 273 57 year year NN 10_1101-2021_01_08_425952 273 58 ) ) -RRB- 10_1101-2021_01_08_425952 273 59 : : : 10_1101-2021_01_08_425952 273 60 > > XX 10_1101-2021_01_08_425952 273 61 library(rdrugtrajectory library(rdrugtrajectory NNP 10_1101-2021_01_08_425952 273 62 ) ) -RRB- 10_1101-2021_01_08_425952 273 63 > > XX 10_1101-2021_01_08_425952 273 64 patientList patientList NNP 10_1101-2021_01_08_425952 273 65 < < XX 10_1101-2021_01_08_425952 273 66 - - HYPH 10_1101-2021_01_08_425952 273 67 getDrugPersistence(therapyDF getDrugPersistence(therapyDF NNP 10_1101-2021_01_08_425952 273 68 = = SYM 10_1101-2021_01_08_425952 273 69 testTherapyDF testTherapyDF NNS 10_1101-2021_01_08_425952 273 70 , , , 10_1101-2021_01_08_425952 273 71 + + CC 10_1101-2021_01_08_425952 273 72 idList idList NNP 10_1101-2021_01_08_425952 273 73 = = SYM 10_1101-2021_01_08_425952 273 74 NULL NULL NNP 10_1101-2021_01_08_425952 273 75 , , , 10_1101-2021_01_08_425952 273 76 + + CC 10_1101-2021_01_08_425952 273 77 prodcodeList prodcodeList NNP 10_1101-2021_01_08_425952 273 78 = = SYM 10_1101-2021_01_08_425952 273 79 NULL NULL NNP 10_1101-2021_01_08_425952 273 80 , , , 10_1101-2021_01_08_425952 273 81 + + CC 10_1101-2021_01_08_425952 273 82 duration duration NN 10_1101-2021_01_08_425952 273 83 = = SYM 10_1101-2021_01_08_425952 273 84 395 395 CD 10_1101-2021_01_08_425952 273 85 , , , 10_1101-2021_01_08_425952 273 86 + + CC 10_1101-2021_01_08_425952 273 87 buffer buffer NNP 10_1101-2021_01_08_425952 273 88 = = SYM 10_1101-2021_01_08_425952 273 89 60 60 CD 10_1101-2021_01_08_425952 273 90 , , , 10_1101-2021_01_08_425952 273 91 + + CC 10_1101-2021_01_08_425952 273 92 endOfRecordDate endOfRecordDate NNP 10_1101-2021_01_08_425952 273 93 = = SYM 10_1101-2021_01_08_425952 273 94 " " `` 10_1101-2021_01_08_425952 273 95 2017 2017 CD 10_1101-2021_01_08_425952 273 96 - - HYPH 10_1101-2021_01_08_425952 273 97 12 12 CD 10_1101-2021_01_08_425952 273 98 - - SYM 10_1101-2021_01_08_425952 273 99 31 31 CD 10_1101-2021_01_08_425952 273 100 " " '' 10_1101-2021_01_08_425952 273 101 ) ) -RRB- 10_1101-2021_01_08_425952 273 102 Of of IN 10_1101-2021_01_08_425952 273 103 3838 3838 CD 10_1101-2021_01_08_425952 273 104 patient patient NN 10_1101-2021_01_08_425952 273 105 therapy therapy NN 10_1101-2021_01_08_425952 273 106 records record NNS 10_1101-2021_01_08_425952 273 107 , , , 10_1101-2021_01_08_425952 273 108 954 954 CD 10_1101-2021_01_08_425952 273 109 patients patient NNS 10_1101-2021_01_08_425952 273 110 had have VBD 10_1101-2021_01_08_425952 273 111 a a DT 10_1101-2021_01_08_425952 273 112 prescription prescription NN 10_1101-2021_01_08_425952 273 113 365 365 CD 10_1101-2021_01_08_425952 273 114 ( ( -LRB- 10_1101-2021_01_08_425952 273 115 + + CC 10_1101-2021_01_08_425952 273 116 /- /- . 10_1101-2021_01_08_425952 273 117 30 30 CD 10_1101-2021_01_08_425952 273 118 ) ) -RRB- 10_1101-2021_01_08_425952 273 119 days day NNS 10_1101-2021_01_08_425952 273 120 after after IN 10_1101-2021_01_08_425952 273 121 the the DT 10_1101-2021_01_08_425952 273 122 first first JJ 10_1101-2021_01_08_425952 273 123 prescription prescription NN 10_1101-2021_01_08_425952 273 124 event event NN 10_1101-2021_01_08_425952 273 125 on on IN 10_1101-2021_01_08_425952 273 126 record record NN 10_1101-2021_01_08_425952 273 127 , , , 10_1101-2021_01_08_425952 273 128 resulting result VBG 10_1101-2021_01_08_425952 273 129 in in IN 10_1101-2021_01_08_425952 273 130 a a DT 10_1101-2021_01_08_425952 273 131 crude crude JJ 10_1101-2021_01_08_425952 273 132 fraction fraction NN 10_1101-2021_01_08_425952 273 133 of of IN 10_1101-2021_01_08_425952 273 134 only only JJ 10_1101-2021_01_08_425952 273 135 0.25 0.25 CD 10_1101-2021_01_08_425952 273 136 patients patient NNS 10_1101-2021_01_08_425952 273 137 . . . 10_1101-2021_01_08_425952 274 1 getDrugPersistence getDrugPersistence NNS 10_1101-2021_01_08_425952 274 2 only only RB 10_1101-2021_01_08_425952 274 3 observes observe VBZ 10_1101-2021_01_08_425952 274 4 events event NNS 10_1101-2021_01_08_425952 274 5 recorded record VBN 10_1101-2021_01_08_425952 274 6 precisely precisely RB 10_1101-2021_01_08_425952 274 7 duration duration NN 10_1101-2021_01_08_425952 274 8 days day NNS 10_1101-2021_01_08_425952 274 9 after after IN 10_1101-2021_01_08_425952 274 10 the the DT 10_1101-2021_01_08_425952 274 11 first first JJ 10_1101-2021_01_08_425952 274 12 prescription prescription NN 10_1101-2021_01_08_425952 274 13 . . . 10_1101-2021_01_08_425952 275 1 The the DT 10_1101-2021_01_08_425952 275 2 buffer buffer NN 10_1101-2021_01_08_425952 275 3 can can MD 10_1101-2021_01_08_425952 275 4 be be VB 10_1101-2021_01_08_425952 275 5 used use VBN 10_1101-2021_01_08_425952 275 6 to to TO 10_1101-2021_01_08_425952 275 7 identify identify VB 10_1101-2021_01_08_425952 275 8 patients patient NNS 10_1101-2021_01_08_425952 275 9 who who WP 10_1101-2021_01_08_425952 275 10 received receive VBD 10_1101-2021_01_08_425952 275 11 a a DT 10_1101-2021_01_08_425952 275 12 prescription prescription NN 10_1101-2021_01_08_425952 275 13 shortly shortly RB 10_1101-2021_01_08_425952 275 14 after after IN 10_1101-2021_01_08_425952 275 15 the the DT 10_1101-2021_01_08_425952 275 16 end end NN 10_1101-2021_01_08_425952 275 17 of of IN 10_1101-2021_01_08_425952 275 18 the the DT 10_1101-2021_01_08_425952 275 19 duration duration NN 10_1101-2021_01_08_425952 275 20 , , , 10_1101-2021_01_08_425952 275 21 but but CC 10_1101-2021_01_08_425952 275 22 more more RBR 10_1101-2021_01_08_425952 275 23 importantly importantly RB 10_1101-2021_01_08_425952 275 24 , , , 10_1101-2021_01_08_425952 275 25 to to TO 10_1101-2021_01_08_425952 275 26 ensure ensure VB 10_1101-2021_01_08_425952 275 27 patients patient NNS 10_1101-2021_01_08_425952 275 28 actively actively RB 10_1101-2021_01_08_425952 275 29 undergoing undergo VBG 10_1101-2021_01_08_425952 275 30 treatment treatment NN 10_1101-2021_01_08_425952 275 31 ( ( -LRB- 10_1101-2021_01_08_425952 275 32 indicated indicate VBN 10_1101-2021_01_08_425952 275 33 by by IN 10_1101-2021_01_08_425952 275 34 a a DT 10_1101-2021_01_08_425952 275 35 prescription prescription NN 10_1101-2021_01_08_425952 275 36 shortly shortly RB 10_1101-2021_01_08_425952 275 37 before before IN 10_1101-2021_01_08_425952 275 38 the the DT 10_1101-2021_01_08_425952 275 39 desired desire VBN 10_1101-2021_01_08_425952 275 40 duration duration NN 10_1101-2021_01_08_425952 275 41 days day NNS 10_1101-2021_01_08_425952 275 42 ) ) -RRB- 10_1101-2021_01_08_425952 275 43 are be VBP 10_1101-2021_01_08_425952 275 44 included include VBN 10_1101-2021_01_08_425952 275 45 . . . 10_1101-2021_01_08_425952 276 1 As as IN 10_1101-2021_01_08_425952 276 2 the the DT 10_1101-2021_01_08_425952 276 3 buffer buffer NN 10_1101-2021_01_08_425952 276 4 is be VBZ 10_1101-2021_01_08_425952 276 5 reduced reduce VBN 10_1101-2021_01_08_425952 276 6 , , , 10_1101-2021_01_08_425952 276 7 the the DT 10_1101-2021_01_08_425952 276 8 fraction fraction NN 10_1101-2021_01_08_425952 276 9 of of IN 10_1101-2021_01_08_425952 276 10 prescription prescription NN 10_1101-2021_01_08_425952 276 11 persistence persistence NN 10_1101-2021_01_08_425952 276 12 is be VBZ 10_1101-2021_01_08_425952 276 13 reduced reduce VBN 10_1101-2021_01_08_425952 276 14 until until IN 10_1101-2021_01_08_425952 276 15 the the DT 10_1101-2021_01_08_425952 276 16 algorithm algorithm NNP 10_1101-2021_01_08_425952 276 17 attempts attempt VBZ 10_1101-2021_01_08_425952 276 18 to to TO 10_1101-2021_01_08_425952 276 19 only only RB 10_1101-2021_01_08_425952 276 20 identify identify VB 10_1101-2021_01_08_425952 276 21 patients patient NNS 10_1101-2021_01_08_425952 276 22 with with IN 10_1101-2021_01_08_425952 276 23 a a DT 10_1101-2021_01_08_425952 276 24 prescription prescription NN 10_1101-2021_01_08_425952 276 25 exactly exactly RB 10_1101-2021_01_08_425952 276 26 duration duration NN 10_1101-2021_01_08_425952 276 27 of of IN 10_1101-2021_01_08_425952 276 28 days day NNS 10_1101-2021_01_08_425952 276 29 after after IN 10_1101-2021_01_08_425952 276 30 the the DT 10_1101-2021_01_08_425952 276 31 first first JJ 10_1101-2021_01_08_425952 276 32 prescription prescription NN 10_1101-2021_01_08_425952 276 33 . . . 10_1101-2021_01_08_425952 277 1 Future future JJ 10_1101-2021_01_08_425952 277 2 software software NN 10_1101-2021_01_08_425952 277 3 updates update NNS 10_1101-2021_01_08_425952 277 4 will will MD 10_1101-2021_01_08_425952 277 5 incorporate incorporate VB 10_1101-2021_01_08_425952 277 6 repeat repeat NN 10_1101-2021_01_08_425952 277 7 prescription prescription NN 10_1101-2021_01_08_425952 277 8 data datum NNS 10_1101-2021_01_08_425952 277 9 to to TO 10_1101-2021_01_08_425952 277 10 increase increase VB 10_1101-2021_01_08_425952 277 11 the the DT 10_1101-2021_01_08_425952 277 12 accuracy accuracy NN 10_1101-2021_01_08_425952 277 13 of of IN 10_1101-2021_01_08_425952 277 14 the the DT 10_1101-2021_01_08_425952 277 15 calculation calculation NN 10_1101-2021_01_08_425952 277 16 . . . 10_1101-2021_01_08_425952 278 1 4 4 LS 10_1101-2021_01_08_425952 278 2 . . . 10_1101-2021_01_08_425952 279 1 Closing closing NN 10_1101-2021_01_08_425952 279 2 remarks remark NNS 10_1101-2021_01_08_425952 279 3 and and CC 10_1101-2021_01_08_425952 279 4 future future JJ 10_1101-2021_01_08_425952 279 5 work work NN 10_1101-2021_01_08_425952 279 6 rdrugtrajectory rdrugtrajectory NN 10_1101-2021_01_08_425952 279 7 is be VBZ 10_1101-2021_01_08_425952 279 8 an an DT 10_1101-2021_01_08_425952 279 9 R r NN 10_1101-2021_01_08_425952 279 10 package package NN 10_1101-2021_01_08_425952 279 11 which which WDT 10_1101-2021_01_08_425952 279 12 has have VBZ 10_1101-2021_01_08_425952 279 13 the the DT 10_1101-2021_01_08_425952 279 14 potential potential NN 10_1101-2021_01_08_425952 279 15 for for IN 10_1101-2021_01_08_425952 279 16 exciting exciting JJ 10_1101-2021_01_08_425952 279 17 applications application NNS 10_1101-2021_01_08_425952 279 18 such such JJ 10_1101-2021_01_08_425952 279 19 as as IN 10_1101-2021_01_08_425952 279 20 im- im- NNS 10_1101-2021_01_08_425952 279 21 proving prove VBG 10_1101-2021_01_08_425952 279 22 clinical clinical JJ 10_1101-2021_01_08_425952 279 23 decision decision NN 10_1101-2021_01_08_425952 279 24 - - HYPH 10_1101-2021_01_08_425952 279 25 making making NN 10_1101-2021_01_08_425952 279 26 , , , 10_1101-2021_01_08_425952 279 27 identifying identify VBG 10_1101-2021_01_08_425952 279 28 possible possible JJ 10_1101-2021_01_08_425952 279 29 new new JJ 10_1101-2021_01_08_425952 279 30 treatments treatment NNS 10_1101-2021_01_08_425952 279 31 and and CC 10_1101-2021_01_08_425952 279 32 analysing analyse VBG 10_1101-2021_01_08_425952 279 33 outcomes outcome NNS 10_1101-2021_01_08_425952 279 34 from from IN 10_1101-2021_01_08_425952 279 35 existing exist VBG 10_1101-2021_01_08_425952 279 36 treatments treatment NNS 10_1101-2021_01_08_425952 279 37 . . . 10_1101-2021_01_08_425952 280 1 We -PRON- PRP 10_1101-2021_01_08_425952 280 2 have have VBP 10_1101-2021_01_08_425952 280 3 demonstrated demonstrate VBN 10_1101-2021_01_08_425952 280 4 several several JJ 10_1101-2021_01_08_425952 280 5 functions function NNS 10_1101-2021_01_08_425952 280 6 , , , 10_1101-2021_01_08_425952 280 7 some some DT 10_1101-2021_01_08_425952 280 8 of of IN 10_1101-2021_01_08_425952 280 9 which which WDT 10_1101-2021_01_08_425952 280 10 detail detail NN 10_1101-2021_01_08_425952 280 11 sorting sort VBG 10_1101-2021_01_08_425952 280 12 and and CC 10_1101-2021_01_08_425952 280 13 matching match VBG 10_1101-2021_01_08_425952 280 14 records record NNS 10_1101-2021_01_08_425952 280 15 whilst whilst IN 10_1101-2021_01_08_425952 280 16 others other NNS 10_1101-2021_01_08_425952 280 17 demonstrate demonstrate VBP 10_1101-2021_01_08_425952 280 18 fundamental fundamental JJ 10_1101-2021_01_08_425952 280 19 statistical statistical JJ 10_1101-2021_01_08_425952 280 20 analysis analysis NN 10_1101-2021_01_08_425952 280 21 . . . 10_1101-2021_01_08_425952 281 1 We -PRON- PRP 10_1101-2021_01_08_425952 281 2 used use VBD 10_1101-2021_01_08_425952 281 3 fabricated fabricate VBN 10_1101-2021_01_08_425952 281 4 clinical clinical JJ 10_1101-2021_01_08_425952 281 5 and and CC 10_1101-2021_01_08_425952 281 6 prescription prescription NN 10_1101-2021_01_08_425952 281 7 dataframes dataframe NNS 10_1101-2021_01_08_425952 281 8 , , , 10_1101-2021_01_08_425952 281 9 along along IN 10_1101-2021_01_08_425952 281 10 with with IN 10_1101-2021_01_08_425952 281 11 the the DT 10_1101-2021_01_08_425952 281 12 age age NN 10_1101-2021_01_08_425952 281 13 , , , 10_1101-2021_01_08_425952 281 14 gender gender NN 10_1101-2021_01_08_425952 281 15 and and CC 10_1101-2021_01_08_425952 281 16 index index NN 10_1101-2021_01_08_425952 281 17 of of IN 10_1101-2021_01_08_425952 281 18 multiple multiple JJ 10_1101-2021_01_08_425952 281 19 deprivation deprivation NN 10_1101-2021_01_08_425952 281 20 score score NN 10_1101-2021_01_08_425952 281 21 of of IN 10_1101-2021_01_08_425952 281 22 each each DT 10_1101-2021_01_08_425952 281 23 patient patient NN 10_1101-2021_01_08_425952 281 24 and and CC 10_1101-2021_01_08_425952 281 25 presented present VBD 10_1101-2021_01_08_425952 281 26 analyses analysis NNS 10_1101-2021_01_08_425952 281 27 of of IN 10_1101-2021_01_08_425952 281 28 cohort cohort NN 10_1101-2021_01_08_425952 281 29 - - HYPH 10_1101-2021_01_08_425952 281 30 wide wide JJ 10_1101-2021_01_08_425952 281 31 prescrip- prescrip- JJ 10_1101-2021_01_08_425952 281 32 tion tion NN 10_1101-2021_01_08_425952 281 33 patterns pattern NNS 10_1101-2021_01_08_425952 281 34 , , , 10_1101-2021_01_08_425952 281 35 first first JJ 10_1101-2021_01_08_425952 281 36 - - HYPH 10_1101-2021_01_08_425952 281 37 line line NN 10_1101-2021_01_08_425952 281 38 treatment treatment NN 10_1101-2021_01_08_425952 281 39 distributions distribution NNS 10_1101-2021_01_08_425952 281 40 , , , 10_1101-2021_01_08_425952 281 41 how how WRB 10_1101-2021_01_08_425952 281 42 to to TO 10_1101-2021_01_08_425952 281 43 stratify stratify VB 10_1101-2021_01_08_425952 281 44 by by IN 10_1101-2021_01_08_425952 281 45 patient patient JJ 10_1101-2021_01_08_425952 281 46 characteristics characteristic NNS 10_1101-2021_01_08_425952 281 47 , , , 10_1101-2021_01_08_425952 281 48 and and CC 10_1101-2021_01_08_425952 281 49 some some DT 10_1101-2021_01_08_425952 281 50 basic basic JJ 10_1101-2021_01_08_425952 281 51 tools tool NNS 10_1101-2021_01_08_425952 281 52 to to TO 10_1101-2021_01_08_425952 281 53 assist assist VB 10_1101-2021_01_08_425952 281 54 longitudinal longitudinal JJ 10_1101-2021_01_08_425952 281 55 analysis analysis NN 10_1101-2021_01_08_425952 281 56 of of IN 10_1101-2021_01_08_425952 281 57 prescriptions prescription NNS 10_1101-2021_01_08_425952 281 58 . . . 10_1101-2021_01_08_425952 282 1 The the DT 10_1101-2021_01_08_425952 282 2 descriptions description NNS 10_1101-2021_01_08_425952 282 3 presented present VBN 10_1101-2021_01_08_425952 282 4 in in IN 10_1101-2021_01_08_425952 282 5 this this DT 10_1101-2021_01_08_425952 282 6 publication publication NN 10_1101-2021_01_08_425952 282 7 are be VBP 10_1101-2021_01_08_425952 282 8 not not RB 10_1101-2021_01_08_425952 282 9 substitutes substitute NNS 10_1101-2021_01_08_425952 282 10 for for IN 10_1101-2021_01_08_425952 282 11 the the DT 10_1101-2021_01_08_425952 282 12 material material NN 10_1101-2021_01_08_425952 282 13 in in IN 10_1101-2021_01_08_425952 282 14 the the DT 10_1101-2021_01_08_425952 282 15 reference reference NN 10_1101-2021_01_08_425952 282 16 manual manual NN 10_1101-2021_01_08_425952 282 17 . . . 10_1101-2021_01_08_425952 283 1 We -PRON- PRP 10_1101-2021_01_08_425952 283 2 recommend recommend VBP 10_1101-2021_01_08_425952 283 3 the the DT 10_1101-2021_01_08_425952 283 4 reader reader NN 10_1101-2021_01_08_425952 283 5 consults consult VBZ 10_1101-2021_01_08_425952 283 6 the the DT 10_1101-2021_01_08_425952 283 7 R r NN 10_1101-2021_01_08_425952 283 8 ? ? . 10_1101-2021_01_08_425952 284 1 help help VB 10_1101-2021_01_08_425952 284 2 command command VB 10_1101-2021_01_08_425952 284 3 or or CC 10_1101-2021_01_08_425952 284 4 reference reference VB 10_1101-2021_01_08_425952 284 5 manual manual NN 10_1101-2021_01_08_425952 284 6 before before IN 10_1101-2021_01_08_425952 284 7 running run VBG 10_1101-2021_01_08_425952 284 8 a a DT 10_1101-2021_01_08_425952 284 9 function function NN 10_1101-2021_01_08_425952 284 10 . . . 10_1101-2021_01_08_425952 285 1 In in IN 10_1101-2021_01_08_425952 285 2 particular particular JJ 10_1101-2021_01_08_425952 285 3 , , , 10_1101-2021_01_08_425952 285 4 functions function NNS 10_1101-2021_01_08_425952 285 5 related relate VBN 10_1101-2021_01_08_425952 285 6 to to IN 10_1101-2021_01_08_425952 285 7 the the DT 10_1101-2021_01_08_425952 285 8 construction construction NN 10_1101-2021_01_08_425952 285 9 of of IN 10_1101-2021_01_08_425952 285 10 timelines timeline NNS 10_1101-2021_01_08_425952 285 11 for for IN 10_1101-2021_01_08_425952 285 12 survival survival NN 10_1101-2021_01_08_425952 285 13 analysis analysis NNP 10_1101-2021_01_08_425952 285 14 ( ( -LRB- 10_1101-2021_01_08_425952 285 15 time time NN 10_1101-2021_01_08_425952 285 16 dependent dependent JJ 10_1101-2021_01_08_425952 285 17 / / SYM 10_1101-2021_01_08_425952 285 18 independent independent JJ 10_1101-2021_01_08_425952 285 19 Cox Cox NNP 10_1101-2021_01_08_425952 285 20 regression regression NN 10_1101-2021_01_08_425952 285 21 , , , 10_1101-2021_01_08_425952 285 22 Kaplan Kaplan NNP 10_1101-2021_01_08_425952 285 23 Meier Meier NNP 10_1101-2021_01_08_425952 285 24 survival survival NN 10_1101-2021_01_08_425952 285 25 curves curve NNS 10_1101-2021_01_08_425952 285 26 and and CC 10_1101-2021_01_08_425952 285 27 mean mean VB 10_1101-2021_01_08_425952 285 28 cumulative cumulative JJ 10_1101-2021_01_08_425952 285 29 function function NN 10_1101-2021_01_08_425952 285 30 ) ) -RRB- 10_1101-2021_01_08_425952 285 31 or or CC 10_1101-2021_01_08_425952 285 32 a a DT 10_1101-2021_01_08_425952 285 33 matrix matrix NN 10_1101-2021_01_08_425952 285 34 for for IN 10_1101-2021_01_08_425952 285 35 drug drug NN 10_1101-2021_01_08_425952 285 36 incidence incidence NN 10_1101-2021_01_08_425952 285 37 rate rate NN 10_1101-2021_01_08_425952 285 38 requires require VBZ 10_1101-2021_01_08_425952 285 39 fine fine JJ 10_1101-2021_01_08_425952 285 40 tuning tuning NN 10_1101-2021_01_08_425952 285 41 of of IN 10_1101-2021_01_08_425952 285 42 several several JJ 10_1101-2021_01_08_425952 285 43 parameters parameter NNS 10_1101-2021_01_08_425952 285 44 . . . 10_1101-2021_01_08_425952 286 1 .CC .CC NFP 10_1101-2021_01_08_425952 286 2 - - : 10_1101-2021_01_08_425952 286 3 BY by IN 10_1101-2021_01_08_425952 286 4 - - HYPH 10_1101-2021_01_08_425952 286 5 ND ND NNP 10_1101-2021_01_08_425952 286 6 4.0 4.0 CD 10_1101-2021_01_08_425952 286 7 International international JJ 10_1101-2021_01_08_425952 286 8 licensemade licensemade NN 10_1101-2021_01_08_425952 286 9 available available JJ 10_1101-2021_01_08_425952 286 10 under under IN 10_1101-2021_01_08_425952 286 11 a a DT 10_1101-2021_01_08_425952 286 12 ( ( -LRB- 10_1101-2021_01_08_425952 286 13 which which WDT 10_1101-2021_01_08_425952 286 14 was be VBD 10_1101-2021_01_08_425952 286 15 not not RB 10_1101-2021_01_08_425952 286 16 certified certify VBN 10_1101-2021_01_08_425952 286 17 by by IN 10_1101-2021_01_08_425952 286 18 peer peer NN 10_1101-2021_01_08_425952 286 19 review review NN 10_1101-2021_01_08_425952 286 20 ) ) -RRB- 10_1101-2021_01_08_425952 286 21 is be VBZ 10_1101-2021_01_08_425952 286 22 the the DT 10_1101-2021_01_08_425952 286 23 author author NN 10_1101-2021_01_08_425952 286 24 / / SYM 10_1101-2021_01_08_425952 286 25 funder funder NN 10_1101-2021_01_08_425952 286 26 , , , 10_1101-2021_01_08_425952 286 27 who who WP 10_1101-2021_01_08_425952 286 28 has have VBZ 10_1101-2021_01_08_425952 286 29 granted grant VBN 10_1101-2021_01_08_425952 286 30 bioRxiv biorxiv IN 10_1101-2021_01_08_425952 286 31 a a DT 10_1101-2021_01_08_425952 286 32 license license NN 10_1101-2021_01_08_425952 286 33 to to TO 10_1101-2021_01_08_425952 286 34 display display VB 10_1101-2021_01_08_425952 286 35 the the DT 10_1101-2021_01_08_425952 286 36 preprint preprint NN 10_1101-2021_01_08_425952 286 37 in in IN 10_1101-2021_01_08_425952 286 38 perpetuity perpetuity NN 10_1101-2021_01_08_425952 286 39 . . . 10_1101-2021_01_08_425952 287 1 It -PRON- PRP 10_1101-2021_01_08_425952 287 2 is be VBZ 10_1101-2021_01_08_425952 287 3 The the DT 10_1101-2021_01_08_425952 287 4 copyright copyright NN 10_1101-2021_01_08_425952 287 5 holder holder NN 10_1101-2021_01_08_425952 287 6 for for IN 10_1101-2021_01_08_425952 287 7 this this DT 10_1101-2021_01_08_425952 287 8 preprintthis preprintthis NN 10_1101-2021_01_08_425952 287 9 version version NN 10_1101-2021_01_08_425952 287 10 posted post VBD 10_1101-2021_01_08_425952 287 11 January January NNP 10_1101-2021_01_08_425952 287 12 9 9 CD 10_1101-2021_01_08_425952 287 13 , , , 10_1101-2021_01_08_425952 287 14 2021 2021 CD 10_1101-2021_01_08_425952 287 15 . . . 10_1101-2021_01_08_425952 287 16 ; ; : 10_1101-2021_01_08_425952 287 17 https://doi.org/10.1101/2021.01.08.425952doi https://doi.org/10.1101/2021.01.08.425952doi ADD 10_1101-2021_01_08_425952 287 18 : : : 10_1101-2021_01_08_425952 287 19 bioRxiv biorxiv IN 10_1101-2021_01_08_425952 287 20 preprint preprint NN 10_1101-2021_01_08_425952 287 21 https://doi.org/10.1101/2021.01.08.425952 https://doi.org/10.1101/2021.01.08.425952 XX 10_1101-2021_01_08_425952 287 22 http://creativecommons.org/licenses/by-nd/4.0/ http://creativecommons.org/licenses/by-nd/4.0/ NNP 10_1101-2021_01_08_425952 287 23 Journal Journal NNP 10_1101-2021_01_08_425952 287 24 of of IN 10_1101-2021_01_08_425952 287 25 Statistical Statistical NNP 10_1101-2021_01_08_425952 287 26 Software Software NNP 10_1101-2021_01_08_425952 287 27 29 29 CD 10_1101-2021_01_08_425952 287 28 0.0 0.0 CD 10_1101-2021_01_08_425952 287 29 0.1 0.1 CD 10_1101-2021_01_08_425952 287 30 0.2 0.2 CD 10_1101-2021_01_08_425952 287 31 0.3 0.3 CD 10_1101-2021_01_08_425952 287 32 0 0 CD 10_1101-2021_01_08_425952 287 33 25 25 CD 10_1101-2021_01_08_425952 287 34 50 50 CD 10_1101-2021_01_08_425952 287 35 75 75 CD 10_1101-2021_01_08_425952 287 36 100 100 CD 10_1101-2021_01_08_425952 287 37 125 125 CD 10_1101-2021_01_08_425952 287 38 Buffer Buffer NNP 10_1101-2021_01_08_425952 287 39 size size NN 10_1101-2021_01_08_425952 287 40 ( ( -LRB- 10_1101-2021_01_08_425952 287 41 n n JJ 10_1101-2021_01_08_425952 287 42 days day NNS 10_1101-2021_01_08_425952 287 43 before before IN 10_1101-2021_01_08_425952 287 44 365 365 CD 10_1101-2021_01_08_425952 287 45 ) ) -RRB- 10_1101-2021_01_08_425952 287 46 F F NNP 10_1101-2021_01_08_425952 287 47 ra ra NNP 10_1101-2021_01_08_425952 287 48 ct ct NNP 10_1101-2021_01_08_425952 287 49 io io NNP 10_1101-2021_01_08_425952 287 50 n n NNP 10_1101-2021_01_08_425952 287 51 o o NNP 10_1101-2021_01_08_425952 287 52 f f NNP 10_1101-2021_01_08_425952 287 53 p p NN 10_1101-2021_01_08_425952 287 54 re re NN 10_1101-2021_01_08_425952 287 55 sc sc RB 10_1101-2021_01_08_425952 287 56 ri ri NNP 10_1101-2021_01_08_425952 287 57 p p NN 10_1101-2021_01_08_425952 287 58 tio tio NN 10_1101-2021_01_08_425952 287 59 n n NNP 10_1101-2021_01_08_425952 287 60 p p NNP 10_1101-2021_01_08_425952 287 61 e e NNP 10_1101-2021_01_08_425952 287 62 rs rs NN 10_1101-2021_01_08_425952 287 63 is be VBZ 10_1101-2021_01_08_425952 287 64 te te NNP 10_1101-2021_01_08_425952 287 65 n n NNP 10_1101-2021_01_08_425952 287 66 ce ce NNP 10_1101-2021_01_08_425952 287 67 Figure Figure NNP 10_1101-2021_01_08_425952 287 68 9 9 CD 10_1101-2021_01_08_425952 287 69 : : : 10_1101-2021_01_08_425952 287 70 The the DT 10_1101-2021_01_08_425952 287 71 fraction fraction NN 10_1101-2021_01_08_425952 287 72 of of IN 10_1101-2021_01_08_425952 287 73 prescription prescription NN 10_1101-2021_01_08_425952 287 74 persistence persistence NN 10_1101-2021_01_08_425952 287 75 adjusted adjust VBN 10_1101-2021_01_08_425952 287 76 by by IN 10_1101-2021_01_08_425952 287 77 a a DT 10_1101-2021_01_08_425952 287 78 buffer buffer NN 10_1101-2021_01_08_425952 287 79 number number NN 10_1101-2021_01_08_425952 287 80 of of IN 10_1101-2021_01_08_425952 287 81 days day NNS 10_1101-2021_01_08_425952 287 82 before before IN 10_1101-2021_01_08_425952 287 83 a a DT 10_1101-2021_01_08_425952 287 84 calender calender NN 10_1101-2021_01_08_425952 287 85 year year NN 10_1101-2021_01_08_425952 287 86 . . . 10_1101-2021_01_08_425952 288 1 As as IN 10_1101-2021_01_08_425952 288 2 the the DT 10_1101-2021_01_08_425952 288 3 buffer buffer NN 10_1101-2021_01_08_425952 288 4 approaches approach VBZ 10_1101-2021_01_08_425952 288 5 the the DT 10_1101-2021_01_08_425952 288 6 value value NN 10_1101-2021_01_08_425952 288 7 of of IN 10_1101-2021_01_08_425952 288 8 duration duration NN 10_1101-2021_01_08_425952 288 9 the the DT 10_1101-2021_01_08_425952 288 10 fraction fraction NN 10_1101-2021_01_08_425952 288 11 approaches approach VBZ 10_1101-2021_01_08_425952 288 12 1 1 CD 10_1101-2021_01_08_425952 288 13 . . . 10_1101-2021_01_08_425952 289 1 The the DT 10_1101-2021_01_08_425952 289 2 latest late JJS 10_1101-2021_01_08_425952 289 3 release release NN 10_1101-2021_01_08_425952 289 4 of of IN 10_1101-2021_01_08_425952 289 5 rdrugtrajectory rdrugtrajectory NN 10_1101-2021_01_08_425952 289 6 along along IN 10_1101-2021_01_08_425952 289 7 with with IN 10_1101-2021_01_08_425952 289 8 source source NN 10_1101-2021_01_08_425952 289 9 code code NN 10_1101-2021_01_08_425952 289 10 and and CC 10_1101-2021_01_08_425952 289 11 reference reference NN 10_1101-2021_01_08_425952 289 12 manual manual NN 10_1101-2021_01_08_425952 289 13 is be VBZ 10_1101-2021_01_08_425952 289 14 available available JJ 10_1101-2021_01_08_425952 289 15 for for IN 10_1101-2021_01_08_425952 289 16 download download NN 10_1101-2021_01_08_425952 289 17 from from IN 10_1101-2021_01_08_425952 289 18 https://github.com/acnash/rdrugtrajectory https://github.com/acnash/rdrugtrajectory NN 10_1101-2021_01_08_425952 289 19 . . . 10_1101-2021_01_08_425952 290 1 Whilst whilst IN 10_1101-2021_01_08_425952 290 2 active active JJ 10_1101-2021_01_08_425952 290 3 members member NNS 10_1101-2021_01_08_425952 290 4 of of IN 10_1101-2021_01_08_425952 290 5 the the DT 10_1101-2021_01_08_425952 290 6 scientific scientific JJ 10_1101-2021_01_08_425952 290 7 research research NN 10_1101-2021_01_08_425952 290 8 community community NN 10_1101-2021_01_08_425952 290 9 we -PRON- PRP 10_1101-2021_01_08_425952 290 10 will will MD 10_1101-2021_01_08_425952 290 11 continue continue VB 10_1101-2021_01_08_425952 290 12 to to TO 10_1101-2021_01_08_425952 290 13 add add VB 10_1101-2021_01_08_425952 290 14 new new JJ 10_1101-2021_01_08_425952 290 15 features feature NNS 10_1101-2021_01_08_425952 290 16 to to TO 10_1101-2021_01_08_425952 290 17 rdrugtrajectory rdrugtrajectory VB 10_1101-2021_01_08_425952 290 18 whilst whilst IN 10_1101-2021_01_08_425952 290 19 making make VBG 10_1101-2021_01_08_425952 290 20 necessary necessary JJ 10_1101-2021_01_08_425952 290 21 improvements improvement NNS 10_1101-2021_01_08_425952 290 22 to to IN 10_1101-2021_01_08_425952 290 23 existing exist VBG 10_1101-2021_01_08_425952 290 24 features feature NNS 10_1101-2021_01_08_425952 290 25 . . . 10_1101-2021_01_08_425952 291 1 Acknowledgements Acknowledgements NNPS 10_1101-2021_01_08_425952 291 2 Oxford Oxford NNP 10_1101-2021_01_08_425952 291 3 Science Science NNP 10_1101-2021_01_08_425952 291 4 Innovation Innovation NNP 10_1101-2021_01_08_425952 291 5 , , , 10_1101-2021_01_08_425952 291 6 NIHR NIHR NNP 10_1101-2021_01_08_425952 291 7 Oxford Oxford NNP 10_1101-2021_01_08_425952 291 8 Biomedical Biomedical NNP 10_1101-2021_01_08_425952 291 9 Research Research NNP 10_1101-2021_01_08_425952 291 10 Centre Centre NNP 10_1101-2021_01_08_425952 291 11 and and CC 10_1101-2021_01_08_425952 291 12 NIHR NIHR NNP 10_1101-2021_01_08_425952 291 13 Oxford Oxford NNP 10_1101-2021_01_08_425952 291 14 Health Health NNP 10_1101-2021_01_08_425952 291 15 Biomedical Biomedical NNP 10_1101-2021_01_08_425952 291 16 Research Research NNP 10_1101-2021_01_08_425952 291 17 Centre Centre NNP 10_1101-2021_01_08_425952 291 18 ( ( -LRB- 10_1101-2021_01_08_425952 291 19 Informatics Informatics NNP 10_1101-2021_01_08_425952 291 20 and and CC 10_1101-2021_01_08_425952 291 21 Digital Digital NNP 10_1101-2021_01_08_425952 291 22 Health Health NNP 10_1101-2021_01_08_425952 291 23 theme theme NN 10_1101-2021_01_08_425952 291 24 , , , 10_1101-2021_01_08_425952 291 25 grant grant VB 10_1101-2021_01_08_425952 291 26 BRC-1215- BRC-1215- NNP 10_1101-2021_01_08_425952 291 27 20005 20005 CD 10_1101-2021_01_08_425952 291 28 ) ) -RRB- 10_1101-2021_01_08_425952 291 29 . . . 10_1101-2021_01_08_425952 292 1 Thanks thank NNS 10_1101-2021_01_08_425952 292 2 to to IN 10_1101-2021_01_08_425952 292 3 Dr Dr NNP 10_1101-2021_01_08_425952 292 4 Michelle Michelle NNP 10_1101-2021_01_08_425952 292 5 Hardy Hardy NNP 10_1101-2021_01_08_425952 292 6 for for IN 10_1101-2021_01_08_425952 292 7 assistance assistance NN 10_1101-2021_01_08_425952 292 8 with with IN 10_1101-2021_01_08_425952 292 9 the the DT 10_1101-2021_01_08_425952 292 10 article article NN 10_1101-2021_01_08_425952 292 11 . . . 10_1101-2021_01_08_425952 293 1 References reference NNS 10_1101-2021_01_08_425952 293 2 Bally Bally NNP 10_1101-2021_01_08_425952 293 3 M M NNP 10_1101-2021_01_08_425952 293 4 , , , 10_1101-2021_01_08_425952 293 5 Dendukuri Dendukuri NNP 10_1101-2021_01_08_425952 293 6 N N NNP 10_1101-2021_01_08_425952 293 7 , , , 10_1101-2021_01_08_425952 293 8 Rich Rich NNP 10_1101-2021_01_08_425952 293 9 B B NNP 10_1101-2021_01_08_425952 293 10 , , , 10_1101-2021_01_08_425952 293 11 Nadeau Nadeau NNP 10_1101-2021_01_08_425952 293 12 L L NNP 10_1101-2021_01_08_425952 293 13 , , , 10_1101-2021_01_08_425952 293 14 Helin Helin NNP 10_1101-2021_01_08_425952 293 15 - - HYPH 10_1101-2021_01_08_425952 293 16 Salmivaara Salmivaara NNP 10_1101-2021_01_08_425952 293 17 A A NNP 10_1101-2021_01_08_425952 293 18 , , , 10_1101-2021_01_08_425952 293 19 Garbe Garbe NNP 10_1101-2021_01_08_425952 293 20 E E NNP 10_1101-2021_01_08_425952 293 21 , , , 10_1101-2021_01_08_425952 293 22 Brophy Brophy NNP 10_1101-2021_01_08_425952 293 23 JM JM NNP 10_1101-2021_01_08_425952 293 24 ( ( -LRB- 10_1101-2021_01_08_425952 293 25 2017 2017 CD 10_1101-2021_01_08_425952 293 26 ) ) -RRB- 10_1101-2021_01_08_425952 293 27 . . . 10_1101-2021_01_08_425952 294 1 “ " `` 10_1101-2021_01_08_425952 294 2 Risk risk NN 10_1101-2021_01_08_425952 294 3 of of IN 10_1101-2021_01_08_425952 294 4 Acute acute JJ 10_1101-2021_01_08_425952 294 5 Myocardial Myocardial NNP 10_1101-2021_01_08_425952 294 6 Infarction Infarction NNP 10_1101-2021_01_08_425952 294 7 with with IN 10_1101-2021_01_08_425952 294 8 NSAIDs nsaid NNS 10_1101-2021_01_08_425952 294 9 in in IN 10_1101-2021_01_08_425952 294 10 Real real JJ 10_1101-2021_01_08_425952 294 11 World world NN 10_1101-2021_01_08_425952 294 12 Use use NN 10_1101-2021_01_08_425952 294 13 : : : 10_1101-2021_01_08_425952 294 14 Bayesian bayesian JJ 10_1101-2021_01_08_425952 294 15 Meta- meta- NN 10_1101-2021_01_08_425952 294 16 .CC .CC : 10_1101-2021_01_08_425952 294 17 - - : 10_1101-2021_01_08_425952 294 18 BY by IN 10_1101-2021_01_08_425952 294 19 - - HYPH 10_1101-2021_01_08_425952 294 20 ND ND NNP 10_1101-2021_01_08_425952 294 21 4.0 4.0 CD 10_1101-2021_01_08_425952 294 22 International international JJ 10_1101-2021_01_08_425952 294 23 licensemade licensemade NN 10_1101-2021_01_08_425952 294 24 available available JJ 10_1101-2021_01_08_425952 294 25 under under IN 10_1101-2021_01_08_425952 294 26 a a DT 10_1101-2021_01_08_425952 294 27 ( ( -LRB- 10_1101-2021_01_08_425952 294 28 which which WDT 10_1101-2021_01_08_425952 294 29 was be VBD 10_1101-2021_01_08_425952 294 30 not not RB 10_1101-2021_01_08_425952 294 31 certified certify VBN 10_1101-2021_01_08_425952 294 32 by by IN 10_1101-2021_01_08_425952 294 33 peer peer NN 10_1101-2021_01_08_425952 294 34 review review NN 10_1101-2021_01_08_425952 294 35 ) ) -RRB- 10_1101-2021_01_08_425952 294 36 is be VBZ 10_1101-2021_01_08_425952 294 37 the the DT 10_1101-2021_01_08_425952 294 38 author author NN 10_1101-2021_01_08_425952 294 39 / / SYM 10_1101-2021_01_08_425952 294 40 funder funder NN 10_1101-2021_01_08_425952 294 41 , , , 10_1101-2021_01_08_425952 294 42 who who WP 10_1101-2021_01_08_425952 294 43 has have VBZ 10_1101-2021_01_08_425952 294 44 granted grant VBN 10_1101-2021_01_08_425952 294 45 bioRxiv biorxiv IN 10_1101-2021_01_08_425952 294 46 a a DT 10_1101-2021_01_08_425952 294 47 license license NN 10_1101-2021_01_08_425952 294 48 to to TO 10_1101-2021_01_08_425952 294 49 display display VB 10_1101-2021_01_08_425952 294 50 the the DT 10_1101-2021_01_08_425952 294 51 preprint preprint NN 10_1101-2021_01_08_425952 294 52 in in IN 10_1101-2021_01_08_425952 294 53 perpetuity perpetuity NN 10_1101-2021_01_08_425952 294 54 . . . 10_1101-2021_01_08_425952 295 1 It -PRON- PRP 10_1101-2021_01_08_425952 295 2 is be VBZ 10_1101-2021_01_08_425952 295 3 The the DT 10_1101-2021_01_08_425952 295 4 copyright copyright NN 10_1101-2021_01_08_425952 295 5 holder holder NN 10_1101-2021_01_08_425952 295 6 for for IN 10_1101-2021_01_08_425952 295 7 this this DT 10_1101-2021_01_08_425952 295 8 preprintthis preprintthis NN 10_1101-2021_01_08_425952 295 9 version version NN 10_1101-2021_01_08_425952 295 10 posted post VBD 10_1101-2021_01_08_425952 295 11 January January NNP 10_1101-2021_01_08_425952 295 12 9 9 CD 10_1101-2021_01_08_425952 295 13 , , , 10_1101-2021_01_08_425952 295 14 2021 2021 CD 10_1101-2021_01_08_425952 295 15 . . . 10_1101-2021_01_08_425952 295 16 ; ; : 10_1101-2021_01_08_425952 295 17 https://doi.org/10.1101/2021.01.08.425952doi https://doi.org/10.1101/2021.01.08.425952doi ADD 10_1101-2021_01_08_425952 295 18 : : : 10_1101-2021_01_08_425952 295 19 bioRxiv biorxiv VB 10_1101-2021_01_08_425952 295 20 preprint preprint NN 10_1101-2021_01_08_425952 295 21 https://github.com/acnash/rdrugtrajectory https://github.com/acnash/rdrugtrajectory NN 10_1101-2021_01_08_425952 295 22 https://doi.org/10.1101/2021.01.08.425952 https://doi.org/10.1101/2021.01.08.425952 XX 10_1101-2021_01_08_425952 295 23 http://creativecommons.org/licenses/by-nd/4.0/ http://creativecommons.org/licenses/by-nd/4.0/ NN 10_1101-2021_01_08_425952 295 24 30 30 CD 10_1101-2021_01_08_425952 295 25 rdrugtrajectory rdrugtrajectory NN 10_1101-2021_01_08_425952 295 26 : : : 10_1101-2021_01_08_425952 295 27 Analysing Analysing NNP 10_1101-2021_01_08_425952 295 28 Drug Drug NNP 10_1101-2021_01_08_425952 295 29 Prescriptions Prescriptions NNPS 10_1101-2021_01_08_425952 295 30 in in IN 10_1101-2021_01_08_425952 295 31 Electronic Electronic NNP 10_1101-2021_01_08_425952 295 32 Health Health NNP 10_1101-2021_01_08_425952 295 33 Care Care NNP 10_1101-2021_01_08_425952 295 34 Records Records NNP 10_1101-2021_01_08_425952 295 35 Analysis Analysis NNP 10_1101-2021_01_08_425952 295 36 of of IN 10_1101-2021_01_08_425952 295 37 Individual Individual NNP 10_1101-2021_01_08_425952 295 38 Patient Patient NNP 10_1101-2021_01_08_425952 295 39 Data Data NNP 10_1101-2021_01_08_425952 295 40 . . . 10_1101-2021_01_08_425952 295 41 ” " '' 10_1101-2021_01_08_425952 295 42 British British NNP 10_1101-2021_01_08_425952 295 43 Medical Medical NNP 10_1101-2021_01_08_425952 295 44 Journal Journal NNP 10_1101-2021_01_08_425952 295 45 , , , 10_1101-2021_01_08_425952 295 46 357 357 CD 10_1101-2021_01_08_425952 295 47 , , , 10_1101-2021_01_08_425952 295 48 j1909 j1909 JJ 10_1101-2021_01_08_425952 295 49 . . . 10_1101-2021_01_08_425952 296 1 doi:10.1136/ doi:10.1136/ NNP 10_1101-2021_01_08_425952 296 2 bmj.j1909 bmj.j1909 NNP 10_1101-2021_01_08_425952 296 3 . . . 10_1101-2021_01_08_425952 297 1 Ghosh Ghosh NNP 10_1101-2021_01_08_425952 297 2 RE RE NNP 10_1101-2021_01_08_425952 297 3 , , , 10_1101-2021_01_08_425952 297 4 Crellin Crellin NNP 10_1101-2021_01_08_425952 297 5 E E NNP 10_1101-2021_01_08_425952 297 6 , , , 10_1101-2021_01_08_425952 297 7 Beatty Beatty NNP 10_1101-2021_01_08_425952 297 8 S S NNP 10_1101-2021_01_08_425952 297 9 , , , 10_1101-2021_01_08_425952 297 10 Donegan Donegan NNP 10_1101-2021_01_08_425952 297 11 K K NNP 10_1101-2021_01_08_425952 297 12 , , , 10_1101-2021_01_08_425952 297 13 Myles Myles NNP 10_1101-2021_01_08_425952 297 14 P P NNP 10_1101-2021_01_08_425952 297 15 , , , 10_1101-2021_01_08_425952 297 16 Williams Williams NNP 10_1101-2021_01_08_425952 297 17 R R NNP 10_1101-2021_01_08_425952 297 18 ( ( -LRB- 10_1101-2021_01_08_425952 297 19 2019 2019 CD 10_1101-2021_01_08_425952 297 20 ) ) -RRB- 10_1101-2021_01_08_425952 297 21 . . . 10_1101-2021_01_08_425952 298 1 “ " `` 10_1101-2021_01_08_425952 298 2 How how WRB 10_1101-2021_01_08_425952 298 3 Clinical Clinical NNP 10_1101-2021_01_08_425952 298 4 Practice Practice NNP 10_1101-2021_01_08_425952 298 5 Research Research NNP 10_1101-2021_01_08_425952 298 6 Datalink Datalink NNP 10_1101-2021_01_08_425952 298 7 data datum NNS 10_1101-2021_01_08_425952 298 8 are be VBP 10_1101-2021_01_08_425952 298 9 used use VBN 10_1101-2021_01_08_425952 298 10 to to TO 10_1101-2021_01_08_425952 298 11 support support VB 10_1101-2021_01_08_425952 298 12 pharmacovigilance pharmacovigilance NN 10_1101-2021_01_08_425952 298 13 . . . 10_1101-2021_01_08_425952 298 14 ” " '' 10_1101-2021_01_08_425952 298 15 Therapeutic therapeutic JJ 10_1101-2021_01_08_425952 298 16 Advances Advances NNPS 10_1101-2021_01_08_425952 298 17 in in IN 10_1101-2021_01_08_425952 298 18 Drug Drug NNP 10_1101-2021_01_08_425952 298 19 Safety Safety NNP 10_1101-2021_01_08_425952 298 20 , , , 10_1101-2021_01_08_425952 298 21 10 10 CD 10_1101-2021_01_08_425952 298 22 , , , 10_1101-2021_01_08_425952 298 23 1–7 1–7 CD 10_1101-2021_01_08_425952 298 24 . . . 10_1101-2021_01_08_425952 299 1 doi:10.1177/2042098619854010 doi:10.1177/2042098619854010 NNP 10_1101-2021_01_08_425952 299 2 . . . 10_1101-2021_01_08_425952 300 1 Hepp Hepp NNP 10_1101-2021_01_08_425952 300 2 Z Z NNP 10_1101-2021_01_08_425952 300 3 , , , 10_1101-2021_01_08_425952 300 4 Dodick Dodick NNP 10_1101-2021_01_08_425952 300 5 DW DW NNP 10_1101-2021_01_08_425952 300 6 , , , 10_1101-2021_01_08_425952 300 7 Varon Varon NNP 10_1101-2021_01_08_425952 300 8 SF SF NNP 10_1101-2021_01_08_425952 300 9 , , , 10_1101-2021_01_08_425952 300 10 Chia Chia NNP 10_1101-2021_01_08_425952 300 11 J J NNP 10_1101-2021_01_08_425952 300 12 , , , 10_1101-2021_01_08_425952 300 13 Matthew Matthew NNP 10_1101-2021_01_08_425952 300 14 N N NNP 10_1101-2021_01_08_425952 300 15 , , , 10_1101-2021_01_08_425952 300 16 Gillard Gillard NNP 10_1101-2021_01_08_425952 300 17 P P NNP 10_1101-2021_01_08_425952 300 18 , , , 10_1101-2021_01_08_425952 300 19 Hansen Hansen NNP 10_1101-2021_01_08_425952 300 20 RN RN NNP 10_1101-2021_01_08_425952 300 21 , , , 10_1101-2021_01_08_425952 300 22 Devine Devine NNP 10_1101-2021_01_08_425952 300 23 EB EB NNP 10_1101-2021_01_08_425952 300 24 ( ( -LRB- 10_1101-2021_01_08_425952 300 25 2017 2017 CD 10_1101-2021_01_08_425952 300 26 ) ) -RRB- 10_1101-2021_01_08_425952 300 27 . . . 10_1101-2021_01_08_425952 301 1 “ " `` 10_1101-2021_01_08_425952 301 2 Persistence Persistence NNP 10_1101-2021_01_08_425952 301 3 and and CC 10_1101-2021_01_08_425952 301 4 Switching Switching NNP 10_1101-2021_01_08_425952 301 5 Patterns Patterns NNPS 10_1101-2021_01_08_425952 301 6 of of IN 10_1101-2021_01_08_425952 301 7 Oral Oral NNP 10_1101-2021_01_08_425952 301 8 Migraine Migraine NNP 10_1101-2021_01_08_425952 301 9 Prophylactic Prophylactic NNP 10_1101-2021_01_08_425952 301 10 Medications Medications NNPS 10_1101-2021_01_08_425952 301 11 Among among IN 10_1101-2021_01_08_425952 301 12 Patients Patients NNPS 10_1101-2021_01_08_425952 301 13 with with IN 10_1101-2021_01_08_425952 301 14 Chronic Chronic NNP 10_1101-2021_01_08_425952 301 15 Migraine Migraine NNP 10_1101-2021_01_08_425952 301 16 : : : 10_1101-2021_01_08_425952 301 17 A a DT 10_1101-2021_01_08_425952 301 18 Retrospective Retrospective NNP 10_1101-2021_01_08_425952 301 19 Claims Claims NNPS 10_1101-2021_01_08_425952 301 20 Analysis analysis NN 10_1101-2021_01_08_425952 301 21 . . . 10_1101-2021_01_08_425952 301 22 ” " '' 10_1101-2021_01_08_425952 301 23 Cephalalgia cephalalgia NN 10_1101-2021_01_08_425952 301 24 , , , 10_1101-2021_01_08_425952 301 25 37(5 37(5 CD 10_1101-2021_01_08_425952 301 26 ) ) -RRB- 10_1101-2021_01_08_425952 301 27 , , , 10_1101-2021_01_08_425952 301 28 470–485 470–485 CD 10_1101-2021_01_08_425952 301 29 . . . 10_1101-2021_01_08_425952 302 1 doi:10.1177/0333102416678382 doi:10.1177/0333102416678382 NNP 10_1101-2021_01_08_425952 302 2 . . . 10_1101-2021_01_08_425952 303 1 Oyinlola Oyinlola NNP 10_1101-2021_01_08_425952 303 2 JO JO NNP 10_1101-2021_01_08_425952 303 3 , , , 10_1101-2021_01_08_425952 303 4 Campbell Campbell NNP 10_1101-2021_01_08_425952 303 5 J J NNP 10_1101-2021_01_08_425952 303 6 , , , 10_1101-2021_01_08_425952 303 7 Kousoulis Kousoulis NNP 10_1101-2021_01_08_425952 303 8 AA AA NNP 10_1101-2021_01_08_425952 303 9 ( ( -LRB- 10_1101-2021_01_08_425952 303 10 2016 2016 CD 10_1101-2021_01_08_425952 303 11 ) ) -RRB- 10_1101-2021_01_08_425952 303 12 . . . 10_1101-2021_01_08_425952 304 1 “ " `` 10_1101-2021_01_08_425952 304 2 Is be VBZ 10_1101-2021_01_08_425952 304 3 Real real JJ 10_1101-2021_01_08_425952 304 4 World world NN 10_1101-2021_01_08_425952 304 5 Evidence evidence NN 10_1101-2021_01_08_425952 304 6 Influencing Influencing NNP 10_1101-2021_01_08_425952 304 7 Practice Practice NNP 10_1101-2021_01_08_425952 304 8 ? ? . 10_1101-2021_01_08_425952 305 1 A a DT 10_1101-2021_01_08_425952 305 2 Systematic Systematic NNP 10_1101-2021_01_08_425952 305 3 Review Review NNP 10_1101-2021_01_08_425952 305 4 of of IN 10_1101-2021_01_08_425952 305 5 CPRD CPRD NNP 10_1101-2021_01_08_425952 305 6 Research Research NNP 10_1101-2021_01_08_425952 305 7 in in IN 10_1101-2021_01_08_425952 305 8 NICE NICE NNP 10_1101-2021_01_08_425952 305 9 Guidance Guidance NNP 10_1101-2021_01_08_425952 305 10 . . . 10_1101-2021_01_08_425952 305 11 ” " '' 10_1101-2021_01_08_425952 305 12 BMC BMC NNP 10_1101-2021_01_08_425952 305 13 Health Health NNP 10_1101-2021_01_08_425952 305 14 Service Service NNP 10_1101-2021_01_08_425952 305 15 Research Research NNP 10_1101-2021_01_08_425952 305 16 , , , 10_1101-2021_01_08_425952 305 17 16(299 16(299 CD 10_1101-2021_01_08_425952 305 18 ) ) -RRB- 10_1101-2021_01_08_425952 305 19 , , , 10_1101-2021_01_08_425952 305 20 1–12 1–12 NNP 10_1101-2021_01_08_425952 305 21 . . . 10_1101-2021_01_08_425952 306 1 doi:10.1186 doi:10.1186 NNP 10_1101-2021_01_08_425952 306 2 / / SYM 10_1101-2021_01_08_425952 306 3 s12913 s12913 NNP 10_1101-2021_01_08_425952 306 4 - - HYPH 10_1101-2021_01_08_425952 306 5 016 016 CD 10_1101-2021_01_08_425952 306 6 - - HYPH 10_1101-2021_01_08_425952 306 7 1562 1562 CD 10_1101-2021_01_08_425952 306 8 - - HYPH 10_1101-2021_01_08_425952 306 9 8 8 CD 10_1101-2021_01_08_425952 306 10 . . . 10_1101-2021_01_08_425952 307 1 Affiliation affiliation NN 10_1101-2021_01_08_425952 307 2 : : : 10_1101-2021_01_08_425952 307 3 Nuffield Nuffield NNP 10_1101-2021_01_08_425952 307 4 Department Department NNP 10_1101-2021_01_08_425952 307 5 of of IN 10_1101-2021_01_08_425952 307 6 Clinical Clinical NNP 10_1101-2021_01_08_425952 307 7 Neurosciences Neurosciences NNPS 10_1101-2021_01_08_425952 307 8 Medical Medical NNP 10_1101-2021_01_08_425952 307 9 Sciences Sciences NNPS 10_1101-2021_01_08_425952 307 10 Division Division NNP 10_1101-2021_01_08_425952 307 11 University University NNP 10_1101-2021_01_08_425952 307 12 of of IN 10_1101-2021_01_08_425952 307 13 Oxford Oxford NNP 10_1101-2021_01_08_425952 307 14 Oxford Oxford NNP 10_1101-2021_01_08_425952 307 15 UK UK NNP 10_1101-2021_01_08_425952 307 16 OX3 OX3 NNP 10_1101-2021_01_08_425952 307 17 9DU 9DU NNP 10_1101-2021_01_08_425952 307 18 E e NN 10_1101-2021_01_08_425952 307 19 - - NN 10_1101-2021_01_08_425952 307 20 mail mail NN 10_1101-2021_01_08_425952 307 21 : : : 10_1101-2021_01_08_425952 307 22 anthony.nash@ndcn.ox.ac.uk anthony.nash@ndcn.ox.ac.uk NNP 10_1101-2021_01_08_425952 307 23 Journal Journal NNP 10_1101-2021_01_08_425952 307 24 of of IN 10_1101-2021_01_08_425952 307 25 Statistical Statistical NNP 10_1101-2021_01_08_425952 307 26 Software Software NNP 10_1101-2021_01_08_425952 307 27 http://www.jstatsoft.org/ http://www.jstatsoft.org/ NN 10_1101-2021_01_08_425952 307 28 published publish VBN 10_1101-2021_01_08_425952 307 29 by by IN 10_1101-2021_01_08_425952 307 30 the the DT 10_1101-2021_01_08_425952 307 31 Foundation Foundation NNP 10_1101-2021_01_08_425952 307 32 for for IN 10_1101-2021_01_08_425952 307 33 Open Open NNP 10_1101-2021_01_08_425952 307 34 Access Access NNP 10_1101-2021_01_08_425952 307 35 Statistics Statistics NNPS 10_1101-2021_01_08_425952 307 36 http://www.foastat.org/ http://www.foastat.org/ NN 10_1101-2021_01_08_425952 307 37 MMMMMM MMMMMM NNS 10_1101-2021_01_08_425952 307 38 YYYY YYYY NNP 10_1101-2021_01_08_425952 307 39 , , , 10_1101-2021_01_08_425952 307 40 Volume volume NN 10_1101-2021_01_08_425952 307 41 VV VV NNP 10_1101-2021_01_08_425952 307 42 , , , 10_1101-2021_01_08_425952 307 43 Issue issue NN 10_1101-2021_01_08_425952 307 44 II II NNP 10_1101-2021_01_08_425952 307 45 Submitted submit VBN 10_1101-2021_01_08_425952 307 46 : : : 10_1101-2021_01_08_425952 307 47 yyyy yyyy NNP 10_1101-2021_01_08_425952 307 48 - - HYPH 10_1101-2021_01_08_425952 307 49 mm mm NNP 10_1101-2021_01_08_425952 307 50 - - HYPH 10_1101-2021_01_08_425952 307 51 dd dd NNP 10_1101-2021_01_08_425952 307 52 doi:10.18637 doi:10.18637 NNP 10_1101-2021_01_08_425952 307 53 / / SYM 10_1101-2021_01_08_425952 307 54 jss.v000.i00 jss.v000.i00 NNP 10_1101-2021_01_08_425952 307 55 Accepted accept VBN 10_1101-2021_01_08_425952 307 56 : : : 10_1101-2021_01_08_425952 307 57 yyyy yyyy NNP 10_1101-2021_01_08_425952 307 58 - - HYPH 10_1101-2021_01_08_425952 307 59 mm mm NNP 10_1101-2021_01_08_425952 307 60 - - HYPH 10_1101-2021_01_08_425952 307 61 dd dd NNP 10_1101-2021_01_08_425952 307 62 .CC .CC NFP 10_1101-2021_01_08_425952 307 63 - - : 10_1101-2021_01_08_425952 307 64 BY by IN 10_1101-2021_01_08_425952 307 65 - - HYPH 10_1101-2021_01_08_425952 307 66 ND ND NNP 10_1101-2021_01_08_425952 307 67 4.0 4.0 CD 10_1101-2021_01_08_425952 307 68 International international JJ 10_1101-2021_01_08_425952 307 69 licensemade licensemade NN 10_1101-2021_01_08_425952 307 70 available available JJ 10_1101-2021_01_08_425952 307 71 under under IN 10_1101-2021_01_08_425952 307 72 a a DT 10_1101-2021_01_08_425952 307 73 ( ( -LRB- 10_1101-2021_01_08_425952 307 74 which which WDT 10_1101-2021_01_08_425952 307 75 was be VBD 10_1101-2021_01_08_425952 307 76 not not RB 10_1101-2021_01_08_425952 307 77 certified certify VBN 10_1101-2021_01_08_425952 307 78 by by IN 10_1101-2021_01_08_425952 307 79 peer peer NN 10_1101-2021_01_08_425952 307 80 review review NN 10_1101-2021_01_08_425952 307 81 ) ) -RRB- 10_1101-2021_01_08_425952 307 82 is be VBZ 10_1101-2021_01_08_425952 307 83 the the DT 10_1101-2021_01_08_425952 307 84 author author NN 10_1101-2021_01_08_425952 307 85 / / SYM 10_1101-2021_01_08_425952 307 86 funder funder NN 10_1101-2021_01_08_425952 307 87 , , , 10_1101-2021_01_08_425952 307 88 who who WP 10_1101-2021_01_08_425952 307 89 has have VBZ 10_1101-2021_01_08_425952 307 90 granted grant VBN 10_1101-2021_01_08_425952 307 91 bioRxiv biorxiv IN 10_1101-2021_01_08_425952 307 92 a a DT 10_1101-2021_01_08_425952 307 93 license license NN 10_1101-2021_01_08_425952 307 94 to to TO 10_1101-2021_01_08_425952 307 95 display display VB 10_1101-2021_01_08_425952 307 96 the the DT 10_1101-2021_01_08_425952 307 97 preprint preprint NN 10_1101-2021_01_08_425952 307 98 in in IN 10_1101-2021_01_08_425952 307 99 perpetuity perpetuity NN 10_1101-2021_01_08_425952 307 100 . . . 10_1101-2021_01_08_425952 308 1 It -PRON- PRP 10_1101-2021_01_08_425952 308 2 is be VBZ 10_1101-2021_01_08_425952 308 3 The the DT 10_1101-2021_01_08_425952 308 4 copyright copyright NN 10_1101-2021_01_08_425952 308 5 holder holder NN 10_1101-2021_01_08_425952 308 6 for for IN 10_1101-2021_01_08_425952 308 7 this this DT 10_1101-2021_01_08_425952 308 8 preprintthis preprintthis NN 10_1101-2021_01_08_425952 308 9 version version NN 10_1101-2021_01_08_425952 308 10 posted post VBD 10_1101-2021_01_08_425952 308 11 January January NNP 10_1101-2021_01_08_425952 308 12 9 9 CD 10_1101-2021_01_08_425952 308 13 , , , 10_1101-2021_01_08_425952 308 14 2021 2021 CD 10_1101-2021_01_08_425952 308 15 . . . 10_1101-2021_01_08_425952 308 16 ; ; : 10_1101-2021_01_08_425952 308 17 https://doi.org/10.1101/2021.01.08.425952doi https://doi.org/10.1101/2021.01.08.425952doi ADD 10_1101-2021_01_08_425952 308 18 : : : 10_1101-2021_01_08_425952 308 19 bioRxiv biorxiv IN 10_1101-2021_01_08_425952 308 20 preprint preprint NN 10_1101-2021_01_08_425952 308 21 http://dx.doi.org/10.1136/bmj.j1909 http://dx.doi.org/10.1136/bmj.j1909 JJ 10_1101-2021_01_08_425952 308 22 http://dx.doi.org/10.1136/bmj.j1909 http://dx.doi.org/10.1136/bmj.j1909 JJ 10_1101-2021_01_08_425952 308 23 http://dx.doi.org/10.1177/2042098619854010 http://dx.doi.org/10.1177/2042098619854010 NNS 10_1101-2021_01_08_425952 308 24 http://dx.doi.org/10.1177/0333102416678382 http://dx.doi.org/10.1177/0333102416678382 VBP 10_1101-2021_01_08_425952 308 25 http://dx.doi.org/10.1186/s12913-016-1562-8 http://dx.doi.org/10.1186/s12913-016-1562-8 NNP 10_1101-2021_01_08_425952 308 26 mailto:anthony.nash@ndcn.ox.ac.uk mailto:anthony.nash@ndcn.ox.ac.uk NNP 10_1101-2021_01_08_425952 308 27 http://www.jstatsoft.org/ http://www.jstatsoft.org/ NN 10_1101-2021_01_08_425952 308 28 http://www.foastat.org/ http://www.foastat.org/ NN 10_1101-2021_01_08_425952 308 29 http://dx.doi.org/10.18637/jss.v000.i00 http://dx.doi.org/10.18637/jss.v000.i00 NNP 10_1101-2021_01_08_425952 308 30 https://doi.org/10.1101/2021.01.08.425952 https://doi.org/10.1101/2021.01.08.425952 NNP 10_1101-2021_01_08_425952 308 31 http://creativecommons.org/licenses/by-nd/4.0/ http://creativecommons.org/licenses/by-nd/4.0/ NNP