-
Notifications
You must be signed in to change notification settings - Fork 0
/
myDoc.R
333 lines (320 loc) · 14.2 KB
/
myDoc.R
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
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
## Taxo Dict
{
taxo_FP <- c('207Q00000X', '207QA0000X', '207QA0505X', '207QG0300X') # CMS08, FamilyPractice
taxo_GP <- c('208D00000X') # CMS01, GeneralPractice
taxo_IM <- c('207R00000X', '207RA0000X', '207RG0300X') # CMS 11, InternalMedicine
taxo_PedM <- c('208000000X', '2080A0000X') # CMS37, PediatricMedicine
taxo_NP <- c('363L00000X', '363LA2200X', '363LC1500X', '363LF0000X', '363LG0600X',
'363LP0200X', '363LP2300X') # CMS50, NursePractitioner
# taxo_PreM <- c() # CMS84, PreventiveMedicine
taxo_CCNS <- c('364S00000X', '364SA2200X', '364SC1501X', '364SF0001X', '364SG0600X',
'364SP0200X') # CMS89, Certified Clinical Nurse Specialist
taxo_PA <- c('363A00000X', '363AM0700X') # CMS97, PhysicianAssistant
taxo_OBGYN_org <- c('207V00000X', '207VG0400X', '207VX0000X') # CMS16, OBGYN
taxo_OBGYN_sup <- c('363LX0001X', '363LW0102X', '364SW0102X')
}
taxo_PCP <- c(taxo_FP, taxo_GP, taxo_IM, taxo_PedM, taxo_NP, taxo_CCNS, taxo_PA) # 8 categories for PCP.
taxo_OBGYN <- c(taxo_OBGYN_org, taxo_OBGYN_sup)
taxo_info <- rbind(data.table('taxo' = '207Q00000X', 'spec1' = 'FP', 'reference' = 'CMS08',
'description' = 'Allopathic & Osteopathic Physicians/Family Medicine'),
data.table('taxo' = '207QA0000X', 'spec1' = 'FP', 'reference' = 'CMS08',
'description' = 'Allopathic & Osteopathic Physicians/Family Medicine, Adolescent Medicine'),
data.table('taxo' = '207QA0505X', 'spec1' = 'FP', 'reference' = 'CMS08',
'description' = 'Allopathic & Osteopathic Physicians/Family Medicine, Adult Medicine'),
data.table('taxo' = '207QG0300X', 'spec1' = 'FP', 'reference' = 'CMS08',
'description' = 'Allopathic & Osteopathic Physicians/Family Medicine, Geriatric Medicine'),
data.table('taxo' = '208D00000X', 'spec1' = 'GP', 'reference' = 'CMS01',
'description' = 'Allopathic & Osteopathic Physicians/General Practice'),
data.table('taxo' = '207R00000X', 'spec1' = 'IM', 'reference' = 'CMS11',
'description' = 'Allopathic & Osteopathic Physicians/Internal Medicine'),
data.table('taxo' = '207RA0000X', 'spec1' = 'IM', 'reference' = 'CMS11',
'description' = 'Allopathic & Osteopathic Physicians/Internal Medicine, Adolescent Medicine'),
data.table('taxo' = '207RG0300X', 'spec1' = 'IM', 'reference' = 'CMS11',
'description' = 'Allopathic & Osteopathic Physicians/Internal Medicine, Geriatric Medicine'),
data.table('taxo' = '208000000X', 'spec1' = 'PedM', 'reference' = 'CMS37',
'description' = 'Allopathic & Osteopathic Physicians/Pediatrics'),
data.table('taxo' = '2080A0000X', 'spec1' = 'PedM', 'reference' = 'CMS37',
'description' = 'Allopathic & Osteopathic Physicians/Pediatrics, Adolescent Medicine'),
data.table('taxo' = '363L00000X', 'spec1' = 'NP', 'reference' = 'CMS50',
'description' = 'Physician Assistants & Advanced Practice Nursing Providers/Nurse Practitioner'),
data.table('taxo' = '363LA2200X', 'spec1' = 'NP', 'reference' = 'CMS50',
'description' = 'Physician Assistants & Advanced Practice Nursing Providers/Nurse Practitioner, Adult Health'),
data.table('taxo' = '363LC1500X', 'spec1' = 'NP', 'reference' = 'CMS50',
'description' = 'Physician Assistants & Advanced Practice Nursing Providers/Nurse Practitioner, Community Health'),
data.table('taxo' = '363LF0000X', 'spec1' = 'NP', 'reference' = 'CMS50',
'description' = 'Physician Assistants & Advanced Practice Nursing Providers/Nurse Practitioner, Family'),
data.table('taxo' = '363LG0600X', 'spec1' = 'NP', 'reference' = 'CMS50',
'description' = 'Physician Assistants & Advanced Practice Nursing Providers/Nurse Practitioner, Gerontology'),
data.table('taxo' = '363LP0200X', 'spec1' = 'NP', 'reference' = 'CMS50',
'description' = 'Physician Assistants & Advanced Practice Nursing Providers/Nurse Practitioner, Pediatrics'),
data.table('taxo' = '363LP2300X', 'spec1' = 'NP', 'reference' = 'CMS50',
'description' = 'Physician Assistants & Advanced Practice Nursing Providers/Nurse Practitioner, Primary Care'),
data.table('taxo' = '364S00000X', 'spec1' = 'CCNS', 'reference' = 'CMS89',
'description' = 'Physician Assistants & Advanced Practice Nursing Providers/Clinical Nurse Specialist'),
data.table('taxo' = '364SA2200X', 'spec1' = 'CCNS', 'reference' = 'CMS89',
'description' = 'Physician Assistants & Advanced Practice Nursing Providers/Clinical Nurse Specialist, Adult Health'),
data.table('taxo' = '364SC1501X', 'spec1' = 'CCNS', 'reference' = 'CMS89',
'description' = 'Physician Assistants & Advanced Practice Nursing Providers/Clinical Nurse Specialist, Community Health/Public Health'),
data.table('taxo' = '364SF0001X', 'spec1' = 'CCNS', 'reference' = 'CMS89',
'description' = 'Physician Assistants & Advanced Practice Nursing Providers/Clinical Nurse Specialist, Family Health'),
data.table('taxo' = '364SG0600X', 'spec1' = 'CCNS', 'reference' = 'CMS89',
'description' = 'Physician Assistants & Advanced Practice Nursing Providers/Clinical Nurse Specialist, Gerontology'),
data.table('taxo' = '364SP0200X', 'spec1' = 'CCNS', 'reference' = 'CMS89',
'description' = 'Physician Assistants & Advanced Practice Nursing Providers/Clinical Nurse Specialist, Pediatrics'),
data.table('taxo' = '363A00000X', 'spec1' = 'PA', 'reference' = 'CMS97',
'description' = 'Physician Assistants & Advanced Practice Nursing Providers/Physician Assistant'),
data.table('taxo' = '363AM0700X', 'spec1' = 'PA', 'reference' = 'CMS97',
'description' = 'Physician Assistants & Advanced Practice Nursing Providers/Physician Assistant, Medical'),
data.table('taxo' = '207V00000X', 'spec1' = 'OBGYN', 'reference' = 'CMS16',
'description' = 'Allopathic & Osteopathic Physicians/Obstetrics & Gynecology'),
data.table('taxo' = '207VG0400X', 'spec1' = 'OBGYN', 'reference' = 'CMS16',
'description' = 'Allopathic & Osteopathic Physicians/Obstetrics & Gynecology, Gynecology'),
data.table('taxo' = '207VX0000X', 'spec1' = 'OBGYN', 'reference' = 'CMS16',
'description' = 'Allopathic & Osteopathic Physicians/Obstetrics & Gynecology, Obstetrics'),
data.table('taxo' = '363LX0001X', 'spec1' = 'OBGYN', 'reference' = 'sup',
'description' = 'Physician Assistants & Advanced Practice Nursing Providers/Nurse Practitioner, Obstetrics & Gynecology'),
data.table('taxo' = '363LW0102X', 'spec1' = 'OBGYN', 'reference' = 'sup',
'description' = 'Physician Assistants & Advanced Practice Nursing Providers/Nurse Practitioner, Women’s Health'),
data.table('taxo' = '364SW0102X', 'spec1' = 'OBGYN', 'reference' = 'sup',
'description' = 'Physician Assistants & Advanced Practice Nursing Providers/Clinical Nurse Specialist, Women’s Health'),
NULL # placeholder for comments
)
taxo_info[spec1 %in% c('FP',
'GP',
'IM',
'PedM',
'NP',
'CCNS',
'PA'),
spec0 := 'PCP'][spec1 %in% c('OBGYN'),
spec0 := 'OBGYN']
## EM code: CPT list
CPTList <- c(99201:99215,
99241:99255,
99381:99429) # modified (2019-02-11)
## Entity List
entityNameList <- c(
'CMG',
'DayKimbal',
'ECHN',
'Grinffin',
'HHC',
'Middlesex',
## 'PHA',
'ProHealth',
'SaintFrancis',
'SaintMary',
'Soundview',
'StamfordHealth',
'Starling',
'StVincent',
'Waterbury',
'WCHN',
'WestMed',
'YaleMedicine',
'YaleNewHaven'
)
## returned AN lists.
entityNameReturned <- c(
'CMG',
## 'DayKimbal',
## 'ECHN',
'Grinffin',
'HHC',
'Middlesex',
## 'PHA', # join into CMG 20190216
'ProHealth',
'SaintFrancis',
'SaintMary',
'Soundview',
'StamfordHealth',
'Starling',
'StVincent',
## 'Waterbury',
'WCHN',
'WestMed',
'YaleMedicine',
'YaleNewHaven'
)
## MeasureList for each AN
# measurelist <- c(
# '2017AAB',
# '2017AMM_12w',
# '2017AMM_6m',
# '2017BCS',
# '2017CCS',
# '2017CHL',
# ## 'Diabetes',
# '2017HbA1c',
# ## 'HbA1c2016',
# ## 'HbA1c2015',
# '2017IET_Enga',
# '2017IET_Init',
# '2017MMA_50',
# '2017MMA_75',
# '2017NCS',
# NULL
# )
measurelist <- c(
## "2017LARC",
# "2017CHL",
# "2017HbA1c_eye",
# "2017HbA1c_kidney",
# "2017FUH_30d",
# "2017FUH_7d",
# "2016FUH_30d",
# "2016FUH_7d",
# "2015FUH_30d",
# "2015FUH_7d",
# "2014FUH_30d",
# "2014FUH_7d",
# "2013FUH_30d",
# "2013FUH_7d",
# "2017ImAdo1",
# "2017ImAdo2",
# "2017ImAdo3",
# "2017ImAdo4",
# "2017ADHD_30d",
# "2017ADHD_10m",
# "2017WcvAdo",
# "2017skip1",
# "2017skip3",
# "2017ReAd",
# "2017LBP",
# "2017ReAd_obs",
# "2017ReAd_exp",
# "2017ReAd_oe",
"2017BCS",
"2017CCS",
# '2016BCS',
# '2015BCS',
# '2014BCS',
# '2017IET_Init',
# '2017IET_Enga',
# '2017IET_Init_alcohol',
# '2017IET_Enga_alcohol',
# '2017IET_Init_opioid',
# '2017IET_Enga_opioid',
# '2017IET_Init_drug',
# '2017IET_Enga_drug',
# '2017AMM_6m',
# '2017AMM_12w',
# '2016AMM_6m',
# '2016AMM_12w',
# '2015AMM_6m',
# '2015AMM_12w',
# '2014AMM_6m',
# '2014AMM_12w',
# '2013AMM_6m',
# '2013AMM_12w',
NULL)
measurelist_lowerbetter <- c(
'2017NCS',
## "2017LBP",
NULL
)
## edit version for running NPI attribution
## edit_dt <- '20190217' # apply several selecting criteria from Martha's email
# edit_dt <- '20190218' # joint PHA into CMG
edit_dt <- '20191129' # add some medicare entities
spec.order <- c("NP", "CCNS", "PA", "OBGYN", "IM", "FP", "GP", "PedM")
## measure year
myear <- 2016
## org_crosswork for Shiny group
name_dat_samp <- readRDS(file = "name_dat_samp.rds")
org_crosswalk <- unique(as.data.table(name_dat_samp)[, .(org_name, org_url, insurance)])
org_crosswalk[, org_abbr := c(
'Waterbury',
'CMG',
'DayKimbal',
'ECHN',
'Grinffin',
'HHC',
'Middlesex',
'ProHealth',
'SaintFrancis',
'SaintMary',
'Soundview',
'StVincent',
'StamfordHealth',
'Starling',
'WCHN',
'WestMed',
'YaleMedicine',
'YaleNewHaven'
)]
org_crosswalk <- rbind(org_crosswalk,
list('Out Of Organizations', NA, 'Commercial', 'outAN'))
## measure_info for score_dat.rds for Shiny group
score_dat_samp <- as.data.table(readRDS('score_dat_samp.rds'))
measure_info <- unique(score_dat_samp[, .(
measure_abbr
)])
measure_info[, measure_label := c('LARC',
'ADHD_30d',
'ADHD_10m',
'skip',
'AMM_12w',
'AMM_6m',
'AAB',
'LBP',
'MMA_50',
'MMA_75',
'BCS',
'MDD',
'CCS',
'CHL',
'HbA1c',
'HbA1c_eye',
'HbA1c_kidney',
'IET_Enga',
'FUH_30d',
'FUH_7d',
'ReAd',
'ImAdo',
'IET_Init',
'NCS',
'CAHPS_courteous',
'CAHPS_Comm',
'CAHPS_overall',
'CAHPS_timely',
'WcvAdo',
NULL)]
# measure_info <- measure_info[data.table(measure_label = c(
# 'LARC',
# 'ADHD_30d',
# 'ADHD_10m',
# 'skip',
# 'AMM_12w',
# 'AMM_6m',
# 'AAB',
# 'LBP',
# 'MMA_50',
# 'MMA_75',
# 'BCS',
# 'MDD',
# 'CCS',
# 'CHL',
# 'HbA1c',
# 'HbA1c_eye',
# 'HbA1c_kidney',
# 'IET_Enga',
# 'FUH_30d',
# 'FUH_7d',
# 'ReAd',
# 'ImAdo',
# 'IET_Init',
# "IET_Init_drug",
# "IET_Init_alcohol",
# "IET_Init_opioid",
# "IET_Enga_drug",
# "IET_Enga_alcohol",
# "IET_Enga_opioid",
# 'NCS',
# 'CAHPS_courteous',
# 'CAHPS_Comm',
# 'CAHPS_overall',
# 'CAHPS_timely',
# 'WcvAdo',
# NULL
# )), on = "measure_label"]