-
Notifications
You must be signed in to change notification settings - Fork 1
/
37_opioids_expR.do
303 lines (302 loc) · 9.03 KB
/
37_opioids_expR.do
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
di "$S_TIME"
clear
set more off
tempfile pde_2013 pde_2014 pde2013bc pde2014bc
use usrds_id srvc_dt gnn using "/dcs01/igm/segevlab/data/usrds2015/claims/pd/pde2013",clear
save `pde_2013',replace
use usrds_id srvc_dt gnn using "/dcs01/igm/segevlab/data/usrds2016/claims/pd/pde2014",clear
save `pde_2014',replace
local year "y=2013/2014"
forvalues `year' {
capture use `pde_`y'',clear
if _rc==0 {
di "processing pde_`y'.dta ..."
gen opioids1=(strpos(gnn,"ACETORPHINE")!=0)
gen opioids2=(strpos(gnn,"ACETYLCODEINE")!=0)
gen opioids3=(strpos(gnn,"ACETYLMETHADOL")!=0)
gen opioids4=(strpos(gnn,"ACRYLFENTANYL")!=0)
gen opioids5=(strpos(gnn,"ALFENTANIL")!=0)
gen opioids6=(strpos(gnn,"ALPHAPRODINE")!=0)
gen opioids7=(strpos(gnn,"ANILERIDINE")!=0)
gen opioids8=(strpos(gnn,"APADOLINE")!=0)
gen opioids9=(strpos(gnn,"ASALHYDROMORPHONE")!=0)
gen opioids10=(strpos(gnn,"AZIDOMORPHINE")!=0)
gen opioids11=(strpos(gnn,"BENZHYDROCODONE")!=0)
gen opioids12=(strpos(gnn,"BETA HYDROXYMEFENTANYL")!=0)
gen opioids13=(strpos(gnn,"BETA-CASOMORPHINS")!=0)
gen opioids14=(strpos(gnn,"BEZITRAMIDE")!=0)
gen opioids15=(strpos(gnn,"BREMAZOCINE")!=0)
gen opioids16=(strpos(gnn,"BRIFENTANIL")!=0)
gen opioids17=(strpos(gnn,"BROMPTON MIXTURE")!=0)
gen opioids18=(strpos(gnn,"BUPRENORPHINE")!=0)
gen opioids19=(strpos(gnn,"BUTORPHANOL")!=0)
gen opioids20=(strpos(gnn,"CARFENTANIL")!=0)
gen opioids21=(strpos(gnn,"CIRAMADOL")!=0)
gen opioids22=(strpos(gnn,"COCODAMOL")!=0)
gen opioids23=(strpos(gnn,"CODEINE")!=0)
gen opioids24=(strpos(gnn,"CODYDRAMOL")!=0)
gen opioids25=(strpos(gnn,"CONORFONE")!=0)
gen opioids26=(strpos(gnn,"CROTONYLFENTANYL")!=0)
gen opioids27=(strpos(gnn,"CYCLAZOCINE")!=0)
gen opioids28=(strpos(gnn,"CYCLOPROPYLFENTANYL")!=0)
gen opioids29=(strpos(gnn,"DERMORPHIN")!=0)
gen opioids30=(strpos(gnn,"DESMETRAMADOL")!=0)
gen opioids31=(strpos(gnn,"DESOMORPHINE")!=0)
gen opioids32=(strpos(gnn,"DEXTROMORAMIDE")!=0)
gen opioids33=(strpos(gnn,"DEXTROPROPOXYPHENE")!=0)
gen opioids34=(strpos(gnn,"DEXTRORPHAN")!=0)
gen opioids35=(strpos(gnn,"DEZOCINE")!=0)
gen opioids36=(strpos(gnn,"DIAMORPHINE")!=0)
gen opioids37=(strpos(gnn,"DICONAL")!=0)
gen opioids38=(strpos(gnn,"DIFENOXIN HYDROCHLORIDE/ATROPINE SULFATE")!=0)
gen opioids39=(strpos(gnn,"DIHYDROCODEINE")!=0)
gen opioids40=(strpos(gnn,"DIHYDROETORPHINE")!=0)
gen opioids41=(strpos(gnn,"DIHYDROMORPHINE")!=0)
gen opioids42=(strpos(gnn,"DIMETHYLTHIAMBUTENE")!=0)
gen opioids43=(strpos(gnn,"DINALBUPHINE SEBACATE")!=0)
gen opioids44=(strpos(gnn,"DIPHENOXYLATE")!=0)
gen opioids45=(strpos(gnn,"DIPIPANONE")!=0)
gen opioids46=(strpos(gnn,"ENADOLINE")!=0)
gen opioids47=(strpos(gnn,"ENDOMORPHIN 1")!=0)
gen opioids48=(strpos(gnn,"ENDOMORPHIN 2")!=0)
gen opioids49=(strpos(gnn,"EPTAZOCINE")!=0)
gen opioids50=(strpos(gnn,"ESEROLINE")!=0)
gen opioids51=(strpos(gnn,"ETHYLKETAZOCINE")!=0)
gen opioids52=(strpos(gnn,"ETHYLKETOCYCLAZOCINE")!=0)
gen opioids53=(strpos(gnn,"ETHYLMORPHINE")!=0)
gen opioids54=(strpos(gnn,"ETONITAZENE")!=0)
gen opioids55=(strpos(gnn,"ETORPHINE")!=0)
gen opioids56=(strpos(gnn,"ETOXERIDINE")!=0)
gen opioids57=(strpos(gnn,"FAXELADOL")!=0)
gen opioids58=(strpos(gnn,"FENTANYL")!=0)
gen opioids59=(strpos(gnn,"FURETHIDINE")!=0)
gen opioids60=(strpos(gnn,"GELONIDA")!=0)
gen opioids61=(strpos(gnn,"HEROIN")!=0)
gen opioids62=(strpos(gnn,"HYDROCODONE")!=0)
gen opioids63=(strpos(gnn,"HYDROMORPHONE")!=0)
gen opioids64=(strpos(gnn,"HYPNORM")!=0)
gen opioids65=(strpos(gnn,"ISALMADOL")!=0)
gen opioids66=(strpos(gnn,"ISOMETHADONE")!=0)
gen opioids67=(strpos(gnn,"KETAZOCINE")!=0)
gen opioids68=(strpos(gnn,"KETOBEMIDONE")!=0)
gen opioids69=(strpos(gnn,"KETOGAN")!=0)
gen opioids70=(strpos(gnn,"KYOTORPHIN")!=0)
gen opioids71=(strpos(gnn,"LEFETAMINE")!=0)
gen opioids72=(strpos(gnn,"LEVACETYLMETHADOL")!=0)
gen opioids73=(strpos(gnn,"LEVOMETHADONE")!=0)
gen opioids74=(strpos(gnn,"LEVOMETHADYL")!=0)
gen opioids75=(strpos(gnn,"LEVORPHANOL")!=0)
gen opioids76=(strpos(gnn,"LOFENTANIL")!=0)
gen opioids77=(strpos(gnn,"MEFENTANYL")!=0)
gen opioids78=(strpos(gnn,"MEPERIDINE")!=0)
gen opioids79=(strpos(gnn,"MEPTAZINOL")!=0)
gen opioids80=(strpos(gnn,"METAZOCINE")!=0)
gen opioids81=(strpos(gnn,"METHADONE")!=0)
gen opioids82=(strpos(gnn,"METHADYL ACETATE")!=0)
gen opioids83=(strpos(gnn,"METHYLSAMIDORPHAN")!=0)
gen opioids84=(strpos(gnn,"MIRFENTANIL")!=0)
gen opioids85=(strpos(gnn,"MORPHINE")!=0)
gen opioids86=(strpos(gnn,"MORPHINOMIMETIC AGENT")!=0)
gen opioids87=(strpos(gnn,"MORPHINONE")!=0)
gen opioids88=(strpos(gnn,"NALBUPHINE")!=0)
gen opioids89=(strpos(gnn,"NICOCODINE")!=0)
gen opioids90=(strpos(gnn,"NICOMORPHINE")!=0)
gen opioids91=(strpos(gnn,"NOCISTATIN")!=0)
gen opioids92=(strpos(gnn,"NORACYMETHADOL")!=0)
gen opioids93=(strpos(gnn,"NORBUPRENORPHINE")!=0)
gen opioids94=(strpos(gnn,"NORDEXTROPROPOXYPHENE")!=0)
gen opioids95=(strpos(gnn,"NORMETHADONE")!=0)
gen opioids96=(strpos(gnn,"NORMORPHINE")!=0)
gen opioids97=(strpos(gnn,"NORPETHIDINE")!=0)
gen opioids98=(strpos(gnn,"NORPROPOXYPHENE")!=0)
gen opioids99=(strpos(gnn,"OCFENTANIL")!=0)
gen opioids100=(strpos(gnn,"O-DEMETHYLTRAMADOL")!=0)
gen opioids101=(strpos(gnn,"OLICERIDINE")!=0)
gen opioids102=(strpos(gnn,"OPIATE")!=0)
gen opioids103=(strpos(gnn,"OPIUM")!=0)
gen opioids104=(strpos(gnn,"ORIPAVINE")!=0)
gen opioids105=(strpos(gnn,"OXYCODEGOL")!=0)
gen opioids106=(strpos(gnn,"OXYCODONE")!=0)
gen opioids107=(strpos(gnn,"OXYMORPHONE")!=0)
gen opioids108=(strpos(gnn,"PARACYMETHADOL")!=0)
gen opioids109=(strpos(gnn,"PENTAMORPHONE")!=0)
gen opioids110=(strpos(gnn,"PENTAZOCINE")!=0)
gen opioids111=(strpos(gnn,"PETHIDINE")!=0)
gen opioids112=(strpos(gnn,"PHENADOXONE")!=0)
gen opioids113=(strpos(gnn,"PHENARIDINE")!=0)
gen opioids114=(strpos(gnn,"PHENAZOCINE")!=0)
gen opioids115=(strpos(gnn,"PHENCYCLIDINE")!=0)
gen opioids116=(strpos(gnn,"PHENOPERIDINE")!=0)
gen opioids117=(strpos(gnn,"PICENADOL")!=0)
gen opioids118=(strpos(gnn,"PIMINODINE")!=0)
gen opioids119=(strpos(gnn,"PIRINITRAMIDE")!=0)
gen opioids120=(strpos(gnn,"PIRITRAMIDE")!=0)
gen opioids121=(strpos(gnn,"PROFADOL")!=0)
gen opioids122=(strpos(gnn,"PROMEDOL")!=0)
gen opioids123=(strpos(gnn,"PROPIRAM")!=0)
gen opioids124=(strpos(gnn,"PROPOXYPHENE")!=0)
gen opioids125=(strpos(gnn,"PROTOPINE")!=0)
gen opioids126=(strpos(gnn,"REMIFENTANIL")!=0)
gen opioids127=(strpos(gnn,"SAMERIDINE")!=0)
gen opioids128=(strpos(gnn,"SAMIDORPHAN")!=0)
gen opioids129=(strpos(gnn,"SEMORPHONE")!=0)
gen opioids130=(strpos(gnn,"SUFENTANIL")!=0)
gen opioids131=(strpos(gnn,"TAPENTADOL")!=0)
gen opioids132=(strpos(gnn,"THEBAINE")!=0)
gen opioids133=(strpos(gnn,"TIFLUADOM")!=0)
gen opioids134=(strpos(gnn,"TILIDINE")!=0)
gen opioids135=(strpos(gnn,"TONAZOCINE")!=0)
gen opioids136=(strpos(gnn,"TRAMADOL")!=0)
gen opioids137=(strpos(gnn,"TREFENTANIL")!=0)
gen opioids138=(strpos(gnn,"TRIMEPERIDINE")!=0)
gen opioids_rx=( ///
opioids1+ ///
opioids2+ ///
opioids3+ ///
opioids4+ ///
opioids5+ ///
opioids6+ ///
opioids7+ ///
opioids8+ ///
opioids9+ ///
opioids10+ ///
opioids11+ ///
opioids12+ ///
opioids13+ ///
opioids14+ ///
opioids15+ ///
opioids16+ ///
opioids17+ ///
opioids18+ ///
opioids19+ ///
opioids20+ ///
opioids21+ ///
opioids22+ ///
opioids23+ ///
opioids24+ ///
opioids25+ ///
opioids26+ ///
opioids27+ ///
opioids28+ ///
opioids29+ ///
opioids30+ ///
opioids31+ ///
opioids32+ ///
opioids33+ ///
opioids34+ ///
opioids35+ ///
opioids36+ ///
opioids37+ ///
opioids38+ ///
opioids39+ ///
opioids40+ ///
opioids41+ ///
opioids42+ ///
opioids43+ ///
opioids44+ ///
opioids45+ ///
opioids46+ ///
opioids47+ ///
opioids48+ ///
opioids49+ ///
opioids50+ ///
opioids51+ ///
opioids52+ ///
opioids53+ ///
opioids54+ ///
opioids55+ ///
opioids56+ ///
opioids57+ ///
opioids58+ ///
opioids59+ ///
opioids60+ ///
opioids61+ ///
opioids62+ ///
opioids63+ ///
opioids64+ ///
opioids65+ ///
opioids66+ ///
opioids67+ ///
opioids68+ ///
opioids69+ ///
opioids70+ ///
opioids71+ ///
opioids72+ ///
opioids73+ ///
opioids74+ ///
opioids75+ ///
opioids76+ ///
opioids77+ ///
opioids78+ ///
opioids79+ ///
opioids80+ ///
opioids81+ ///
opioids82+ ///
opioids83+ ///
opioids84+ ///
opioids85+ ///
opioids86+ ///
opioids87+ ///
opioids88+ ///
opioids89+ ///
opioids90+ ///
opioids91+ ///
opioids92+ ///
opioids93+ ///
opioids94+ ///
opioids95+ ///
opioids96+ ///
opioids97+ ///
opioids98+ ///
opioids99+ ///
opioids100+ ///
opioids101+ ///
opioids102+ ///
opioids103+ ///
opioids104+ ///
opioids105+ ///
opioids106+ ///
opioids107+ ///
opioids108+ ///
opioids109+ ///
opioids110+ ///
opioids111+ ///
opioids112+ ///
opioids113+ ///
opioids114+ ///
opioids115+ ///
opioids116+ ///
opioids117+ ///
opioids118+ ///
opioids119+ ///
opioids120+ ///
opioids121+ ///
opioids122+ ///
opioids123+ ///
opioids124+ ///
opioids125+ ///
opioids126+ ///
opioids127+ ///
opioids128+ ///
opioids129+ ///
opioids130+ ///
opioids131+ ///
opioids132+ ///
opioids133+ ///
opioids134+ ///
opioids135+ ///
opioids136+ ///
opioids137+ ///
opioids138 ///
>0)
keep usrds_id srvc_dt opioids_rx
duplicates drop
compress
save `pde`y'bc', replace
}
}
forvalues `year' {
capture append using `pde`y'bc'
}
save 37_opioids_expR.dta,replace
di "$S_TIME"